*BSD News Article 61058


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!news.hawaii.edu!ames!agate!howland.reston.ans.net!newsfeed.internetmci.com!news.sprintlink.net!helena.MT.net!nate
From: nate@trout.sri.MT.net (Nate Williams)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: How to automatic dial when use pppd
Date: 2 Feb 1996 17:36:28 GMT
Organization: SRI Intl. - Montana Operations
Lines: 63
Message-ID: <4eti2t$cp7@helena.MT.net>
References: <4ekn2g$8k4@tst.hk.super.net>
Reply-To: "Nate Williams" <nate@sneezy.sri.com>
NNTP-Posting-Host: trout.sri.mt.net

In article <4ekn2g$8k4@tst.hk.super.net>,
Mr Cheung Sau Wai <swc@news.hk.super.net> wrote:
[ A very long line.  Next time, use the return key. :) ]

> I have a 19.2K dedicate line to my ISP, and use pppd for connection. 
> Can someone know how can I automatic dial when the connction is down? Is
> that I need other software or I need to config in the ppp.conf?

First of all, ppp.conf isn't used by pppd, it's used by 'ppp'.  Are you
using pppd or ppp?  If you're using the former, you want to create a
little shell script which loops forever and runs pppd.  (And make sure
that you have /etc/ppp/options setup correctly).  Here is my pppd
dialout shell script.

#!/bin/sh
#
# PPPD Auto-Dialer script
#
# Note:

#  You *MUST* use -detach mode or else the pppd process will fork
#  into the background and you will get hundreds of pppd processes trying
#  to connect to the remote site.  The current behavior causes the line to
#  re-dial when pppd fails, so it acts like a auto-dialer.
#
DEVICE=cuaa0

while `true`; do
    /usr/sbin/pppd sri.MT.net:micgate -detach \
        connect 'chat -v -f /etc/ppp/ppp0/chat' $DEVICE 115200
    # If we fail, wait a little while for the line to settle down
    sleep 15
done

And, here is my chat script.  Unfortunately, you have to build a custom
chat script for every outgoing connection, but you should be able to get
the idea here.

/etc/ppp/ppp0/chat:
ABORT "NO CARRIER" ABORT BUSY "" ATZ OK ATZ OK ATDT4432530 CONNECT "" \
ogin: ppp ssword: \qsecret

(The continuation line was put in there by me, it should be one complete
line in the file)

Finally, you need to figure out a way to call the script.  One way to do it
would be to have it called from out of /etc/ttys, using a line such as this:

ttyd0   "/etc/ppp/ppp0/ppp-dialout"         unknown off secure

Again, this is sort of a lie, since in fact it's not ttyd0 being used but instead
cuaa0, but you get the picture.

Hopefully this is some help,


Nate

-- 
nate@sneezy.sri.com    | Research Engineer, SRI Intl. - Montana Operations
nate@trout.sri.MT.net  | Loving life in God's country, the great state of
work #: (406) 449-7662 | Montana.
home #: (406) 443-7063 | A fly pole and a 4x4 Chevy truck = Heaven on Earth