CentOS bridge setup

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

  1. Copy the eth0 settings to br0 (here already if you need another naming of your adapters you can correct it)
  2. You record the entries for eth0 in the configuration file of br0
  3. replace the Ethernet adapter type with Bridge
  4. Remove the MAC address from the br0 configuration
  5. 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

Leave a Reply

Your email address will not be published.

Anti SPAM *