From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nguyen Dinh Nam <64vn@cardvn.net> Date: Mon, 14 Feb 2005 22:19:31 +0000 Subject: Re: [LARTC] NAT over 2 providers (not load balance) Message-Id: <421123F3.2030105@cardvn.net> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org > This does not work since all the packets are forwarded to the default GW > which is ISP_GW_1. in routing tables, you must have two rules to route packets with different sources to different gateways first: ip rule add from 172.17.31.5 lookup 1 ip route add table 1 default via $GW=ISP_GW_1 ip rule add from 172.17.31.7 lookup 2 ip route add table 2 default via $GW=ISP_GW_2 then $IPTABLES -t nat -A POSTROUTING -s 172.17.31.5 -j SNAT --to-source $ISP_IP_1 $IPTABLES -t nat -A POSTROUTING -s 172.17.31.7 -j SNAT --to-source $ISP_IP_2 > As far as I remember, the routing decisions and policy are before the > POSTROUTING chain in which the SNAT occurs... Kernel Packet Traveling Diagram http://www.docum.org/docum.org/kptd/ might be helpful for you in case you want load balacing your internet connections, you can consult http://selab.edu.ms/twiki/bin/view/Networking/MultihomedLinuxNetworking _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/