Subject: Re: pppoe connection randomly down
To: J.Lorec <j.lorec@ddcr.biz>
From: Mirko Thiesen <thiesi@ReLink.NetWorkXXIII.de>
List: netbsd-help
Date: 03/20/2004 16:31:32
On Sat, 20 Mar 2004, J.Lorec wrote:

> hello,my connection finally hang late this morning and I had to manually
> restart the network few hours later to recovermy connection.hereis the
> tcpdump output extract requested (I cannot interpret those messages at all
> by myself):...12:35:02.167752 PPPoE  [ses 0xef01] Echo-Req(122),

I once had a similar problem and wrote the following two very short shell
scripts:

(16:24:42) root@ReLink [~] # cat /usr/local/bin/watchdog
#!/bin/sh
#
# watchdog -- (c) 2002 by Thiesi, NetWorkXXIII / Reliable Link
#
# $VERSION: 0.5 20.06.2002.08:19:21

pingtest() {
    sleep 60
    ping -o -c 5 www.heise.de || ping -o -c 5 www.NetBSD.org || ping -c 10
www.google.com || ping -o -c 10 204.152.186.171
    }

restartadsl() {
     logger -i Ping tests *failed* - about to restart ADSL connection
     /usr/local/bin/renew_adsl
     }

while [ 0 -eq 0 ] ; do pingtest 0 || restartadsl 0; done

(16:24:50) root@ReLink [~] # cat /usr/local/bin/renew_adsl
#!/bin/sh
#
# renew_adsl -- (c) 2003 by Thiesi, NetWork XXIII / Reliable Link
#
# $VERSION: 0.1 27.08.2003.18:46:25

ifconfig pppoe0 down && sleep 1 && ifconfig pppoe0 up

The first one is called via the following entry in the crontab file:

@reboot		/usr/local/bin/watchdog >/dev/null 2>&1

Thus, it is started every time I reboot my machine. Of course this does
not address the acutal problem in any way. But at least it makes manual
checks for the Internet connection being still there and then restarting
it unneccessary.

Bye, K&K,
T-Zee
-- 
thiesi@NetWork23.Sytes.NET ---- NetBSD: Power to the people!
Tel.: ++49-(0)171-416 05 09 -- Fax: ++49-(0)171-134 16 05 09
Mirko Thiesen, P.O. Box 26 03 54, D-13413 Berlin, W. Germany
             "We're with you all the way, mostly"