Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: seph <seph@directionless.org>
To: lartc@vger.kernel.org
Subject: [LARTC] multiple links and nat
Date: Thu, 05 Jan 2006 16:02:10 +0000	[thread overview]
Message-ID: <w52u0cipssd.fsf@lame.message.id> (raw)

Hi, this might be a dumb question, but I'm not finding much
information online.

I'm trying to setup a 2.6 linux box to run nat across multiple
upstream links as a simple way to aggregate bandwidth. I found the
instructions in lartc section 4.2
(http://lartc.org/howto/lartc.rpdb.multiple-links.html) fairly clear
and straightforward. I implemented those, and a couple of trivial
iptables commands and tried it.

Persistent masqueraded connections (like ssh) weren't very happy. The
frequently hung, and I saw the "MASQUERADE: Route sent us somewhere
else." error. googling for that, I see lots of suggestions to use
connmark, but no examples of how connmark and the multiple link stuff
interact. Does anyone have a pointer?

The rules I'm using are roughly:

/sbin/ip route add P1_NET dev IF1 src IP1 table 201
/sbin/ip route add default via P1 table 201
/sbin/ip route add P1_NET dev IF1 src IP1
/sbin/ip route add 127.0.0.0/8 dev lo table 201
/sbin/ip rule add from IP1 table 201
/sbin/ip route add P2_NET dev IF2 src IP2 table 202
/sbin/ip route add default via P2 table 202
/sbin/ip route add P2_NET dev IF2 src IP2
/sbin/ip route add 127.0.0.0/8 dev lo table 202
/sbin/ip rule add from IP2 table 202


/sbin/ip route del default
/sbin/ip route add default scope global nexthop via P1 dev IF1 weight 1 nexthop via P2 dev IF2 weight 4
/sbin/ip route flush cache


/sbin/iptables -t nat -A PREROUTING -s LOCALNET -d P1_NET -j ACCEPT
/sbin/iptables -t nat -A PREROUTING -s LOCALNET -d P2_NET -j ACCEPT
/sbin/iptables -t nat -A POSTROUTING -o IF1 -s LOCALNET -j MASQUERADE
/sbin/iptables -t nat -A POSTROUTING -o IF2 -s LOCALNET -j MASQUERADE


thanks
seph
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

             reply	other threads:[~2006-01-05 16:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-05 16:02 seph [this message]
2006-01-05 16:21 ` [LARTC] multiple links and nat Edmundo Carmona
2006-01-06 19:14 ` seph
2006-01-07  5:02 ` gypsy
2006-01-20 10:24 ` [LARTC] Multiple " Mikael Svenson

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=w52u0cipssd.fsf@lame.message.id \
    --to=seph@directionless.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox