CentOS 6: Bonding Multiple Network Interface Cards (NICs)
Bonding NICs can help us achieve high network availability even if one of the network card falls down. Usually, bonding NICs are implement for high-speed no interruption service like SAN storage. Do not think that bonding will multiply the data transmit. To multiply data transmit, we need to do multipathing. You can refer here for more information: http://blog.open-e.com/bonding-versus-mpio-explained/.
First off all, make sure your server has 2 or more NICs to be combined. Make sure all of them are connected to a same switch as picture below:
Variables that I used:
OS: CentOS 6 64bit
Storage server main IP: 192.168.0.100
Network interface cards involved: eth0, eth1, eth2, eth3
1. Make sure we have the utilities to bond NICs. Run following command to install:
yum install ethtool -y |
2. Create a new bond NIC called bond0. This will be our bonding master interface, where our real NIC will be use as slave interface. Whenever a slave NIC down, another slave NIC will take over so the master interface will be not affected:
touch /etc/sysconfig/network-scripts/ifcfg-bond0 vi /etc/sysconfig/network-scripts/ifcfg-bond0 |
And add following line:
DEVICE=bond0 ONBOOT=yes IPADDR=192.168.0.100 NETMASK=255.255.255.0 NETWORK=192.168.0.0 USERCTL=no BOOTPROTO=no |
3. Now we need to change some values on every physical NICs configuration files that we have. In this case, I will need to change following files under /etc/sysconfig/network-scripts directory:
ifcfg-eth0:
DEVICE=eth0 ONBOOT=yes USERCTL=no MASTER=bond0 SLAVE=yes BOOTPROTO=no |
ifcfg-eth1:
DEVICE=eth1 ONBOOT=yes USERCTL=no MASTER=bond0 SLAVE=yes BOOTPROTO=no |
ifcfg-eth2:
DEVICE=eth2 ONBOOT=yes USERCTL=no MASTER=bond0 SLAVE=yes BOOTPROTO=no |
ifcfg-eth3:
DEVICE=eth3 ONBOOT=yes USERCTL=no MASTER=bond0 SLAVE=yes BOOTPROTO=no |
4. Now we need to register the bonding module inside CentOS as a device. We need to create a new files called bonding.conf under /etc/modprobe.d directory:
touch /etc/modprobe.d/bonding.conf vi /etc/modprobe.d/bonding.conf |
Add following line:
alias bond0 bonding options bond0 mode=5 miimon=100 |
List of bonding modes can be refer here:
http://unixfoo.blogspot.com/2008/02/network-bonding-part-ii-modes-of.html
5. Add the module to kernel:
modprobe bonding |
6. Restart network:
service network restart |
Done! You will noticed that another interface is added into interface list (ifconfig) called bond0. You can monitor the bonding state by running following command:
watch -n1 'cat /proc/net/bonding/bond0' |
Related Posts
- CentOS 6: Install Remote Logging Server (rsyslog)
- CentOS 6: Install VPN PPTP Client – The Simple Way
- CentOS: Install TP-Link TL-WN821N Wireless USB Driver
- Linux: Create and Configure SSH Honeypot
- CentOS: Install MongoDB – The Simple Way
- Basic Linux Command in PDF
- CentOS: Restore/Recover from Amanda Backup
- CentOS: Install OpenLDAP with Webmin – The Simple Way
- Clone VM in VMware ESXi 5 using vSphere Client
- cPanel with CentOS 6 as Internet Gateway
Sci/Tech – Google News- Google goes to the Galapagos Islands: Backpack-mounted Street View cameras ... - Daily Mail 24 May 2013
- "This is a win for Xbox customers" says Microsoft, emerging victorious from ... - Eurogamer.net 24 May 2013
- Nissan SA recalling old-gen Micras - Independent Online 24 May 2013
- Twitter unveils more secure login option - WBRC 24 May 2013
- Samsung Galaxy S4 creates history, becomes fastest-selling Android phone - India Today 24 May 2013


