LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: Virtual Interfaces?

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: Virtual Interfaces?
From: Roberto Nibali <ratz@xxxxxxxxxxxx>
Date: Wed, 17 Dec 2003 22:19:18 +0100
ntadmin@xxxxxxxxxxxx wrote:
Ok, I see now how your proof of concept works.

Cool.

I can be a little dense
sometimes..;)

;) Me too.

 Do you have any idea what the differences are between using
ifconfig and ip addr?

Yes.

 When I add an IP with ifconfig it shows up with ip
addr show...

Correct, but not vice versa. And the real problem is that if you add multiple IP addresses to a physical interface _without_ a label then ifconfig won't see it anymore. Also you are kind of restricted on the labelling with ifconfig. And starting with a certain string length for the label, ifconfig will simply truncate the names, which can be highly annoying if you have a VPN cluster with thousands of VPN connections that are labelled according to a clusterwide semantics. Ohh, and for example if you use cipe for VPNs (which you seem to be using according to your kernel) and you try to make a fast failover, ifconfig will be tripping through races while inserting interfaces which results in some VPN devices being up and some not (you can see this behavior on fast machines which try to set up hundreds of VPNs without delays).

But for normal people 'ifconfig ...' == 'ip addr add', basically :).

I'm not sure I know if this means that they do the same thing
or not.

No, they won't. ifconfig uses PF_UNIX socket and an ioctl and ip addr add simply uses the fast _and_ highly reliable user space to kernel space transportation mechanism called NETLINK. See below:

# strace -e socket,ioctl ifconfig eth0:4 155.23.5.25 netmask 255.255.255.240 broadcast 155.23.5.31
socket(PF_UNIX, SOCK_DGRAM, 0)          = 3
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
socket(PF_INET6, SOCK_DGRAM, 0)         = 5
ioctl(4, 0x8916, 0xbffff1a0)            = 0
ioctl(4, 0x8913, 0xbffff0c0)            = 0
ioctl(4, 0x8914, 0xbffff0c0)            = 0
ioctl(4, 0x891c, 0xbffff1a0)            = 0
ioctl(4, 0x891a, 0xbffff1a0)            = 0
ioctl(4, 0x8913, 0xbffff0c0)            = 0
ioctl(4, 0x8914, 0xbffff0c0)            = 0

# strace -e socket,ioctl ip addr add 155.23.5.25/28 brd + dev eth0 label eth0:4
socket(PF_NETLINK, SOCK_RAW, 0)         = 3

I reckon this speaks for itself ...

In addition, maybe you know, maybe somebody else can help me?

Probably someone else is better.

I am
wondering about the IPaddr script that comes with Heartbeat.  When it
executes it runs the gratuitous arp send_arp command 5 times.  I am
wondering if it would be safe to reduce this as it is adding additional
minutes to the failover time that we would like to reclaim.

So I went along and checked out the current linux-ha cvs branch. And to my joy I find that Horms has started IPaddr2 which will be using the iproute2 framework ;). I'm confident, that with IPaddr2 things will be working just great.

Checking out ../heartbeat/libnet_util/send_arp.c I would say that the -r option should do the trick. Now let's see how IPaddr calls send_arp:

Aha:

ARGS="-i $ARP_INTERVAL_MS -r $ARP_REPEAT -p $SENDARPPIDFILE $TARGET_INTERFACE $BASEIP auto $BASEIP $ARP_NETMASK"

which is in ip_start() which gets called by IPaddr <ip-address> start. And ARP_REPEAT can be overwritten by presetting that variable. As simple as that ;).

Best regards,
Roberto Nibali, ratz
--
echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'|dc

<Prev in Thread] Current Thread [Next in Thread>