...
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth1'
list ports 'eth2'
list ports 'eth3'
list ports 'eth4'
list ports 'eth0'
config interface 'lan'
option device 'br-lan'
option proto 'dhcp'
Before you suggest to use OpenWrt as a router instead, the main router's configuration is not accessible for... "reasons". By setting up OpenWrt as a router I would run into a double NAT problem and none of the router guides here involve leaving the main router untouched.
What router model are you using (EDIT: ER-X I see)? SQM can be used on bridge members, but typically not og ports of a physical switch (unless you first de-aggregate the switch into individual ports and the use a software bridge on these ports...)
So if your router has a dedicated wan interface then the bump in the wire configuration is achievable...
I think you could create a new software bridge between the wan port (eth0) and br-lan and then instantiate sqm on eth0.
Technically it is a bit more nuanced, I believe. SQM really does not care about L3 or L2, but it needs to actually see the traffic, and that is possible if the packets actually traverse the CPU, any offloading be it L2 or L3 that makes packets evade the CPU is not compatible with SQM (unless the offload engine implements its own AQM/scheduler)
In the default configuration, eth0 belonged to the wan interface not the br-lan one. However, when connecting the main router to eth0, I wouldn't get internet. This is actually explained in this guide that I followed. I got it working by following optional step 6
Can you explain how to do this? I am not very familiar with OpenWrt.
I'm still not convinced that this can be done on a switch. I'm happy to be wrong about this -- I'll be following so that I can learn, for sure.
But some thoughts/questions:
On a device with a switch chip, how would it be configured to ensure that the bridge happens in software, not hardware?
On a device like the ER-X, the software bridged performance (on the EdgeMax firmware) is known to impose a significant performance penalty - about 250Mbps max throughput -- while routing can happen at 1Gbps. If the device were configured such that the bridge happens via the CPU and then SQM is applied on top of that, wouldn't the bandwidth hit be so bad as to make this impractical?
How does the 'bump in the wire' config come together? I get the idea, but I don't personally know how one would implement this without routing between two interfaces (which would require a different subnet upstream vs downstream).
Would the bandwidth shaping with SQM be able to differentiate between traffic destined for the lan vs wan (I.e. the internet)?
This method would only be able to shape the traffic that flows through it... but if there are any devices connected to the main router in any way that bypasses this device (including WiFi, if not connected to one of the ER-X ports), those would not be subject to SQM. This means that the other devices on the network would be able to saturate the upstream router/wan connection (which means that the goals of reducing buffer bloat/latency cannot be guaranteed).
I do not mind the throughput penalty. I'm much more concerned about bufferbloat.
There are a couple APs connected to the main router but they are too low bandwidth to saturate the main router's uplink. The devices connected to my OpenWrt device on the other hand are able to saturate the main router's uplink bandwidth easily.
Just so that it is known for this discussion, what is your internet speed from the ISP?
And what is the acceptable minimum bandwidth for the devices that you are trying to throttle? Keep in mind that this will be the total aggregate bandwidth of all devices that are connected to the ER-X.
I'm still rather skeptical that SQM can be achieved on a device configured as a switch (vs a router). But, if we assume I am incorrect, you may end up with unreasonably slow performance -- so it would be good to know what that floor is for your situation.
I believe that this is when the device is in routing mode. Similarly, as I mentioned earlier, I know for fact that the software bridging (available in the vendor firmware) also maxes out at 250Mbps. With that in mind, I would guess that trying to do both SQM and software bridging would further load the CPU, thus lowering the bandwidth. But, I could be wrong (and if so, I'll own that ).
Have you considered the really simple, non-software based solution of just dropping your Ethernet speed to 100Mbps? Most computer OS's have the ability to set the connection parameters -- so you can set it to 100Mbps/Full Duplex right on the computer.