as promised, I will post some details of my solution.
disclaimer:
this is my solution at the moment, that came up after several hours of trial and error. This is no law. I am happy about any comment that helps us to understand how dsa switch config really works.
What I have:
Router: Xiaomi Router 3G V2 (or similar), 3 ethernet ports, named LAN1, LAN2 and WAN.
What I wanted to have: 5 VLANs on port WAN (117, 178, 119, 120, 128) tagged, VLAN 117 on port LAN1 untagged, LAN2 currently unused; some WIFIs, linked to the appropriate VLANs
What I did:
/etc/config/network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fdd4:59f1:e12d::/48'
config interface 'lan'
option type 'bridge'
option ifname 'br0.117'
option proto 'static'
option ipaddr '192.168.117.7'
option netmask '255.255.255.0'
option gateway '192.168.117.1'
config interface 'lan6'
option proto 'dhcpv6'
option ifname '@lan'
option reqprefix 'no'
config interface 'media'
option type 'bridge'
option ifname 'br0.118'
option proto 'static'
option ipaddr '192.168.118.7'
option netmask '255.255.255.0'
option gateway '192.168.118.1'
config interface 'media6'
option proto 'dhcpv6'
option ifname '@media'
option reqprefix 'no'
config interface 'gast'
option type 'bridge'
option ifname 'br0.119'
option proto 'static'
option ipaddr '192.168.119.7'
option netmask '255.255.255.0'
option gateway '192.168.119.1'
config interface 'iot'
option type 'bridge'
option ifname 'br0.120'
option proto 'static'
option ipaddr '192.168.120.7'
option netmask '255.255.255.0'
option gateway '192.168.120.1'
config interface 'iot6'
option proto 'dhcpv6'
option ifname '@iot'
option reqprefix 'no'
config interface 'rapw'
option type 'bridge'
option ifname 'br0.128'
option proto 'static'
option ipaddr '192.168.128.7'
option netmask '255.255.255.0'
option gateway '192.168.128.1'
config interface 'rapw6'
option proto 'dhcpv6'
option ifname '@rapw'
option reqprefix 'no'
config interface 'gast6'
option proto 'dhcpv6'
option ifname '@gast'
option reqprefix 'no'
The device br0 needs to bet set up separately. After br0 is brought up, netifd creates the links to br0.VID automatically.
/etc/config/setup:
#!/bin/ash
sleep 20
logger -t brsetup "Setup: started..."
# The master interface needs to be brought up before the slave ports.
ip link set eth0 up
# bring up the slave interfaces
ip link set lan1 up
ip link set lan2 up
ip link set wan up
# create bridge
ip link add name br0 type bridge
# activate VLAN filtering
ip link set dev br0 type bridge vlan_filtering 1
# bring up the bridge
ip link set dev br0 up
logger -t brsetup "Setup: Sleep started..."
sleep 5
# add ports to bridge
ip link set dev lan1 master br0
ip link set dev lan2 master br0
ip link set dev wan master br0
# tag traffic on ports
bridge vlan add dev wan vid 117
bridge vlan add dev wan vid 118
bridge vlan add dev wan vid 119
bridge vlan add dev wan vid 120
bridge vlan add dev wan vid 128
bridge vlan del dev wan vid 1
bridge vlan add dev lan1 vid 117 pvid untagged
bridge vlan del dev lan1 vid 1
bridge vlan del dev lan2 vid 1
# tag traffic on bridge
bridge vlan add dev br0 self vid 117
bridge vlan add dev br0 self vid 118
bridge vlan add dev br0 self vid 119
bridge vlan add dev br0 self vid 120
bridge vlan add dev br0 self vid 128
bridge vlan del dev br0 self vid 1
# activate vlan filtering on briges
# (not quite sure if this is really needed... but it's for free :-) )
ip link set dev br-lan type bridge vlan_filtering 1
ip link set dev br-media type bridge vlan_filtering 1
ip link set dev br-gast type bridge vlan_filtering 1
ip link set dev br-iot type bridge vlan_filtering 1
ip link set dev br-rapw type bridge vlan_filtering 1
logger -t brsetup "Setup: done..."
The script is executed from hotplug; I decided to use the ifup condition of lo as trigger condition; therefor you find some sleeps in the script. The better solution would be to call parts of the script depending on netifd actions.
The "sleep 5" after bringing up br0 seems to be pretty important. If br0 comes up, netifd activates all the interfaces defined in /etc/config/network. Without sleep, the connections did not work.
/etc/hotplug.d/iface/99-lan:
[ "${ACTION}" = "ifup" ] && {
logger -t brsetup "hotplug: Device: ${DEVICE} / Action: ${ACTION}"
[ "${DEVICE}" = "lo" ] && {
/etc/config/setup
}
}
It creates some bridges and new ports...
root@test:~# bridge v
port vlan ids
lan2 None
lan1 117 PVID Egress Untagged
wan 117
118
119
120
128
br-lan 1 PVID Egress Untagged
br-gast 1 PVID Egress Untagged
br-iot 1 PVID Egress Untagged
br-rapw 1 PVID Egress Untagged
br0 117
118
119
120
128
br0.119 1 PVID Egress Untagged
br0.120 1 PVID Egress Untagged
br0.117 1 PVID Egress Untagged
br-media 1 PVID Egress Untagged
br0.118 1 PVID Egress Untagged
br0.128 1 PVID Egress Untagged
wlan0 1 PVID Egress Untagged
wlan0-1 1 PVID Egress Untagged
wlan0-2 1 PVID Egress Untagged
wlan0-3 1 PVID Egress Untagged
wlan1 1 PVID Egress Untagged
wlan1-1 1 PVID Egress Untagged
wlan1-2 1 PVID Egress Untagged
wlan1-3 1 PVID Egress Untagged
root@test:~# bridge link
3: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 master br0 state disabled priority 32 cost 100
4: lan1@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 master br0 state disabled priority 32 cost 100
5: wan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 4
18: br0.119@br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-gast state forwarding priority 32 cost 100
19: br0.120@br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-iot state forwarding priority 32 cost 100
20: br0.117@br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-lan state forwarding priority 32 cost 100
22: br0.118@br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-media state forwarding priority 32 cost 100
23: br0.128@br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-rapw state forwarding priority 32 cost 100
43: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-lan state forwarding priority 32 cost 100
44: wlan0-1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-gast state forwarding priority 32 cost 100
45: wlan0-2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-iot state forwarding priority 32 cost 100
46: wlan0-3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-rapw state forwarding priority 32 cost 100
53: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-lan state forwarding priority 32 cost 100
54: wlan1-1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-gast state forwarding priority 32 cost 100
55: wlan1-2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-iot state forwarding priority 32 cost 100
56: wlan1-3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-rapw state forwarding priority 32 cost 100
root@test:~# ip -d link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0 minmtu 0 maxmtu 0 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 50:d2:f5:26:b3:9e brd ff:ff:ff:ff:ff:ff promiscuity 4 minmtu 68 maxmtu 1500 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 portname p6
3: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br0 state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
link/ether 50:d2:f5:26:b3:9e brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 0 maxmtu 65535
bridge_slave state disabled priority 32 cost 100 hairpin off guard off root_block off fastleave off learning on flood on port_id 0x8002 port_no 0x2 designated_port 32770 designated_cost 0 designated_bridge 8000.50:D2:F5:26:B3:9E designated_root 8000.50:D2:F5:26:B3:9E hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on mcast_to_unicast off neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 portname p2 switchid 00000000
4: lan1@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br0 state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
link/ether 50:d2:f5:26:b3:9e brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 0 maxmtu 65535
bridge_slave state disabled priority 32 cost 100 hairpin off guard off root_block off fastleave off learning on flood on port_id 0x8001 port_no 0x1 designated_port 32769 designated_cost 0 designated_bridge 8000.50:D2:F5:26:B3:9E designated_root 8000.50:D2:F5:26:B3:9E hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on mcast_to_unicast off neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 portname p3 switchid 00000000
5: wan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0 state UP mode DEFAULT group default qlen 1000
link/ether 50:d2:f5:26:b3:9f brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 0 maxmtu 65535
bridge_slave state forwarding priority 32 cost 4 hairpin off guard off root_block off fastleave off learning on flood on port_id 0x8003 port_no 0x3 designated_port 32771 designated_cost 0 designated_bridge 8000.50:D2:F5:26:B3:9E designated_root 8000.50:D2:F5:26:B3:9E hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on mcast_to_unicast off neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 portname p4 switchid 00000000
8: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 50:d2:f5:26:b3:9e brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
bridge forward_delay 200 hello_time 200 max_age 2000 ageing_time 30000 stp_state 0 priority 32767 vlan_filtering 1 vlan_protocol 802.1Q bridge_id 7fff.50:D2:F5:26:B3:9E designated_root 7fff.50:D2:F5:26:B3:9E root_port 0 root_path_cost 0 topology_change 0 topology_change_detected 0 hello_timer 0.00 tcn_timer 0.00 topology_change_timer 0.00 gc_timer 48.37 vlan_default_pvid 1 vlan_stats_enabled 0 vlan_stats_per_port 0 group_fwd_mask 0 group_address 01:80:c2:00:00:00 mcast_snooping 0 mcast_router 1 mcast_query_use_ifaddr 0 mcast_querier 0 mcast_hash_elasticity 16 mcast_hash_max 512 mcast_last_member_count 2 mcast_startup_query_count 2 mcast_last_member_interval 100 mcast_membership_interval 26000 mcast_querier_interval 25500 mcast_query_interval 12500 mcast_query_response_interval 1000 mcast_startup_query_interval 3124 mcast_stats_enabled 0 mcast_igmp_version 2 mcast_mld_version 1 nf_call_iptables 0 nf_call_ip6tables 0 nf_call_arptables 0 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
9: br-gast: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 50:d2:f5:26:b3:9e brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
bridge forward_delay 200 hello_time 200 max_age 2000 ageing_time 30000 stp_state 0 priority 32767 vlan_filtering 1 vlan_protocol 802.1Q bridge_id 7fff.50:D2:F5:26:B3:9E designated_root 7fff.50:D2:F5:26:B3:9E root_port 0 root_path_cost 0 topology_change 0 topology_change_detected 0 hello_timer 0.00 tcn_timer 0.00 topology_change_timer 0.00 gc_timer 181.98 vlan_default_pvid 1 vlan_stats_enabled 0 vlan_stats_per_port 0 group_fwd_mask 0 group_address 01:80:c2:00:00:00 mcast_snooping 0 mcast_router 1 mcast_query_use_ifaddr 0 mcast_querier 0 mcast_hash_elasticity 16 mcast_hash_max 512 mcast_last_member_count 2 mcast_startup_query_count 2 mcast_last_member_interval 100 mcast_membership_interval 26000 mcast_querier_interval 25500 mcast_query_interval 12500 mcast_query_response_interval 1000 mcast_startup_query_interval 3124 mcast_stats_enabled 0 mcast_igmp_version 2 mcast_mld_version 1 nf_call_iptables 0 nf_call_ip6tables 0 nf_call_arptables 0 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
10: br-iot: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 50:d2:f5:26:b3:9e brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
bridge forward_delay 200 hello_time 200 max_age 2000 ageing_time 30000 stp_state 0 priority 32767 vlan_filtering 1 vlan_protocol 802.1Q bridge_id 7fff.50:D2:F5:26:B3:9E designated_root 7fff.50:D2:F5:26:B3:9E root_port 0 root_path_cost 0 topology_change 0 topology_change_detected 0 hello_timer 0.00 tcn_timer 0.00 topology_change_timer 0.00 gc_timer 197.34 vlan_default_pvid 1 vlan_stats_enabled 0 vlan_stats_per_port 0 group_fwd_mask 0 group_address 01:80:c2:00:00:00 mcast_snooping 0 mcast_router 1 mcast_query_use_ifaddr 0 mcast_querier 0 mcast_hash_elasticity 16 mcast_hash_max 512 mcast_last_member_count 2 mcast_startup_query_count 2 mcast_last_member_interval 100 mcast_membership_interval 26000 mcast_querier_interval 25500 mcast_query_interval 12500 mcast_query_response_interval 1000 mcast_startup_query_interval 3124 mcast_stats_enabled 0 mcast_igmp_version 2 mcast_mld_version 1 nf_call_iptables 0 nf_call_ip6tables 0 nf_call_arptables 0 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
11: br-rapw: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 50:d2:f5:26:b3:9e brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
bridge forward_delay 200 hello_time 200 max_age 2000 ageing_time 30000 stp_state 0 priority 32767 vlan_filtering 1 vlan_protocol 802.1Q bridge_id 7fff.50:D2:F5:26:B3:9E designated_root 7fff.50:D2:F5:26:B3:9E root_port 0 root_path_cost 0 topology_change 0 topology_change_detected 0 hello_timer 0.00 tcn_timer 0.00 topology_change_timer 0.00 gc_timer 68.39 vlan_default_pvid 1 vlan_stats_enabled 0 vlan_stats_per_port 0 group_fwd_mask 0 group_address 01:80:c2:00:00:00 mcast_snooping 0 mcast_router 1 mcast_query_use_ifaddr 0 mcast_querier 0 mcast_hash_elasticity 16 mcast_hash_max 512 mcast_last_member_count 2 mcast_startup_query_count 2 mcast_last_member_interval 100 mcast_membership_interval 26000 mcast_querier_interval 25500 mcast_query_interval 12500 mcast_query_response_interval 1000 mcast_startup_query_interval 3124 mcast_stats_enabled 0 mcast_igmp_version 2 mcast_mld_version 1 nf_call_iptables 0 nf_call_ip6tables 0 nf_call_arptables 0 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
17: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 50:d2:f5:26:b3:9e brd ff:ff:ff:ff:ff:ff promiscuity 5 minmtu 68 maxmtu 65535
bridge forward_delay 1500 hello_time 200 max_age 2000 ageing_time 30000 stp_state 0 priority 32768 vlan_filtering 1 vlan_protocol 802.1Q bridge_id 8000.50:D2:F5:26:B3:9E designated_root 8000.50:D2:F5:26:B3:9E root_port 0 root_path_cost 0 topology_change 0 topology_change_detected 0 hello_timer 0.00 tcn_timer 0.00 topology_change_timer 0.00 gc_timer 90.63 vlan_default_pvid 1 vlan_stats_enabled 0 vlan_stats_per_port 0 group_fwd_mask 0 group_address 01:80:c2:00:00:00 mcast_snooping 1 mcast_router 1 mcast_query_use_ifaddr 0 mcast_querier 0 mcast_hash_elasticity 16 mcast_hash_max 4096 mcast_last_member_count 2 mcast_startup_query_count 2 mcast_last_member_interval 100 mcast_membership_interval 26000 mcast_querier_interval 25500 mcast_query_interval 12500 mcast_query_response_interval 1000 mcast_startup_query_interval 3124 mcast_stats_enabled 0 mcast_igmp_version 2 mcast_mld_version 1 nf_call_iptables 0 nf_call_ip6tables 0 nf_call_arptables 0 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
18: br0.119@br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-gast state UP mode DEFAULT group default qlen 1000
link/ether 50:d2:f5:26:b3:9e brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 0 maxmtu 65535
vlan protocol 802.1Q id 119 <REORDER_HDR>
bridge_slave state forwarding priority 32 cost 100 hairpin off guard off root_block off fastleave off learning on flood on port_id 0x8002 port_no 0x2 designated_port 32770 designated_cost 0 designated_bridge 7fff.50:D2:F5:26:B3:9E designated_root 7fff.50:D2:F5:26:B3:9E hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on mcast_to_unicast off neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
19: br0.120@br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-iot state UP mode DEFAULT group default qlen 1000
link/ether 50:d2:f5:26:b3:9e brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 0 maxmtu 65535
vlan protocol 802.1Q id 120 <REORDER_HDR>
bridge_slave state forwarding priority 32 cost 100 hairpin off guard off root_block off fastleave off learning on flood on port_id 0x8002 port_no 0x2 designated_port 32770 designated_cost 0 designated_bridge 7fff.50:D2:F5:26:B3:9E designated_root 7fff.50:D2:F5:26:B3:9E hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on mcast_to_unicast off neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
20: br0.117@br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP mode DEFAULT group default qlen 1000
link/ether 50:d2:f5:26:b3:9e brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 0 maxmtu 65535
vlan protocol 802.1Q id 117 <REORDER_HDR>
bridge_slave state forwarding priority 32 cost 100 hairpin off guard off root_block off fastleave off learning on flood on port_id 0x8003 port_no 0x3 designated_port 32771 designated_cost 0 designated_bridge 7fff.50:D2:F5:26:B3:9E designated_root 7fff.50:D2:F5:26:B3:9E hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on mcast_to_unicast off neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
21: br-media: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether e2:a7:1c:64:29:64 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
bridge forward_delay 200 hello_time 200 max_age 2000 ageing_time 30000 stp_state 0 priority 32767 vlan_filtering 1 vlan_protocol 802.1Q bridge_id 7fff.E2:A7:1C:64:29:64 designated_root 7fff.E2:A7:1C:64:29:64 root_port 0 root_path_cost 0 topology_change 0 topology_change_detected 0 hello_timer 0.00 tcn_timer 0.00 topology_change_timer 0.00 gc_timer 30.63 vlan_default_pvid 1 vlan_stats_enabled 0 vlan_stats_per_port 0 group_fwd_mask 0 group_address 01:80:c2:00:00:00 mcast_snooping 0 mcast_router 1 mcast_query_use_ifaddr 0 mcast_querier 0 mcast_hash_elasticity 16 mcast_hash_max 512 mcast_last_member_count 2 mcast_startup_query_count 2 mcast_last_member_interval 100 mcast_membership_interval 26000 mcast_querier_interval 25500 mcast_query_interval 12500 mcast_query_response_interval 1000 mcast_startup_query_interval 3124 mcast_stats_enabled 0 mcast_igmp_version 2 mcast_mld_version 1 nf_call_iptables 0 nf_call_ip6tables 0 nf_call_arptables 0 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
22: br0.118@br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-media state UP mode DEFAULT group default qlen 1000
link/ether 50:d2:f5:26:b3:9e brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 0 maxmtu 65535
vlan protocol 802.1Q id 118 <REORDER_HDR>
bridge_slave state forwarding priority 32 cost 100 hairpin off guard off root_block off fastleave off learning on flood on port_id 0x8001 port_no 0x1 designated_port 32769 designated_cost 0 designated_bridge 7fff.E2:A7:1C:64:29:64 designated_root 7fff.E2:A7:1C:64:29:64 hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on mcast_to_unicast off neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
23: br0.128@br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-rapw state UP mode DEFAULT group default qlen 1000
link/ether 50:d2:f5:26:b3:9e brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 0 maxmtu 65535
vlan protocol 802.1Q id 128 <REORDER_HDR>
bridge_slave state forwarding priority 32 cost 100 hairpin off guard off root_block off fastleave off learning on flood on port_id 0x8002 port_no 0x2 designated_port 32770 designated_cost 0 designated_bridge 7fff.50:D2:F5:26:B3:9E designated_root 7fff.50:D2:F5:26:B3:9E hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on mcast_to_unicast off neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
43: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP mode DEFAULT group default qlen 1000
link/ether 50:d2:f5:26:b3:a0 brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 256 maxmtu 2304
bridge_slave state forwarding priority 32 cost 100 hairpin on guard off root_block off fastleave off learning on flood on port_id 0x8001 port_no 0x1 designated_port 32769 designated_cost 0 designated_bridge 7fff.50:D2:F5:26:B3:9E designated_root 7fff.50:D2:F5:26:B3:9E hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on mcast_to_unicast on neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
44: wlan0-1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-gast state UP mode DEFAULT group default qlen 1000
link/ether 52:d2:f5:26:b3:a0 brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 256 maxmtu 2304
bridge_slave state forwarding priority 32 cost 100 hairpin off guard off root_block off fastleave off learning on flood on port_id 0x8001 port_no 0x1 designated_port 32769 designated_cost 0 designated_bridge 7fff.50:D2:F5:26:B3:9E designated_root 7fff.50:D2:F5:26:B3:9E hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on mcast_to_unicast off neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
45: wlan0-2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-iot state UP mode DEFAULT group default qlen 1000
link/ether 56:d2:f5:26:b3:a0 brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 256 maxmtu 2304
bridge_slave state forwarding priority 32 cost 100 hairpin off guard off root_block off fastleave off learning on flood on port_id 0x8001 port_no 0x1 designated_port 32769 designated_cost 0 designated_bridge 7fff.50:D2:F5:26:B3:9E designated_root 7fff.50:D2:F5:26:B3:9E hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on mcast_to_unicast off neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
46: wlan0-3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-rapw state UP mode DEFAULT group default qlen 1000
link/ether 5a:d2:f5:26:b3:a0 brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 256 maxmtu 2304
bridge_slave state forwarding priority 32 cost 100 hairpin off guard off root_block off fastleave off learning on flood on port_id 0x8001 port_no 0x1 designated_port 32769 designated_cost 0 designated_bridge 7fff.50:D2:F5:26:B3:9E designated_root 7fff.50:D2:F5:26:B3:9E hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on mcast_to_unicast off neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
53: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP mode DEFAULT group default qlen 1000
link/ether 50:d2:f5:26:b3:a1 brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 256 maxmtu 2304
bridge_slave state forwarding priority 32 cost 100 hairpin on guard off root_block off fastleave off learning on flood on port_id 0x8002 port_no 0x2 designated_port 32770 designated_cost 0 designated_bridge 7fff.50:D2:F5:26:B3:9E designated_root 7fff.50:D2:F5:26:B3:9E hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on mcast_to_unicast on neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
54: wlan1-1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-gast state UP mode DEFAULT group default qlen 1000
link/ether 52:d2:f5:26:b3:a1 brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 256 maxmtu 2304
bridge_slave state forwarding priority 32 cost 100 hairpin on guard off root_block off fastleave off learning on flood on port_id 0x8003 port_no 0x3 designated_port 32771 designated_cost 0 designated_bridge 7fff.50:D2:F5:26:B3:9E designated_root 7fff.50:D2:F5:26:B3:9E hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on mcast_to_unicast on neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
55: wlan1-2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-iot state UP mode DEFAULT group default qlen 1000
link/ether 56:d2:f5:26:b3:a1 brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 256 maxmtu 2304
bridge_slave state forwarding priority 32 cost 100 hairpin off guard off root_block off fastleave off learning on flood on port_id 0x8003 port_no 0x3 designated_port 32771 designated_cost 0 designated_bridge 7fff.50:D2:F5:26:B3:9E designated_root 7fff.50:D2:F5:26:B3:9E hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on mcast_to_unicast off neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
56: wlan1-3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-rapw state UP mode DEFAULT group default qlen 1000
link/ether 5a:d2:f5:26:b3:a1 brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 256 maxmtu 2304
bridge_slave state forwarding priority 32 cost 100 hairpin off guard off root_block off fastleave off learning on flood on port_id 0x8003 port_no 0x3 designated_port 32771 designated_cost 0 designated_bridge 7fff.50:D2:F5:26:B3:9E designated_root 7fff.50:D2:F5:26:B3:9E hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on mcast_to_unicast off neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
What I (think I have) learned:
- with DSA, you get names for every port of your switch like LANx, WAN
- direct interaction with eth0 or eth0.VID seems to be unnecessary
- these new ports claim to be usable as standard ethernet ports, but obviously they are not... see post 1 of this thread
- putting these ports into a bridge makes them magically work
The good thing of this setup is the remaining usability of the LUCI network config. You can define your WIFIs and add them to networks as before.
What could be improved:
- split the script up into parts and integrate them into netifd
- investigate the performance of the WAN port; seems to be a bit slow
- most likely much more