All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Schulz <msc@antzsystem.de>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Starting from scratch w/ multiple uplinks
Date: Wed, 11 May 2005 17:45:00 +0000	[thread overview]
Message-ID: <200505111945.00654.msc@antzsystem.de> (raw)
In-Reply-To: <756AAB68-8733-4BF4-A78F-146966BD9E0F@mediarete.it>

Am Dienstag, 10. Mai 2005 14:56 schrieb Markus Schulz:
> Am Dienstag, 10. Mai 2005 09:33 schrieb Rafael A Barrero:
> > Thanks for the link!
> >
> > At the beginning of the document it states that it will not work
> > with two modem connections. What if both my ADSL lines are pppoe?
> > Will this still work?
>
> it works fine. if i'm at home i can post my script.

okay, here is the important part of my script:

#!/bin/sh
set -x
PTP=`ifconfig ppp0 | grep P-t-P | sed 's/.*P-t-P:\([^ ]*\).*/\1/g'`
IP1=`ifconfig ppp0 | grep addr | sed 's/.*addr:\([^ ]*\).*/\1/g'`
IP2=`ifconfig ppp1 | grep addr | sed 's/.*addr:\([^ ]*\).*/\1/g'`

echo 1 >  /proc/sys/net/ipv4/ip_forward

#del all routes from table 201 (search for better way to do this)
for route in `ip rule list | grep ^201 | sed 's/^201:.*from \([^ ]*\) 
lookup 201/\1/'`; do
        ip rule del prio 201 from $route table 201
done

#del all routes from table 202 (search for better way to do this)
for route in `ip rule list | grep ^202 | sed 's/^202:.*from \([^ ]*\) 
lookup 202/\1/'`; do
        ip rule del prio 202 from $route table 202
done

ip rule del prio 50 table main
ip rule add prio 50 table main
ip route del default table main

#ppp0
ip rule add prio 201 from $IP1 table 201

#next two lines is for testing purpose
ip rule del fwmark 0x20 table 201
ip rule add fwmark 0x20 table 201

ip route add default via $PTP dev ppp0 src $IP1 proto static table 201
ip route append prohibit default table 201 metric 1 proto static

#ppp1
ip rule add prio 202 from $IP2 table 202
ip route add default via $PTP dev ppp1 src $IP2 proto static table 202
ip route append prohibit default table 202 metric 1 proto static

#multipath route.
ip rule del prio 222 table 222
ip rule add prio 222 table 222
ip route add default table 222 proto static \
        nexthop via $PTP dev ppp0 \
        nexthop via $PTP dev ppp1


#skipped all other firewall iptables rules except the two needed snat 
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -I POSTROUTING -o ppp0 -j SNAT --to-source $IP1
iptables -t nat -I POSTROUTING -o ppp1 -j SNAT --to-source $IP2


if you have some improvements, then let me a note.

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

      parent reply	other threads:[~2005-05-11 17:45 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-09 14:05 [LARTC] Starting from scratch w/ multiple uplinks Rafael A Barrero
2005-05-09 14:30 ` Sylvain BERTRAND
2005-05-09 15:14 ` Rafael A Barrero
2005-05-09 15:53 ` Markus Feilner
2005-05-09 15:58 ` Sylvain BERTRAND
2005-05-09 16:19 ` Brian J. Murrell
2005-05-09 18:11 ` Markus Schulz
2005-05-09 20:06 ` Brian J. Murrell
2005-05-09 23:37 ` Alexander Samad
2005-05-10  9:33 ` Rafael A Barrero
2005-05-10 10:12 ` Marc Manthey
2005-05-10 11:02 ` Markus Feilner
2005-05-10 11:11 ` Sylvain BERTRAND
2005-05-10 11:13 ` Robert Vangel
2005-05-10 12:07 ` Robert Vangel
2005-05-10 12:19 ` Marc Manthey
2005-05-10 12:39 ` Paulo Andre
2005-05-10 12:56 ` Markus Schulz
2005-05-10 13:00 ` Markus Schulz
2005-05-10 13:04 ` Paulo Andre
2005-05-10 13:40 ` Markus Schulz
2005-05-10 14:08 ` Rafael A Barrero
2005-05-10 15:10 ` Markus Feilner
2005-05-10 23:53 ` Alexander Samad
2005-05-11  0:02 ` Alexander Samad
2005-05-11 17:45 ` Markus Schulz [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=200505111945.00654.msc@antzsystem.de \
    --to=msc@antzsystem.de \
    --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.