Subject: Re: pppoe connection randomly down
To: J.Lorec <j.lorec@ddcr.biz>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-help
Date: 03/20/2004 17:16:30
--XsQoSWH+UP9D9v3l
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sat, Mar 20, 2004 at 02:10:27PM +0100, 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):...
[...]
> IP-Addr=192.168.254.25412:35:32.167749 PPPoE  [ses 0xef01] Echo-Req(125),
> Magic-Num=10d63af112:35:32.291893 PPPoE  [ses 0xef01] Echo-Rep(125),
> Magic-Num=5959e31e12:35:33.914553 PPPoE  [ses 0xef01] Echo-Req(43),
> Magic-Num=5959e31e12:35:33.914582 PPPoE  [ses 0xef01] Echo-Rep(43),
> Magic-Num=10d63af112:35:34.106992 PPPoE  [ses 0xef01] Conf-Req(19),
> IP-Addr=192.168.254.25412:35:36.123516 PPPoE  [ses 0xef01] Conf-Req(20),
> IP-Addr=192.168.254.25412:35:38.137848 PPPoE  [ses 0xef01] Conf-Req(21),
> IP-Addr=192.168.254.25412:35:42.167752 PPPoE  [ses 0xef01] Echo-Req(126),
> Magic-Num=10d63af112:35:42.288718 PPPoE  [ses 0xef01] Echo-Rep(126),
> Magic-Num=5959e31e12:35:44.153288 PPPoE  [ses 0xef01] Echo-Req(44),
> Magic-Num=5959e31e12:35:44.153319 PPPoE  [ses 0xef01] Echo-Rep(44),
> Magic-Num=10d63af1...

> what happens? Is this a configuration problem? Is
> something missing?

It looks like the pppoe session is still up, as the remote properly reply to
Echo-Req paquets. It's most likely an issue on the ISP side.

> Is something like "options PPPOE_TERM_UNKNOWN_SESSIONS"
> kernel option may help?

I don't think so. This session isn't dead, from the client side at last.

To work around this, I would write a small shell script trying a ping to
know-working IPs at the ISP side, and restart the pppoe session if it fail.
At one time I used the attached script (of course you'll have to change the
IPs), but now I don't need this any more.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

--XsQoSWH+UP9D9v3l
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=checklink

#! /bin/sh

if (ping -c10 -n -o -q -w10 62.212.96.44  || \
    ping -c10 -n -o -q -w10 62.4.16.80 || \
    ping -c10 -n -o -q -w10 62.4.17.109) > /dev/null 2> /dev/null; then
	logger -t checklink -p daemon.debug "pppoe up"
	exit 0
fi
#link is down; notify and tries to wake up
logger -t checklink -p daemon.warning "pppoe is down"
ifconfig pppoe0 down
sleep 20
ifconfig pppoe0 up
sleep 20
ifconfig pppoe0 up
exit 0

--XsQoSWH+UP9D9v3l--