From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarek Poplawski Date: Thu, 17 Aug 2006 06:54:11 +0000 Subject: [LARTC] Re: Routing packets over multiple links (NICS) all on the Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org On 16-08-2006 16:18, Jacques Rompen wrote: > > > On 8/16/06, *Jarek Poplawski* > 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