Routing for multiple uplinks and SNAT to 2 source IPs

Linux Advanced Routing and Traffic Control

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

 



Hi,

I configured a router box to use 2 providers, as described
in the HOWTO. (Apendix 1)

I want to use both links to reach a single smtp server.  As I read
in the kptd and in some old messages of this list, doing a SNAT
in the postrouting chain comes _after_ the routing desision.
So I guess the following lines I'm trying to use are wrong.
(See Apendix 1)

What can I do to have multiple connection to the same IP to
use both links?

Do the following lines have some effect after I do SNAT in the
mangle table of the POSTROUTING chain?

# use the right route if the source address is already set
ip rule add from $IP1 table T1
ip rule add from $IP2 table T2

Thanks a lot!
Nelson.-

Apendix 1:

# SNAT the internal networks using round robin. I think this wont work.
iptables -t nat -A POSTROUTING -o $IF1 -s 192.168.0.0/255.255.255.0 
-j SNAT --to-source $IP1 --to-source $IP2
iptables -t nat -A POSTROUTING -o $IF1 -s 192.168.10.0/255.255.255.0
-j SNAT --to-source $IP1 --to-source $IP2
iptables -t nat -A POSTROUTING -o $IF2 -s 192.168.0.0/255.255.255.0 
-j SNAT --to-source $IP1 --to-source $IP2
iptables -t nat -A POSTROUTING -o $IF2 -s 192.168.10.0/255.255.255.0
-j SNAT --to-source $IP1 --to-source $IP2


[1] http://lartc.org/howto/lartc.rpdb.multiple-links.html 
[2] http://www.docum.org/docum.org/kptd/

-- 
Homepage : http://geocities.com/arhuaco

The first principle is that you must not fool yourself
and you are the easiest person to fool.
     -- Richard Feynman.
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


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