RE: backup static routes for freebsd (default)

2003-08-14 Thread Ezra Banoba
Thanks Phil,
I tried some guesswork myself to add the secondary default routes router
style with weights and that's the only way the route add command will accept
another default route. I do not know how freebsd interpretes this:
route add default [gateway] [administrative weight]

though this has no effect when i birng down the default route.

Maybe a script to ping the gateways at intervals will do.
Any other ideas are welcome.
Thanks.

Ezra Banoba
Systems Administrator/Programmer
Computer Froniters International
Plot 32 Lumumba Avenue
www.cfi.co.ug
+256 031260485

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Philip Payne
Sent: Tuesday, August 05, 2003 2:38 AM
To: 'Ezra Banoba'; [EMAIL PROTECTED]
Subject: RE: backup static routes for freebsd (default)


Hi,

> I have a gatway box running freebsd 4.8 and several links to
> the internet
> via different ISP's.
> This box is connected directly to one of the ISP's but also
> has access to
> the other gatways via the LAN.
> I would like to setup static backup (default) routes such
> that when and if
> the main link goes down, the default route for this box is
> automatically
> changed to point to another router on the LAN.I am having trouble
> implementing this on freebsd.
> Any ideas?

First, I'm more of a router person than familiar with how FreeBSD calculates
it's routing table so the following is all guesswork from "man route".

The issue with static routes is that they rarely have any idea of the status
of their destination but this can be fudged if you're using point-to-point
interfaces e.g. DSL, leased line. In general terms what you'd be doing on a
router is:

1) Have a default route directed out a point-to-point interface connected to
the ISP (not the IP address) so that when the interface is down, the static
route is removed from the live routing table.
2) Have a weighted default route via an alternative IP address. The weight
implies this route is only used when the former default route is not
available.

I've read "man route" and I get the impression you can add a route via an
interface rather than a destination with the switch "-interface" so your
first step is to add a default route along the lines

> route add default -interface 

... this is a guess as the man page isn't explicit. Also, I don't know
whether this route remains live or is removed as required during a failure
on the point-to-point interface you'd configure this to. It definitely won't
work if your primary access method is a broadcast interface e.g. ethernet.

Further, I can't find any details on adding a weight to a static route to
create the secondary route so I'm not sure this is going to be possible via
an automatic routing table kind of thing.

So.(getting to the point very slowly)

The only other method I can think of would be a script to ping the far end
addresses regularly in order. Depending on which one is up, you could inject
a default route statement as required to the correct destination.

I'd be interested in other suggestions as this doesn't sound entirely great
as there are many other reasons than link failure why an address wouldn't be
pingable.

Thanks,
Phil.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


RE: backup static routes for freebsd (default)

2003-08-14 Thread Ezra Banoba
Hi,
It works like magic.
But then, ... that means I still would have to use a script to mark the
interface as down when the remote gateway is inaccessible. Or is there a way
to automagically mark the interface down if the network is inaccessible?

Ezra Banoba
Systems Administrator/Programmer
Computer Froniters International
Plot 32 Lumumba Avenue
www.cfi.co.ug
+256 031260485

-Original Message-
From: Philip Payne [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 06, 2003 1:56 AM
To: Nick Rogness; Ezra Banoba
Cc: Philip Payne
Subject: RE: backup static routes for freebsd (default)


Hi,

>   # route add 0.0.0.0 PRIMARY_GW -netmask 127.0.0.0
>   # route add 127.0.0.0 PRIMARY_GW -netmask 127.0.0.0
>   # route add default SECONDARY_GW

Good thinking, more specific routes take precedence over less specific ones,
you always forget the fundamental stuff ;-) ... and it's a routing only
solution so no scripts, great.

Unfortunately I'm not in a position to try it so, Ezra, if it works let me
know for future reference. Would much appreciate it.

Thanks,
Phil.


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: backup static routes for freebsd (default)

2003-08-14 Thread Thomas Spreng
hi,

On Mon, Aug 04, 2003 at 11:52:54PM -0700, Ezra Banoba wrote:
> Hello,
> I have a gatway box running freebsd 4.8 and several links to the internet
> via different ISP's.
> This box is connected directly to one of the ISP's but also has access to
> the other gatways via the LAN.
> I would like to setup static backup (default) routes such that when and if
> the main link goes down, the default route for this box is automatically
> changed to point to another router on the LAN.I am having trouble
> implementing this on freebsd.
> Any ideas?

you might want to take a look at the ng_one2many(4) manpage. It is a
module for the netgraph(4) subsystem which allows routing over several
links.
If you want a really cheap & dirty solution, you could simply write a
script that checks if the main gateway is down and then changes the
default route to your backup router.

hope that helps...
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


RE: backup static routes for freebsd (default)

2003-08-14 Thread Philip Payne
Hi,

> I have a gatway box running freebsd 4.8 and several links to 
> the internet
> via different ISP's.
> This box is connected directly to one of the ISP's but also 
> has access to
> the other gatways via the LAN.
> I would like to setup static backup (default) routes such 
> that when and if
> the main link goes down, the default route for this box is 
> automatically
> changed to point to another router on the LAN.I am having trouble
> implementing this on freebsd.
> Any ideas?

First, I'm more of a router person than familiar with how FreeBSD calculates
it's routing table so the following is all guesswork from "man route". 

The issue with static routes is that they rarely have any idea of the status
of their destination but this can be fudged if you're using point-to-point
interfaces e.g. DSL, leased line. In general terms what you'd be doing on a
router is:

1) Have a default route directed out a point-to-point interface connected to
the ISP (not the IP address) so that when the interface is down, the static
route is removed from the live routing table. 
2) Have a weighted default route via an alternative IP address. The weight
implies this route is only used when the former default route is not
available.

I've read "man route" and I get the impression you can add a route via an
interface rather than a destination with the switch "-interface" so your
first step is to add a default route along the lines

> route add default -interface 

... this is a guess as the man page isn't explicit. Also, I don't know
whether this route remains live or is removed as required during a failure
on the point-to-point interface you'd configure this to. It definitely won't
work if your primary access method is a broadcast interface e.g. ethernet. 

Further, I can't find any details on adding a weight to a static route to
create the secondary route so I'm not sure this is going to be possible via
an automatic routing table kind of thing.

So.(getting to the point very slowly)

The only other method I can think of would be a script to ping the far end
addresses regularly in order. Depending on which one is up, you could inject
a default route statement as required to the correct destination.

I'd be interested in other suggestions as this doesn't sound entirely great
as there are many other reasons than link failure why an address wouldn't be
pingable.

Thanks,
Phil.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: backup static routes for freebsd (default)

2003-08-10 Thread Tillman
On Wed, Aug 06, 2003 at 07:53:55AM -0700, Ezra Banoba wrote:
> Hi,
> It works like magic.
> But then, ... that means I still would have to use a script to mark the
> interface as down when the remote gateway is inaccessible. Or is there a way
> to automagically mark the interface down if the network is inaccessible?

Dynamic routing protocols, such as provided by zebra/quagga? On a
multi-access link, determining that the network is down is somewhat
difficult unless you can build some kind of keep-alive state-checking
mechanism (which is one of the functions that most routing protocols
provide).

-T


-- 
One day someone asked Master Yun-men: "I've heard it said that one should
not leave home to become a monk without parents' consent. How then should
one leave home?" "Shallow!" the Master said.
"I don't understand." "Deep!" replied the Master.
Master Yun-men
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


RE: backup static routes for freebsd (default)

2003-08-07 Thread Nick Rogness
On Tue, 5 Aug 2003, Ezra Banoba wrote:

> Thanks Phil, I tried some guesswork myself to add the secondary default
> routes router style with weights and that's the only way the route add
> command will accept another default route. I do not know how freebsd
> interpretes this: route add default [gateway] [administrative weight]
>
> though this has no effect when i birng down the default route.
>
> Maybe a script to ping the gateways at intervals will do. Any other
> ideas are welcome. Thanks.

The trick to adding a backup default route is to split 'default'
into 2 different and more specific subnets:

# route add 0.0.0.0 PRIMARY_GW -netmask 127.0.0.0
# route add 127.0.0.0 PRIMARY_GW -netmask 127.0.0.0
# route add default SECONDARY_GW

Now that default is split into 2 different smaller subnets than
'default' they will be the preferred route.  If your interface
that connects PRIMARY_GW goes down, the first 2 routes will be
removed, leave your backup 'default' gateway to take affect.

This only works if PRIMARY_GW and SECONDARY_GW are on seperate
physical networks and will also only work if the INTERFACE goes
down.  It will not work if the PRIMARY_GW goes down but the
physical interface connected to that network stays up.


Nick Rogness <[EMAIL PROTECTED]>
-
  How many people here have telekenetic powers? Raise my hand.
-Emo Philips


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


RE: backup static routes for freebsd (default)

2003-08-06 Thread Nick Rogness
On Wed, 6 Aug 2003, Ezra Banoba wrote:

> Hi, It works like magic. But then, ... that means I still would have to
> use a script to mark the interface as down when the remote gateway is
> inaccessible. Or is there a way to automagically mark the interface down
> if the network is inaccessible?

Not without a active routing protocol like OSPF/RIP/etc (using
gated or zebra).  In which case, the interface stays up but the
routes get removed.


Nick Rogness <[EMAIL PROTECTED]>
-
  How many people here have telekenetic powers? Raise my hand.
-Emo Philips


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


backup static routes for freebsd (default)

2003-08-05 Thread Ezra Banoba
Hello,
I have a gatway box running freebsd 4.8 and several links to the internet
via different ISP's.
This box is connected directly to one of the ISP's but also has access to
the other gatways via the LAN.
I would like to setup static backup (default) routes such that when and if
the main link goes down, the default route for this box is automatically
changed to point to another router on the LAN.I am having trouble
implementing this on freebsd.
Any ideas?

Ezra Banoba
Systems Administrator/Programmer
Computer Froniters International
Plot 32 Lumumba Avenue
www.cfi.co.ug
+256 031260485

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"