I was/am unable to find documentation how to configure a single VLAN-aware bridge on x86 with dedicated Network Interfaces via /etc/network/config
.
What I want to get is:
- A single one
bridge
which is vlan aware - One or more Ports (dedicated NIC) configured as Trunk-Ports, without an untagged PVID, which are enslaved to the
bridge
If I do it manually with iproute2
and bridge
it seams as I get the desired result.
The output of bridge vlan
looks at least as on my DGS-1210-10 where I was able to configure a single vlan aware bridge on DSA via /etc/config/network
.
#!/bin/sh
BRIDGE="br-vlan"
ip link add name ${BRIDGE} type bridge vlan_filtering 1 vlan_default_pvid 0
ip link set ${BRIDGE} up
for NIC in eth2 eth3
do
ip link set ${NIC} master ${BRIDGE}
ip link set ${NIC} up
done
for VID in 16 17
do
bridge vlan add vid ${VID} dev ${BRIDGE} self
for NIC in eth2 eth3
do
bridge vlan add vid ${VID} dev ${NIC}
done
done
root@OpenWrt:/# sh -x /root/setup_vlan-aware_bridge.sh
+ BRIDGE=br-vlan
+ ip link add name br-vlan type bridge vlan_filtering 1 vlan_default_pvid 0
+ ip link set br-vlan up
+ ip link set eth2 master br-vlan
+ ip link set eth2 up
+ ip link set eth3 master br-vlan
+ ip link set eth3 up
+ bridge vlan add vid 16 dev br-vlan self
+ bridge vlan add vid 16 dev eth2
+ bridge vlan add vid 16 dev eth3
+ bridge vlan add vid 17 dev br-vlan self
+ bridge vlan add vid 17 dev eth2
+ bridge vlan add vid 17 dev eth3
root@OpenWrt:/# ip -br l
lo DOWN 00:00:00:00:00:00 <LOOPBACK>
eth0 DOWN 20:7c:14:a2:b0:84 <BROADCAST,MULTICAST>
eth1 DOWN 20:7c:14:a2:b0:85 <BROADCAST,MULTICAST>
eth2 DOWN 20:7c:14:a2:b0:86 <NO-CARRIER,BROADCAST,MULTICAST,UP>
eth3 DOWN 20:7c:14:a2:b0:87 <NO-CARRIER,BROADCAST,MULTICAST,UP>
br-vlan DOWN 20:7c:14:a2:b0:86 <NO-CARRIER,BROADCAST,MULTICAST,UP>
root@OpenWrt:/# brctl show
bridge name bridge id STP enabled interfaces
br-vlan 8000.207c14a2b086 no eth2
eth3
root@OpenWrt:/# bridge vlan
port vlan-id
eth2 16
17
eth3 16
17
br-vlan 16
17
Compare with bridge vlan
from the DGS-1210-10 where lan8
is the Trunk:
root@sw1:~# bridge vlan
port vlan-id
lan1 4094 PVID Egress Untagged
lan2 64 PVID Egress Untagged
lan3 64 PVID Egress Untagged
lan4 71 PVID Egress Untagged
lan5 17 PVID Egress Untagged
lan6 24 PVID Egress Untagged
lan7 24 PVID Egress Untagged
lan8 16
17
24
64
65
71
76
77
lan9 1 PVID Egress Untagged
lan10 1 PVID Egress Untagged
switch 1
16
17
24
64
65
71
76
77
4094
When I try to configure a single vlan-aware bridge on x86 (via /etc/config/network
) it results in ether a total mess or not working at all. (For now I spare us from sharing total misconfigured snippets. Maybe someone has a pointer for me, or even a working example.)
I'm however able to configure multiple bridges, but still: I'm unsure if this is really correct because bridge vlan
looks a little bit odd to me, even that ip -d link
shows an id
on the vlan-subinterfaces. but not on/for the 2 bridge interfaces. But I'm not sure if they even should... However I want to use a single vlan-aware bridge anyway, so configuring multiple bridges and ensalve vlan subinterfaces is not an option for now.
Reference for the multiple bridges with vlan sub interfaces:
config interface 'vlan16'
option type 'bridge'
list ifname 'eth2.16'
list ifname 'eth3.16'
option proto 'none'
config interface 'vlan17'
option type 'bridge'
list ifname 'eth2.17'
list ifname 'eth3.17'
option proto 'none'
root@OpenWrt:/# ip -br l
lo UNKNOWN 00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP>
eth0 DOWN 20:7c:14:a2:b0:84 <BROADCAST,MULTICAST>
eth1 DOWN 20:7c:14:a2:b0:85 <BROADCAST,MULTICAST>
eth2 DOWN 20:7c:14:a2:b0:86 <NO-CARRIER,BROADCAST,MULTICAST,UP>
eth3 DOWN 20:7c:14:a2:b0:87 <NO-CARRIER,BROADCAST,MULTICAST,UP>
br-vlan16 DOWN 20:7c:14:a2:b0:86 <NO-CARRIER,BROADCAST,MULTICAST,UP>
eth2.16@eth2 LOWERLAYERDOWN 20:7c:14:a2:b0:86 <NO-CARRIER,BROADCAST,MULTICAST,UP>
eth3.16@eth3 LOWERLAYERDOWN 20:7c:14:a2:b0:87 <NO-CARRIER,BROADCAST,MULTICAST,UP>
br-vlan17 DOWN 20:7c:14:a2:b0:86 <NO-CARRIER,BROADCAST,MULTICAST,UP>
eth2.17@eth2 LOWERLAYERDOWN 20:7c:14:a2:b0:86 <NO-CARRIER,BROADCAST,MULTICAST,UP>
eth3.17@eth3 LOWERLAYERDOWN 20:7c:14:a2:b0:87 <NO-CARRIER,BROADCAST,MULTICAST,UP>
root@OpenWrt:/# brctl show
bridge name bridge id STP enabled interfaces
br-vlan16 7fff.207c14a2b086 no eth2.16
eth3.16
br-vlan17 7fff.207c14a2b086 no eth2.17
eth3.17
root@OpenWrt:/# bridge vlan
port vlan-id
br-vlan16 1 PVID Egress Untagged
eth2.16 1 PVID Egress Untagged
eth3.16 1 PVID Egress Untagged
br-vlan17 1 PVID Egress Untagged
eth2.17 1 PVID Egress Untagged
eth3.17 1 PVID Egress Untagged