The following examples assume that the /etc/ppp/options file
contains the auth option (as in the default /etc/ppp/options file
in the ppp distribution).
Probably the most common use of pppd is to dial out to an ISP.
This can be done with a command such as
pppd call isp
where the /etc/ppp/peers/isp file is set up by the system
administrator to contain something like this:
ttyS0 19200 crtscts
connect '/usr/sbin/chat -v -f /etc/ppp/chat-isp'
noauth
In this example, we are using chat to dial the ISP's modem and go
through any logon sequence required. The /etc/ppp/chat-isp file
contains the script used by chat; it could for example contain
something like this:
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
ABORT "BUSY"
ABORT "Username/Password Incorrect"
"" "at"
OK "at&d0&c1"
OK "atdt2468135"
"name:" "^Umyuserid"
"word:" "\qmypassword"
"ispts" "\q^Uppp"
"~-^Uppp-~"
See the chat(8) man page for details of chat scripts.
Pppd can also be used to provide a dial-in ppp service for users.
If the users already have login accounts, the simplest way to set
up the ppp service is to let the users log in to their accounts
and run pppd (installed setuid-root) with a command such as
pppd proxyarp
To allow a user to use the PPP facilities, you need to allocate
an IP address for that user's machine and create an entry in
/etc/ppp/pap-secrets, /etc/ppp/chap-secrets, or
/etc/ppp/srp-secrets (depending on which authentication method
the PPP implementation on the user's machine supports), so that
the user's machine can authenticate itself. For example, if Joe
has a machine called "joespc" that is to be allowed to dial in to
the machine called "server" and use the IP address joespc.my.net,
you would add an entry like this to /etc/ppp/pap-secrets or
/etc/ppp/chap-secrets:
joespc server "joe's secret" joespc.my.net
(See srp-entry(8) for a means to generate the server's entry when
SRP-SHA1 is in use.) Alternatively, you can create a username
called (for example) "ppp", whose login shell is pppd and whose
home directory is /etc/ppp. Options to be used when pppd is run
this way can be put in /etc/ppp/.ppprc.
If your serial connection is any more complicated than a piece of
wire, you may need to arrange for some control characters to be
escaped. In particular, it is often useful to escape XON (^Q)
and XOFF (^S), using asyncmap a0000. If the path includes a
telnet, you probably should escape ^] as well (asyncmap
200a0000). If the path includes an rlogin, you will need to use
the escape ff option on the end which is running the rlogin
client, since many rlogin implementations are not transparent;
they will remove the sequence [0xff, 0xff, 0x73, 0x73, followed
by any 8 bytes] from the stream.