No vlan config on Cudy WR2100 possible

I run OpenWrt 23.05.5 (r24106-10cc5fcd00) on a
Cudy WR2100
MediaTek MT7621 ver:1 eco:3

The thing worked fine for a few years. But now I need to reconfigure it to work with vlans.

I did set up a new device "switch" as bridge device with following vlans and all Ports are bridged:

But as soon as I try to switch the "lan" interface, without changing any IP-settings, to the switch.1 device, I loose connectivity. Even over direct connection to a port of the Cudy, bypassing my switches and also over wifi.

After 90 seconds the configuration is restored.
this seems to happen as soon as I map any bridge with vlans to the lan interface.

Is my cudy broken? It runs on Kernel Version 5.15.167

Your device uses DSA, so the sequencing is critical if you're using LuCI. I personally find it easier to do this by editing the config file directly.

That said, the important part is to set the bridge-VLANs as you have done, then edit your lan interface to use switch.1. Only after that change can you actually apply the settings.

If you still cannot get it to work, post your network config file and I'll show you how to edit accordingly:

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network

Thank you for your incredibly fast help.
When editing via ssh I fear loosing access because I guess the configuration wouldn't be reverted after 90 seconds…

The part with the sequencing I did not understand. I loose conectivity after editing lan to use switch.1 and applying that.

~# ubus call system board
{
	"kernel": "5.15.167",
	"hostname": "OpenWrt-Keller",
	"system": "MediaTek MT7621 ver:1 eco:3",
	"model": "Cudy WR2100",
	"board_name": "cudy,wr2100",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "23.05.5",
		"revision": "r24106-10cc5fcd00",
		"target": "ramips/mt7621",
		"description": "OpenWrt 23.05.5 r24106-10cc5fcd00"
	}
}
~# cat /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 packet_steering '1'
	option ula_prefix 'fd8a:de29:da35::/48'

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

config interface 'lan'
	option device 'newbridge'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '192.168.0.2'
	option gateway '1.1.0.1' # redacted

config interface 'wan'
	option device 'wan'
	option proto 'dhcp'

config interface 'wan6'
	option device 'wan'
	option proto 'dhcpv6'
	option reqaddress 'try'
	option reqprefix 'auto'

config device
	option type 'bridge'
	option name 'switch'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'

config bridge-vlan
	option device 'switch'
	option vlan '1'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'

config bridge-vlan
	option device 'switch'
	option vlan '20'
	list ports 'lan1:t'
	list ports 'lan2:t'
	list ports 'lan3:t'
	list ports 'lan4:t'

config bridge-vlan
	option device 'switch'
	option vlan '30'
	list ports 'lan1:t'
	list ports 'lan2:t'
	list ports 'lan3:t'
	list ports 'lan4:t'

config bridge-vlan
	option device 'switch'
	option vlan '40'
	list ports 'lan1:t'
	list ports 'lan2:t'
	list ports 'lan3:t'
	list ports 'lan4:t'

config device
	option type 'bridge'
	option name 'newbridge'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'

Ah... I see the problem. You have three bridges defined, both with the same ports. The ports can only be present in a single bridge. You also have a few other issues. We'll fix them.

Let's keep the standard br-lan. So... delete this:

Then edit the VLANs so that they use device br-lan:

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

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

config bridge-vlan
	option device 'br-lan'
	option vlan '30'
	list ports 'lan1:t'
	list ports 'lan2:t'
	list ports 'lan3:t'
	list ports 'lan4:t'

config bridge-vlan
	option device 'br-lan'
	option vlan '40'
	list ports 'lan1:t'
	list ports 'lan2:t'
	list ports 'lan3:t'
	list ports 'lan4:t'

And delete this:

Now, edit the lan interface to use device br-lan.1:

config interface 'lan'
	option device 'br-lan.1'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '192.168.0.2'
	option gateway '1.1.0.1' # redacted

(obviously make sure your gateway is specified appropriately. (if the upstream is actually via the wan, omit the gateway entirely).

Restart when you're done with these changes.

1 Like

That did indeed work.
I'm unsure why, because it certainly looks like one of the dozen tries of today.
Maybe because editing the file directly and not using luci.
Ah it might be because the tutorial I used wanted me to create a new bridge device from the start, so I had always at least two bridges on all lan ports.

Anyway. Thank you very much.
I will try to configure the rest from here on. Thank you.