I"ve been working with lvs for the past few weeks. I was able to get
my remote servers to respond to requests sent to a different address
than is bounded to any of their interfaces by using the following
iptables line. I was able to put this together by working with some
old ipchains examples:
iptables -t nat -A PREROUTING -d cvg1-lvs-vip -p tcp --dport 0:65535
-j REDIRECT
echo 1 > /proc/sys/net/ipv4/ip_forward
Onoce I do the above, then the server this is being ran one will be
able to handle connections the LVS server is routing to it. So
incoming connections come from one box, but need to go directly to the
client from the real server. Once I do the above, it works.
But can someone explain to me why it works? I'm just not sure at all
.....
I guess I dont understand PREROUTING and what the REDIRECT option has
to do with anything .....
Any insight would be much apprecaited
Regards,
Bill Omer
|