Linux : How to create a bridge interface on RHEL/CentOS

By | January 4, 2013

A bridge interface is actually a virtual interface handled by a config file on your Linux system. Creating a bridge is quite simple, just follow those steps and you’re all set!

1. Create the bridge interface configuration file :

vi /etc/sysconfig/network-scripts/ifcfg-br0

Add the the following parameters :

DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
STP=on
IPADDR=
NETMASK=
GATEWAY=
DNS1=

2. Configure the physical interface member of the bridge with those values :

DEVICE=eth0
BOOTPROTO=static
HWADDR=
ONBOOT=yes
NETMASK=
GATEWAY=
BRIDGE=br0
TYPE=Ethernet

As you can see, there is no IP address on the physical interface because they belong to the bridge. For the gateway and netmask, simply add the same as you are using on the bridge interface.