Re: How to access the internet from load-balanced nodes?

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




Now I need to know how give working nodes ability to access the internet? I ask this because I don't know how to write properly iptables rules so LVS balancing packets will not conflict with working nodes internet connections. Should I assign some IP-alias for default gateway for that nodes or something else?

make sure you can route the outbound traffic through the lvs cluster and then nat it to the external pool IP of that cluster

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A POSTROUTING -s some_internal_IP -o eth0 -j SNAT --to-source the_public_cluster_IP

you can add as many of the second lines as you see fit depending on how many internal boxes you have.

Also remember that the default route for the internal boxes should be an IP that is floating so that in the event of one of your LVS's crashing you can still route outbound.

Hope that helps
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux