Do it your self Hobby

How to Configure Multiple LAN Subnets and SQM on OpenWrt (Per Port Bandwidth Limits)

Step-by-step guide to set up one and four separate LAN networks on OpenWrt, each assigned to an individual Ethernet port with its own IP range, DHCP server, firewall zone, and SQM bandwidth shaping. Ideal for isolating devices and managing traffic per port.

What sqm-scripts does:

  • Implements Smart Queue Management using queuing disciplines like fq_codel or cake.
  • Prioritizes interactive traffic (like VoIP, gaming, or SSH) over bulk transfers (like downloads).
  • Helps maintain low latency even under heavy upload/download loads.
  • Prevents one device or application from hogging all the bandwidth.

SINGLE LAN NETWORK SETUP

STEP 1: Install SQM

Install via command line.

opkg update
opkg install sqm-scripts luci-app-sqm

Or install via Luci. Go to System > Software > click Update lists. In the filter box, search for sqm and install: 

sqm-scripts
luci-app-sqm

STEP 2: Create SQM Instances

After installing the software, refresh the page and go to Network > SQM QoS. You can customize your interface, speeds, and other settings. Click Add for each port interface. For each interface:

For LAN1

  • Enable this SQM instance: checked
  • Interface name: lan1
  • Download speed: 40000 kbit
  • Upload speed: 16000 kbit
  • Queueing discipline: cake
  • Script: piece_of_cake.qos

Repeat for:

  • LAN2: 30000 / 12000
  • LAN3: 20000 / 8000
  • LAN4: 10000 / 4000
  • Save and apply


MULTIPLE LAN NETWORK SETUP

STEP 1: SPLIT LAN PORTS

Create individual interfaces. Go to Network > Interfaces > Devices. Configure br-lan, Bridge ports and uncheck lan3, lan4, lan5 to remove them from the bridge. Let lan2 stay in br-lan.

STEP 2: Create Interfaces

Go to Network > Interfaces and add new interface

  • Name: LAN2
  • Protocol: Static Address
  • Device: lan3
  • IPv4 address: 192,168.20.1
  • IPv4 netmask: 255.255.255.0
  • Firewall: LAN2
  • DHCP Server: Set up DHCP Server (enable)
  • Name: LAN3
  • Protocol: Static Address
  • Device: lan4
  • IPv4 address: 192,168.30.1
  • IPv4 netmask: 255.255.255.0
  • Firewall: LAN3
  • DHCP Server: Set up DHCP Server (enable)
  • Name: LAN4
  • Protocol: Static Address
  • Device: lan5
  • IPv4 address: 192,168.40.1
  • IPv4 netmask: 255.255.255.0
  • Firewall: LAN4
  • DHCP Server: Set up DHCP Server (enable)
  • Name: lan (default, dont change)
  • Device: br-lan
  • IPv4 address: 192,168.1.1

STEP 3: Configure Firewall Zones

STEP 3: Configure Firewall Zones

Go to Network > Firewall.

Edit lan2,lan3,lan4:
input=accept, output=accept, foward=accept

Edit wan:
Allow forward from source zones: lan, lan2, lan3, lan4
bandwidth limits sqm multiple lan firewall

STEP 4: Create SQM Instances

Go to Network > SQM QoS. Click Add for each port interface. For each interface:

For LAN1

  • Enable this SQM instance: checked
  • Interface name: lan
  • Download speed: 40000 kbit
  • Upload speed: 16000 kbit
  • Queueing discipline: cake
  • Script: piece_of_cake.qos


Repeat for:

  • LAN2: 30000 / 12000
  • LAN3: 20000 / 8000
  • LAN4: 10000 / 4000

Leave a Comment

Your email address will not be published. Required fields are marked *