Re: Fwd: Access virtual IP from keepalived host

"Lennart Sorensen" <[email protected]>
Newsgroups gmane.linux.keepalived.devel
Message-ID <[email protected]>
On Tue, Jul 16, 2013 at 11:19:10PM +0400, kay wrote:
> For some reason it doesn't work. I guess that is because eth0 has several
> IP addresses. And when I access VIP the source IP is VIP. How can I make
> source IP to be real IP? Maybe I need to use iproute2 with ip rules?

If you open a connection to the VIP, then the responses will come from
the VIP.  That's how sockets work and how it should be.

When the device with the VIP is creating a connection, then it picks
which IP to use.

The application can choose to bind to a given IP when creating a socket,
or the kernel can pick one based on the source IP specified on a route
(if one is specified), or the kernel will pick one that matches the
destination subnet if it has one, or it can pick the primary IP of the
interface it will use to reach the destination address.

So this route for example says what IP it will use when connecting to
other addresses going through that route:

172.30.128.0/19 dev fe-cm-1  proto kernel  scope link  src 172.30.128.249 

This one will just use the default (primary) IP of the interface:

default via 172.30.128.1 dev fe-cm-1  proto zebra 

-- 
Len Sorensen

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.