CentOS bridge setup

In Centos is a little interesting in set″pa of bridge adapters. I assume that is already installed bridge-utils package and eth0 (This is in my example) is configured, so let's take a look at the basic steps

  1. Copy the settings of eth0 in br0 (here if you need a different naming convention for your adapters fix)
  2. Zanestvate entries in the configuration file eth0 br0
  3. replace the adapter type of the Ethernet Bridge
  4. Removing MAC address from configuration br0
  5. Set in the configuration eth0 that will have a bridge adapter br0

To save time, I've picked it up as a simple 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. Required fields are marked *

anti SPAM *