]> git.ozlabs.org Git - ppp.git/blob - pppd/pppd.8
added packet filtering; malloc VJ state
[ppp.git] / pppd / pppd.8
1 .\" manual page [] for pppd 2.0
2 .\" $Id: pppd.8,v 1.17 1996/01/18 04:01:15 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 tty_name
15 ] [
16 .I speed
17 ] [
18 .I options
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 or if the name of the controlling terminal is given,
40 .I pppd
41 will use the controlling terminal, and will not fork to put itself in
42 the background.
43 .TP
44 .I <speed>
45 Set the baud rate to <speed> (a decimal number).  On systems such as
46 4.4BSD and NetBSD, any speed can be specified.  Other systems
47 (e.g. SunOS) allow only a limited set of speeds.
48 .TP
49 .B asyncmap \fI<map>
50 Set the async character map to <map>.
51 This map describes which control characters cannot be successfully
52 received over the serial line.
53 .I pppd
54 will ask the peer to send these characters as a 2-byte escape sequence.
55 The argument is a 32 bit hex number
56 with each bit representing a character to escape. 
57 Bit 0 (00000001) represents the character 0x00;
58 bit 31 (80000000) represents the character 0x1f or ^_.
59 If multiple \fBasyncmap\fR options are
60 given, the values are ORed together.
61 If no \fBasyncmap\fR option is given, no async character map will be
62 negotiated for the receive direction; the peer should then escape
63 \fIall\fR control characters.
64 .TP
65 .B auth
66 Require the peer to authenticate itself before allowing network
67 packets to be sent or received.
68 .TP
69 .B connect \fI<p>
70 Use the executable or shell command specified by \fI<p>\fR to set up the
71 serial line.  This script would typically use the chat(8) program to
72 dial the modem and start the remote ppp session.
73 .TP
74 .B crtscts
75 Use hardware flow control (i.e. RTS/CTS) to control the flow of data
76 on the serial port.  If neither the \fBcrtscts\fR nor the
77 \fB\-crtscts\fR option is given, the hardware flow control setting for
78 the serial port is left unchanged.
79 .TP
80 .B defaultroute
81 Add a default route to the system routing tables, using the peer as
82 the gateway, when IPCP negotiation is successfully completed.
83 This entry is removed when the PPP connection is broken.
84 .TP
85 .B disconnect \fI<p>
86 Run the executable or shell command specified by \fI<p>\fR after
87 \fIpppd\fR has terminated the link.  This script could, for example,
88 issue commands to the modem to cause it to hang up if hardware modem
89 control signals were not available.
90 .TP
91 .B escape \fIxx,yy,...
92 Specifies that certain characters should be escaped on transmission
93 (regardless of whether the peer requests them to be escaped with its
94 async control character map).  The characters to be escaped are
95 specified as a list of hex numbers separated by commas.  Note that
96 almost any character can be specified for the \fBescape\fR option,
97 unlike the \fBasyncmap\fR option which only allows control characters
98 to be specified.  The characters which may not be escaped are those
99 with hex values 0x20 - 0x3f or 0x5e.
100 .TP
101 .B file \fI<f>
102 Read options from file <f> (the format is described below).
103 .TP
104 .B lock
105 Specifies that \fIpppd\fR should create a UUCP-style lock file for the
106 serial device to ensure exclusive access to the device.
107 .TP
108 .B mru \fI<n>
109 Set the MRU [Maximum Receive Unit] value to <n> for negotiation.
110 .I pppd
111 will ask the peer to send packets of no more than <n> bytes.  The
112 minimum MRU value is 128.  The default MRU value is 1500.  A value of
113 296 is recommended for slow links (40 bytes for TCP/IP header + 256
114 bytes of data).
115 .TP
116 .B mtu \fI<n>
117 Set the MTU [Maximum Transmit Unit] value to \fI<n>\fR.  Unless the
118 peer requests a smaller value via MRU negotiation, \fIpppd\fR will
119 request that the kernel networking code send data packets of no more
120 than \fIn\fR bytes through the PPP network interface. 
121 .TP
122 .B netmask \fI<n>
123 Set the interface netmask to <n>, a 32 bit netmask in "decimal dot"
124 notation (e.g. 255.255.255.0).  If this option is given, the value
125 specified is ORed with the default netmask.  The default netmask is
126 chosen based on the negotiated remote IP address; it is the
127 appropriate network mask for the class of the remote IP address, ORed
128 with the netmasks for any non point-to-point network interfaces in the
129 system which are on the same network.
130 .TP
131 .B passive
132 Enables the "passive" option in the LCP.  With this option,
133 .I pppd
134 will attempt to initiate a connection; if no reply is received from
135 the peer,
136 .I pppd
137 will then just wait passively for a valid LCP packet from the peer
138 (instead of exiting, as it does without this option).
139 .TP
140 .B silent
141 With this option,
142 .I pppd
143 will not transmit LCP packets to initiate a connection until a valid
144 LCP packet is received from the peer (as for the `passive' option with
145 ancient versions of \fIpppd\fR).
146 .SH OPTIONS
147 .TP
148 .I <local_IP_address>\fB:\fI<remote_IP_address>
149 Set the local and/or remote interface IP addresses.  Either one may be
150 omitted.  The IP addresses can be specified with a host name or in
151 decimal dot notation (e.g. 150.234.56.78).  The default local
152 address is the (first) IP address of the system (unless the
153 .B noipdefault
154 option is given).  The remote address will be obtained from the peer
155 if not specified in any option.  Thus, in simple cases, this option is
156 not required.  If a local and/or remote IP address is specified with
157 this option,
158 .I pppd
159 will not accept a different value from the peer in the IPCP
160 negotiation, unless the
161 .B ipcp-accept-local
162 and/or
163 .B ipcp-accept-remote
164 options are given, respectively.
165 .TP
166 .B -ac
167 Disable Address/Control compression negotiation (use default, i.e.
168 address/control field compression disabled).
169 .TP
170 .B -all
171 Don't request or allow negotiation of any options for LCP and IPCP (use
172 default values).
173 .TP
174 .B -am
175 Disable asyncmap negotiation (use the default asyncmap, i.e. escape
176 all control characters).
177 .TP
178 .B -as \fI<n>
179 Same as
180 .B asyncmap \fI<n>
181 .TP
182 .B bsdcomp \fInr,nt
183 Request that the peer compress packets that it sends, using the
184 BSD-Compress scheme, with a maximum code size of \fInr\fR bits, and
185 agree to compress packets sent to the peer with a maximum code size of
186 \fInt\fR bits.  If \fInt\fR is not specified, it defaults to the value
187 given for \fInr\fR.  Values in the range 9 to 15 may be used for
188 \fInr\fR and \fInt\fR; larger values give better compression but
189 consume more kernel memory for compression dictionaries.
190 Alternatively, a value of 0 for \fInr\fR or \fInt\fR disables
191 compression in the corresponding direction.
192 .TP
193 .B \-bsdcomp
194 Disables BSD-Compress compression; \fBpppd\fR will not request or
195 agree to compress packets using the BSD-Compress scheme.
196 .TP
197 .B +chap
198 Require the peer to authenticate itself using CHAP [Cryptographic
199 Handshake Authentication Protocol] authentication.
200 .TP
201 .B -chap
202 Don't agree to authenticate using CHAP.
203 .TP
204 .B chap-interval \fI<n>
205 If this option is given,
206 .I pppd
207 will rechallenge the peer every <n> seconds.
208 .TP
209 .B chap-max-challenge \fI<n>
210 Set the maximum number of CHAP challenge transmissions to <n> (default
211 10).
212 .TP
213 .B chap-restart \fI<n>
214 Set the CHAP restart interval (retransmission timeout for challenges)
215 to <n> seconds (default 3).
216 .TP
217 .B -crtscts
218 Disable hardware flow control (i.e. RTS/CTS) on the serial port.  If
219 neither the \fBcrtscts\fR nor the \fB\-crtscts\fR option is given,
220 the hardware flow control setting for the serial port is left
221 unchanged.
222 .TP
223 .B -d
224 Increase debugging level (same as the \fBdebug\fR option).
225 .TP
226 .B debug
227 Increase debugging level (same as \fB\-d\fR).
228 If this option is given, \fIpppd\fR will log the contents of all
229 control packets sent or received in a readable form.  The packets are
230 logged through syslog with facility \fIdaemon\fR and level
231 \fIdebug\fR.  This information can be directed to a file by setting up
232 /etc/syslog.conf appropriately (see syslog.conf(5)).
233 .TP
234 .B \-defaultroute
235 Disable the \fBdefaultroute\fR option.  The system administrator who
236 wishes to prevent users from creating default routes with \fIpppd\fR
237 can do so by placing this option in the /etc/ppp/options file.
238 .TP
239 .B deflate \fInr,nt
240 Request that the peer compress packets that it sends, using the
241 Deflate scheme, with a maximum window size of \fI2**nr\fR bits, and
242 agree to compress packets sent to the peer with a maximum window size of
243 \fI2**nt\fR bits.  If \fInt\fR is not specified, it defaults to the value
244 given for \fInr\fR.  Values in the range 8 to 15 may be used for
245 \fInr\fR and \fInt\fR; larger values give better compression but
246 consume more kernel memory for compression dictionaries.
247 Alternatively, a value of 0 for \fInr\fR or \fInt\fR disables
248 compression in the corresponding direction.  (Note: \fBpppd\fR
249 requests Deflate compression in preference to BSD-Compress
250 if the peer can do either.)
251 .TP
252 .B \-deflate
253 Disables Deflate compression; \fBpppd\fR will not request or agree to
254 compress packets using the Deflate scheme.
255 .TP
256 .B demand
257 Initiate the link only on demand, i.e. when data traffic is present.
258 With this option, the remote IP address must be specific by the user
259 on the command line or in an options file.  \fBpppd\fR will initially
260 configure the interface and enable it for IP traffic without
261 connecting to the peer.  When traffic is available, \fBpppd\fR will
262 connect to the peer and perform negotiation, authentication, etc.
263 When this is completed, \fBpppd\fR will commence passing data packets
264 (i.e., IP packets) across the link.  The persist, idle and holdoff
265 options are often useful in conjuction with this option.
266 .B -detach
267 Don't fork to become a background process (otherwise
268 .I pppd
269 will do so if a serial device other than its controlling terminal is
270 specified).
271 .TP
272 .B ms-dns \fI<addr>
273 If
274 .I pppd
275 is acting as a server for Microsoft Windows clients, this option
276 allows
277 .I pppd
278 to supply one or two DNS (Domain Name Server) addresses to the
279 clients.  The first instance of this option specifies the primary DNS
280 address; the second instance (if given) specifies the secondary DNS
281 address.
282 .TP
283 .B domain \fI<d>
284 Append the domain name <d> to the local host name for authentication
285 purposes.  For example, if gethostname() returns the name porsche, but the
286 fully qualified domain name is porsche.Quotron.COM, you would use the
287 domain option to set the domain name to Quotron.COM.
288 .TP
289 .B holdoff \fI<n>
290 Specifies how many seconds to wait before re-initiating the link after
291 it terminates.  This option only has effect if the persist option is
292 used.
293 .TP
294 .B idle \fI<n>
295 Specifies that \fBpppd\fR should disconnect if it is idle for
296 \fI<n>\fR seconds.  The link is idle when no data packets (i.e. IP
297 packets) are being sent or received.
298 .TP
299 .B -ip
300 Disable IPCP negotiation and IP communication.  This option should
301 only be required if the peer is buggy and gets confused by requests
302 from
303 .I pppd
304 for IPCP negotiation.
305 .TP
306 .B +ipx
307 Enable the IPXCP and IPX protocols.  Under Linux, this is the default
308 condition if your kernel supports IPX.  This option is presently only
309 supported under Linux.
310 .TP
311 .B -ipx
312 Disable the IPXCP and IPX protocols.  This option should only be
313 required if the peer is buggy and gets confused by requests from
314 .I pppd
315 for IPXCP negotiation.
316 .TP
317 .B ipcp-accept-local
318 With this option,
319 .I pppd
320 will accept the peer's idea of our local IP address, even if the
321 local IP address was specified in an option.
322 .TP
323 .B ipcp-accept-remote
324 With this option,
325 .I pppd
326 will accept the peer's idea of its (remote) IP address, even if the
327 remote IP address was specified in an option.
328 .TP
329 .B ipcp-max-configure \fI<n>
330 Set the maximum number of IPCP configure-request transmissions to <n>
331 (default 10).
332 .TP
333 .B ipcp-max-failure \fI<n>
334 Set the maximum number of IPCP configure-NAKs returned before starting
335 to send configure-Rejects instead to <n> (default 10).
336 .TP
337 .B ipcp-max-terminate \fI<n>
338 Set the maximum number of IPCP terminate-request transmissions to <n>
339 (default 3).
340 .TP
341 .B ipcp-restart \fI<n>
342 Set the IPCP restart interval (retransmission timeout) to <n> seconds
343 (default 3).
344 .TP
345 .B ipparam \fIstring
346 Provides an extra parameter to the ip-up and ip-down scripts.  If this
347 option is given, the \fIstring\fR supplied is given as the 6th
348 parameter to those scripts.
349 .TP
350 .B ipx-network \fI<n>
351 Set the IPX network number in the IPXCP configure request frame to
352 <n>. There is no valid default. If this option is not specified then
353 the network number is obtained from the peer. If the peer does not
354 have the network number, the IPX protocol will not be started. This is
355 a hexadecimal number and is entered without any leading sequence such
356 as 0x. It is related to the \fIipxcp-accept-network\fR option.
357 .TP
358 .B ipx-node \fI<n>:<m>
359 Set the IPX node numbers. The two node numbers are separated from each
360 other with a colon character. The first number <n> is the local node
361 number. The second number <m> is the peer's node number. Each node number
362 is a hexadecimal number, to the maximum of ten significant digits. The
363 node numbers on the ipx-network must be unique. There is no valid
364 default. If this option is not specified then the node number is
365 obtained from the peer. This option is a related to the
366 \fIipxcp-accept-local\fR and \fIipxcp-accept-remote\fR options.
367 .TP
368 .B ipx-router-name \fI<string>
369 Set the name of the router. This is a string and is sent to the peer
370 as information data.
371 .TP
372 .B ipx-routing \fI<n>
373 Set the routing protocol to be received by this option. More than one
374 instance of \fIipx-routing\fR may be specified. The '\fInone\fR'
375 option (0) may be specified as the only instance of ipx-routing. The
376 values may be \fI0\fR for \fINONE\fR, \fI2\fR for \fIRIP/SAP\fR, and
377 \fI4\fR for \fINLSP\fR.
378 .TP
379 .B ipxcp-accept-local
380 Accept the peer's NAK for the node number specified in the ipx-node
381 option. If a node number was specified, and non-zero, the default is
382 to insist that the value be used. If you include this option then you
383 will permit the peer to override the entry of the node number.
384 .TP
385 .B ipxcp-accept-network
386 Accept the peer's NAK for the network number specified in the
387 ipx-network option. If a network number was specified, and non-zero, the
388 default is to insist that the value be used. If you include this
389 option then you will permit the peer to override the entry of the node
390 number.
391 .TP
392 .B ipxcp-accept-remote
393 Use the peer's network number specified in the configure request
394 frame. If a node number was specified for the peer and this option was
395 not specified, the peer will be forced to use the value which you have
396 specified.
397 .TP
398 .B ipxcp-max-configure \fI<n>
399 Set the maximum number of IPXCP configure request frames which the
400 system will send to <n>. The default is 10.
401 .TP
402 .B ipxcp-max-failure \fI<n>
403 Set the maximum number of IPXCP NAK frames which the local system will
404 send before it rejects the options. The default value is 3.
405 .TP
406 .B ipxcp-max-terminate \fI<n>
407 Set the maximum nuber of IPXCP terminate request frames before the
408 local system considers that the peer is not listening to them. The
409 default value is 3.
410 .TP
411 .B kdebug \fIn
412 Enable debugging code in the kernel-level PPP driver.  The argument
413 \fIn\fR is a number which is the sum of the following values: 1 to
414 enable general debug messages, 2 to request that the contents of
415 received packets be printed, and 4 to request that the contents of
416 transmitted packets be printed.
417 .TP
418 .B lcp-echo-failure \fI<n>
419 If this option is given, \fIpppd\fR will presume the peer to be dead
420 if \fIn\fR LCP echo-requests are sent without receiving a valid LCP
421 echo-reply.  If this happens, \fIpppd\fR will terminate the
422 connection.  Use of this option requires a non-zero value for the
423 \fIlcp-echo-interval\fR parameter.  This option can be used to enable
424 \fIpppd\fR to terminate after the physical connection has been broken
425 (e.g., the modem has hung up) in situations where no hardware modem
426 control lines are available.
427 .TP
428 .B lcp-echo-interval \fI<n>
429 If this option is given, \fIpppd\fR will send an LCP echo-request
430 frame to the peer every \fIn\fR seconds.  Under Linux, the
431 echo-request is sent when no packets have been received from the peer
432 for \fIn\fR seconds.  Normally the peer should respond to the
433 echo-request by sending an echo-reply.  This option can be used with
434 the \fIlcp-echo-failure\fR option to detect that the peer is no longer
435 connected.
436 .TP
437 .B lcp-max-configure \fI<n>
438 Set the maximum number of LCP configure-request transmissions to <n>
439 (default 10).
440 .TP
441 .B lcp-max-failure \fI<n>
442 Set the maximum number of LCP configure-NAKs returned before starting
443 to send configure-Rejects instead to <n> (default 10).
444 .TP
445 .B lcp-max-terminate \fI<n>
446 Set the maximum number of LCP terminate-request transmissions to <n>
447 (default 3).
448 .TP
449 .B lcp-restart \fI<n>
450 Set the LCP restart interval (retransmission timeout) to <n> seconds
451 (default 3).
452 .TP
453 .B local
454 Don't use the modem control lines.  With this option,
455 .B pppd
456 will ignore the state of the CD (Carrier Detect) signal from the modem and
457 will not change the state of the DTR (Data Terminal Ready) signal.
458 .TP
459 .B login
460 Use the system password database for authenticating the peer using
461 PAP, and record the user in the system wtmp file.
462 .TP
463 .B modem
464 Use the modem control lines.  This option is the default.  With this
465 option,
466 .B pppd
467 will wait for the CD (Carrier Detect) signal from the modem to be asserted
468 when opening the serial device
469 (unless a connect script is specified), and it will drop the DTR (Data
470 Terminal Ready) signal briefly when the connection is terminated and before
471 executing the connect script.
472 On Ultrix, this option implies hardware
473 flow control, as for the \fBcrtscts\fR option.  
474 .TP
475 .B -mn
476 Disable magic number negotiation.  With this option,
477 .I pppd
478 cannot detect a looped-back line.
479 .TP
480 .B -mru
481 Disable MRU [Maximum Receive Unit] negotiation.  With this option,
482 \fIpppd\fR will use the default MRU value of 1500 bytes.
483 .TP
484 .B name \fI<n>
485 Set the name of the local system for authentication purposes to <n>.
486 .TP
487 .B noipdefault
488 Disables the default behaviour when no local IP address is specified,
489 which is to determine (if possible) the local IP address from the
490 hostname.  With this option, the peer will have to supply the local IP
491 address during IPCP negotiation (unless it specified explicitly on the
492 command line or in an options file).
493 .TP
494 .B -p
495 Same as the
496 .B passive
497 option.
498 .TP
499 .B +pap
500 Require the peer to authenticate itself using PAP.
501 .TP
502 .B -pap
503 Don't agree to authenticate using PAP.
504 .TP
505 .B papcrypt
506 Indicates that all secrets in the /etc/ppp/pap-secrets file which
507 are used for checking the identity of the peer are encrypted, and thus
508 pppd should not accept a password which (before encryption) is
509 identical to the secret from the /etc/ppp/pap-secrets file.
510 .TP
511 .B pap-max-authreq \fI<n>
512 Set the maximum number of PAP authenticate-request transmissions to
513 <n> (default 10).
514 .TP
515 .B pap-restart \fI<n>
516 Set the PAP restart interval (retransmission timeout) to <n> seconds
517 (default 3).
518 .TP
519 .B pap-timeout \fI<n>
520 Set the maximum time that
521 .I pppd
522 will wait for the peer to authenticate itself with PAP to
523 <n> seconds (0 means no limit).
524 .TP
525 .B -pc
526 Disable protocol field compression negotiation (use default, i.e.
527 protocol field compression disabled).
528 .TP
529 .B persist
530 Do not exit after a connection is terminated; instead try to reopen
531 the connection.
532 .TP
533 .B predictor1
534 Attempt to request that the peer send frames which
535 have been compressed using Predictor-1 compression.  This option will
536 be ignored unless Predictor-1 code has been loaded into the kernel.
537 .TP
538 .B -predictor1
539 Do not accept or agree to Predictor-1 comprssion.
540 .TP
541 .B proxyarp
542 Add an entry to this system's ARP [Address Resolution Protocol] table
543 with the IP address of the peer and the Ethernet address of this
544 system.
545 .TP
546 .B \-proxyarp
547 Disable the \fBproxyarp\fR option.  The system administrator who
548 wishes to prevent users from creating proxy ARP entries with
549 \fIpppd\fR can do so by placing this option in the /etc/ppp/options
550 file.
551 .TP
552 .B remotename \fI<n>
553 Set the assumed name of the remote system for authentication purposes
554 to <n>.
555 .TP
556 .B +ua \fI<p>
557 Agree to authenticate using PAP [Password Authentication Protocol] if
558 requested by the peer, and
559 use the data in file <p> for the user and password to send to the
560 peer. The file contains the remote user name, followed by a newline,
561 followed by the remote password, followed by a newline.  This option
562 is obsolescent.
563 .TP
564 .B usehostname
565 Enforce the use of the hostname as the name of the local system for
566 authentication purposes (overrides the
567 .B name
568 option).
569 .TP
570 .B user \fI<u>
571 Set the user name to use for authenticating this machine with the peer
572 using PAP to <u>.
573 .TP
574 .B -vj
575 Disable negotiation of Van Jacobson style TCP/IP header compression (use
576 default, i.e. no compression).
577 .TP
578 .B -vjccomp
579 Disable the connection-ID compression option in Van Jacobson style
580 TCP/IP header compression.  With this option, \fIpppd\fR will not omit
581 the connection-ID byte from Van Jacobson compressed TCP/IP headers,
582 nor ask the peer to do so.
583 .TP
584 .B vj-max-slots \fIn
585 Sets the number of connection slots to be used by the Van Jacobson
586 TCP/IP header compression and decompression code to \fIn\fR, which
587 must be between 2 and 16 (inclusive).
588 .TP
589 .B xonxoff
590 Use software flow control (i.e. XON/XOFF) to control the flow of data on
591 the serial port.  This option is only implemented on Linux systems
592 at present.
593 .SH OPTIONS FILES
594 Options can be taken from files as well as the command line.  
595 .I pppd
596 reads options from the files /etc/ppp/options and ~/.ppprc before
597 looking at the command line.  An options file is parsed into a series
598 of words, delimited by whitespace.  Whitespace can be included in a
599 word by enclosing the word in quotes (").  A backslash (\\) quotes the
600 following character.  A hash (#) starts a comment, which continues
601 until the end of the line.
602 .SH AUTHENTICATION
603 .I pppd
604 provides system administrators with sufficient access control that PPP
605 access to a server machine can be provided to legitimate users without
606 fear of compromising the security of the server or the network it's
607 on.  In part this is provided by the /etc/ppp/options file, where the
608 administrator can place options to require authentication whenever
609 .I pppd
610 is run, and in part by the PAP and CHAP secrets files, where the
611 administrator can restrict the set of IP addresses which individual
612 users may use.
613 .LP
614 The default behaviour of
615 .I pppd
616 is to agree to authenticate if requested, and to not
617 require authentication from the peer.  However, 
618 .I pppd
619 will not agree to
620 authenticate itself with a particular protocol if it has no secrets
621 which could be used to do so.
622 .LP
623 Authentication is based on secrets, which are selected from secrets
624 files (/etc/ppp/pap-secrets for PAP, /etc/ppp/chap-secrets for CHAP).
625 Both secrets files have the same format, and both can store secrets
626 for several combinations of server (authenticating peer) and client
627 (peer being authenticated).  Note that
628 .I pppd
629 can be both a server
630 and client, and that different protocols can be used in the two
631 directions if desired.
632 .LP
633 A secrets file is parsed into words as for a options file.  A secret
634 is specified by a line containing at least 3 words, in the order
635 client name, server name, secret.  Any following words on the same line are
636 taken to be a list of acceptable IP addresses for that client.  If
637 there are only 3 words on the line, it is assumed that any IP address
638 is OK; to disallow all IP addresses, use "-".  If the secret starts
639 with an `@', what follows is assumed to be the name of a file from
640 which to read the secret.  A "*" as the client or server name matches
641 any name.  When selecting a secret, \fIpppd\fR takes the best match, i.e.
642 the match with the fewest wildcards.
643 .LP
644 Thus a secrets file contains both secrets for use in authenticating
645 other hosts, plus secrets which we use for authenticating ourselves to
646 others.  Which secret to use is chosen based on the names of the host
647 (the `local name') and its peer (the `remote name').  The local name
648 is set as follows:
649 .TP 3
650 if the \fBusehostname\fR option is given,
651 then the local name is the hostname of this machine
652 (with the domain appended, if given)
653 .TP 3
654 else if the \fBname\fR option is given,
655 then use the argument of the first \fBname\fR option seen
656 .TP 3
657 else if the local IP address is specified with a hostname,
658 then use that name
659 .TP 3
660 else use the hostname of this machine (with the domain appended, if given)
661 .LP
662 When authenticating ourselves using PAP, there is also a `username'
663 which is the local name by default, but can be set with the \fBuser\fR
664 option or the \fB+ua\fR option.
665 .LP
666 The remote name is set as follows:
667 .TP 3
668 if the \fBremotename\fR option is given,
669 then use the argument of the last \fBremotename\fR option seen
670 .TP 3
671 else if the remote IP address is specified with a hostname,
672 then use that host name
673 .TP 3
674 else the remote name is the null string "".
675 .LP
676 Secrets are selected from the PAP secrets file as follows:
677 .TP 2
678 *
679 For authenticating the peer, look for a secret with client ==
680 username specified in the PAP authenticate-request, and server ==
681 local name.
682 .TP 2
683 *
684 For authenticating ourselves to the peer, look for a secret with
685 client == our username, server == remote name.
686 .LP
687 When authenticating the peer with PAP, a secret of "" matches any
688 password supplied by the peer.  If the password doesn't match the
689 secret, the password is encrypted using crypt() and checked against
690 the secret again; thus secrets for authenticating the peer can be
691 stored in encrypted form.  If the \fBpapcrypt\fR option is given, the
692 first (unencrypted) comparison is omitted, for better security.
693 .LP
694 If the \fBlogin\fR option was specified, the
695 username and password are also checked against the system password
696 database.  Thus, the system administrator can set up the pap-secrets
697 file to allow PPP access only to certain users, and to restrict the
698 set of IP addresses that each user can use.  Typically, when using the
699 \fBlogin\fR option, the secret in /etc/ppp/pap-secrets would be "", to
700 avoid the need to have the same secret in two places.
701 .LP
702 Secrets are selected from the CHAP secrets file as follows:
703 .TP 2
704 *
705 For authenticating the peer, look for a secret with client == name
706 specified in the CHAP-Response message, and server == local name.
707 .TP 2
708 *
709 For authenticating ourselves to the peer, look for a secret with
710 client == local name, and server == name specified in the
711 CHAP-Challenge message.
712 .LP
713 Authentication must be satisfactorily completed before IPCP (or any
714 other Network Control Protocol) can be started.  If authentication
715 fails, \fIpppd\fR will terminated the link (by closing LCP).  If IPCP
716 negotiates an unacceptable IP address for the remote host, IPCP will
717 be closed.  IP packets can only be sent or received when IPCP is open.
718 .LP
719 In some cases it is desirable to allow some hosts which can't
720 authenticate themselves to connect and use one of a restricted set of
721 IP addresses, even when the local host generally requires
722 authentication.  If the peer refuses to authenticate itself when
723 requested, \fIpppd\fR takes that as equivalent to authenticating with
724 PAP using the empty string for the username and password.  Thus, by
725 adding a line to the pap-secrets file which specifies the empty string
726 for the client and password, it is possible to allow restricted access
727 to hosts which refuse to authenticate themselves.
728 .SH ROUTING
729 .LP
730 When IPCP negotiation is completed successfully,
731 .I pppd
732 will inform the kernel of the local and remote IP addresses for the
733 ppp interface.  This is sufficient to create a
734 host route to the remote end of the link, which will enable the peers
735 to exchange IP packets.  Communication with other machines generally
736 requires further modification to routing tables and/or ARP (Address
737 Resolution Protocol) tables.  In some cases this will be done
738 automatically through the actions of the \fIrouted\fR or \fIgated\fR
739 daemons, but in most cases some further intervention is required.
740 .LP
741 Sometimes it is desirable
742 to add a default route through the remote host, as in the case of a
743 machine whose only connection to the Internet is through the ppp
744 interface.  The \fBdefaultroute\fR option causes \fIpppd\fR to create such a
745 default route when IPCP comes up, and delete it when the link is
746 terminated.
747 .LP
748 In some cases it is desirable to use proxy ARP, for example on a
749 server machine connected to a LAN, in order to allow other hosts to
750 communicate with the remote host.  The \fBproxyarp\fR option causes \fIpppd\fR
751 to look for a network interface on the same subnet as the remote host
752 (an interface supporting broadcast and ARP, which is up and not a
753 point-to-point or loopback interface).  If found, \fIpppd\fR creates a
754 permanent, published ARP entry with the IP address of the remote host
755 and the hardware address of the network interface found.
756 .SH EXAMPLES
757 .LP
758 In the simplest case, you can connect the serial ports of two machines
759 and issue a command like
760 .IP
761 pppd /dev/ttya 9600 passive
762 .LP
763 to each machine, assuming there is no \fIgetty\fR running on the
764 serial ports.  If one machine has a \fIgetty\fR running, you can use
765 \fIkermit\fR or \fItip\fR on the other machine to log in to the first
766 machine and issue a command like
767 .IP
768 pppd passive
769 .LP
770 Then exit from the communications program (making sure the connection
771 isn't dropped), and issue a command like
772 .IP
773 pppd /dev/ttya 9600
774 .LP
775 The process of logging in to the other machine and starting \fIpppd\fR
776 can be automated by using the \fBconnect\fR option to run \fIchat\fR,
777 for example:
778 .IP
779 pppd /dev/ttya 38400 connect 'chat "" "" "login:" "username"
780 "Password:" "password" "% " "exec pppd passive"'
781 .LP
782 (Note however that running chat like this will leave the password
783 visible in the parameter list of pppd and chat.)
784 .LP
785 If your serial connection is any more complicated than a piece of
786 wire, you may need to arrange for some control characters to be
787 escaped.  In particular, it is often useful to escape XON (^Q) and
788 XOFF (^S), using \fBasyncmap a0000\fR.  If the path includes a telnet,
789 you probably should escape ^] as well (\fBasyncmap 200a0000\fR).
790 If the path includes an rlogin, you will need to use the \fBescape
791 ff\fR option on the end which is running the rlogin client, since many
792 rlogin implementations are not
793 transparent; they will remove the sequence [0xff, 0xff, 0x73, 0x73,
794 followed by any 8 bytes] from the stream.
795 .SH DIAGNOSTICS
796 .LP
797 Messages are sent to the syslog daemon using facility LOG_DAEMON.
798 (This can be overriden by recompiling \fIpppd\fR with the macro
799 LOG_PPP defined as the desired facility.)  In order to see the error
800 and debug messages, you will need to edit your /etc/syslog.conf file
801 to direct the messages to the desired output device or file.
802 .LP
803 The \fBdebug\fR option causes the contents of all control packets sent
804 or received to be logged, that is, all LCP, PAP, CHAP or IPCP packets.
805 This can be useful if the PPP negotiation does not succeed.
806 If debugging is enabled at compile time, the \fBdebug\fR option also
807 causes other debugging messages to be logged.
808 .LP
809 Debugging can also be enabled or disabled by sending a
810 SIGUSR1 to the
811 .I pppd
812 process.  This signal acts as a toggle.
813 .SH FILES
814 .TP
815 .B /var/run/ppp\fIn\fB.pid \fR(BSD or Linux), \fB/etc/ppp/ppp\fIn\fB.pid \fR(others)
816 Process-ID for \fIpppd\fR process on ppp interface unit \fIn\fR.
817 .TP
818 .B /etc/ppp/ip-up
819 A program or script which is executed when the link is available for
820 sending and receiving IP packets (that is, IPCP has come up).  It is
821 executed with the parameters
822 .IP
823 \fIinterface-name tty-device speed local-IP-address
824 remote-IP-address\fR
825 .IP
826 and with its standard input,
827 output and error streams redirected to \fB/dev/null\fR.
828 .IP
829 This program or script is executed with the same real and effective
830 user-ID as \fIpppd\fR, that is, at least the effective user-ID and
831 possibly the real user-ID will be \fBroot\fR.  This is so that it can
832 be used to manipulate routes, run privileged daemons (e.g.
833 \fBsendmail\fR), etc.  Be careful that the contents of the
834 /etc/ppp/ip-up and /etc/ppp/ip-down scripts do not compromise your
835 system's security.
836 .TP
837 .B /etc/ppp/ip-down
838 A program or script which is executed when the link is no longer
839 available for sending and receiving IP packets.  This script can be
840 used for undoing the effects of the /etc/ppp/ip-up script.  It is
841 invoked with the same parameters as the ip-up script, and the same
842 security considerations apply, since it is executed with the same
843 effective and real user-IDs as \fIpppd\fR.
844 .TP
845 .B /etc/ppp/ipx-up
846 A program or script which is executed when the link is available for
847 sending and receiving IPX packets (that is, IPXCP has come up).  It is
848 executed with the parameters
849 .IP
850 \fIinterface-name tty-device speed network-number local-IPX-node-address
851 remote-IPX-node-address local-IPX-routing-protocol remote-IPX-routing-protocol
852 local-IPX-router-name remote-IPX-router-name ipparam pppd-pid\fR 
853 .IP
854 and with its standard input,
855 output and error streams redirected to \fB/dev/null\fR.
856 .br
857 .IP
858 The local-IPX-routing-protocol and remote-IPX-routing-protocol field
859 may be one of the following:
860 .IP
861 NONE      to indicate that there is no routing protocol
862 .br
863 RIP       to indicate that RIP/SAP should be used
864 .br
865 NLSP      to indicate that Novell NLSP should be used
866 .br
867 RIP NLSP  to indicate that both RIP/SAP and NLSP should be used
868 .br
869 .IP
870 This program or script is executed with the same real and effective
871 user-ID as \fIpppd\fR, that is, at least the effective user-ID and
872 possibly the real user-ID will be \fBroot\fR.  This is so that it can
873 be used to manipulate routes, run privileged daemons (e.g.
874 \fBripd\fR), etc.  Be careful that the contents of the
875 /etc/ppp/ipx-up and /etc/ppp/ipx-down scripts do not compromise your
876 system's security.
877 .TP
878 .B /etc/ppp/ipx-down
879 A program or script which is executed when the link is no longer
880 available for sending and receiving IPX packets.  This script can be
881 used for undoing the effects of the /etc/ppp/ipx-up script.  It is
882 invoked with the same parameters as the ipx-up script, and the same
883 security considerations apply, since it is executed with the same
884 effective and real user-IDs as \fIpppd\fR.
885 .TP
886 .B /etc/ppp/pap-secrets
887 Usernames, passwords and IP addresses for PAP authentication.
888 .TP
889 .B /etc/ppp/chap-secrets
890 Names, secrets and IP addresses for CHAP authentication.
891 .TP
892 .B /etc/ppp/options
893 System default options for
894 .I pppd,
895 read before user default options or command-line options.
896 .TP
897 .B ~/.ppprc
898 User default options, read before command-line options.
899 .TP
900 .B /etc/ppp/options.\fIttyname
901 System default options for the serial port being used, read after
902 command-line options.  In forming the \fIttyname\fR part of this
903 filename, an initial /dev/ is stripped from the port name (if
904 present), and any slashes in the remaining part are converted to
905 dots.
906 .SH SEE ALSO
907 .TP
908 .B RFC1144
909 Jacobson, V.
910 .I Compressing TCP/IP headers for low-speed serial links.
911 February 1990.
912 .TP
913 .B RFC1321
914 Rivest, R.
915 .I The MD5 Message-Digest Algorithm.
916 April 1992.
917 .TP
918 .B RFC1332
919 McGregor, G.
920 .I PPP Internet Protocol Control Protocol (IPCP).
921 May 1992.
922 .TP
923 .B RFC1334
924 Lloyd, B.; Simpson, W.A.
925 .I PPP authentication protocols.
926 October 1992.
927 .TP
928 .B RFC1661
929 Simpson, W.A.
930 .I The Point\-to\-Point Protocol (PPP).
931 July 1994.
932 .TP
933 .B RFC1662
934 Simpson, W.A.
935 .I PPP in HDLC-like Framing.
936 July 1994.
937 .SH NOTES
938 The following signals have the specified effect when sent to the
939 .I pppd
940 process.
941 .TP
942 .B SIGINT, SIGTERM
943 These signals cause \fBpppd\fR to terminate the link (by closing LCP),
944 restore the serial device settings, and exit.
945 .TP
946 .B SIGHUP
947 This signal causes \fBpppd\fR to terminate the link, restore the
948 serial device settings, and close the serial device.  If the
949 \fBpersist\fR option has been specified, \fBpppd\fR will try to reopen
950 the serial device and start another connection.  Otherwise \fBpppd\fR
951 will exit.
952 .TP
953 .B SIGUSR2
954 This signal causes
955 .B pppd
956 to renegotiate compression.  This can be useful to re-enable
957 compression after it has been disabled as a result of a fatal
958 decompression error.  With the BSD Compress scheme, fatal
959 decompression errors generally indicate a bug in one or other
960 implementation.
961
962 .SH AUTHORS
963 Paul Mackerras (paulus@cs.anu.edu.au), based on earlier work by
964 Drew Perkins,
965 Brad Clements,
966 Karl Fox,
967 Greg Christy,
968 and
969 Brad Parker.