Subject: Re: Using ppp on demand
To: None <>
From: D'Arcy" "J.M. <>
List: current-users
Date: 05/08/1999 09:46:49
Thus spake D'Arcy J.M. Cain
> If someone can tell me how to do this I'll write up something for the
> networking FAQ.

Better late than never I suppose.  Here's the first draft.  Anyone want
to comment before I continue?

How to set up PPP to use dial on demand

Rather than running pppd manually to call your ISP, you can set up PPP to
dial up your ISP on demand.  Here's how.  We'll use the following details
in our examples.  You will have to change them to suit your environment.

isp             The name of the isp to connect to.
login           Your login name at the ISP.
password        The password you use to connect.
555-1234        The phone number of the ISP.      An IP at the ISP.  See further discussion below.
tty00           The port to connect through.
57600           The baud rate to connect to the modem with.

First, make sure that the following is in /etc/ppp/chap-secrets and/or
/etc/ppp/pap-secrets depending on which your ISP supports.

login isp "password"

Now, make sure you have a proper /etc/ppp/chat-isp script.  Here is an
example but you would have to change this depending on your modem, special
requirements, etc.  Basically, this file is exactly like the one used for
normal PPP dialup.

ABORT "Invalid login"
"" "AT"
OK "AT&D0&C1"
OK "ATDT555-1234"

Next you need to create a file called /etc/ppp/peers/isp as follows

tty00 57600 crtscts
name login
remotename isp
connect '/usr/sbin/chat -v -f /etc/ppp/chat-isp

Finally, go into /etc/rc.conf and change the ppp_peers as follows.


On reboot, your system will set up the interface on ppp0 but will only dial
when a packet is destined to an IP outside of your local network.

D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.