Network multi-pathing on two Ethernet cards
Q Running Red Hat, I have two Ethernet cards plugged into a single switch and a single static IP address. Is it possible to set up network multi-pathing on these two network interfaces so that if one link dies, it fails over to the second without setting up a virtual IP address?
A Yes, IP multi-pathing (bonding) allows a host to be redundantly connected to a network by two independent paths. There are other bonding methods, but as you want high availability I'd suggest IP multi-pathing is your best bet. Unlike the floating virtual IP method of multi-path redundancy, bonding creates a floating virtual interface. Under Red Hat, to configure bonding you need to associate the two physical interfaces with a new virtual bonded interface, 'bond0', within the standard network configuration files. Thus, ifcfg-eth0 and ifcfg-eth1 will need to contain the following:
Now, create a new bonded network interface file called bond0 that contains the network specific information that your previous network configuration file (ifcfg- eth0) contained, like this:
You've now configured the network information on the new virtual interface and associated it tothe two physical ones. Next you'll need to configure bonding to initialise on boot. Set the polling interface and bonding method, in this case Active/Standby. Add the following to /etc/modprobe.conf:
alias bond0 bonding options
bonding mode=1 miimon=100
install bond0 /sbin/modprobe eth0;
/sbin/modprobe eth1; /sbin/modprobe bonding; /bin/true
mode=1 is active/standby
miimon=100 is the polling interval is the network polling interval in milliseconds - 100ms.
Now you'll need to load the bonding module and restart networking. As root, execute the following commands:
service network restart
The only thing left is to update any config files, such as Iptables, that reference the physical interface with the new bonded interface.
Follow us on Identi.ca or Twitter