How to load-balance and fail-over with LVS

Disable ARP on nodes

ARP broadcasts are special packets which are recognised by your network's switches and used to associate MAC addresses with IP address. The LVS directors will share a common IP address with each of our nodes, and so in order to avoid confusing the switch we need to disable ARP on the nodes.

To disable ARP place the following lines in /etc/sysctl.conf:

/etc/sysctl.conf

net.ipv4.conf.eth0.arp_ignore=3
net.ipv4.conf.eth0.arp_announce=2

And then reboot, or run the following command to make the change take effect immediately:

sysctl -p /etc/sysctl.conf

You can then check the settings just by outputting the appropriate files in /proc:

cat /proc/sys/net/ipv4/conf/eth0/arp_announce
cat /proc/sys/net/ipv4/conf/eth0/arp_ignore 

If your using Shorewall then you will also need to add arp_ignore=3 to its configuration:

/etc/shorewall/interfaces

net     eth0            detect          dhcp,arp_ignore=3