Re: NAT over 2 providers (not load balance)

Linux Advanced Routing and Traffic Control

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

 



I did this once upon a time, and have of course since lost the specific 
commands. But, as I recall, you mark the the packets you want to send out 
eth2, and then add a second route table with a second default GW for 
packets with the appropriate mark.

Perhaps there is a more elegant solution out there.

On Mon, 14 Feb 2005, Mihai Vlad wrote:

> Hi guys,
> 
> Can you take a look at this? :)
> 
> 
> 		+-----------+
> 		|           |
> 	 eth1-|-          |
> 		|          -|-eth0---LAN---
> 		|           |
> 	 eth2-|-          |
> 		|           |
> 		+-----------+
> -
> 
> eth0 is connected to the LAN having the IP=LAN_IP
> 
> eth1 is connected to the first  ISP having IP=ISP_IP_1 and GW=ISP_GW_1
> eth2 is connected to the second ISP having IP=ISP_IP_2 and GW=ISP_GW_2
> 
> I need to selectively SNAT clients in the LAN to ISP_IP_1 or ISP_IP_2.
> 
> That would be something like:
> $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
> 
> 
> This does not work since all the packets are forwarded to the default GW
> which is ISP_GW_1.
> 
> How can I change this?
> 
> As far as I remember, the routing decisions and policy are before the
> POSTROUTING chain in which the SNAT occurs...
> 
> Please help!
> 
> Mihai Vlad  
> 
> 
> _______________________________________________
> LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> 


_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux