[lvs-users] DNS LVS questions

Pete Ashdown pashdown at xmission.com
Tue Sep 4 22:08:10 BST 2012

I'm trying to setup a DNS LVS like this:

Server A: x.x.x.10
Server B: x.x.x.11
Server C: x.x.x.12

The VIPs are also in the same network x.x.x.2 and x.x.x.3, they are
respectively assigned to A & B, or both of them to one via heartbeat if the
other server is down.  LVS is setup to distribute requests between the
three servers.  This is working fine.

The problem I'm getting is that the reply comes back from the wrong source
with the real IP address of A, B, or C, with the "unexpected source"
error.  I was presuming that I could SNAT this problem away, but it appears
that SNAT does not work if the destination is on the same subnet?

iptables -t nat -A POSTROUTING -p -udp --dport domain --destination
x.x.x.11 -j SNAT --to-source x.x.x.10.

My question is whether my real IPs need to be on an entirely different
subnet for this to work (that routes through the same box with the VIPs)? 
Is any possible way of doing this the way I've got it setup or is my
initial design flawed?

Thank you.

More information about the lvs-users mailing list