All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@o2.pl>
To: lartc@vger.kernel.org
Subject: [LARTC] Re: Routing packets over multiple links (NICS) all on the
Date: Thu, 17 Aug 2006 06:54:11 +0000	[thread overview]
Message-ID: <ec13pb$ee8$1@sea.gmane.org> (raw)
In-Reply-To: <ebuoth$aeu$1@sea.gmane.org>

On 16-08-2006 16:18, Jacques Rompen wrote:
> 
> 
> On 8/16/06, *Jarek Poplawski* <jarkao2@o2.pl <mailto:jarkao2@o2.pl>> wrote:
> 
>     As far as I know multipath cached should work for routing output
>     of a current box but it's not working for router (if something
>     has not changed lately). Multipath without "cached" should do
>     simple randomization, but maybe for the begining it would be
>     better to assign fixed paths by source ip and save experimenting
>     with multipaths for later.
> 
>     Jarek P.
> 
>  
> Hi Jarek,
>  
> I will try with only multipath.
>  
> Ive tried the static routes. But still ive had trouble getting this code 
> to work
> ip ro add default  nexthop via x.x.x.x dev eth1 weight 1 nexthop via
> y.y.y.y dev eth2
> ip route add default table provider1 via x.x.x.x dev eth1
> ip route add default table provider2 via y.y.y.y dev eth2
> because x.x.x.x = y.y.y.y in my case. Somehow it doesnt look at the eth 
> device anymore.

Anyway in my opinion it should work.
Try something like this:

#IP_ROUTE_MULTIPATH = "y"
#(if 2.6.x  IP_ROUTE_MULTIPATH_CACHED = "n" !)
#Here with CONNMARK method (so without Anastasov's patch!).
#Change 192.168.0.0/24 and eth0 to your local network
#address/mask and interface.

ip route add default nexthop via x.x.x.x dev eth1 \
   nexthop via x.x.x.x dev eth2

ip route add 192.168.0.0/24 dev eth0 table 101
ip route add default via x.x.x.x dev eth1 table 101

ip route add 192.168.0.0/24 dev eth0 table 102
ip route add default via x.x.x.x dev eth2 table 102

ip rule add fwmark 1 table 101
ip rule add fwmark 2 table 102

iptables -t mangle -A POSTROUTING -o eth1 -j MARK --set-mark 1
iptables -t mangle -A POSTROUTING -o eth2 -j MARK --set-mark 2

iptables -t mangle -A POSTROUTING -j CONNMARK --save-mark
iptables -t mangle -A PREROUTING -j CONNMARK --restore-mark

echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter

You should also add NAT (MASQERADE) rules.

Nexthop devices will be changed randomly per flow (with some 
caching) so try with destinations from different networks.

Jarek P.

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

  parent reply	other threads:[~2006-08-17  6:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-16  9:36 [LARTC] Re: Routing packets over multiple links (NICS) all on the Jarek Poplawski
2006-08-16 12:50 ` Jacques Rompen
2006-08-16 13:52 ` Jarek Poplawski
2006-08-16 14:18 ` Jacques Rompen
2006-08-17  6:54 ` Jarek Poplawski [this message]
2006-08-17 17:11 ` Luciano Ruete
2006-08-17 17:48 ` Jacques Rompen
2006-08-17 19:02 ` Luciano Ruete
2006-08-21 12:20 ` Jacques Rompen

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='ec13pb$ee8$1@sea.gmane.org' \
    --to=jarkao2@o2.pl \
    --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.