All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nguyen Dinh Nam <64vn@cardvn.net>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] NAT over 2 providers (not load balance)
Date: Mon, 14 Feb 2005 22:19:31 +0000	[thread overview]
Message-ID: <421123F3.2030105@cardvn.net> (raw)
In-Reply-To: <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAENEVIhFsNkiQ6vTBNVSNQcKAAAAQAAAAwP1excSwi0q2AVixPMeQJAEAAAAA@web-profile.net>


> 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/

      parent reply	other threads:[~2005-02-14 22:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-14 20:27 [LARTC] NAT over 2 providers (not load balance) Mihai Vlad
2005-02-14 20:35 ` Ben
2005-02-14 20:47 ` /dev/rob0
2005-02-14 20:47 ` Tóth Nándor
2005-02-14 21:58 ` Peter Surda
2005-02-14 22:19 ` Nguyen Dinh Nam [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=421123F3.2030105@cardvn.net \
    --to=64vn@cardvn.net \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.