How can I correctly configure LVS to masqerade/NAT packets from virtual ip to/from clients?

Currently I have:

UDP rr
  ->            Masq    10     0          5
  ->            Masq    10     0          9

Problem I'm seeing:

dig my.test.domain @
;; reply from unexpected source:, expected

I would expect NAT/Masq to rewrite the ip, but aparently the server responds directly to the client.


When not setting the director as gateway, I had to enable some additional options:

sysctl -w net.ipv4.ip_forward=1
sysctl -w net.ipv4.vs.conntrack=1
iptables -t nat -A POSTROUTING -j MASQUERADE

Now it works as expected

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.