[lvs-users] One realserver must connect to services to other realservers (routing problem).

Markus Hofer hofmarkus at gmail.com
Thu Aug 25 14:03:27 BST 2011

Hey guys,

i have a question about the connection of one (or in future more) 
realserver to services
to other realserver.

The problem is that when i would connect from one realserver (A) to a 
other servive on a other
realserver (B) the connection go to the LVS-Box (in my case keepalived 
loadbalancer) and then
to the other realserver (B).

My loadbalance ist keepalived with NAT.

For example:

Tomcat Service on Realserver A with external IP (VIP)

         Loadbalancer (LVS) (IP
        ^                                    |
        |                                    |
        |                                    |
        |                                    |
        |                                    V

(            (

The problem is, that realserver B see that the question for the service 
comes from the network and then goes
directly to A, but couldn't work out the answer, because realserver A 
ask and not

My work around for this problem is:

- in the hostfile i make a other local entry for the tomcat-service. So 
realserver A ask realserver B directly and not
over LVS. But this is very complicate, because I must insert all 
DNS-entry local to this realserver A.

My qustion is how I could work around this without other new DNS entries?

If the realserver go outside for services i have insert a SNAT on 

I think i could make some somethink like that if one realserver must 
connect to one other realserver, but I think
this SNAT i must insert in the PREROUTING?
It not easy to make changes on a service ONLINE and so i would ask the 
LVS Users Mailing List if someone could help me.


Markus Hofer

More information about the lvs-users mailing list