PPP connections drop frequently and won't automatically come up again

Cordula's Web cpghost at cordula.ws
Mon Apr 19 09:05:36 PDT 2004

Mon, 19 Apr 2004 00:08:13 +0200, Guido Winkelmann <guido at unknownsite.de>:

> I am using a small FreeBSD machine as a NAT router (and for a few other 
> purposes) for an ADSL connection for my home network. I am using the user 
> space ppp program with the -ddial and the -nat switch for this.
> The problem is that, at seemingly random intervals, the connection to the 
> internet will go down (or rather, stop working) and refuse to automatically 
> come up again. After a reboot, everything works again.

This typically happens, when the router that is serving the ADSL
session reload(s). For some mysterious reason, ppp doesn't notice
that the PAD session is dead (despite keep-alives) and thus doesn't
try to redial. [I confirmed _many_ _times_ with my ISP's netadmins
that they either rebootet my peer router, or swapped equipment,
exactly the moment ppp(8) showed the symptoms you describe.]

You can verify this by logging in to ppp:

# pppctl /var/run/internet

You can close the connection manually:

PPP> close
PPP> quit

and it will then come up again automatically, iff the router
behind the DSLAM is ready to accept new connections. Depending
upon load and equipment, this can take between 10 and 60 (!)
minutes. In the meantime, enjoy:
# tail -f /var/log/ppp

A possible work-around is a watchdog script which tests
the integrity of the link, and which could manually (e.g. via
expect) close the connection if necessary. Of course, fixing
ppp(8) would be much, MUCH better!

> After that happened again yesterday, I logged in to the machine via ssh (which 
> took a lot longer than usual btw, it was about a minute until I was prompted 
> for my password).

DNS problems when the link is down...

> I found the ppp process to still be running, the interface 
> tun0 to still be up and the default route to still be set to tun0. Also, 
> there was no mention of any problem in /var/log/ppp or /var/log/messages (at 
> least not from ppp itself - some other daemon was repeatedly complaining 
> about the lack of internet connectivity). The send/receive diode on the DSL 
> modem was still blinking wildly.

Use pppctl /var/run/internet as described above.

> Next thing I did was to unplug the DSL modem from its power supply, wait a few 
> seconds and plug it in again, hoping that now the ppp process would finally 
> realize that there was something wrong and reinitiate the connection, but 
> that didn't succeed. I only could bring up the Internet connection again with 
> a reboot.

No, you don't need to reboot. Just close the connection with
pppctl, or kill the ppp daemon and restart it manually.

> This happens at very irregular intervals. The last time, it happened only a 
> few hours after bootup, the time before, everything worked fine for nearly a 
> month, until I rebooted the machine for updating. (I did get disconnected a 
> few times during that months, though. At least I got a new IP address a few 
> times. But the connection never stayed down for more than a few seconds.)
> The FreeBSD version is RELENG_5_2, updated two or three days ago.
> I've got the following lines in /etc/rc.conf for ppp:
> [...]
> # Internet access from the local network
> gateway_enable="YES"
> ppp_enable="YES"
> ppp_mode="ddial"
> ppp_nat="YES"
> ppp_profile="arcor"
> ######################
> [...]
> and this is my /etc/ppp/ppp.conf:
> default:
>   set server /var/run/internet "" 0177
>   set log Phase tun command
>   set ifaddr
> arcor:
>   set device PPPoE:rl0
>   set authname xxxxxxx
>   set authkey xxxxxx
>   set dial
>   set login
>   add default HISADDR
> [...]
> (the rest is just portforwarding)
> Could someone please help me with that?
> 	Guido Winkelmann

Cordula's Web. http://www.cordula.ws/

More information about the freebsd-questions mailing list