when adding interfaces to the bridge it is possible to add interfaces no currently created.
and when the interface is created it is not tied into the bridge.
Steps to replicate:
- Create a interface with a vif
# set interface ethernet eth0 vif 1 # commit
- Create the bridge and add two interfaces. one of those interfaces is currently not existing
[email protected]# show int # set interfaces bridge br1 address 10.3.4.5/24 # set interfaces bridge br1 member interface eth0.1 # set interfaces bridge br1 member interface eth1.1 # commit
- Create the missing interface
# set interface ethernet eth1 vif 1 # commit
- The vif is created, but is not tied to the bridge group
[email protected]# show int eth eth1 ... vif 1 { } [email protected]# show int bridge br1 address 10.3.4.5/24 member { interface eth0.1 { } interface eth1.1 { } } [email protected]# ip a s eth1.1 6: [email protected]: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 52:54:05:12:34:57 brd ff:ff:ff:ff:ff:ff inet6 fe80::5054:5ff:fe12:3457/64 scope link valid_lft forever preferred_lft forever [email protected]# brctl show bridge name bridge id STP enabled interfaces br1 8000.525405123456 yes eth0.1 <-- interface eth1.1 is not added to the bridge
To fix this two posibillities exists.
- Do not allow additions of un-initialized interfaces . this also means that deletion of an interface in a bridge-group also should be disallowed.
- On interface creation, make it check if it should be in a bridge-group and run the bridge-script to re-add the interface to the bridge-group
out of these two methods i would prefer if solution 2 is implemented.
I am still not 100% sure that this syntax is better then having the bridge mapping on the interface itself. because this is actually a function of the interface and not of the bridge. and will be added/removed with the interface. so this is something that also could have been in the ethernet-script