OpenWrt as VLAN switch

OpenWRT users, developers, experts:

I did read a thread referenced herein below, though it seems rather old at this juncture and it is for a different piece of hardware than I have. My APs are a WRT3200ACS and a WRT1900AC.

  1. I would generally think to use the WAN port as my Trunk port to go to my switch. The below entitled thread describes this as being a poor choice but I really did not understand why that would be. May I ask why?

  2. The configuration I am desirous of is a bit different from the original poster's. I want one port (lets say the WAN port) to be a trunk port that can carry all VLAN traffic to the switch. I then want each of the 4 LAN ports to carry traffic from VLAN 192 as an access port.

The original thread contained herein below also states that VLANs must be blow 15? Why would that be a requirement? My VALNs are all above 15; thus, if that is true OpenWRT will not be a solution for me in this respect.

Thanks in advance and I hope everyone stays safe from the thugs and healthy.

You have quite different hardware. In the WRT3200 and most other routers with gigabit ports, all the ports go into the same switch hardware, so you can use them interchangeably-- the names on the box of wan vs lan are just names. That is not the case with the TL-WR841 where the WAN port is an independent path into the CPU bypassing the switch.

Also the gigabit switches usually don't have any VLAN number restrictions.

1 Like

I'm on x86/64, but I have a similar infrastructure design.
Can someone share a very basic config of how to setup the wan port (eth0, in my case) to use a VLAN in OpenWRT version 22.03.0?
The documentation is sometimes confusing because it is not clear which version they're talking about, and most examples found are related to the older versions not using DSA.

@LinkTheLegend - you should start a new thread since your situation does not involve an OpenWrt based switch configuration. I'll give you a quick answer -- if you need more, please open a new thread.

Since you're using x86 and you do not have a built-in switch in your device, the answer is really simple... standard dotted notation is used in your scenario, not DSA.

eth0 -> untagged/PVID/native
eth0.x (where x = VLAN ID) -> tagged network (802.1q)

The device that is downstream of this ethernet port must be VLAN aware -- typically this would be a smart/managed switch, but it could also be a computer or an AP or other device, provide it can be configured to work with 802.1q tagged ethernet frames.

1 Like

mk24, et alia:

Well, I finally got it figured out. I am not entirely sure I understand why what I did worked but it did. I still need to learn much more about how OpenWRT performs VLAN functions as DSA and menu changes have been forthcoming in the last release.