View Single Post
Old 25th January 2008, 19:00
spitzbueb spitzbueb is offline
Junior Member
Join Date: Aug 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Set gateway and iptables so the lb forwards traffic


My problem was that I forgot to set the gateway for the public interfaces, as the loadbalancer heartbeat config only sets the one for the private interface.

So when the server came up I wrote:

route add default gw aaa.bbb.ccc.ddd eth1
where as aaa.bbb.ccc.ddd is the gateway and eth1 the interface alias of the public interface.

My problem then was, that I haven't got internet connection on the virtual webservers (they only have a private network) and I didn't want to set up a gateway just for them.

So I used the active load balancers private ip as gateway for the virtual servers. By typing the following ipchains command:

iptables -t nat -A POSTROUTING -j MASQUERADE -s
To forward traffic in the net.

Just ask if you have more questions.

Reply With Quote