Skip to contentSkip to conversation

Backup Route

LARTC Michel A. S. Pereira - KIDMumU[InLove] [email protected] 7 participants 8 messages Nov 16, 2000 – Mar 19, 2003

lore
Share & tools
lore

Michel A. S. Pereira - KIDMumU[InLove] [email protected]

author
#0 lore raw

Hi there.

I've two Internet connections at the same box, one connection is
made through ADSL, and another is made with a Radio-Link (WaveLAN IE822).
I wan't to do a backup connection with the ADSL link. With what tools I can do this?
ipchains, iptables, a third party tool?

--
____________________________________________________________
PIII 500MHz - 98MB RAM - HD 8.2GB - Diamond Stealth III s540
USR Sportster 56K Int Voice - SoundBlaster AWE 64 -- CL 5.1
//LinuxMan by Friends - The power of a GNU generation\\
<A HREF="http://www.techs.com.br">http://www.techs.com.br</A> - ICQ 4553082 - #theprodigy #olinux

begin:vcard
n:Angelo da Silva Pereira;Michel
tel;work:16 222 0930
x-mozilla-html:FALSE
url:<A HREF="http://www.techs.com.br">http://www.techs.com.br</A> org:TECHS Provider
version:2.1
email;internet:<A HREF="mailto:[email protected]">[email protected]</A> adr;quoted-printable:;;Av. S=E3o Paulo, 929=0D=0ACentro;Araraquara;SP;14801;Brasil x-mozilla-cpt:;8160
fn:Michel Angelo da Silva Pereira
end:vcard

#1 lore raw

<PRE>&quot;Michel A. S. Pereira - KIDMumU[InLove]&quot; wrote:
&gt;<i>
</I>&gt;<i> Hi there.
</I>&gt;<i>
</I>&gt;<i> I've two Internet connections at the same box, one connection is
</I>&gt;<i> made through ADSL, and another is made with a Radio-Link (WaveLAN </I>&gt;<i> IE822).

</I>&gt;<i>     I wan't to do a backup connection with the ADSL link.
</I>&gt;<i>     With what tools I can do this?
</I>&gt;<i>     ipchains, iptables, a third party tool?

</I>&gt;<i>
</I>I'm in the middle of doing something very similar. I don't know how often they update the archives on this list but the subject on the thread for what I'm working on
is [a complicated routing scenario (for me at least)]

Basically you'll have to compile the advanced routing options into the kernel allong with ipchains, then install the iproute2 tools. Then you'll have to configure your box properly using the advanced routing tools and ipchains for the redundant routes. It's way too complicated to explain it all in one email, so your best bet is to look in the archives on this list.

Probably your single best source of information in the way of docs is the command reference doc for the &quot;ip&quot; command (comes in the iproute2 package). If you read and understand this doc, you'll be well on your way to doing what you want to do. You can also read the ipchains howto, the advanced routing howto, and the ip-masquerading howto.

When I get it all done, I'm thinking of writing a howto on the subject, we'll see...

-Andrew

</PRE>

#2 lore raw
In reply to Michel A. S. Pereira - KIDMumU[InLove] [email protected]

<PRE>On Thu, Nov 16, 2000 at 02:49:33PM -0800, Andrew wrote:

&gt;<i> &gt; I wan't to do a backup connection with the ADSL link.
</I>&gt;<i> &gt; With what tools I can do this?
</I>&gt;<i> &gt; ipchains, iptables, a third party tool?
</I>&gt;<i> &gt;
</I>&gt;<i> I'm in the middle of doing something very similar. I don't know how often they </I>&gt;<i> update the archives on this list but the subject on the thread for what I'm </I>&gt;<i> working on
</I>
Linux has a thing called 'dead gateway detection', which might work for you. Just make two routes with a different metric, should work I think.

Existing sessions will die however because their source IP address is unroutable.

Regards,

bert hubert

Signature · 6 lines
PowerDNS                     Versatile DNS Services  
Trilab                       The Technology People   
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet


</PRE>
#3 lore raw
In reply to Michel A. S. Pereira - KIDMumU[InLove] [email protected]

<PRE>For configuring a backup route, it shouldn't be that difficult. You should configure the preferred route (the radio link) statically, with the default metric,
and for the backup route (ADSL link), configure it (also statically) with a higher metric.

This way traffic will go along the preferred route, as long as the link is up.
When the link fails, the route with the higher metric should take over. The routing algorithm will always take a (valid) route with the lowest metric.

But indeed, you should read the iproute2 docs,
and test the configuration you've chosen.

If you want to do load balancing and traffic filtering, all the others (iptables/ipchains and
the advanced routing howto )come into the picture. But for mere backup routes, playing with metrics will do.

Regards, Guy

Andrew wrote:
&gt;<i>
</I>&gt;<i> &quot;Michel A. S. Pereira - KIDMumU[InLove]&quot; wrote:
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; Hi there.
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; I've two Internet connections at the same box, one connection is
</I>&gt;<i> &gt; made through ADSL, and another is made with a Radio-Link (WaveLAN </I>&gt;<i> &gt; IE822).

</I>&gt;<i> &gt;     I wan't to do a backup connection with the ADSL link.
</I>&gt;<i> &gt;     With what tools I can do this?
</I>&gt;<i> &gt;     ipchains, iptables, a third party tool?

</I>&gt;<i> &gt;
</I>&gt;<i> I'm in the middle of doing something very similar. I don't know how often they
</I>&gt;<i> update the archives on this list but the subject on the thread for what I'm
</I>&gt;<i> working on
</I>&gt;<i> is [a complicated routing scenario (for me at least)]
</I>&gt;<i>
</I>&gt;<i> Basically you'll have to compile the advanced routing options into the kernel
</I>&gt;<i> allong with ipchains, then install the iproute2 tools. Then you'll have to
</I>&gt;<i> configure your box properly using the advanced routing tools and ipchains for
</I>&gt;<i> the redundant routes. It's way too complicated to explain it all in one email,
</I>&gt;<i> so your best bet is to look in the archives on this list.
</I>&gt;<i>
</I>&gt;<i> Probably your single best source of information in the way of docs is the
</I>&gt;<i> command reference doc for the &quot;ip&quot; command (comes in the iproute2 package). If
</I>&gt;<i> you read and understand this doc, you'll be well on your way to doing what you
</I>&gt;<i> want to do. You can also read the ipchains howto, the advanced routing howto,
</I>&gt;<i> and the ip-masquerading howto.
</I>&gt;<i>
</I>&gt;<i> When I get it all done, I'm thinking of writing a howto on the subject, we'll
</I>&gt;<i> see...
</I>&gt;<i>
</I>&gt;<i> -Andrew
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> LARTC mailing list / <A HREF="mailto:[email protected]">[email protected]</A>
</I>&gt;<i> <A HREF="http://mailman.ds9a.nl/mailman/listinfo/lartc">http://mailman.ds9a.nl/mailman/listinfo/lartc</A> HOWTO: <A HREF="http://ds9a.nl/2.4Routing/">http://ds9a.nl/2.4Routing/</A> </I>

</PRE>

#4 lore raw
In reply to Michel A. S. Pereira - KIDMumU[InLove] [email protected]

<PRE>bert hubert wrote:
&gt;<i>
</I>&gt;<i> On Thu, Nov 16, 2000 at 02:49:33PM -0800, Andrew wrote:
</I>&gt;<i>

</I>&gt;<i> &gt; &gt;     I wan't to do a backup connection with the ADSL link.
</I>&gt;<i> &gt; &gt;     With what tools I can do this?
</I>&gt;<i> &gt; &gt;     ipchains, iptables, a third party tool?

</I>&gt;<i> &gt; &gt;
</I>&gt;<i> &gt; I'm in the middle of doing something very similar. I don't know how often they </I>&gt;<i> &gt; update the archives on this list but the subject on the thread for what I'm </I>&gt;<i> &gt; working on
</I>&gt;<i>
</I>&gt;<i> Linux has a thing called 'dead gateway detection', which might work for you. </I>&gt;<i> Just make two routes with a different metric, should work I think. </I>&gt;<i>
</I>&gt;<i> Existing sessions will die however because their source IP address is </I>&gt;<i> unroutable.
</I>
I'm not sure that is working correctly. I have two DSLs to the internet with different IP addresses, speeds and ISPs.

DSL1: 63.194.. 384Kb/sec X 1.5-6Mb/sec ADSL on eth1 via pacbell
DSL2: 64.63.. is 768Kb/sec SDSL on eth2 via lmki

Test:
ping yahoo site through DSL1
unplug phone line from bridge on DSL1
ip route flush table cache
ping yahoo site --- No response
tracepath yahoo site --- Still trying to use DSL1

That isn't working.

Here's my setup:

$ ip route
10.1.1.1 dev eth2  scope link  src 10.1.1.2
10.0.0.0/24 dev eth0  scope link  src 10.0.0.1
127.0.0.0/8 dev lo  scope link
default
        nexthop via 63.194.239.201  dev eth1 weight 99
        nexthop via 10.1.1.1  dev eth2 weight 1

10.1.1.1 is the internal ip of the dsl2 router. Pretty nice, Pacbell should start using these.
Note: the higher the weight, the more traffic sent through that route. I want most of my local traffic to go through DSL1. Anything requesting traffic on DSL2 will get a response from DSL2, but very little traffic initiated by the router machine will go through DSL2.

$ ip rule
0:      from all lookup local
32763:  from 10.0.0.0/24 lookup 10
32764:  from 63.194.239.202 lookup 10
32765:  from 10.1.1.2 lookup 20
32766:  from all lookup main
32767:  from all lookup default
$ ip route show table 10
63.194.239.201 dev eth1  scope link  src 63.194.239.202
10.0.0.0/24 dev eth0  scope link
default via 63.194.239.201 dev eth1
$ ip route show table 20
10.1.1.1 dev eth2  scope link  src 10.1.1.2
default via 10.1.1.1 dev eth2

I could write a script that would monitor the interfaces with ping and change the default route after several failed attempts. With the way ping works, to account for several failed responses, you would have to wait about 60 seconds for about three attempts. I think 5 would be good, but that can be configurable.

Does this sound good or is this already done better in another tool? I wonder if a routing daemon would do something like this. Monitor with ping, but not expect any routing messages from the monitored routers. Anyone know?

</PRE>

#5 lore raw
In reply to Michel A. S. Pereira - KIDMumU[InLove] [email protected]

<PRE>Mike Fedyk wrote:
&gt;<i>
</I>&gt;<i> bert hubert wrote:
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; On Thu, Nov 16, 2000 at 02:49:33PM -0800, Andrew wrote:
</I>&gt;<i> &gt;

</I>&gt;<i> &gt; &gt; &gt;     I wan't to do a backup connection with the ADSL link.
</I>&gt;<i> &gt; &gt; &gt;     With what tools I can do this?
</I>&gt;<i> &gt; &gt; &gt;     ipchains, iptables, a third party tool?

</I>&gt;<i> &gt; &gt; &gt;
</I>&gt;<i> &gt; &gt; I'm in the middle of doing something very similar. I don't know how often they </I>&gt;<i> &gt; &gt; update the archives on this list but the subject on the thread for what I'm </I>&gt;<i> &gt; &gt; working on
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; Linux has a thing called 'dead gateway detection', which might work for you. </I>&gt;<i> &gt; Just make two routes with a different metric, should work I think. </I>&gt;<i> &gt;
</I>&gt;<i> &gt; Existing sessions will die however because their source IP address is </I>&gt;<i> &gt; unroutable.
</I>&gt;<i>
</I>&gt;<i> I'm not sure that is working correctly. I have two DSLs to the internet with </I>&gt;<i> different IP addresses, speeds and ISPs.
</I>&gt;<i>
</I>&gt;<i> DSL1: 63.194.. 384Kb/sec X 1.5-6Mb/sec ADSL on eth1 via pacbell </I>&gt;<i> DSL2: 64.63.. is 768Kb/sec SDSL on eth2 via lmki
</I>&gt;<i>
</I>&gt;<i> Test:
</I>&gt;<i> ping yahoo site through DSL1
</I>&gt;<i> unplug phone line from bridge on DSL1
</I>&gt;<i> ip route flush table cache
</I>&gt;<i> ping yahoo site --- No response
</I>&gt;<i> tracepath yahoo site --- Still trying to use DSL1
</I>&gt;<i>
</I>&gt;<i> That isn't working.
</I>&gt;<i>
</I>&gt;<i> Here's my setup:
</I>&gt;<i> $ ip route
</I>&gt;<i> 10.1.1.1 dev eth2 scope link src 10.1.1.2
</I>&gt;<i> 10.0.0.0/24 dev eth0 scope link src 10.0.0.1
</I>&gt;<i> 127.0.0.0/8 dev lo scope link
</I>&gt;<i> default
</I>&gt;<i> nexthop via 63.194.239.201 dev eth1 weight 99
</I>&gt;<i> nexthop via 10.1.1.1 dev eth2 weight 1
</I>&gt;<i>
</I>For the default route, try:
ip route add default via 63.194.239.201 dev eth1
ip route add default via 10.1.1.1 dev eth2 metric 10

But you will loose the load balancing behaviour.

Emmanuel.

</PRE>

#6 lore raw
In reply to Michel A. S. Pereira - KIDMumU[InLove] [email protected]

<PRE>Emmanuel Fuste wrote:
&gt;<i>
</I>&gt;<i> Mike Fedyk wrote:
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; bert hubert wrote:
</I>&gt;<i> &gt; &gt; Linux has a thing called 'dead gateway detection', which might work for you. </I>&gt;<i> &gt; &gt; Just make two routes with a different metric, should work I think. </I>&gt;<i> &gt; &gt;
</I>&gt;<i> &gt; &gt; Existing sessions will die however because their source IP address is </I>&gt;<i> &gt; &gt; unroutable.
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; I'm not sure that is working correctly. I have two DSLs to the internet with </I>&gt;<i> &gt; different IP addresses, speeds and ISPs.
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; DSL1: 63.194.. 384Kb/sec X 1.5-6Mb/sec ADSL on eth1 via pacbell </I>&gt;<i> &gt; DSL2: 64.63.. is 768Kb/sec SDSL on eth2 via lmki
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; Test:
</I>&gt;<i> &gt; ping yahoo site through DSL1
</I>&gt;<i> &gt; unplug phone line from bridge on DSL1
</I>&gt;<i> &gt; ip route flush table cache
</I>&gt;<i> &gt; ping yahoo site --- No response
</I>&gt;<i> &gt; tracepath yahoo site --- Still trying to use DSL1
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; That isn't working.
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; Here's my setup:
</I>&gt;<i> &gt; $ ip route
</I>&gt;<i> &gt; 10.1.1.1 dev eth2 scope link src 10.1.1.2
</I>&gt;<i> &gt; 10.0.0.0/24 dev eth0 scope link src 10.0.0.1
</I>&gt;<i> &gt; 127.0.0.0/8 dev lo scope link
</I>&gt;<i> &gt; default
</I>&gt;<i> &gt; nexthop via 63.194.239.201 dev eth1 weight 99
</I>&gt;<i> &gt; nexthop via 10.1.1.1 dev eth2 weight 1
</I>&gt;<i> &gt;
</I>&gt;<i> For the default route, try:
</I>&gt;<i> ip route add default via 63.194.239.201 dev eth1
</I>&gt;<i> ip route add default via 10.1.1.1 dev eth2 metric 10
</I>&gt;<i>
</I>&gt;<i> But you will loose the load balancing behaviour.
</I>&gt;<i>
</I>&gt;<i> Emmanuel.
</I>
I am not running any kind of routing daemon, is this required for this to work? Maybe rdisc?

The problem I'm having is having a dsl go down suddenly, and switching over to another for outbound traffic for our network.

I run a ping and unplug the phone from the dsl bridge. This is how it would go down in a real situation. The ping stops. I &quot;ip ro f t cache&quot;, but still nothing. I turn off the dsl bridge, and still nothing. The only thing that I've tried that works is &quot;ip link set eth1 down&quot;. It seems that I need an active status monitoring system.

Here's my setup:

<A HREF="mailto:root@gateway">root@gateway</A>:/etc/init.d$ ip ro 63.194.239.201 dev eth1 scope link src 63.194.239.202 10.1.1.1 dev eth2 scope link src 10.1.1.2
10.0.0.0/24 dev eth0 scope link
127.0.0.0/8 dev lo scope link
default via 63.194.239.201 dev eth1
default via 10.1.1.1 dev eth2 metric 2

<A HREF="mailto:root@gateway">root@gateway</A>:/etc/init.d$ ip ru

0:      from all lookup local
32760:  from 10.1.1.2 lookup 20
32761:  from 63.194.239.202 lookup 10
32766:  from all lookup main
32767:  from all lookup default

<A HREF="mailto:root@gateway">root@gateway</A>:/etc/init.d$ ip ro s t 10 63.194.239.201 dev eth1 scope link src 63.194.239.202 10.0.0.0/24 dev eth0 scope link
default via 63.194.239.201 dev eth1

<A HREF="mailto:root@gateway">root@gateway</A>:/etc/init.d$ ip ro s t 20 10.1.1.1 dev eth2 scope link src 10.1.1.2
default via 10.1.1.1 dev eth2

</PRE>

#7 lore raw

[LARTC] backup route

In reply to Michel A. S. Pereira - KIDMumU[InLove] [email protected]

Hello,
I have box connected to 2 isp, via 1.1.1.1 eth0 and via 2.2.2.2 eth1. I want that gateway 2.2.2.2 will be used only if 1.1.1.1 is not active. Curently configuration is with weight 1 and weight 256, so it uses gateway 2.2.2.2 sometimes.
I missed some manual topic or it is only way to make backup with iproute2?

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/