Is it possible to setup bridge on teamed interface?

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

vl1969

Active Member
Feb 5, 2014
634
76
28
I have a centos 7 server setup. 4 physical nics teamed into a pair of interfaces. Team0 and team1
Now I want to run kvm on it and that needs a bridge, is it possible to setup a bridge on a teamed interface?
Webmin does not allow this apparently only showing the physical nics in the list.
 

Blinky 42

Active Member
Aug 6, 2015
615
232
43
48
PA, USA
You can probably convince NetworkManager to play along but I know you can do it with files in /etc/sysconfig/network-script/ifcfg-* just fine by adding a
Code:
BRIDGE="br42"
line to add that interface to the br42 bridge. If you have an IP address on the team/bond, then move that configuration over into the bridge file to avoid issues.

As a bare minimum from the command line you should be able to do it by hand like
Code:
brctl addbr br0
brctl addif br0 team0
brctl addbr br1
brctl addbr br1 team1
brctl show
And see that the 2 bonded/teamed interfaces are attached to their own bridges.
 

vl1969

Active Member
Feb 5, 2014
634
76
28
You can probably convince NetworkManager to play along but I know you can do it with files in /etc/sysconfig/network-script/ifcfg-* just fine by adding a
Code:
BRIDGE="br42"
line to add that interface to the br42 bridge. If you have an IP address on the team/bond, then move that configuration over into the bridge file to avoid issues.

As a bare minimum from the command line you should be able to do it by hand like
Code:
brctl addbr br0
brctl addif br0 team0
brctl addbr br1
brctl addbr br1 team1
brctl show
And see that the 2 bonded/teamed interfaces are attached to their own bridges.
thanks, I think I will try the CLI way if it means it will move all the needed things in the files.
I do not use network manager in the server, in fact it is disabled and removed from the system.
a quick question though, isn't the brctl cleate device in "/sys/controls/net" as opposed to
/etc/sysconfig/network-scripts?
I was playing with webmin last week and created a bridge than, and I could not remove it as there was no files in the network-scripts folder for bridge, and I could not remember where else it could be.
had similar issue with a bond interface I tried earlier too.
 

Blinky 42

Active Member
Aug 6, 2015
615
232
43
48
PA, USA
The brctl commands will just configure it until the next reboot, it isn't permanent.
If you have tossed NetworkManager (I usually do too on any server since it just gets in the way) and are using files in /etc/sysconfig/network-scripts then you add files like ifcfg-br42 for the br42 interface. Just be sure to make the type "Bridge" like
Code:
TYPE="Bridge"
instead of Ethernet.

For example, in ifcfg-br16
Code:
DEVICE=br16
TYPE=Bridge
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=192.168.16.22
PREFIX=24
And then in your ifcfg-team* files link it to the bridge with a BRIDGE="br16" line, and move any IP address info from the team file into the bridge file.

I don't use webmin, so can't comment on that side. It probably just runs the brctl commands directly instead of creating/modifying the static config files in /etc/sysconfig/network-scripts/ifcfg-* if you couldn't find the files you expected.
 

vl1969

Active Member
Feb 5, 2014
634
76
28
gotcha, so I have to create the bridge ifcfg files anyway and move the
BOOTPROTO=static to it.
I do not use static IPs , I use dhcp reserved addresses.
if I remember once the bridge it linked to the interface it takes on the MAC address of the interface, right? so the reserve IP should simply jump to the bridge on restart.
or am I wrong?