Wednesday 29 November 2006

Linux NIC Bonding

I had a query on how to setup NIC bonding in RHEL4 so thought I would document it for the blog.

I'll start with a standard server with 2 NICs, eth0 and eth1. Here is the output from 'ifconfig':


The configuration scripts are found in /etc/sysconfig/network/network/scripts:


eth0 is a static interface configured in /etc/sysconfig/network/network-scripts/ifcfg-eth0:


eth1 is a static interface configured in /etc/sysconfig/network/network-scripts/ifcfg-eth1

The hardware is configured in /etc/modprobe.conf:


First we add a config file for bond0, /etc/sysconfig/network/network-scripts/ifcfg-bond0:


Now we edit /etc/sysconfig/network/network-scripts/ifcfg-eth0:


Now we edit /etc/sysconfig/network/network-scripts/ifcfg-eth1:

Network scripts are now complete in /etc/sysconfig/network/network-scripts:


Add the bonding driver to /etc/modprobe.conf:


Shut down the network with 'service network stop'
Insert the bonding driver with 'modprobe bonding -o bond0 miimon=100 mode=1'
Start the network with 'service network start':

Check the interfaces with 'ifconfig':


Check the routing is ok with 'route -n':


View the status with 'cat /proc/net/bonding/bond0':


No comments:

Post a Comment