Virtual Bridge

Create a bridge between two interfaces
Bridge:- A Bridge is a way to connect two different interfaces together. Packets are forward based on Ethernet address, rather that ip address.

brctl is used to set up, maintain, and inspect the Ethernet bridge configuration in the Linux kernel.

To install bridge in Linux we need following packages
  • bridge-utils
  • tunctl
Step-1
yum install bridge-utils tunctl
cp /etc/sysconfig/network-scripts/ifcfg-eth0  /etc/sysconfig/network-scripts/ifcfg-br0

Modify the contents of our new file (ifcfg-br0) to resemble the following configuration

/etc/sysconfig/network-scripts/ifcfg-br0:
DEVICE="br0"
NM_CONTROLLED="yes"
ONBOOT="yes"  
TYPE="Bridge"
BOOTPROTO="none"
IPADDR="192.168.1.58"
PREFIX="24"
GATEWAY="192.168.1.1"
DNS1="8.8.8.8"
DEFROUTE="yes"
NAME="Bridge Network br0"

Next, we will make a few adjustments to the previous interface to ensure the new network bridge configuration is used here-out.

/etc/sysconfig/network-scripts/ifcfg-eth0:
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT="yes"  
TYPE="Ethernet"
BOOTPROTO="none"
IPADDR="192.168.1.98"
PREFIX="24"
GATEWAY="192.168.1.1"
DNS1="8.8.8.8"
DNS2="8.8.4.4"
DEFROUTE="yes"
NAME="Ethernet Network eth0"
Bridge="br0"

Same will be done in /etc/sysconfig/network-scripts/ifcfg-eth1 as in eth0
To ensure that your new network bridge will take effect
service network restart
You will find that interface eth0 and eth1 now connect to bridge network.
Finally check the bridge.

Comments

Popular posts from this blog

Managing Vm's with Virish

How Yum Works?

Steps to install Ubuntu