Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jun 1996 09:31:27 -0400
From:      Mark Plummer <markus@clark.net>
To:        Kenneth Ingham <ingham@i-pi.com>
Cc:        questions@freebsd.org
Subject:   Re: I want PPP to stay up all the time 
Message-ID:  <199606211331.JAA26255@clark.net>
In-Reply-To: Your message of "Thu, 20 Jun 1996 17:36:04 MDT." <199606202336.RAA00786@cube.i-pi.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> OS: FreeBSD 2.1.
> 
> I'm have a full-time (modem) ppp connection to the internet.  I'd like the  
> link to stay up all the time.  What happens now with both kernel and user PPP
  
> is that if the link drops (i.e. due to a noisy phone line), it stays down.
> 
> I've gone over the man pages and the FreeBSD Handbook and have found nothing 
 
> that seems to help.  I would dig through the source, but my CD drive is dead 
 
> (but under warranty, so will eventually be replaced).
> 
> I have tried both user and kernel ppp.
> 
> Any suggestions?
> 
> Kenneth Ingham
> ingham@i-pi.com

hey,

    i use a script which pings the far side of the connection (or something
which is always reachable if the connection is up).  if the connection is down,
it restarts ppp automatically.  i run it from cron every five minutes.  here
it is...


#!/bin/sh
PATH=/sbin:/usr/sbin:/bin:/usr/bin
ipaddr="$1" # which ip address to check for basic connectivity
ppptag="$2" # which tag in ppp.conf to use to redial
pppline=`ps -axu | grep "[p][p][p][) ]"`
if [ ! -z "$pppline" ] ; then
  if ping -c 10 $ipaddr 2> /dev/null | grep -q "100% packet loss" ; then
    ppppid=`echo $pppline | awk '{print $2}'`
    kill $ppppid
    sleep 3
    ppp $ppptag > /dev/null 2>&1 &
  fi
else
  ppp $ppptag > /dev/null 2>&1 &
fi

-- Mark Plummer, markus@clark.net, +1 410 796 1272



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606211331.JAA26255>