STP does not work properly when creating bridge inside container


I have a container with multiple interfaces. I am creating a network bridge between them using the brctl command and enabling stp on that bridge. However, when I now create a network loop inside my network, the network gets flooded with traffic and is effectively unusable.

I noticed that the bridge does not accept any other node as root. When manually setting the priority however, other nodes do accept the bridge inside the container as root.

When I try the same thing otside of a container, everything works as intended and the bridge accepts other nodes as root.

Could there be any reason why stp messages are somehow disregarded inside a container? Or is there some configuration that has to be set for stp to properly work?

Can you post some example config and commands to show your setup so I can try and recreate?

You should be able to recreate the Issue using the following steps:
-Create a container with two interfaces, in this case eth0 and eth1
-Install bridge-utils inside the container
-type the following commands:

brctl addbr bridge
brctl addif bridge eth0
brctl addif bridge eth1
brctl stp bridge on
ifconfig bridge up

-now connect eth0 or eth1 to a network with STP already working
-when typing

brctl showstp bridge

the field “designated root” will always be the same as “bridge id” even when the bridge inside the container is not the root bridge

How are you connecting eth0 and eth1 to an external network? What NIC type are you using?

The interfaces are physically connected to the external network, the nictype is physical.

For anyone encountering this problem in the future:
The workaround we ended up using is to use openvswitch instead of bridge-utils.
For this solution to work however openvswitch has to be installed in both, the Container and the Host.

1 Like