From: "Bob Beers" Date: Thu, 12 Apr 2007 12:45:37 +0000 Subject: Re: [LARTC] two routes, non-permanent higher proiority Message-Id: <4f6ba3b0704120545h28346036md19c3e2a361c1943@mail.gmail.com> List-Id: References: <4f6ba3b0704110716k7b68f183h37f415ddefba3af0@mail.gmail.com> In-Reply-To: <4f6ba3b0704110716k7b68f183h37f415ddefba3af0@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org On 4/11/07, Randy Wallace 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