Link-Aggregation in LAN with VLANs

Hi all,
Im looking for some advice for configuring link-aggregation (/bonding/port-channel) of 2 lan ports of my OpenWRT-Router (Linksys WRT-3200ACM / OpenWrt 21.02.3 r16554-1d4dea6d4f ) in LUCI-UI and routing multiple VLANs each with their own network-interface through the port-channel.

I googled for quite some time and read multiple threads in this forum but im just not able to wrap my head around this topic.

I installed these extra packages and i think im able to do all necessary things in Luci but im not sure.
kmod-bonding 5.4.188-1
luci-proto-bonding git-21.222.28122-085bb7c
proto-bonding 2021-04-09-1

Im trying to achieve something like this:

Would be very grateful if someone could help me with this topic.

Do i have to create a bond-interface and ensalve lan3 and lan4 and create an 802.1q devices with the bond-interface as the base?
And than create network-interfaces (each with its separate ip-nw) based on the 802.1q devices?

That seems quite reasonable approach to me.

1 Like

Sadly its not working for me or im too dumb to configure it right.
Do u know if there are any other modules i need to install for it to work?

I haven't ever attempted a LAG on OpenWrt, but my hunch is that you won't get any significant speeds benefit from it unless you have a lot of inter-VLAN traffic that is routed. Your WAN is likely 1Gbps max, and therefore you'll never really benefit from multiple connections for the purposes of standard WAN traffic.

However, you may find this useful if you either require redundancy or if you have lots of inter-VLAN traffic that could cause the link to saturate. In the latter case, you may be limited by the router... but if the router's switch architecture actually has multiple internal 1G links, could simplify by splitting VLANs across multiple ports/links on your router and switch.

IMO, the use case for LAG as you've drawn it is a) redundancy, or b) educational; I think speed/performance will not improve (at least that is my hypothesis). But let us know what gains you experience once you do implement it.

1 Like

Most traditional routers just don't have enough ethernet ports (5+1, with additional constraints coming from the router's CPU ports!), making this rarely worthwhile (I even find it hard to come up a use case for LAG on 8-port managed switches, above that, sure).

2 Likes

I've got it to work with the packages i mentioned in the original post solely using LUCI.
But i found this forum-thread very helpful, while low-level debugging. Especially the the answer from @mj5030 . Thx 2 u mate.
I just redid the same steps i did before in the ui. Seems like there was a hikup in openwrt at my first try.

UI step by step guide for other people with the problem:

  1. Install the packages kmod-bonding 5.4.188-1, luci-proto-bonding git-21.222.28122-085bb7c, proto-bonding 2021-04-09-1 => two devices called "bond0" and "bonding_masters" should be created automatically
  2. create a new interface using the protocol link-aggregation (channel-bonding)
  3. configure the interface with an ip and subnetmask (i never used them, but they r necessary for the interface creation) (i would recommend to wait with pressing save because i've got a feeling, that there was my hikup)
  4. go to advanced settings
  5. check force link
  6. choose the interfaces/devices u want to bond (enslave) (e.g. lan3 and lan4)
  7. safe; safe and apply
  8. go to devices and there u should find a device called "bonding-"
  9. create new 802.1q devices as ur vlan-devices with the bond-device as there base-device
  10. create new interfaces for ur vlan-devices
  11. do ur typical config-stuff for interfaces
  12. done

if ur created bond-device config in /etc/config/network just contains a name option and nothing else. give it a second try.

Now that you have it physically working, can you comment on the practical benefit of doing this? Have you measured performance (I can't imagine it would be any different)? Or are you doing this for redundancy? Or is this purely for learning?

  1. redundancy
  2. when working its easier for me to configure, because i dont want to lose a thought on which vlan should be on which port (tl;dr fits my network-architecture pretty well in my opinion)
  3. im doing a lot of inter-vlan routing (i didnt test the performance benefits. and im not planing to do it)

I get this point... redundancy can be a good thing if you worry about a single-point-of-failure in your cables (probably not the most likely thing to fail, but nonetheless can be useful).

I don't understand your second point...

VLANs on a LAG operate the same way as they do on a single physical link, except that you are using 2 or more physical cables to make the trunk. They fundamentally carry the same data, though... so one link or many, it's just a difference in the physical medium. You could just as easily have your VLANs on a single physical link.

Can you elaborate more on why a LAG is better than a single link WRT VLANs?

I highly doubt you will see any performance benefit at all here, unless your router actually has a higher bandwidth on the internal switch-to-CPU connection. Most devices have 1 or at most 2 internal gigabit links between the built-in switch and the CPU... one of them is often dedicated to the WAN, the other (if present) would carry your LAN/VLAN traffic. So you wouldn't gain any performance benefit.

I'm not sure why you're not planning to do any inter-VLAN routing performance measurements after asserting that this is a reason for you to use a LAG in the first place. Wouldn't it be good to know if it is actually helping (or worse, what about if it is hurting performance)?

Good morning,
I am reconfiguring my network due to a house move. Previously I had my old rt-ac88u configured as Switch+AP only with vlans with the new DSA architecture and I managed to get everything working.
Due to the location of the equipment on this new floor, I will need to connect more devices, including a NAS with services for the internal network and internet, and I would like to configure two ports with LACP (trunk to the router, to which I want to configure the other two ports that you are left with another LAG for other devices in another location of the apartment).
Following the indications of @Ars3n I have configured the LACP in two ports of my router as static (as active or passive I have not been able to make it work), and two ports in the rt-ac88u with OpenWRT, the router show LAG up and both devices can ping each other.
I have also created several vlans associated with the LAG following your instructions, but I cannot correctly configure the vlans in the rest of the ports so that the traffic goes through the trunk.
I have tried adding both the LAG interface and the vlans on the LAN bridge (both show up at 2 Gigabytes) and tagging them but it doesn't work.
My technical knowledge is limited, can someone help me?
Thank you very much in advance.