Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
* [LARTC] Routing for multiple uplinks and SNAT to 2 source IPs
@ 2005-05-29  0:22 Nelson Castillo
  2005-05-29 16:29 ` gypsy
  0 siblings, 1 reply; 2+ messages in thread
From: Nelson Castillo @ 2005-05-29  0:22 UTC (permalink / raw)
  To: lartc

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@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [LARTC] Routing for multiple uplinks and SNAT to 2 source IPs
  2005-05-29  0:22 [LARTC] Routing for multiple uplinks and SNAT to 2 source IPs Nelson Castillo
@ 2005-05-29 16:29 ` gypsy
  0 siblings, 0 replies; 2+ messages in thread
From: gypsy @ 2005-05-29 16:29 UTC (permalink / raw)
  To: lartc

Nelson Castillo wrote:
> 
> 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?

You should google "policy based routing Linux" and "port based routing
Linux"

http://linux-ip.net/html/ch-routing.html
http://snafu.freedom.org/linux2.2/docs/advanced-routing/

I know nothing of squid, but previous posts here indicate that it may be
useful to you.
--
Gypsy
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-05-29 16:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-29  0:22 [LARTC] Routing for multiple uplinks and SNAT to 2 source IPs Nelson Castillo
2005-05-29 16:29 ` gypsy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox