SNAFU VLAN Config in 24.10.0

I have upgraded my Netgear R7800 from OpenWrt v23.05.3 to v24.10.0 and now I have lost all of my configuration ...of course :/.

In v23.05.3 the VLANs were configured like this (and working fine):

How can I recreate this VLAN configuration in v24.10.0 ?
The entire "Switch" menu has disappeared in Luci !
Do I have to make "Bridge" devices or "802.1q" devices in the "Interfaces/Devices" menu ?

When I have tried to make a "Bridge" device on "eth1" and "lan1" with VLAN ID = 4 then I have lost all connectivity to the router that I had on "lan2".
Eventually I had to restart the router. It would not roll back automatically after 2min...

BTW: I use a 24-port managed Ethernet switch connected to the router's port "lan1". I only use wired connections - no WiFi.

Help! Everything is different in this version...

https://openwrt.org/docs/guide-user/network/dsa/dsa-mini-tutorial

1 Like

@slh
The link to the DSA mini tutorial is out of date.
It does not contain changes made in v24.10.0 and the VLAN screenshots in this tutorial do not exist in v24.10.0.

DSA was introduced in v21.02 and I remind you that I had everything working in v23.05.3. Well past the introduction of the DSA.

How can I recreate the VLAN configuration I had working before in v24.10.0 ?

Below is the backup of the /etc/config/network file that used to work in v23.05.3:


config globals 'globals'
	option ula_prefix 'fda9:f932:fa17::/48'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option vid '1'
	option ports '6t 4t 3'
	option description 'LAN'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option vid '2'
	option ports '0t 5'
	option description 'wan'

config switch_vlan
	option device 'switch0'
	option vlan '8'
	option vid '3'
	option ports '6t 4t'
	option description 'Apple'

config switch_vlan
	option device 'switch0'
	option vlan '4'
	option vid '4'
	option ports '6t 4t 1'
	option description 'Room 1'

config switch_vlan
	option device 'switch0'
	option vlan '5'
	option vid '5'
	option ports '6t 4t 2'
	option description 'Room 2'

config switch_vlan
	option device 'switch0'
	option vlan '7'
	option vid '7'
	option ports '6t 4t'
	option description 'IoT'

config switch_vlan
	option device 'switch0'
	option vlan '6'
	option vid '8'
	option ports '6t 4t'
	option description 'VoIP'

config device
	option name 'eth0'
	option ipv6 '0'

config device
	option name 'eth1'
	option ipv6 '0'

config device
	option name 'eth0.2'
	option type '8021q'
	option ifname 'eth0'
	option vid '2'
	option ipv6 '0'

config device
	option name 'eth1.1'
	option type '8021q'
	option ifname 'eth1'
	option vid '1'
	option ipv6 '0'
	option acceptlocal '1'

config device
	option name 'eth1.4'
	option type '8021q'
	option ifname 'eth1'
	option vid '4'
	option ipv6 '0'

config device
	option name 'eth1.5'
	option type '8021q'
	option ifname 'eth1'
	option vid '5'
	option ipv6 '0'
	option acceptlocal '1'

config device
	option name 'eth1.7'
	option type '8021q'
	option ifname 'eth1'
	option vid '7'
	option ipv6 '0'

config device
	option name 'eth1.8'
	option type '8021q'
	option ifname 'eth1'
	option vid '8'
	option ipv6 '0'

config interface 'loopback'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'
	option device 'lo'

config interface 'lan'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option delegate '0'
	option metric '100'
	option device 'eth1.1'
	option broadcast '192.168.1.255'
	option netmask '255.255.255.0'

config interface 'wan'
	option proto 'dhcp'
	option delegate '0'
	option peerdns '0'
	option hostname 'UPC'
	option device 'eth0.2'

config interface 'Apple'
	option proto 'static'
	option device 'eth1.3'
	option ipaddr '192.168.3.1'
	option netmask '255.255.255.0'
	option broadcast '192.168.3.255'

config interface 'Room1'
	option proto 'static'
	option netmask '255.255.255.0'
	option device 'eth1.4'
	option ipaddr '192.168.4.1'

config interface 'Room2'
	option proto 'static'
	option device 'eth1.5'
	option ipaddr '192.168.5.1'
	option netmask '255.255.255.0'
	option delegate '0'

config interface 'VOIP'
	option proto 'static'
	option device 'eth1.8'
	option ipaddr '192.168.8.1'
	option netmask '255.255.255.0'
	option delegate '0'

config interface 'IoT'
	option proto 'static'
	option device 'eth1.7'
	option ipaddr '192.168.7.1'
	option netmask '255.255.255.0'
	option defaultroute '0'

Where are the settings in Luci that correspond to the config switch and config switch_vlan sections ?
They existed in v23.05.3 but they do not exist in v24.10.0 anymore.

The SOC used in the R7800 - IPQ8065 - switched from swconfig to DSA in 24.10.0.

This was mentioned in the release notes for 24.10.0.

There are many examples of how to use DSA in the forum, and on the wiki.

First, create an AP on lan and log into the router by wifi. This is so you won't lose access if Ethernet becomes misconfigured. You can shut down the AP when finished.

Go to Network-Interfaces and click Devices. Click the br-lan Configure button. Add wan as a port so that all the physical Ethernet ports are in the same bridge. This is necessary for hardware switching between the ports to work. Click the Bridge VLAN filtering tab. Check the Enable box at the top. Notice that this page looks and works a lot like the old Switch page. Build out your VLAN table setting ports to tagged untagged or off as needed. Check the local box on all of them. On untagged (access) ports, in their VLAN check both Untagged and Is Primary VLAN. Besides the VLANs you use externally, you will need two VLANs for lan and wan. Conventionally these are numbered 1 and 2 like in swconfig.

Go back to the main Interfaces tab and edit lan. Change the device from br-lan to br-lan.1 In the wan interface change the device from wan to br-lan.2. Make interfaces for all of your other VLANs and attach them with the br-lan.N notation. Even VLANs that only exist for hardware switching between ports still need an Interface of proto Unmanaged or they will not instantiate in the switch.

Click the br-lan Configure button. Add wan as a port so that all the physical Ethernet ports are in the same bridge. This is necessary for hardware switching between the ports to work.

This breaks my brain - what is the sense of merging all the physical ports (including wan) into a huge Bridge device, just to split them into different VLANs in the next step ?
Alas, "merging" is the opposite of "splitting", isn't it ? wtf is going on here ?

Also, what is the use of "hardware switching between the ports" when the packets from the wan port are never just copied to other ports (physical or virtual, vlans) ?
Between wan and other ports, the packets are always PAT/NAT translated by the firewall at Layer 3, they are never switched at Layer 2.

You don't need to add the WAN port to the bridge. Not sure why that was stated.

The Bridged AP guide previously implied that it was necessary and it also had many errors. I've just updated it over the past few days... it should now be clear that this is an optional addition, useful if the additional port is needed.

Here is my config.. I created vlans, 10 is iot and 20 is guest. I then put port 2 on the router in the iot vlan. I have two more access points which both have all three vlans for ssids (lan, iot and guest)

/etc/config/network 

config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd2e:5786:8da::/48'
	option packet_steering '1'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'
	list ports 'lan5'

config interface 'lan'
	option device 'br-lan.1'
	option proto 'static'
	option ipaddr '192.168.1.2'
	option netmask '255.255.255.0'
	option ip6assign '60'

config device
	option name 'br-wan'
	option type 'bridge'
	list ports 'wan'
	list ports 'sfp'

config interface 'wan'
	option device 'br-wan'
	option proto 'dhcp'
	option broadcast '1'

config interface 'wan6'
	option device 'br-wan'
	option proto 'dhcpv6'

config bridge-vlan
	option device 'br-lan'
	option vlan '1'
	list ports 'lan2:u*'

config bridge-vlan
	option device 'br-lan'
	option vlan '10'
	list ports 'lan2:t'
	list ports 'lan3:u*'

config bridge-vlan
	option device 'br-lan'
	option vlan '20'
	list ports 'lan2:t'

config interface 'iot'
	option proto 'static'
	option device 'br-lan.10'
	option ipaddr '192.168.10.2'
	option netmask '255.255.255.0'

config interface 'guest'
	option proto 'static'
	option device 'br-lan.20'
	option ipaddr '192.168.20.2'
	option netmask '255.255.255.0'


I should mention that the default vlan 1 is not tagged.. so every device on the switch joins vlan1 by default.

Are you talking about an upstream switch, or the one built into this device
According to your config, VLAN 1 is only active on port lan2 as an untagged network. It is not connected to any other ports (but maybe it is connected to a WiFi SSID).

Yes - sorry. switch is very overloaded here. :slight_smile: I have an upstream switch connected to port 1.

That depends on the chip in your device and except a few device with actually multiple network interface the majority of devices have just a single switch chip exposing like 5 ports. Yeah I hear you in the back. Yes they have different colours but in the end they share the same fate.
To be now able to emulate actual independent layer 2 device i.e. for a router, with one interface at the ISP and one interface in your local network you need two interfaces to route between them.
That's why with the defaults OpenWrt assigns vlan id 1 to lan and id 2 to wan. They are untagged so on the ether it's just a frame. But within the CPU Linux can now seperate those interfaces and do layer 3 shizzle.
Does it help?

Ps and edit: that's why with swconfig you need to add port 0, the CPU, to every vlan.

1 Like

It helps a little. I understand why OpenWrt assigns vlan id 1 to lan port and id 2 to wan port so the CPU can now separate those interfaces and do layer 3 shizzle.
I still do not understand what is the sense of merging the physical ports into a huge Bridge device.

At the software level, there are two reasons this is done.

  1. AFAIK, the DSA implementation only supports a single bridge per switch chip. (I believe this will change at some point in the future, and it's also possible some devices support multiple bridges on a single switch now, but the 1:1 relationship is guaranteed to work). Therefore, putting all ports into the same bridge allows them all to be assigned to whatever VLANs are desired with a single bridge + bridge VLAN structure.

  2. If desired, the wan port gets added to the bridge to allow it to participate as "just another port" on the switch. This is completely optional and not required, though, and is only necessary if that additional port is needed. Otherwise, just use one of the lan ports to connect to the upstream.

Again, to be able to configure and use all ports on these switchchips.
It's not like that they are individual Network Interface Cards. No they are not. The "interfaces" are just "emulated" (sorry I fail to find a better word here).

Back in the days with swconfig and without VLAN aware bridges in Linux, we needed to create one bridge per VLAN, but the underlying switch-device is/was just one switch.
In the end of the day I think it does not matter, but IMHO, DSA and VLAN-Aware-Bridges really makes everyone's live easier.