The Centos is a bit interesting in the set of bridge adapters. I assume that the bridge-utils package and eth0 are already installed (in this is in my example) is configured, so let's look at the basic steps
- Copy the eth0 settings to br0 (here already if you need another naming of your adapters you can correct it)
- You record the entries for eth0 in the configuration file of br0
- replace the Ethernet adapter type with Bridge
- Remove the MAC address from the br0 configuration
- You specify in the eth0 configuration that we will have a bridge adapter br0
To save time, I painted it as an elementary bash script
cd /etc/sysconfig/network-scripts/ cp ifcfg-eth0 ifcfg-br0 sed -i 's/eth0/br0/' ifcfg-br0 sed -i 's/Ethernet/Bridge/' ifcfg-br0 sed -i '/HWADDR/d' ifcfg-br0 echo 'BRIDGE="br0"' >> ifcfg-eth0