using iptables for poor-man's load balancing?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We currently have two machines (soon to be 4) that we'd like to balance our web
traffic to. Say for argument's sake that our public IP is 1.2.3.4 and our
internal LAN machines are:
  192.168.1.1
  192.168.1.12
  192.168.1.16
  192.168.1.17

Just curious if the following rules would work to round-robin the connections:

/sbin/iptables -t nat -A PREROUTING -p udp -d 1.2.3.4 --dport 80  -j DNAT \
   --to-destination 192.168.1.1:80 \
   --to-destination 192.168.1.12:80 \
   --to-destination 192.168.1.16:80 \
   --to-destination 192.168.1.17:80
/sbin/iptables -t nat -A PREROUTING -p udp -d 1.2.3.4 --dport 433  -j DNAT \
   --to-destination 192.168.1.1:80 \
   --to-destination 192.168.1.12:80 \
   --to-destination 192.168.1.16:80 \
   --to-destination 192.168.1.17:80

??

Thanks for any feedback or suggestions.

Ian



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux