Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] backup modem for ADSL


----- Original Message -----
From: "Peter McCarthy" <peterm@xxxxxxxxxx>
To: "Linux Sydney (E-mail)" <slug@xxxxxxxxxxx>
Sent: Thursday, February 07, 2002 4:21 PM
Subject: [SLUG] backup modem for ADSL


> Howdy
>
> I would like to configure a modem to be a backup for our rather shaky
Telstra
> ADSL connection.
> the idea being the modem will sit idle until it detects the ADSL is down,
then
> it will dial up our ISP and give us some connection, humble as it may be.
> Naturally the tear down procedure would also occur should the link come
back up.

I have read this late, since it doesn't seem like anyone replied, this may
help.

I'm not sure which distro you are using, but on a redhat system, there are
two scripts that are executed each time a ppp interface goes up ro down.
They are called /etc/ppp/ip-up.local /etc/ppp/ip-down.local.  You create
them yourself, they are called by /etc/ppp/ip-up and /etc/ppp/ip-down (make
sure they are executable "chmod 700")

I have a few systems that have been upgraded from Telstra 56K to ADSL.  We
kept the 56K links and the system dials and connect these modems as they
always have (including they set default route)

Here are my ip-up.local and ip-down.local scripts................
=====================================
#!/bin/bash
# ip-up.local
# Detect which interface has just come up
# used in conjunction with ip-down.local to switch default route
#

logger "UP - $*"

if [ "$4" = "165.228.222.333" ] ; then
  echo "ADSL UP `date` - Switching default route to ADSL" > /dev/console
  echo "ADSL UP   `date` - Switching default route to ADSL" >> /var/log/adsl
  route del default
  route add default $1
fi

====================================
#!/bin/bash

# Detect which interface has just come up
# ip-up.local and ip-down.local used to switch default route
# This script assumes dialout modem is ppp0

logger "DOWN - $*"

if [ "$4" = "165.228.2.118" ] ; then
  echo  "ADSL DOWN `date` - Switching default route to Modem" > /dev/console
  echo  "ADSL DOWN `date` - Switching default route to Modem" >>
/var/log/adsl
  route del default
  route add default ppp0
fi

=====================================

You could add your scripts to dial the modem.
perhaps,
1. Delete default route
2. something like (on a Redhat systems) "route del default" "ifup ppp0"

regards, Ian