Engineering Software, Linux, and Operations. The website of Jack Neely.    

LVS: Real Servers as Clients

I use LVS a lot for load balancing and high availability.  Yet, I’ve never set up the servers to deal properly with the real server as client situation so that the “client” presents the right source IP address when it connects to the same load balanced service it may be providing.  So, the servers often appear as “localhost” to my services.

More or less so I remember, here’s the magic found deep within the LVS HOWTO.

iptables -A POSTROUTING -o lo -d VIP -j SNAT --to-source RIP
iptables -A PREROUTING -i lo -s RIP -d VIP -j ROUTE --oif eth0

Now to see if this works…

 Previous  Up  Next

comments powered by Disqus