[LARTC] two routes, non-permanent higher proiority
Randy Wallace
randywallacejr at gmail.com
Thu Apr 12 05:34:13 CEST 2007
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
More information about the LARTC
mailing list