]> git.ozlabs.org Git - ppp.git/blob - pppd/pppd.8
use /etc/ppp/pppn.pid for ultrix
[ppp.git] / pppd / pppd.8
1 .\" manual page [] for pppd 2.0
2 .\" $Id: pppd.8,v 1.3 1994/04/18 04:40:19 paulus Exp $
3 .\" SH section heading
4 .\" SS subsection heading
5 .\" LP paragraph
6 .\" IP indented paragraph
7 .\" TP hanging label
8 .TH PPPD 8
9 .SH NAME
10 pppd \- Point to Point Protocol daemon
11 .SH SYNOPSIS
12 .B pppd
13 [
14 .I options
15 ] [
16 .I tty_name
17 ] [
18 .I speed
19 ]
20 .SH DESCRIPTION
21 .LP
22 The Point-to-Point Protocol (PPP) provides a method for transmitting
23 datagrams over serial point-to-point links.  PPP
24 is composed of three parts: a method for encapsulating datagrams over
25 serial links, an extensible Link Control Protocol (LCP), and
26 a family of Network Control Protocols (NCP) for establishing
27 and configuring different network-layer protocols.
28 .LP
29 The encapsulation scheme is provided by driver code in the kernel.
30 .B pppd
31 provides the basic LCP, authentication support, and an
32 NCP for establishing and configuring the Internet Protocol (IP)
33 (called the IP Control Protocol, IPCP).
34 .SH FREQUENTLY USED OPTIONS
35 .TP
36 .I <tty_name>
37 Communicate over the named device.  The string "/dev/"
38 is prepended if necessary.  If no device name is given,
39 .I pppd
40 will use the controlling terminal, and will not fork to put itself in
41 the background.
42 .TP
43 .I <speed>
44 Set the baud rate to <speed>.  On systems such as 4.4BSD and NetBSD,
45 any speed can be specified.  Other systems (e.g. SunOS) allow only a
46 limited set of speeds.
47 .TP
48 .B asyncmap \fI<map>
49 Set the async character map to <map>.
50 This map describes which control characters cannot be successfully
51 received over the serial line.
52 .I pppd
53 will ask the peer to send these characters as a 2-byte escape sequence.
54 The argument is a 32 bit hex number
55 with each bit representing a character to escape. 
56 Bit 0 (00000001) represents the character 0x00;
57 bit 31 (80000000) represents the character 0x1f or ^_.
58 If multiple \fBasyncmap\fR options are
59 given, the values are ORed together.
60 If no \fBasyncmap\fR option is given, no async character map will be
61 negotiated for the receive direction; the peer will then escape
62 \fIall\fR control characters.
63 .TP
64 .B auth
65 Require the peer to authenticate itself before allowing network
66 packets to be sent or received.
67 .TP
68 .B connect \fI<p>
69 Use the executable or shell command specified by \fI<p>\fR to set up the
70 serial line.  This script would typically use the "chat" program to
71 dial the modem and start the remote ppp session.
72 .TP
73 .B crtscts
74 Use hardware flow control (i.e. RTS/CTS) to control the flow of data on
75 the serial port.
76 .TP
77 .B defaultroute
78 Add a default route to the system routing tables, using the peer as
79 the gateway, when IPCP negotiation is successfully completed.
80 This entry is removed when the PPP connection is broken.
81 .TP
82 .B disconnect \fI<p>
83 Run the executable or shell command specified by \fI<p>\fR after
84 \fIpppd\fR has terminated the link.  This script could, for example,
85 issue commands to the modem to cause it to hang up.
86 .TP
87 .B escape \fIxx,yy,...
88 Specifies that certain characters should be escaped on transmission
89 (regardless of whether the peer requests them to be escaped with its
90 async control character map).  The characters to be escaped are
91 specified as a list of hex numbers separated by commas.  Note that
92 almost any character can be specified for the \fBescape\fR option,
93 unlike the \fBasyncmap\fR option which only allows control characters
94 to be specified.  The characters which may not be escaped are those
95 with hex values 0x20 - 0x3f or 0x5e.
96 .TP
97 .B file \fI<f>
98 Read options from file <f> (the format is described below).
99 .TP
100 .B lock
101 Specifies that \fIpppd\fR should use a UUCP-style lock on the serial
102 device to ensure exclusive access to the device.
103 .TP
104 .B mru \fI<n>
105 Set the MRU [Maximum Receive Unit] value to <n> for negotiation.
106 .I pppd
107 will ask the peer to send packets of no more than <n> bytes.
108 The minimum MRU value is 128. 
109 The default MRU value is 1500.  A value of 296 is recommended for slow
110 links (40 bytes for TCP/IP header + 256 bytes of data).
111 .TP
112 .B netmask \fI<n>
113 Set the interface netmask to <n>, a 32 bit netmask in "decimal dot" notation
114 (e.g. 255.255.255.0).
115 .TP
116 .B passive
117 Enables the "passive" option in the LCP.  With this option,
118 .I pppd
119 will attempt to initiate a connection; if no reply is received from
120 the peer,
121 .I pppd
122 will then just wait passively for a valid LCP packet from the peer
123 (instead of exiting, as it does without this option).
124 .TP
125 .B silent
126 With this option,
127 .I pppd
128 will not transmit LCP packets to initiate a connection until a valid
129 LCP packet is received from the peer (as for the "passive" option with
130 old versions of \fIpppd\fR).
131 .SH OPTIONS
132 .TP
133 .I <local_IP_address>\fB:\fI<remote_IP_address>
134 Set the local and/or remote interface IP addresses.  Either one may be
135 omitted.  The IP addresses can be specified with a host name or in
136 decimal dot notation (e.g. 150.234.56.78).  The default local
137 address is the (first) IP address of the system (unless the
138 .B noipdefault
139 option is given).  The remote address will be obtained from the peer
140 if not specified in any option.  Thus, in simple cases, this option is
141 not required.
142 If a local and/or remote IP address is specified with this option,
143 .I pppd
144 will not accept a different value from the peer in the IPCP
145 negotiation, unless the
146 .B ipcp-accept-local
147 and/or
148 .B ipcp-accept-remote
149 options are given, respectively.
150 .TP
151 .B -all
152 Don't request or allow negotiation of any options for LCP and IPCP (use
153 default values).
154 .TP
155 .B -ac
156 Disable Address/Control compression negotiation (use default, i.e.
157 address/control field disabled).
158 .TP
159 .B -am
160 Disable asyncmap negotiation (use the default asyncmap, i.e. escape
161 all control characters).
162 .TP
163 .B -as \fI<n>
164 Same as
165 .B asyncmap \fI<n>
166 .TP
167 .B -d
168 Increase debugging level (same as the \fBdebug\fR option).
169 .TP
170 .B -detach
171 Don't fork to become a background process (otherwise
172 .I pppd
173 will do so if a serial device is specified).
174 .TP
175 .B -ip
176 Disable IP address negotiation (with this option, the remote IP
177 address must be specified with an option on the command line or in an
178 options file).
179 .TP
180 .B -mn
181 Disable magic number negotiation.  With this option,
182 .I pppd
183 cannot detect a looped-back line.
184 .TP
185 .B -mru
186 Disable MRU [Maximum Receive Unit] negotiation (use default, i.e. 1500).
187 .TP
188 .B -p
189 Same as the
190 .B passive
191 option.
192 .TP
193 .B -pc
194 Disable protocol field compression negotiation (use default, i.e.
195 protocol field compression disabled).
196 .TP
197 .B +ua \fI<p>
198 Agree to authenticate using PAP [Password Authentication Protocol] if
199 requested by the peer, and
200 use the data in file <p> for the user and password to send to the
201 peer. The file contains the remote user name, followed by a newline,
202 followed by the remote password, followed by a newline.  This option
203 is obsolescent.
204 .TP
205 .B +pap
206 Require the peer to authenticate itself using PAP.
207 .TP
208 .B -pap
209 Don't agree to authenticate using PAP.
210 .TP
211 .B +chap
212 Require the peer to authenticate itself using CHAP [Cryptographic
213 Handshake Authentication Protocol] authentication.
214 .TP
215 .B -chap
216 Don't agree to authenticate using CHAP.
217 .TP
218 .B -vj
219 Disable negotiation of Van Jacobson style IP header compression (use
220 default, i.e. no compression).
221 .TP
222 .B debug
223 Increase debugging level (same as \fB\-d\fR).
224 If this
225 option is given, \fIpppd\fR will log the contents of all control
226 packets sent or received in a readable form.  The packets are logged
227 through syslog with facility \fIdaemon\fR and level \fIdebug\fR.  This
228 information can be directed to a file by setting up /etc/syslog.conf
229 appropriately (see syslog.conf(5)).
230 .TP
231 .B domain \fI<d>
232 Append the domain name <d> to the local host name for authentication
233 purposes.  For example, if gethostname() returns the name porsche, but the
234 fully qualified domain name is porsche.Quotron.COM, you would use the
235 domain option to set the domain name to Quotron.COM.
236 .TP
237 .B modem
238 Use the modem control lines.  (This option is not fully implemented.)
239 .TP
240 .B kdebug \fIn
241 Enable debugging code in the kernel-level PPP driver.  The argument
242 \fIn\fR is a number which is the sum of the following values: 1 to
243 enable general debug messages, 2 to request that the contents of
244 received packets be printed, and 4 to request that the contents of
245 transmitted packets be printed.
246 .TP
247 .B local
248 Don't use the modem control lines.
249 .TP
250 .B mtu \fI<n>
251 Set the MTU [Maximum Transmit Unit] value to \fI<n>\fR.  Unless the
252 peer requests a smaller value via MRU negotiation, \fIpppd\fR will
253 request that the kernel networking code send data packets of no more
254 than \fIn\fR bytes through the PPP network interface. 
255 .TP
256 .B name \fI<n>
257 Set the name of the local system for authentication purposes to <n>.
258 .TP
259 .B user \fI<u>
260 Set the user name to use for authenticating this machine with the peer
261 using PAP to <u>.
262 .TP
263 .B usehostname
264 Enforce the use of the hostname as the name of the local system for
265 authentication purposes (overrides the
266 .B name
267 option).
268 .TP
269 .B remotename \fI<n>
270 Set the assumed name of the remote system for authentication purposes
271 to <n>.
272 .TP
273 .B proxyarp
274 Add an entry to this system's ARP [Address Resolution Protocol] table
275 with the IP address of the peer and the Ethernet address of this
276 system.
277 .TP
278 .B login
279 Use the system password database for authenticating the peer using
280 PAP.
281 .TP
282 .B noipdefault
283 Disables the default behaviour when no local IP address is specified,
284 which is to determine (if possible) the local IP address from the
285 hostname.  With this option, the peer will have to supply the local IP
286 address during IPCP negotiation (unless it specified explicitly on the
287 command line or in an options file).
288 .TP
289 .B lcp-restart \fI<n>
290 Set the LCP restart interval (retransmission timeout) to <n> seconds
291 (default 3).
292 .TP
293 .B lcp-max-terminate \fI<n>
294 Set the maximum number of LCP terminate-request transmissions to <n>
295 (default 3).
296 .TP
297 .B lcp-max-configure \fI<n>
298 Set the maximum number of LCP configure-request transmissions to <n>
299 (default 10).
300 .TP
301 .B lcp-max-failure \fI<n>
302 Set the maximum number of LCP configure-NAKs returned before starting
303 to send configure-Rejects instead to <n> (default 10).
304 .TP
305 .B ipcp-restart \fI<n>
306 Set the IPCP restart interval (retransmission timeout) to <n> seconds
307 (default 3).
308 .TP
309 .B ipcp-max-terminate \fI<n>
310 Set the maximum number of IPCP terminate-request transmissions to <n>
311 (default 3).
312 .TP
313 .B ipcp-max-configure \fI<n>
314 Set the maximum number of IPCP configure-request transmissions to <n>
315 (default 10).
316 .TP
317 .B ipcp-max-failure \fI<n>
318 Set the maximum number of IPCP configure-NAKs returned before starting
319 to send configure-Rejects instead to <n> (default 10).
320 .TP
321 .B pap-restart \fI<n>
322 Set the PAP restart interval (retransmission timeout) to <n> seconds
323 (default 3).
324 .TP
325 .B pap-max-authreq \fI<n>
326 Set the maximum number of PAP authenticate-request transmissions to
327 <n> (default 10).
328 .TP
329 .B chap-restart \fI<n>
330 Set the CHAP restart interval (retransmission timeout for challenges)
331 to <n> seconds (default 3).
332 .TP
333 .B chap-max-challenge \fI<n>
334 Set the maximum number of CHAP challenge transmissions to <n> (default
335 10).
336 .TP
337 .B chap-interval \fI<n>
338 If this option is given,
339 .I pppd
340 will rechallenge the peer every <n> seconds.
341 .TP
342 .B ipcp-accept-local
343 With this option,
344 .I pppd
345 will accept the peer's idea of our local IP address, even if the
346 local IP address was specified in an option.
347 .TP
348 .B ipcp-accept-remote
349 With this option,
350 .I pppd
351 will accept the peer's idea of its (remote) IP address, even if the
352 remote IP address was specified in an option.
353 .SH OPTIONS FILES
354 Options can be taken from files as well as the command line.  
355 .I pppd
356 reads options from the files /etc/ppp/options and $HOME/.ppprc before
357 looking at the command line.  An options file is parsed into a series
358 of words, delimited by whitespace.  Whitespace can be included in a
359 word by enclosing the word in quotes (").  A backslash (\\) quotes the
360 following character.  A hash (#) starts a comment, which continues
361 until the end of the line.
362 .SH AUTHENTICATION
363 .I pppd
364 provides system administrators with sufficient access control that PPP
365 access to a server machine can be provided to legitimate users without
366 fear of compromising the security of the server or the network it's
367 on.  In part this is provided by the /etc/ppp/options file, where the
368 administrator can place options to require authentication whenever
369 .I pppd
370 is run, and in part by the PAP and CHAP secrets files, where the
371 administrator can restrict the set of IP addresses which individual
372 users may use.
373 .LP
374 The default behaviour of
375 .I pppd
376 is to agree to authenticate if requested, and to not
377 require authentication from the peer.  However, 
378 .I pppd
379 will not agree to
380 authenticate itself with a particular protocol if it has no secrets
381 which could be used to do so.
382 .LP
383 Authentication is based on secrets, which are selected from secrets
384 files (/etc/ppp/pap-secrets for PAP, /etc/ppp/chap-secrets for CHAP).
385 Both secrets files have the same format, and both can store secrets
386 for several combinations of server (authenticating peer) and client
387 (peer being authenticated).  Note that
388 .I pppd
389 can be both a server
390 and client, and that different protocols can be used in the two
391 directions if desired.
392 .LP
393 A secrets file is parsed into words as for a options file.  A secret
394 is specified by a line containing at least 3 words, in the order
395 client, server, secret.  Any following words on the same line are
396 taken to be a list of acceptable IP addresses for that client.  If
397 there are only 3 words on the line, it is assumed that any IP address
398 is OK; to disallow all IP addresses, use "-".  If the secret starts
399 with an `@', what follows is assumed to be the name of a file from
400 which to read the secret.  A "*" as the client or server name matches
401 any name.  When selecting a secret, \fIpppd\fR takes the best match, i.e.
402 the match with the fewest wildcards.
403 .LP
404 Thus a secrets file contains both secrets for use in authenticating
405 other hosts, plus secrets which we use for authenticating ourselves to
406 others.  Which secret to use is chosen based on the names of the host
407 (the `local name') and its peer (the `remote name').  The local name
408 is set as follows:
409 .TP 3
410 if the \fBusehostname\fR option is given,
411 then the local name is the hostname of this machine
412 (with the domain appended, if given)
413 .TP 3
414 else if the \fBname\fR option is given,
415 then use the argument of the first \fBname\fR option seen
416 .TP 3
417 else if the local IP address is specified with a hostname,
418 then use that name
419 .TP 3
420 else use the hostname of this machine (with the domain appended, if given)
421 .LP
422 When authenticating ourselves using PAP, there is also a `username'
423 which is the local name by default, but can be set with the \fBuser\fR
424 option or the \fB+ua\fR option.
425 .LP
426 The remote name is set as follows:
427 .TP 3
428 if the \fBremotename\fR option is given,
429 then use the argument of the last \fBremotename\fR option seen
430 .TP 3
431 else if the remote IP address is specified with a hostname,
432 then use that host name
433 .TP 3
434 else the remote name is the null string "".
435 .LP
436 Secrets are selected from the PAP secrets file as follows:
437 .TP 2
438 *
439 For authenticating the peer, look for a secret with client ==
440 username specified in the PAP authenticate-request, and server ==
441 local name.
442 .TP 2
443 *
444 For authenticating ourselves to the peer, look for a secret with
445 client == our username, server == remote name.
446 .LP
447 When authenticating the peer with PAP, a secret of "" matches any
448 password supplied by the peer.  If the password doesn't match the
449 secret, the password is encrypted using crypt() and checked against
450 the secret again; thus secrets for authenticating the peer can be
451 stored in encrypted form.  If the \fBlogin\fR option was specified, the
452 username and password are also checked against the system password
453 database.  Thus, the system administrator can set up the pap-secrets
454 file to allow PPP access only to certain users, and to restrict the
455 set of IP addresses that each user can use.
456 .LP
457 Secrets are selected from the CHAP secrets file as follows:
458 .TP 2
459 *
460 For authenticating the peer, look for a secret with client == name
461 specified in the CHAP-Response message, and server == local name.
462 .TP 2
463 *
464 For authenticating ourselves to the peer, look for a secret with
465 client == local name, and server == name specified in the
466 CHAP-Challenge message.
467 .LP
468 Authentication must be satisfactorily completed before IPCP (or any
469 other Network Control Protocol) can be started.  If authentication
470 fails, \fIpppd\fR will terminated the link (by closing LCP).  If IPCP
471 negotiates an unacceptable IP address for the remote host, IPCP will
472 be closed.  IP packets can only be sent or received when IPCP is open.
473 .LP
474 In some cases it is desirable to allow some hosts which can't
475 authenticate themselves to connect and use one of a restricted set of
476 IP addresses, even when the local host generally requires
477 authentication.  If the peer refuses to authenticate itself when
478 requested, \fIpppd\fR takes that as equivalent to authenticating with
479 PAP using the empty string for the username and password.  Thus, by
480 adding a line to the pap-secrets file which specifies the empty string
481 for the client and password, it is possible to allow restricted access
482 to hosts which refuse to authenticate themselves.
483 .SH ROUTING
484 .LP
485 When IPCP negotiation is completed successfully,
486 .I pppd
487 will inform the kernel of the local and remote IP addresses for the
488 ppp interface.  This is sufficient to create a
489 host route to the remote end of the link, which will enable the peers
490 to exchange IP packets.  Communication with other machines generally
491 requires further modification to routing tables and/or ARP (Address
492 Resolution Protocol) tables.  In some cases this will be done
493 automatically through the actions of the \fIrouted\fR or \fIgated\fR
494 daemons, but in most cases some further intervention is required.
495 .LP
496 Sometimes it is desirable
497 to add a default route through the remote host, as in the case of a
498 machine whose only connection to the Internet is through the ppp
499 interface.  The \fBdefaultroute\fR option causes \fIpppd\fR to create such a
500 default route when IPCP comes up, and delete it when the link is
501 terminated.
502 .LP
503 In some cases it is desirable to use proxy ARP, for example on a
504 server machine connected to a LAN, in order to allow other hosts to
505 communicate with the remote host.  The \fBproxyarp\fR option causes \fIpppd\fR
506 to look for a network interface on the same subnet as the remote host
507 (an interface supporting broadcast and ARP, which is up and not a
508 point-to-point or loopback interface).  If found, \fIpppd\fR creates a
509 permanent, published ARP entry with the IP address of the remote host
510 and the hardware address of the network interface found.
511 .SH EXAMPLES
512 .LP
513 In the simplest case, you can connect the serial ports of two machines
514 and issue a command like
515 .IP
516 pppd /dev/ttya 9600 passive
517 .LP
518 to each machine, assuming there is no \fIgetty\fR running on the
519 serial ports.  If one machine has a \fIgetty\fR running, you can use
520 \fIkermit\fR or \fItip\fR on the other machine to log in to the first
521 machine and issue a command like
522 .IP
523 pppd passive
524 .LP
525 Then exit from the communications program (making sure the connection
526 isn't dropped), and issue a command like
527 .IP
528 pppd /dev/ttya 9600
529 .LP
530 The process of logging in to the other machine and starting \fIpppd\fR
531 can be automated by using the \fBconnect\fR option to run \fIchat\fR,
532 for example:
533 .IP
534 pppd /dev/ttya 38400 connect 'chat "" "" "login:" "username"
535 "Password:" "password" "% " "exec pppd passive"'
536 .LP
537 (Note however that running chat like this will leave the password
538 visible in the parameter list of pppd and chat.)
539 .LP
540 If your serial connection is any more complicated than a piece of
541 wire, you may need to arrange for some control characters to be
542 escaped.  In particular, it is often useful to escape XON (^Q) and
543 XOFF (^S), using \fBasyncmap a0000\fR.  If the path includes a telnet,
544 you probably should escape ^] as well (\fBasyncmap 200a0000\fR).
545 If the path includes an rlogin, you will need to use the \fBescape
546 ff\fR option on the end which is running the rlogin client, since many
547 rlogin implementations are not
548 transparent; they will remove the sequence [0xff, 0xff, 0x73, 0x73,
549 followed by any 8 bytes] from the stream.
550 .SH DIAGNOSTICS
551 .LP
552 Messages are sent to the syslog daemon using facility LOG_DAEMON.
553 (This can be overriden by recompiling \fIpppd\fR with the macro
554 LOG_PPP defined as the desired facility.)  In order to see the error
555 and debug messages, you will need to edit your /etc/syslog.conf file
556 to direct the messages to the desired output device or file.
557 .LP
558 The \fBdebug\fR option causes the contents of all control packets sent
559 or received to be logged, that is, all LCP, PAP, CHAP or IPCP packets.
560 This can be useful if the PPP negotiation does not succeed.
561 If debugging is enabled at compile time, the \fBdebug\fR option also
562 causes other debugging messages to be logged.
563 .LP
564 Debugging can also be enabled by sending a
565 SIGUSR1 to the
566 .I pppd
567 process.
568 Debugging may be disabled by sending a SIGUSR2 to the
569 .I pppd
570 process.
571 .SH FILES
572 .TP
573 .B /var/run/ppp\fIn\fB.pid \fR(BSD), \fB/etc/ppp/ppp\fIn\fB.pid \fR(SunOS)
574 Process-ID for \fIpppd\fR process on ppp interface unit \fIn\fR.
575 .TP
576 .B /etc/ppp/pap-secrets
577 Usernames, passwords and IP addresses for PAP authentication.
578 .TP
579 .B /etc/ppp/chap-secrets
580 Names, secrets and IP addresses for CHAP authentication.
581 .TP
582 .B /etc/ppp/options
583 System default options for
584 .I pppd,
585 read before user default options or command-line options.
586 .TP
587 .B $HOME/.ppprc
588 User default options, read before command-line options.
589 .SH SEE ALSO
590 .TP
591 .B RFC1144
592 Jacobson, V.
593 .I Compressing TCP/IP headers for low-speed serial links.
594 1990 February.
595 .TP
596 .B RFC1321
597 Rivest, R.
598 .I The MD5 Message-Digest Algorithm.
599 1992 April.
600 .TP
601 .B RFC1332
602 McGregor, G.
603 .I PPP Internet Protocol Control Protocol (IPCP).
604 1992 May.
605 .TP
606 .B RFC1334
607 Lloyd, B.; Simpson, W.A.
608 .I PPP authentication protocols.
609 1992 October.
610 .TP
611 .B RFC1548
612 Simpson, W.A.
613 .I The Point\-to\-Point Protocol (PPP).
614 1993 December.
615 .TP
616 .B RFC1549
617 Simpson, W.A.
618 .I PPP in HDLC Framing.
619 1993 December
620 .SH NOTES
621 The following signals have the specified effect when sent to the
622 .I pppd
623 process.
624 .TP
625 .B SIGINT, SIGTERM
626 These signals cause \fIpppd\fR to terminate the link (by closing LCP),
627 restore the serial device settings, and exit.
628 .TP
629 .B SIGHUP
630 Indicates that the physical layer has been disconnected.  \fIpppd\fR
631 will attempt to restore the serial device settings (this may produce
632 error messages on Suns), and then exit.
633 .SH BUGS
634 The use of the modem control lines and the effects of the \fBmodem\fR
635 and \fBlocal\fR options are not well defined.
636 .SH AUTHORS
637 Drew Perkins,
638 Brad Clements,
639 Karl Fox,
640 Greg Christy,
641 Brad Parker (brad@fcr.com),
642 Paul Mackerras (paulus@cs.anu.edu.au)