Hi there.
I have just introduced VLANs into my setup -- something I wanted to do since years, but I've never managed to take the time...
I was fortunate enough to have a couple of routers for a lab setup, so this is how I prepared everything. When I was happy, I wanted to roll that out onto my production setup, and then I noticed that something I couldn't deploy in my test setup (my Netgear GS108Ev3 switch, of which I only have a single device) was actually causing issues.
My high-level design is as follows:
- Linksys WRT1900ACS as my internet router, running OpenWrt 22.03.2
- Netgear R6220 as access points (I have two of them), running OpenWrt 22.03.5
- Netgear GS108Ev3, latest FW version V2.06.24EN, as my "core switch"
Low-level design:
- VLANs 10 (home), 20 (IoT), 30 (guest)
- corresponding networks to the above
- dedicated SSIDs for each of these VLANs, bound to the corresponding networks
My idea was to have a "trunk" port on each of my APs, and on my router, and connect all APs to the router via the above mentioned Netgear "core switch." This doesn't work, however. If I connect the AP directly to the router (with the trunk ports "back-to-back"), it works. So I believe my VLAN setup on the Netgear switch must be broken, but I don't see how?!
Here's my router's setup (excerpts, pastebin for better readability):
config device
option type 'bridge'
option name 'switch'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
config device
option name 'switch.10'
option type '8021q'
option ifname 'switch'
option vid '10'
option acceptlocal '1'
config device
option name 'switch.20'
option type '8021q'
option ifname 'switch'
option vid '20'
option acceptlocal '1'
config device
option name 'switch.30'
option type '8021q'
option ifname 'switch'
option vid '30'
option acceptlocal '1'
config bridge-vlan
option device 'switch'
option vlan '10'
list ports 'lan1:u*'
list ports 'lan3:t'
list ports 'lan4:t'
config bridge-vlan
option device 'switch'
option vlan '20'
list ports 'lan2:u*'
list ports 'lan3:t'
list ports 'lan4:t'
config bridge-vlan
option device 'switch'
option vlan '30'
list ports 'lan3:t'
list ports 'lan4:t'
config bridge-vlan
option device 'switch'
option vlan '90'
option local '0'
config interface 'home'
option device 'switch.10'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.2.1'
config interface 'iot'
option proto 'static'
option device 'switch.20'
option ipaddr '192.168.20.1'
option netmask '255.255.255.0'
config interface 'guest'
option proto 'static'
option device 'switch.30'
option ipaddr '192.168.30.1'
option netmask '255.255.255.0'
option ip6assign '64'
Here's the AP network setup (again, Pastebin link):
config device
option type 'bridge'
option name 'switch'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
list ports 'wan'
config bridge-vlan
option device 'switch'
option vlan '10'
list ports 'lan1:u*'
list ports 'lan2:u*'
list ports 'lan3:u*'
list ports 'wan:t'
config bridge-vlan
option device 'switch'
option vlan '20'
list ports 'wan:t'
config bridge-vlan
option device 'switch'
option vlan '30'
list ports 'lan4:u*'
list ports 'wan:t'
config bridge-vlan
option device 'switch'
option vlan '90'
option local '0'
config interface 'home'
option proto 'static'
option device 'switch.10'
option netmask '255.255.255.0'
option gateway '192.168.2.1'
option ipaddr '192.168.2.38'
config interface 'iot'
option proto 'static'
option device 'switch.20'
option netmask '255.255.255.0'
option ipaddr '192.168.20.38'
config interface 'guest'
option proto 'static'
option device 'switch.30'
option netmask '255.255.255.0'
option ipaddr '192.168.30.38'
And here I'm trying to reproduce my Netgear switch's config:
- Advanced 802.1Q VLAN: enabled
- VLANs and ports:
VLAN ID Port Members
1 1
10 1 2 3 4 5 6 7 8
20 1 2 3 4 5 6 7 8
30 1 2 3 4 5 6 7 8
- VLAN 1: 1u (I left this because I was afraid I could cut myself off the switch's web interface if I removed this)
- VLAN 10: 1t, (2-7)u, 8t
- VLAN 20: (1-8)t
- VLAN 30: (1-8)t
- PVID: 10 for all ports
I hope the above fully reflects what you need to know in order to understand my setup.
(Just so that you understand: The Netgear switch I tried to set up so that I can still keep my original non-segmented setup, therefore I have the many "untagged" ports with a PVID of 10, so that all these devices are in my "home" network. I will later properly segment the rest when I find the time to do so, I might even need another "smart" switch for enforcing VLAN tags.)
With the Netgear switch between the AP's "WAN" port (trunk) and the router's lan4 port (trunk), I have no connectivity on VLANs 20 or 30. With the switch removed, and the two trunk ports directly connected, it works.
Any idea where the problem is?
Thank you in advance for sharing your expertise.
Kind regards,
Ralf