View Single Post
  #9  
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

Hi

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:

Code:
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:

Code:
iptables -t nat -A POSTROUTING -j MASQUERADE -s 192.168.0.0/24
To forward traffic in the 192.168.0.0 net.

Just ask if you have more questions.

regards
Reply With Quote