[ClusterLabs] Passing and binding to virtual IP in my service

Andrei Borzenkov arvidjaar at gmail.com
Thu Jan 7 06:19:35 EST 2016

07.01.2016 13:42, Jorge Fábregas пишет:
> On 01/07/2016 05:28 AM, Nikhil Utane wrote:
>> So my question is, how to pass the virtual IP to my UDPSend OCF agent so
>> that it can then bind to the vip? This will ensure that all messages
>> initiated by my UDPSend goes from vip.
> Hi,
> I don't know how ping -I does it (what system call it uses) but I think
> you'll have to implement that if you want your program to source
> connection from a particular virtual IP.
> As far as I know, the way this is usually done these days is by creating
> routes.  Something like:
> ip route change dev eth0 src
>> Out of curiosity, where is this virtual IP stored in the kernel?
>> I expected to see a secondary interface ( for e.g. eth0:1) with the vip
>> but it isn't there.
> Well, in the old days we used to have a "virtual interface" (eth0:1,
> eth0:2 etc) but the proper modern way is to use "virtual addresses"
> within a single interface.  The caveat is that you need to use the ip
> command to show these virtual addresses (ifconfig is not aware of them):

You can assign label to address which will then be visible in ifconfig; i.e.

ip addr add label eth0:foo dev eth0

will actually make new address appear in ifconfig output as "eth0:foo"

> ip addr show
> You'll see there the notion of a primary IP and secondaries.  The system
> will initiate connection from the primary by default (unless you specify
> a route like the one above).
> HTH,
> Jorge
> _______________________________________________
> Users mailing list: Users at clusterlabs.org
> http://clusterlabs.org/mailman/listinfo/users
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org

More information about the Users mailing list