* [LARTC] two routes, non-permanent higher proiority
@ 2007-04-11 14:16 Bob Beers
2007-04-12 3:34 ` Randy Wallace
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Bob Beers @ 2007-04-11 14:16 UTC (permalink / raw)
To: lartc
Hi LARTC experts,
Can you help me with this scenario? I have been
lurking on this list for a while, but I am very green
wrt advanced routing.
I have a slackware linux based server in a vehicle with
a high bandwidth satellite connection which is only
available while the vehicle is stationary.
This satellite connection comes in via eth0. But while
the vehicle is moving or stationary, we can use a
CDMA modem via a ppp0 connection coming in on
a serial port, but it is much lower bandwidth.
The vehicle operator should only need to park the
vehicle, press the "engage the satellite" button, and
as soon as the link is established, the satellite is
the preferred path to the internet.
There will be traffic coming both from the router and
from wired and wireless devices on private network.
Looking forward to your advice.
-Bob
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 6+ messages in thread
* [LARTC] two routes, non-permanent higher proiority
2007-04-11 14:16 [LARTC] two routes, non-permanent higher proiority Bob Beers
@ 2007-04-12 3:34 ` Randy Wallace
2007-04-12 12:45 ` Bob Beers
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Randy Wallace @ 2007-04-12 3:34 UTC (permalink / raw)
To: lartc
I would write a script that would check for connectivity to the
internet over the ethernet port for internet.
If your slackware router is always connected, and communicating, with
the satellite modem, though not always passing real internet traffic,
you could leave the interface 'up'. From there, you could write a
simple ping-check type script that would ping the satellite gateway,
which would only be visible when the dish is communicating to the NOC.
For example:
if
ping -I eth0 xx.xx.xx.xx
is successful then
ip route del default via xx.xx.xx.xx dev ppp0
ip route add default via xx.xx.xx.xx dev eth0
else
ip route del default via xx.xx.xx.xx dev eth0
ip route add default via xx.xx.xx.xx dev ppp0
otherwise, if eth0 is not always talking to the modem (ethernet), then
you could use ethtool to check for ethernet connectivity before trying
to ping, i.e.
if
(ethtool eth0 | grep 'Link detected: ') = 'yes'
then
ip addr add xx.xx.xx.xx/xx brd + dev eth0
and whatever routes you need to get the satellite gateway.
then run the ping script above.
hope i helped a little,
-Randy
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LARTC] two routes, non-permanent higher proiority
2007-04-11 14:16 [LARTC] two routes, non-permanent higher proiority Bob Beers
2007-04-12 3:34 ` Randy Wallace
@ 2007-04-12 12:45 ` Bob Beers
2007-04-12 17:26 ` Paul Zirnik
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Bob Beers @ 2007-04-12 12:45 UTC (permalink / raw)
To: lartc
On 4/11/07, Randy Wallace <randywallacejr@gmail.com> wrote:
Hi Randy, thanks for the reply,
I'll leave it intact, but I have a few comments/questions at the end.
> I would write a script that would check for connectivity to the
> internet over the ethernet port for internet.
>
> If your slackware router is always connected, and communicating, with
> the satellite modem, though not always passing real internet traffic,
> you could leave the interface 'up'. From there, you could write a
> simple ping-check type script that would ping the satellite gateway,
> which would only be visible when the dish is communicating to the NOC.
>
> For example:
>
> if
>
> ping -I eth0 xx.xx.xx.xx
>
> is successful then
>
> ip route del default via xx.xx.xx.xx dev ppp0
> ip route add default via xx.xx.xx.xx dev eth0
>
> else
>
> ip route del default via xx.xx.xx.xx dev eth0
> ip route add default via xx.xx.xx.xx dev ppp0
>
> otherwise, if eth0 is not always talking to the modem (ethernet), then
> you could use ethtool to check for ethernet connectivity before trying
> to ping, i.e.
>
> if
>
> (ethtool eth0 | grep 'Link detected: ') = 'yes'
>
> then
>
> ip addr add xx.xx.xx.xx/xx brd + dev eth0
>
> and whatever routes you need to get the satellite gateway.
> then run the ping script above.
>
> hope i helped a little,
>
> -Randy
>
This is a good plan, and I'm doing something like this already,
but I was really hoping that there was some static way to
set up two default routes, maybe two route tables even,
and that the kernel would be smart enough to know if the
satellite route was reachable, and prefer it based on some
priority or metric setting. I think the satellite modem may be
powered even if the dish is stowed, so the ethtool check of
"Link detected" may be always true, so not much help.
I suppose maybe this is what the dynamic routing protocols
(OSPF?, or BGP?) was designed to handle? But I suppose
a script from a cronjob would adjust the routing with only
a -- worst case -- 60 second delay.
Thanks,
-Bob
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LARTC] two routes, non-permanent higher proiority
2007-04-11 14:16 [LARTC] two routes, non-permanent higher proiority Bob Beers
2007-04-12 3:34 ` Randy Wallace
2007-04-12 12:45 ` Bob Beers
@ 2007-04-12 17:26 ` Paul Zirnik
2007-04-12 17:37 ` Paul Zirnik
2007-04-12 18:45 ` Bob Beers
4 siblings, 0 replies; 6+ messages in thread
From: Paul Zirnik @ 2007-04-12 17:26 UTC (permalink / raw)
To: lartc
On Thursday 12 April 2007 14:45, Bob Beers wrote:
> On 4/11/07, Randy Wallace <randywallacejr@gmail.com> wrote:
>
> Hi Randy, thanks for the reply,
> I'll leave it intact, but I have a few comments/questions at the end.
>
> > I would write a script that would check for connectivity to the
> > internet over the ethernet port for internet.
> >
> > If your slackware router is always connected, and communicating, with
> > the satellite modem, though not always passing real internet traffic,
> > you could leave the interface 'up'. From there, you could write a
> > simple ping-check type script that would ping the satellite gateway,
> > which would only be visible when the dish is communicating to the NOC.
> >
> > For example:
> >
> > if
> >
> > ping -I eth0 xx.xx.xx.xx
> >
> > is successful then
> >
> > ip route del default via xx.xx.xx.xx dev ppp0
> > ip route add default via xx.xx.xx.xx dev eth0
> >
> > else
> >
> > ip route del default via xx.xx.xx.xx dev eth0
> > ip route add default via xx.xx.xx.xx dev ppp0
> >
> > otherwise, if eth0 is not always talking to the modem (ethernet), then
> > you could use ethtool to check for ethernet connectivity before trying
> > to ping, i.e.
> >
> > if
> >
> > (ethtool eth0 | grep 'Link detected: ') = 'yes'
> >
> > then
> >
> > ip addr add xx.xx.xx.xx/xx brd + dev eth0
> >
> > and whatever routes you need to get the satellite gateway.
> > then run the ping script above.
> >
> > hope i helped a little,
> >
> > -Randy
>
> This is a good plan, and I'm doing something like this already,
> but I was really hoping that there was some static way to
> set up two default routes, maybe two route tables even,
> and that the kernel would be smart enough to know if the
> satellite route was reachable, and prefer it based on some
> priority or metric setting. I think the satellite modem may be
> powered even if the dish is stowed, so the ethtool check of
> "Link detected" may be always true, so not much help.
> I suppose maybe this is what the dynamic routing protocols
> (OSPF?, or BGP?) was designed to handle? But I suppose
> a script from a cronjob would adjust the routing with only
> a -- worst case -- 60 second delay.
You can setup two or more default routes, the kernel automaticaly switches
to the next defaultroute after a timeout.
The timeout can be set via /proc/sys/net/ipv4/inet_peer_gc_maxtime
To switch back to the first route IMHO simply flush the routing cache (not
tested)
regards,
Paul
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LARTC] two routes, non-permanent higher proiority
2007-04-11 14:16 [LARTC] two routes, non-permanent higher proiority Bob Beers
` (2 preceding siblings ...)
2007-04-12 17:26 ` Paul Zirnik
@ 2007-04-12 17:37 ` Paul Zirnik
2007-04-12 18:45 ` Bob Beers
4 siblings, 0 replies; 6+ messages in thread
From: Paul Zirnik @ 2007-04-12 17:37 UTC (permalink / raw)
To: lartc
Ups, sorry wrong /proc value for controling the timeout :(
Right one is /proc/sys/net/ipv4/route/gc_timeout
regards,
Paul
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LARTC] two routes, non-permanent higher proiority
2007-04-11 14:16 [LARTC] two routes, non-permanent higher proiority Bob Beers
` (3 preceding siblings ...)
2007-04-12 17:37 ` Paul Zirnik
@ 2007-04-12 18:45 ` Bob Beers
4 siblings, 0 replies; 6+ messages in thread
From: Bob Beers @ 2007-04-12 18:45 UTC (permalink / raw)
To: lartc
> Right one is /proc/sys/net/ipv4/route/gc_timeout
Thanks Paul, I'll check this out.
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-04-12 18:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-11 14:16 [LARTC] two routes, non-permanent higher proiority Bob Beers
2007-04-12 3:34 ` Randy Wallace
2007-04-12 12:45 ` Bob Beers
2007-04-12 17:26 ` Paul Zirnik
2007-04-12 17:37 ` Paul Zirnik
2007-04-12 18:45 ` Bob Beers
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.