*BSD News Article 37819


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!spool.mu.edu!howland.reston.ans.net!news.moneng.mei.com!uwm.edu!msuinfo!news.mtu.edu!lisa.acs.nmu.edu!lisa.acs.nmu.edu!not-for-mail
From: scottr@lisa.acs.nmu.edu (Scott Reynolds)
Newsgroups: comp.os.386bsd.questions
Subject: Re: PPP for BSD? [ppp-2.1.2]
Date: 12 Nov 1994 12:41:02 -0500
Organization: Northern Michigan University
Lines: 67
Message-ID: <3a2une$lso@lisa.acs.nmu.edu>
References: <39imde$5hj@case.cyberspace.com> <RICK.94Nov9150356@vox.trystero.com> <RICK.94Nov11114322@vox.trystero.com> <3a0j5h$ahd@bart.acs.nmu.edu>
NNTP-Posting-Host: lisa.acs.nmu.edu
Keywords: ppp dialup persist

Well, in fact, my suggestion worked with a minor modification.  I spent a 
little bit of time on it because I wanted an auto-redial in case the line 
was busy...

#
# /etc/ttys
# (note: FreeBSD has /usr/libexec/pppd, does it not?)
#
.
.
tty01	"/usr/sbin/pppd tty01 9600"	unknown	on
.
.

#
# /etc/ppp/options
# (consult pppd(8) for what these mean -- some are defaults, but
# included for clarity's sake)
#
lock
local
-detach
connect "/etc/ppp/dial"
mru 296
noipdefault
ipcp-accept-local
ipcp-accept-remote
defaultroute
user anonymous

#
# /etc/ppp/dial
#

#!/bin/sh
/usr/sbin/chat -f /etc/ppp/dial.scr && exit 0
sleep 300   # 5 minutes between redials
exit 1

#
# /etc/ppp/dial.scr
#

ABORT BUSY ABORT 'NO CARRIER'
'' AT\r\c
TIMEOUT 5 OK-AT\r\c-OK ATDT5551212\r\c
TIMEOUT 45 host: ppp\r\c
ogin: anonymous\r\c
word: guest\r\c


How it works:  init(8) keeps the pppd process running just as if it were 
a getty running on the port.  The /etc/ppp/options script uses a connect 
program that, if the dial succeeds, returns true (0) and lets pppd set up 
the connection.  If the dial fails, the script returns false (1) after 
sleeping for 5 minutes so as to keep init() from complaining about pppd 
looping too fast.  (I imagine you could sleep for as little as 5-10 
seconds without difficulty.)

Please note that the "-detach" in /etc/ppp/options is critical!  Whatever 
else you may change, leave this in if you are going to run pppd from init.

"Works for me."  Your mileage may vary, of course.

--scott

#include <std/disclaimer.h>