Howto: DSA looking like old-style configuration

Hi,

Was a bit fighting with DSA to convert my older pre 21 version config to current style and noticed that using tutorials you do not get the interface br- as you're used to in a multi-lan setup.

Here's an configuration that allows you to recreate it old style again on 21 version.

Example with two networks on your switch: lan (vlan 1 - untagged eth1-3 and tagged eth4) and stb (vlan 9 - tagged on port eth4):

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option delegate '0'
	option igmp_snooping '1'
	option stp '1'

config interface 'stb'
	option proto 'static'
	option ipaddr '192.168.192.254'
	option netmask '255.255.255.0'
	option delegate '0'
	option stp '1'
	option device 'br-stb'

config device
	option name 'switch0'
	option type 'bridge'
	list ports 'eth1'
	list ports 'eth2'
	list ports 'eth3'
	list ports 'eth4'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'switch0.1'

config device
	option name 'br-stb'
	option type 'bridge'
	list ports 'switch0.9'
	option igmp_snooping '1'

config bridge-vlan
	option device 'switch0'
	option vlan '1'
	list ports 'eth1:u*'
	list ports 'eth2:u*'
	list ports 'eth3:u*'
	list ports 'eth4:t'

config bridge-vlan
	option device 'switch0'
	option vlan '9'
	list ports 'eth4:t'

config bridge-vlan
	option device 'switch0'
	option vlan '10'
	list ports 'eth4:u*'

Note: vlan 10 here acts as a dummy vlan with no configuration to dump any untagged traffic in there so it doesn't get leaked somewhere else, maybe.

I don't think you need to declare intermediate bridges like br-stb or br-lan, you can use switch0.N directly as the device in the layer 3 interface.