Mini Mini Howto

Jump to: navigation, search


This howto describes a quick way to get up and going with LVS.


Start from a precompiled Linux distribution. I was using a combination of Fedora Core 4 and Fedora Core 6, but this should work with any recent version of Linux.

The following will set up the real servers ( and to accept data from the load balancer ( for VIP I put it into a shell script and added that script to /etc/rc.d/rc.local on real servers.

echo 1 > /proc/sys/net/ipv4/conf/eth0/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/eth0/arp_announce
echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce

ifconfig lo:0 netmask broadcast up

One time setup on the load balancer:

rpm -U /net/shauna/usr/local/share/RPMS/4/ipvsadm-1.24-7.x86_64.rpm

I put the following script on the load balancer, again referenced in /etc/rc.d/rc.local

ifconfig eth0:0 netmask broadcast up
ipvsadm --clear
ipvsadm --add-service --tcp-service --scheduler rr
ipvsadm --add-server --tcp-service --real-server --gatewaying
ipvsadm --add-server --tcp-service --real-server --gatewaying

That’s all it took. I didn’t recompile anything. My firewall treats, the VIP, just like an ordinary machine. Inside the firewall I have a standard switch. Aside from the firewall, all of the machines are using only one NIC and one subnet.

Note: the LVS/DR load balancing method is used in the above example.


Several years ago I set up an LVS. Recently I did it again. Because of changes in the 2.6 kernel, it was a whole lot easier this time. It was almost trivial. Unfortunately, it took me a long time to dig through the documentation to what I needed.

All of this information was available on Google, but it was hiding. I can appreciate the older documentation – as I said I worked with this software a long time ago – but some of it has little or no value. How many people, for example, need to use an old version of the kernel? There may be a place for that information, but it should not be the first thing that a potential user sees.