Description: a network bridge is a forwarding technique very useful when you have to deal with virtualization and you want to give your virtual machines direct access to your real network, without using NAT.
In this example, I’m going to use a bridge (br0) to access a wired network interface (eth1). I use eth1 for the bridge instead of eth0 because I prefer to use the first network interface to access the machine using SSH and fix any problems that could appear while configuring the bridge.
Use yum to install the packages needed:
yum install bridge-utils
- Edit /etc/sysconfig/network-scripts/ifcfg-eth1 and write this (changing the HWADDR for the MAC address of your network card):
- Edit /etc/sysconfig/network-scripts/ifcfg-br0 with this content (change the IP related fields to fit your needs):
- Add these lines to /etc/sysctl.conf in order to disable packet filtering in the bridge:
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
This improves the bridge’s performance. I recommend to use packet filtering in the computers which connect through the bridge, but not in the bridge itself.
- Apply the syscttl changes:
sysctl -p /etc/sysctl.conf
- Restart your network interfaces:
service network restart