Network interface bonding is a Linux kernel feature which allows to aggregate multiple interfaces (eth0,eth1) into one virtual link such as bond0. Network card bonding is an effective way to increase the available bandwidth. If bonded the interfaces appears as same physical device and they have same MAC address. The other names for network interface bonding are port trunking, NIC teaming channel bonding and link aggregation. The main advantage of bonded network interface is to increase data throughput by load balancing and to provide redundancy by allowing fail over from one component device to another.
## How to create a network interface bond?
Create a file named ifcfg-bondN in the directory /etc/sysconfig/network-scripts, Here “N” is the number of interfaces. Then edit the contents of ifcfg-bondn and make it similar to the configuration settings for an Ethernet interface except that DEVICE is set to bondn instead of ethn.
For example;
DEVICE=”bond0″
IPADDR=192.168.1.121
NETMASK=255.255.255.248
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
TYPE=Ethernet
BONDING_OPTS=”bonding parameters separated by spaces”
For each interface that you want to bond, edit its ifcfg-interface file so that it contains MASTER=bondN and SLAVE entries. An example is given below.
DEVICE=”eth0″
NAME=”System eth0″
IPADDR=192.168.1.101
NETMASK=255.255.255.0
BROADCAST=192.0.2.255
NM_CONTROLLED=”yes”
ONBOOT=yes
USERCTL=no
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
PEERDNS=yes
PEERROUTES=yes
MASTER=bond0
SLAVE
Create the file bonding.conf in the directory/etc/modprobe.d/, so that it contain entry for each bonded interface, for example:
alias bond0 bonding
It ensures that the kernel loads the bonding module is loaded when bring up the bonded interface. All bonded interfaces require entry in this file.
# ip link set eth0 down >> bring interface down
# ip link set eth1 down >> bring interface down
# ip link set bond0 up >> bring interface up
HAPPY BONDING 🙂
0 Comments