What is Network bonding and why should I use it?
Bonding provides a method for aggregating multiple network interfaces into a single logical “bonded” interface. The behavior of the bonded interfaces depends upon the mode; generally speaking, modes provide either hot standby or load balancing services. Additionally, link integrity monitoring may be performed. So if you have multiple NICs it would be a good idea to give bonding a try.
How do I configure my RHEL/CENTOS server for use with bonding?
From a RHEL/CENTOS 6 server it’s quite easy.
Lets say your config is the following: first NIC is eth0 and second is eth1. We are going to use bond0 for our first bonding interface
Edit /etc/modprobe.d/dist.conf and the following line to the bottom.
alias bond0 bonding
next we will edit /etc/sysconfig/network-scripts/ifcfg-eth0
Next do the same for /etc/sysconfig/network-scripts/ifcfg-eth1
Now we create the new bonding interface by creating /etc/sysconfig/network-scripts/ifcfg-bond0 (Please change the IP configuration to match your network.)
Next we restart the network. It’s recommended that you are at a console to do this step and not a SSH session.
ping your gateway: ping <your gateway>
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=255 time=1.78 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=255 time=0.872 ms
If you have similar output We have connectivity!
Now lets look at out config
2: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
link/ether 00:1e:68:04:7a:10 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
link/ether 00:1e:68:04:7a:11 brd ff:ff:ff:ff:ff:ff
3: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 00:1e:68:04:7a:0e brd ff:ff:ff:ff:ff:ff
inet 192.168.1.2 brd 192.168.1.255 scope global bond0
inet6 fe80::21e:68ff:fe04:7a0e/64 scope link
valid_lft forever preferred_lft forever
If your output looks like similar to above congratulations you’ve bonded your first two interfaces together.
For additional bonds just increment the interfaces. i.e bond1 with eth2 & eth3.
If your using Virtualbox server here are the recommended bonding options for /etc/sysconfig/network-scripts/ifcfg-bond0
BONDING_OPTS=”mode=1 miimon=100 fail_over_mac=1″
Also change your virtual device Adapter type to
Intel PRO/1000 T Server.
I had to learn this from trail and error since the original config did not work.
The UMW Linux Administrator