Ethernet NIC configuration for Failover Teaming
The following guide is for the Red Hat Based distributions.
Bond in modprobe
Execute the following on the server to add the bonding module:
# echo "alias bond0 bonding" >> /etc/modprobe.conf
Create interfaces (bond and eth)
Create a new bonding interface:
# vi /etc/sysconfig/network-scripts/ifcfg-bond0 ONBOOT=yes DEVICE=bond0 BOOTPROTO=static IPADDR=<IP_Addr> NETMASK=<Mask> BONDING_OPTS="mode=1 miimon=100"
If you want an other mode than the active-passive failover, you should modify the mode 1 of the BONDING_OPTS.
Assign ethX interface to this new interface to bond0. For each ethX Interface you have to create the file ifcfg-ethX like this:
# vi /etc/sysconfig/network-scripts/ifcfg-eth<X> ONBOOT=yes DEVICE=eth<X> MASTER=bond0 SLAVE=yes
You have to replace the number of the eth interface <x>. Note that will not be always eth0 and eth1. Here is the way to determinate on witch interface the cables are plugged in:
# for i in `seq 0 9`; do printf "eth$i:"; ethtool eth$i | grep Link; done
In case of hardware server, the ports on the switch where it is plugged are fixed: Full Duplex and 100 or 1000 Mbps (depending of what the server NICs are capable).
How to know the NIC capability:
# ethtool eth<x> [...] Supported link: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full [...]
According to this information, you will add one of those line in the /etc/sysconfig/network-scripts/ifcfg-eth<x> file:
ETHTOOL_OPTS="speed 100 duplex full autoneg off"
ETHTOOL_OPTS="speed 1000 duplex full autoneg on"