Configuring a VIP on the loopback interface on Linux
- Last Updated: May 14, 2025
- 1 minute read
- LoadMaster
- LoadMaster GA
- Documentation
On a linux machine, the “ifconfig –a” command will look something like this:
root@RS1 $ ifconfig –a
eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:bb inet addr: 195.30.70.11 Bcast:
195.30.70.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:96561817 errors:526
dropped:0 overruns:5 frame:0 TX
packets:97174301 errors:0 dropped:0 overruns:0 carrier:0 collisions:0
txqueuelen:100 Interrupt:10 Base address:0x4000
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING
MTU:3924 Metric:1 RX packets:3985923
errors:0 dropped:0 overruns:0 frame:0 TX packets:3985923 errors:0 dropped:0
overruns:0 carrier:0 collisions:0 txqueuelen:0
To create an additional loopback interface with an IP alias, use the “ifconfig” command like this:
root@RS1 $ ifconfig lo:1 <VirtualServiceIPAddress> broadcast 195.30.70.200
netmask 255.255.255.255
root@RS1 $ ifconfig lo:1
lo:1 Link encap:Local Loopback inet addr:195.30.70.200 Mask:255.255.255.255 UP
LOOPBACK RUNNING MTU:3924 Metric:1
The next step is to disable invalid ARP replies. Add the following to the /etc/sysctl.conf file:
net.ipv4.conf.all.arp_ignore=1
net.ipv4.conf.eth0.arp_ignore=1
net.ipv4.conf.eth1.arp_ignore=1
net.ipv4.conf.all.arp_announce=2
net.ipv4.conf.eth0.arp_announce=2
net.ipv4.conf.eth1.arp_announce=2