Subject: Re: Using ppp on demand
To: None <current-users@NetBSD.org>
From: D'Arcy" "J.M. <darcy@druid.druid.net>
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.
192.68.1.2      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 "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
ABORT "BUSY"
ABORT "Invalid login"
"" "AT"
OK "AT&D0&C1"
OK "ATDT555-1234"
CONNECT


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

tty00 57600 crtscts
name login
remotename isp
demand
:192.68.1.2
ipcp-accept-local
ipcp-accept-remote
defaultroute
connect '/usr/sbin/chat -v -f /etc/ppp/chat-isp

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

ppp_peers="isp"

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
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.