All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mikael Svenson <mikaels@powertech.no>
To: lartc@vger.kernel.org
Subject: [LARTC] Multiple links and nat
Date: Fri, 20 Jan 2006 10:24:51 +0000	[thread overview]
Message-ID: <43D0BA73.4040601@powertech.no> (raw)
In-Reply-To: <w52u0cipssd.fsf@lame.message.id>

I read the previous thread about this but I seem to have a small problem.

I'm running gentoo with 2.6.14 kernel and have applied the patch from 
http://www.ssi.bg/~ja/#routes.

If I try to lynx to two different pages from the box itself it switches 
the interfaces every other time which is how it's supposed to work.

If I use an extra machine and set it's gateway to 10.0.4.211(eth0), then 
all requests are being sent to just one interface all the time. The same 
happens if I try other machines.

It's only requests generated inside the box which are being routed 
properly. I'm just wondering if something is amiss in my setup.

I have also tried the mpath2.sh script, but I got the same results.


My setup is like this:

eth0: 10.0.4.211 (internal network)
eth1: 192.168.1.2 (ISP1)
eth2: 10.0.0.2 (ISP2)

Commands:

ip route add 192.168.1.0/24 dev eth1 src 192.168.1.2 table T1
ip route add default via 192.168.1.1 table T1
ip route add 10.0.0.0/24 dev eth2 src 10.0.0.2 table T2
ip route add default via 10.0.0.1 table T2

ip rule add from 192.168.1.2 table T1
ip rule add from 10.0.0.2 table T2

ip route add default scope global nexthop via 192.168.1.1 dev eth1 
weight 1 nexthop via 10.0.0.1 dev eth2 weight 1

iptables -t nat -A PREROUTING -s 10.0.4.0/255.255.254.0 -d 
192.168.1.0/24 -j ACCEPT
iptables -t nat -A PREROUTING -s 10.0.4.0/255.255.254.0 -d 10.0.0.0/24 
-j ACCEPT
iptables -t nat -A POSTROUTING -o eth1 -s 10.0.4.0/255.255.254.0 -j 
MASQUERADE
iptables -t nat -A POSTROUTING -o eth2 -s 10.0.4.0/255.255.254.0 -j 
MASQUERADE
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

      parent reply	other threads:[~2006-01-20 10:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-05 16:02 [LARTC] multiple links and nat seph
2006-01-05 16:21 ` Edmundo Carmona
2006-01-06 19:14 ` seph
2006-01-07  5:02 ` gypsy
2006-01-20 10:24 ` Mikael Svenson [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=43D0BA73.4040601@powertech.no \
    --to=mikaels@powertech.no \
    --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.