]> git.ozlabs.org Git - ppp.git/blob - pppd/pppd.8
Patch from Frank Cusack to add support for MSCHAPv2.
[ppp.git] / pppd / pppd.8
1 .\" manual page [] for pppd 2.4
2 .\" $Id: pppd.8,v 1.61 2002/03/05 15:14:04 dfs 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 Pppd provides the basic LCP, authentication support, and an NCP for
31 establishing and configuring the Internet Protocol (IP) (called the IP
32 Control Protocol, IPCP).
33 .SH FREQUENTLY USED OPTIONS
34 .TP
35 .I <tty_name>
36 Communicate over the named device.  The string "/dev/" is prepended if
37 necessary.  If no device name is given, or if the name of the terminal
38 connected to the standard input is given, pppd will use that terminal,
39 and will not fork to put itself in the background.  A value for this
40 option from a privileged source cannot be overridden by a
41 non-privileged user.
42 .TP
43 .I <speed>
44 Set the baud rate to <speed> (a decimal number).  On systems such as
45 4.4BSD and NetBSD, any speed can be specified.  Other systems
46 (e.g. SunOS) allow only a limited set of speeds.
47 .TP
48 .B asyncmap \fI<map>
49 Set the async character map to <map>.  This map describes which
50 control characters cannot be successfully received over the serial
51 line.  Pppd will ask the peer to send these characters as a 2-byte
52 escape sequence.  The argument is a 32 bit hex number with each bit
53 representing a character to escape.  Bit 0 (00000001) represents the
54 character 0x00; bit 31 (80000000) represents the character 0x1f or ^_.
55 If multiple \fIasyncmap\fR options are given, the values are ORed
56 together.  If no \fIasyncmap\fR option is given, no async character
57 map will be negotiated for the receive direction; the peer should then
58 escape \fIall\fR control characters.  To escape transmitted
59 characters, use the \fIescape\fR option.
60 .TP
61 .B auth
62 Require the peer to authenticate itself before allowing network
63 packets to be sent or received.  This option is the default if the
64 system has a default route.  If neither this option nor the
65 \fInoauth\fR option is specified, pppd will only allow the peer to use
66 IP addresses to which the system does not already have a route.
67 .TP
68 .B call \fIname
69 Read options from the file /etc/ppp/peers/\fIname\fR.  This file may
70 contain privileged options, such as \fInoauth\fR, even if pppd
71 is not being run by root.  The \fIname\fR string may not begin with /
72 or include .. as a pathname component.  The format of the options file
73 is described below.
74 .TP
75 .B connect \fIscript
76 Use the executable or shell command specified by \fIscript\fR to set
77 up the serial line.  This script would typically use the chat(8)
78 program to dial the modem and start the remote ppp session.  A value
79 for this option from a privileged source cannot be overridden by a
80 non-privileged user.
81 .TP
82 .B crtscts
83 Use hardware flow control (i.e. RTS/CTS) to control the flow of
84 data on the serial port.  If neither the \fIcrtscts\fR, the
85 \fInocrtscts\fR, the \fIcdtrcts\fR nor the \fInocdtrcts\fR option
86 is given, the hardware flow control setting for the serial port is
87 left unchanged.
88 Some serial ports (such as Macintosh serial ports) lack a true
89 RTS output. Such serial ports use this mode to implement
90 unidirectional flow control. The serial port will
91 suspend transmission when requested by the modem (via CTS)
92 but will be unable to request the modem stop sending to the
93 computer. This mode retains the ability to use DTR as
94 a modem control line.
95 .TP
96 .B defaultroute
97 Add a default route to the system routing tables, using the peer as
98 the gateway, when IPCP negotiation is successfully completed.
99 This entry is removed when the PPP connection is broken.  This option
100 is privileged if the \fInodefaultroute\fR option has been specified.
101 .TP
102 .B disconnect \fIscript
103 Run the executable or shell command specified by \fIscript\fR after
104 pppd has terminated the link.  This script could, for example, issue
105 commands to the modem to cause it to hang up if hardware modem control
106 signals were not available.  The disconnect script is not run if the
107 modem has already hung up.  A value for this option from a privileged
108 source cannot be overridden by a non-privileged user.
109 .TP
110 .B escape \fIxx,yy,...
111 Specifies that certain characters should be escaped on transmission
112 (regardless of whether the peer requests them to be escaped with its
113 async control character map).  The characters to be escaped are
114 specified as a list of hex numbers separated by commas.  Note that
115 almost any character can be specified for the \fIescape\fR option,
116 unlike the \fIasyncmap\fR option which only allows control characters
117 to be specified.  The characters which may not be escaped are those
118 with hex values 0x20 - 0x3f or 0x5e.
119 .TP
120 .B file \fIname
121 Read options from file \fIname\fR (the format is described below).
122 The file must be readable by the user who has invoked pppd.
123 .TP
124 .B init \fIscript
125 Run the executable or shell command specified by \fIscript\fR to
126 initialize the serial line.  This script would typically use the
127 chat(8) program to configure the modem to enable auto answer.  A value
128 for this option from a privileged source cannot be overridden by a
129 non-privileged user.
130 .TP
131 .B lock
132 Specifies that pppd should create a UUCP-style lock file for the
133 serial device to ensure exclusive access to the device.
134 .TP
135 .B mru \fIn
136 Set the MRU [Maximum Receive Unit] value to \fIn\fR. Pppd
137 will ask the peer to send packets of no more than \fIn\fR bytes.  The
138 minimum MRU value is 128.  The default MRU value is 1500.  A value of
139 296 is recommended for slow links (40 bytes for TCP/IP header + 256
140 bytes of data).  (Note that for IPv6 MRU must be at least 1280)
141 .TP
142 .B mtu \fIn
143 Set the MTU [Maximum Transmit Unit] value to \fIn\fR.  Unless the
144 peer requests a smaller value via MRU negotiation, pppd will
145 request that the kernel networking code send data packets of no more
146 than \fIn\fR bytes through the PPP network interface.  (Note that for 
147 IPv6 MTU must be at least 1280)
148 .TP
149 .B passive
150 Enables the "passive" option in the LCP.  With this option, pppd will
151 attempt to initiate a connection; if no reply is received from the
152 peer, pppd will then just wait passively for a valid LCP packet from
153 the peer, instead of exiting, as it would without this option.
154 .SH OPTIONS
155 .TP
156 .I <local_IP_address>\fB:\fI<remote_IP_address>
157 Set the local and/or remote interface IP addresses.  Either one may be
158 omitted.  The IP addresses can be specified with a host name or in
159 decimal dot notation (e.g. 150.234.56.78).  The default local
160 address is the (first) IP address of the system (unless the
161 \fInoipdefault\fR
162 option is given).  The remote address will be obtained from the peer
163 if not specified in any option.  Thus, in simple cases, this option is
164 not required.  If a local and/or remote IP address is specified with
165 this option, pppd
166 will not accept a different value from the peer in the IPCP
167 negotiation, unless the \fIipcp-accept-local\fR and/or
168 \fIipcp-accept-remote\fR options are given, respectively.
169 .TP
170 .B ipv6 \fI<local_interface_identifier>\fR,\fI<remote_interface_identifier>
171 Set the local and/or remote 64-bit interface identifier. Either one may be
172 omitted. The identifier must be specified in standard ascii notation of
173 IPv6 addresses (e.g. ::dead:beef). If the
174 \fIipv6cp-use-ipaddr\fR
175 option is given, the local identifier is the local IPv4 address (see above).
176 On systems which supports a unique persistent id, such as EUI-48 derived
177 from the Ethernet MAC address, \fIipv6cp-use-persistent\fR option can be
178 used to replace the \fIipv6 <local>,<remote>\fR option. Otherwise the 
179 identifier is randomized.
180 .TP
181 .B active-filter \fIfilter-expression
182 Specifies a packet filter to be applied to data packets to determine
183 which packets are to be regarded as link activity, and therefore reset
184 the idle timer, or cause the link to be brought up in demand-dialling
185 mode.  This option is useful in conjunction with the
186 \fBidle\fR option if there are packets being sent or received
187 regularly over the link (for example, routing information packets)
188 which would otherwise prevent the link from ever appearing to be idle.
189 The \fIfilter-expression\fR syntax is as described for tcpdump(1),
190 except that qualifiers which are inappropriate for a PPP link, such as
191 \fBether\fR and \fBarp\fR, are not permitted.  Generally the filter
192 expression should be enclosed in single-quotes to prevent whitespace
193 in the expression from being interpreted by the shell. This option
194 is currently only available under NetBSD, and then only
195 if both the kernel and pppd were compiled with PPP_FILTER defined.
196 .TP
197 .B allow-ip \fIaddress(es)
198 Allow peers to use the given IP address or subnet without
199 authenticating themselves.  The parameter is parsed as for each
200 element of the list of allowed IP addresses in the secrets files (see
201 the AUTHENTICATION section below).
202 .TP
203 .B bsdcomp \fInr,nt
204 Request that the peer compress packets that it sends, using the
205 BSD-Compress scheme, with a maximum code size of \fInr\fR bits, and
206 agree to compress packets sent to the peer with a maximum code size of
207 \fInt\fR bits.  If \fInt\fR is not specified, it defaults to the value
208 given for \fInr\fR.  Values in the range 9 to 15 may be used for
209 \fInr\fR and \fInt\fR; larger values give better compression but
210 consume more kernel memory for compression dictionaries.
211 Alternatively, a value of 0 for \fInr\fR or \fInt\fR disables
212 compression in the corresponding direction.  Use \fInobsdcomp\fR or
213 \fIbsdcomp 0\fR to disable BSD-Compress compression entirely.
214 .TP
215 .B cdtrcts
216 Use a non-standard hardware flow control (i.e. DTR/CTS) to control
217 the flow of data on the serial port.  If neither the \fIcrtscts\fR,
218 the \fInocrtscts\fR, the \fIcdtrcts\fR nor the \fInocdtrcts\fR
219 option is given, the hardware flow control setting for the serial
220 port is left unchanged.
221 Some serial ports (such as Macintosh serial ports) lack a true
222 RTS output. Such serial ports use this mode to implement true
223 bi-directional flow control. The sacrifice is that this flow
224 control mode does not permit using DTR as a modem control line.
225 .TP
226 .B chap-interval \fIn
227 If this option is given, pppd will rechallenge the peer every \fIn\fR
228 seconds.
229 .TP
230 .B chap-max-challenge \fIn
231 Set the maximum number of CHAP challenge transmissions to \fIn\fR
232 (default 10).
233 .TP
234 .B chap-restart \fIn
235 Set the CHAP restart interval (retransmission timeout for challenges)
236 to \fIn\fR seconds (default 3).
237 .TP
238 .B connect-delay \fIn
239 Wait for up \fIn\fR milliseconds after the connect script finishes for
240 a valid PPP packet from the peer.  At the end of this time, or when a
241 valid PPP packet is received from the peer, pppd will commence
242 negotiation by sending its first LCP packet.  The default value is
243 1000 (1 second).  This wait period only applies if the \fBconnect\fR
244 or \fBpty\fR option is used.
245 .TP
246 .B debug
247 Enables connection debugging facilities.
248 If this option is given, pppd will log the contents of all
249 control packets sent or received in a readable form.  The packets are
250 logged through syslog with facility \fIdaemon\fR and level
251 \fIdebug\fR.  This information can be directed to a file by setting up
252 /etc/syslog.conf appropriately (see syslog.conf(5)).
253 .TP
254 .B default-asyncmap
255 Disable asyncmap negotiation, forcing all control characters to be
256 escaped for both the transmit and the receive direction.
257 .TP
258 .B default-mru
259 Disable MRU [Maximum Receive Unit] negotiation.  With this option,
260 pppd will use the default MRU value of 1500 bytes for both the
261 transmit and receive direction.
262 .TP
263 .B deflate \fInr,nt
264 Request that the peer compress packets that it sends, using the
265 Deflate scheme, with a maximum window size of \fI2**nr\fR bytes, and
266 agree to compress packets sent to the peer with a maximum window size
267 of \fI2**nt\fR bytes.  If \fInt\fR is not specified, it defaults to
268 the value given for \fInr\fR.  Values in the range 9 to 15 may be used
269 for \fInr\fR and \fInt\fR; larger values give better compression but
270 consume more kernel memory for compression dictionaries.
271 Alternatively, a value of 0 for \fInr\fR or \fInt\fR disables
272 compression in the corresponding direction.  Use \fInodeflate\fR or
273 \fIdeflate 0\fR to disable Deflate compression entirely.  (Note: pppd
274 requests Deflate compression in preference to BSD-Compress if the peer
275 can do either.)
276 .TP
277 .B demand
278 Initiate the link only on demand, i.e. when data traffic is present.
279 With this option, the remote IP address must be specified by the user
280 on the command line or in an options file.  Pppd will initially
281 configure the interface and enable it for IP traffic without
282 connecting to the peer.  When traffic is available, pppd will
283 connect to the peer and perform negotiation, authentication, etc.
284 When this is completed, pppd will commence passing data packets
285 (i.e., IP packets) across the link.
286
287 The \fIdemand\fR option implies the \fIpersist\fR option.  If this
288 behaviour is not desired, use the \fInopersist\fR option after the
289 \fIdemand\fR option.  The \fIidle\fR and \fIholdoff\fR
290 options are also useful in conjuction with the \fIdemand\fR option.
291 .TP
292 .B domain \fId
293 Append the domain name \fId\fR to the local host name for authentication
294 purposes.  For example, if gethostname() returns the name porsche, but
295 the fully qualified domain name is porsche.Quotron.COM, you could
296 specify \fIdomain Quotron.COM\fR.  Pppd would then use the name
297 \fIporsche.Quotron.COM\fR for looking up secrets in the secrets file,
298 and as the default name to send to the peer when authenticating itself
299 to the peer.  This option is privileged.
300 .TP
301 .B dryrun
302 With the \fBdryrun\fR option, pppd will print out all the option
303 values which have been set and then exit, after parsing the command
304 line and options files and checking the option values, but before
305 initiating the link.  The option values are logged at level info, and
306 also printed to standard output unless the device on standard output
307 is the device that pppd would be using to communicate with the peer.
308 .TP
309 .B dump
310 With the \fBdump\fR option, pppd will print out all the option values
311 which have been set.  This option is like the \fBdryrun\fR option
312 except that pppd proceeds as normal rather than exiting.
313 .TP
314 .B endpoint \fI<epdisc>
315 Sets the endpoint discriminator sent by the local machine to the peer
316 during multilink negotiation to \fI<epdisc>\fR.  The default is to use
317 the MAC address of the first ethernet interface on the system, if any,
318 otherwise the IPv4 address corresponding to the hostname, if any,
319 provided it is not in the multicast or locally-assigned IP address
320 ranges, or the localhost address.  The endpoint discriminator can be
321 the string \fBnull\fR or of the form \fItype\fR:\fIvalue\fR, where
322 type is a decimal number or one of the strings \fBlocal\fR, \fBIP\fR,
323 \fBMAC\fR, \fBmagic\fR, or \fBphone\fR.  The value is an IP address in
324 dotted-decimal notation for the \fBIP\fR type, or a string of bytes in
325 hexadecimal, separated by periods or colons for the other types.  For
326 the MAC type, the value may also be the name of an ethernet or similar
327 network interface.  This option is currently only available under
328 Linux.
329 .TP
330 .B hide-password
331 When logging the contents of PAP packets, this option causes pppd to
332 exclude the password string from the log.  This is the default.
333 .TP
334 .B holdoff \fIn
335 Specifies how many seconds to wait before re-initiating the link after
336 it terminates.  This option only has any effect if the \fIpersist\fR
337 or \fIdemand\fR option is used.  The holdoff period is not applied if
338 the link was terminated because it was idle.
339 .TP
340 .B idle \fIn
341 Specifies that pppd should disconnect if the link is idle for \fIn\fR
342 seconds.  The link is idle when no data packets (i.e. IP packets) are
343 being sent or received.  Note: it is not advisable to use this option
344 with the \fIpersist\fR option without the \fIdemand\fR option.
345 If the \fBactive-filter\fR
346 option is given, data packets which are rejected by the specified
347 activity filter also count as the link being idle.
348 .TP
349 .B ipcp-accept-local
350 With this option, pppd will accept the peer's idea of our local IP
351 address, even if the local IP address was specified in an option.
352 .TP
353 .B ipcp-accept-remote
354 With this option, pppd will accept the peer's idea of its (remote) IP
355 address, even if the remote IP address was specified in an option.
356 .TP
357 .B ipcp-max-configure \fIn
358 Set the maximum number of IPCP configure-request transmissions to
359 \fIn\fR (default 10).
360 .TP
361 .B ipcp-max-failure \fIn
362 Set the maximum number of IPCP configure-NAKs returned before starting
363 to send configure-Rejects instead to \fIn\fR (default 10).
364 .TP
365 .B ipcp-max-terminate \fIn
366 Set the maximum number of IPCP terminate-request transmissions to
367 \fIn\fR (default 3).
368 .TP
369 .B ipcp-restart \fIn
370 Set the IPCP restart interval (retransmission timeout) to \fIn\fR
371 seconds (default 3).
372 .TP
373 .B ipparam \fIstring
374 Provides an extra parameter to the ip-up and ip-down scripts.  If this
375 option is given, the \fIstring\fR supplied is given as the 6th
376 parameter to those scripts.
377 .TP
378 .B ipv6cp-max-configure \fIn
379 Set the maximum number of IPv6CP configure-request transmissions to
380 \fIn\fR (default 10).
381 .TP
382 .B ipv6cp-max-failure \fIn
383 Set the maximum number of IPv6CP configure-NAKs returned before starting
384 to send configure-Rejects instead to \fIn\fR (default 10).
385 .TP
386 .B ipv6cp-max-terminate \fIn
387 Set the maximum number of IPv6CP terminate-request transmissions to
388 \fIn\fR (default 3).
389 .TP
390 .B ipv6cp-restart \fIn
391 Set the IPv6CP restart interval (retransmission timeout) to \fIn\fR
392 seconds (default 3).
393 .TP
394 .B ipx
395 Enable the IPXCP and IPX protocols.  This option is presently only
396 supported under Linux, and only if your kernel has been configured to
397 include IPX support.
398 .TP
399 .B ipx-network \fIn
400 Set the IPX network number in the IPXCP configure request frame to
401 \fIn\fR, a hexadecimal number (without a leading 0x).  There is no
402 valid default.  If this option is not specified, the network number is
403 obtained from the peer.  If the peer does not have the network number,
404 the IPX protocol will not be started.
405 .TP
406 .B ipx-node \fIn\fB:\fIm
407 Set the IPX node numbers. The two node numbers are separated from each
408 other with a colon character. The first number \fIn\fR is the local
409 node number. The second number \fIm\fR is the peer's node number. Each
410 node number is a hexadecimal number, at most 10 digits long. The node
411 numbers on the ipx-network must be unique. There is no valid
412 default. If this option is not specified then the node numbers are
413 obtained from the peer.
414 .TP
415 .B ipx-router-name \fI<string>
416 Set the name of the router. This is a string and is sent to the peer
417 as information data.
418 .TP
419 .B ipx-routing \fIn
420 Set the routing protocol to be received by this option. More than one
421 instance of \fIipx-routing\fR may be specified. The '\fInone\fR'
422 option (0) may be specified as the only instance of ipx-routing. The
423 values may be \fI0\fR for \fINONE\fR, \fI2\fR for \fIRIP/SAP\fR, and
424 \fI4\fR for \fINLSP\fR.
425 .TP
426 .B ipxcp-accept-local
427 Accept the peer's NAK for the node number specified in the ipx-node
428 option. If a node number was specified, and non-zero, the default is
429 to insist that the value be used. If you include this option then you
430 will permit the peer to override the entry of the node number.
431 .TP
432 .B ipxcp-accept-network
433 Accept the peer's NAK for the network number specified in the
434 ipx-network option. If a network number was specified, and non-zero, the
435 default is to insist that the value be used. If you include this
436 option then you will permit the peer to override the entry of the node
437 number.
438 .TP
439 .B ipxcp-accept-remote
440 Use the peer's network number specified in the configure request
441 frame. If a node number was specified for the peer and this option was
442 not specified, the peer will be forced to use the value which you have
443 specified.
444 .TP
445 .B ipxcp-max-configure \fIn
446 Set the maximum number of IPXCP configure request frames which the
447 system will send to \fIn\fR. The default is 10.
448 .TP
449 .B ipxcp-max-failure \fIn
450 Set the maximum number of IPXCP NAK frames which the local system will
451 send before it rejects the options. The default value is 3.
452 .TP
453 .B ipxcp-max-terminate \fIn
454 Set the maximum nuber of IPXCP terminate request frames before the
455 local system considers that the peer is not listening to them. The
456 default value is 3.
457 .TP
458 .B kdebug \fIn
459 Enable debugging code in the kernel-level PPP driver.  The argument
460 values depend on the specific kernel driver, but in general a value of
461 1 will enable general kernel debug messages.  (Note that these
462 messages are usually only useful for debugging the kernel driver
463 itself.)  For the Linux 2.2.x kernel driver, the value is a sum of
464 bits: 1 to
465 enable general debug messages, 2 to request that the contents of
466 received packets be printed, and 4 to request that the contents of
467 transmitted packets be printed.  On most systems, messages printed by
468 the kernel are logged by syslog(1) to a file as directed in the
469 /etc/syslog.conf configuration file.
470 .TP
471 .B ktune
472 Enables pppd to alter kernel settings as appropriate.  Under Linux,
473 pppd will enable IP forwarding (i.e. set /proc/sys/net/ipv4/ip_forward
474 to 1) if the \fIproxyarp\fR option is used, and will enable the
475 dynamic IP address option (i.e. set /proc/sys/net/ipv4/ip_dynaddr to
476 1) in demand mode if the local address changes.
477 .TP
478 .B lcp-echo-failure \fIn
479 If this option is given, pppd will presume the peer to be dead
480 if \fIn\fR LCP echo-requests are sent without receiving a valid LCP
481 echo-reply.  If this happens, pppd will terminate the
482 connection.  Use of this option requires a non-zero value for the
483 \fIlcp-echo-interval\fR parameter.  This option can be used to enable
484 pppd to terminate after the physical connection has been broken
485 (e.g., the modem has hung up) in situations where no hardware modem
486 control lines are available.
487 .TP
488 .B lcp-echo-interval \fIn
489 If this option is given, pppd will send an LCP echo-request frame to
490 the peer every \fIn\fR seconds.  Normally the peer should respond to
491 the echo-request by sending an echo-reply.  This option can be used
492 with the \fIlcp-echo-failure\fR option to detect that the peer is no
493 longer connected.
494 .TP
495 .B lcp-max-configure \fIn
496 Set the maximum number of LCP configure-request transmissions to
497 \fIn\fR (default 10).
498 .TP
499 .B lcp-max-failure \fIn
500 Set the maximum number of LCP configure-NAKs returned before starting
501 to send configure-Rejects instead to \fIn\fR (default 10).
502 .TP
503 .B lcp-max-terminate \fIn
504 Set the maximum number of LCP terminate-request transmissions to
505 \fIn\fR (default 3).
506 .TP
507 .B lcp-restart \fIn
508 Set the LCP restart interval (retransmission timeout) to \fIn\fR
509 seconds (default 3).
510 .TP
511 .B linkname \fIname\fR
512 Sets the logical name of the link to \fIname\fR.  Pppd will create a
513 file named \fBppp-\fIname\fB.pid\fR in /var/run (or /etc/ppp on some
514 systems) containing its process ID.  This can be useful in determining
515 which instance of pppd is responsible for the link to a given peer
516 system.  This is a privileged option.
517 .TP
518 .B local
519 Don't use the modem control lines.  With this option, pppd will ignore
520 the state of the CD (Carrier Detect) signal from the modem and will
521 not change the state of the DTR (Data Terminal Ready) signal.
522 .TP
523 .B logfd \fIn
524 Send log messages to file descriptor \fIn\fR.  Pppd will send log
525 messages to at most one file or file descriptor (as well as sending
526 the log messages to syslog), so this option and the \fBlogfile\fR
527 option are mutually exclusive.  The default is for pppd to send log
528 messages to stdout (file descriptor 1), unless the serial port is
529 already open on stdout.
530 .TP
531 .B logfile \fIfilename
532 Append log messages to the file \fIfilename\fR (as well as sending the
533 log messages to syslog).  The file is opened with the privileges of
534 the user who invoked pppd, in append mode.
535 .TP
536 .B login
537 Use the system password database for authenticating the peer using
538 PAP, and record the user in the system wtmp file.  Note that the peer
539 must have an entry in the /etc/ppp/pap-secrets file as well as the
540 system password database to be allowed access.
541 .TP
542 .B maxconnect \fIn
543 Terminate the connection when it has been available for network
544 traffic for \fIn\fR seconds (i.e. \fIn\fR seconds after the first
545 network control protocol comes up).
546 .TP
547 .B maxfail \fIn
548 Terminate after \fIn\fR consecutive failed connection attempts.  A
549 value of 0 means no limit.  The default value is 10.
550 .TP
551 .B modem
552 Use the modem control lines.  This option is the default.  With this
553 option, pppd will wait for the CD (Carrier Detect) signal from the
554 modem to be asserted when opening the serial device (unless a connect
555 script is specified), and it will drop the DTR (Data Terminal Ready)
556 signal briefly when the connection is terminated and before executing
557 the connect script.  On Ultrix, this option implies hardware flow
558 control, as for the \fIcrtscts\fR option.
559 .TP
560 .B mp
561 Enables the use of PPP multilink; this is an alias for the `multilink'
562 option.  This option is currently only available under Linux.
563 .TP
564 .B mpshortseq
565 Enables the use of short (12-bit) sequence numbers in multilink
566 headers, as opposed to 24-bit sequence numbers.  This option is only
567 available under Linux, and only has any effect if multilink is
568 enabled (see the multilink option).
569 .TP
570 .B mrru \fIn
571 Sets the Maximum Reconstructed Receive Unit to \fIn\fR.  The MRRU is
572 the maximum size for a received packet on a multilink bundle, and is
573 analogous to the MRU for the individual links.  This option is
574 currently only available under Linux, and only has any effect if
575 multilink is enabled (see the multilink option).
576 .TP
577 .B ms-dns \fI<addr>
578 If pppd is acting as a server for Microsoft Windows clients, this
579 option allows pppd to supply one or two DNS (Domain Name Server)
580 addresses to the clients.  The first instance of this option specifies
581 the primary DNS address; the second instance (if given) specifies the
582 secondary DNS address.  (This option was present in some older
583 versions of pppd under the name \fBdns-addr\fR.)
584 .TP
585 .B ms-wins \fI<addr>
586 If pppd is acting as a server for Microsoft Windows or "Samba"
587 clients, this option allows pppd to supply one or two WINS (Windows
588 Internet Name Services) server addresses to the clients.  The first
589 instance of this option specifies the primary WINS address; the second
590 instance (if given) specifies the secondary WINS address.
591 .TP
592 .B multilink
593 Enables the use of the PPP multilink protocol.  If the peer also
594 supports multilink, then this link can become part of a bundle between
595 the local system and the peer.  If there is an existing bundle to the
596 peer, pppd will join this link to that bundle, otherwise pppd will
597 create a new bundle.  See the MULTILINK section below.  This option is
598 currently only available under Linux.
599 .TP
600 .B name \fIname
601 Set the name of the local system for authentication purposes to
602 \fIname\fR.  This is a privileged option.  With this option, pppd will
603 use lines in the secrets files which have \fIname\fR as the second
604 field when looking for a secret to use in authenticating the peer.  In
605 addition, unless overridden with the \fIuser\fR option, \fIname\fR
606 will be used as the name to send to the peer when authenticating the
607 local system to the peer.  (Note that pppd does not append the domain
608 name to \fIname\fR.)
609 .TP
610 .B netmask \fIn
611 Set the interface netmask to \fIn\fR, a 32 bit netmask in "decimal dot"
612 notation (e.g. 255.255.255.0).  If this option is given, the value
613 specified is ORed with the default netmask.  The default netmask is
614 chosen based on the negotiated remote IP address; it is the
615 appropriate network mask for the class of the remote IP address, ORed
616 with the netmasks for any non point-to-point network interfaces in the
617 system which are on the same network.  (Note: on some platforms, pppd
618 will always use 255.255.255.255 for the netmask, if that is the only
619 appropriate value for a point-to-point interface.)
620 .TP
621 .B noaccomp
622 Disable Address/Control compression in both directions (send and
623 receive).
624 .TP
625 .B noauth
626 Do not require the peer to authenticate itself.  This option is
627 privileged.
628 .TP
629 .B nobsdcomp
630 Disables BSD-Compress compression; \fBpppd\fR will not request or
631 agree to compress packets using the BSD-Compress scheme.
632 .TP
633 .B noccp
634 Disable CCP (Compression Control Protocol) negotiation.  This option
635 should only be required if the peer is buggy and gets confused by
636 requests from pppd for CCP negotiation.
637 .TP
638 .B nocrtscts
639 Disable hardware flow control (i.e. RTS/CTS) on the serial port.
640 If neither the \fIcrtscts\fR nor the \fInocrtscts\fR nor the
641 \fIcdtrcts\fR nor the \fInocdtrcts\fR option is given, the hardware
642 flow control setting for the serial port is left unchanged.
643 .TP
644 .B nocdtrcts
645 This option is a synonym for \fInocrtscts\fR. Either of these options will
646 disable both forms of hardware flow control.
647 .TP
648 .B nodefaultroute
649 Disable the \fIdefaultroute\fR option.  The system administrator who
650 wishes to prevent users from creating default routes with pppd
651 can do so by placing this option in the /etc/ppp/options file.
652 .TP
653 .B nodeflate
654 Disables Deflate compression; pppd will not request or agree to
655 compress packets using the Deflate scheme.
656 .TP
657 .B nodetach
658 Don't detach from the controlling terminal.  Without this option, if a
659 serial device other than the terminal on the standard input is
660 specified, pppd will fork to become a background process.
661 .TP
662 .B noendpoint
663 Disables pppd from sending an endpoint discriminator to the peer or
664 accepting one from the peer (see the MULTILINK section below).  This
665 option should only be required if the peer is buggy.
666 .TP
667 .B noip
668 Disable IPCP negotiation and IP communication.  This option should
669 only be required if the peer is buggy and gets confused by requests
670 from pppd for IPCP negotiation.
671 .TP
672 .B noipv6
673 Disable IPv6CP negotiation and IPv6 communication. This option should
674 only be required if the peer is buggy and gets confused by requests
675 from pppd for IPv6CP negotiation.
676 .TP
677 .B noipdefault
678 Disables the default behaviour when no local IP address is specified,
679 which is to determine (if possible) the local IP address from the
680 hostname.  With this option, the peer will have to supply the local IP
681 address during IPCP negotiation (unless it specified explicitly on the
682 command line or in an options file).
683 .TP
684 .B noipx
685 Disable the IPXCP and IPX protocols.  This option should only be
686 required if the peer is buggy and gets confused by requests from pppd
687 for IPXCP negotiation.
688 .TP
689 .B noktune
690 Opposite of the \fIktune\fR option; disables pppd from changing system
691 settings.
692 .TP
693 .B nolog
694 Do not send log messages to a file or file descriptor.  This option
695 cancels the \fBlogfd\fR and \fBlogfile\fR options.
696 .TP
697 .B nomagic
698 Disable magic number negotiation.  With this option, pppd cannot
699 detect a looped-back line.  This option should only be needed if the
700 peer is buggy.
701 .TP
702 .B nomp
703 Disables the use of PPP multilink.  This option is currently only
704 available under Linux.
705 .TP
706 .B nompshortseq
707 Disables the use of short (12-bit) sequence numbers in the PPP
708 multilink protocol, forcing the use of 24-bit sequence numbers.  This
709 option is currently only available under Linux, and only has any
710 effect if multilink is enabled.
711 .TP
712 .B nomultilink
713 Disables the use of PPP multilink.  This option is currently only
714 available under Linux.
715 .TP
716 .B nopcomp
717 Disable protocol field compression negotiation in both the receive and
718 the transmit direction.
719 .TP
720 .B nopersist
721 Exit once a connection has been made and terminated.  This is the
722 default unless the \fIpersist\fR or \fIdemand\fR option has been
723 specified.
724 .TP
725 .B nopredictor1
726 Do not accept or agree to Predictor-1 compression.
727 .TP
728 .B noproxyarp
729 Disable the \fIproxyarp\fR option.  The system administrator who
730 wishes to prevent users from creating proxy ARP entries with pppd can
731 do so by placing this option in the /etc/ppp/options file.
732 .TP
733 .B notty
734 Normally, pppd requires a terminal device.  With this option, pppd
735 will allocate itself a pseudo-tty master/slave pair and use the slave
736 as its terminal device.  Pppd will create a child process to act as a
737 `character shunt' to transfer characters between the pseudo-tty master
738 and its standard input and output.  Thus pppd will transmit characters
739 on its standard output and receive characters on its standard input
740 even if they are not terminal devices.  This option increases the
741 latency and CPU overhead of transferring data over the ppp interface
742 as all of the characters sent and received must flow through the
743 character shunt process.  An explicit device name may not be given if
744 this option is used.
745 .TP
746 .B novj
747 Disable Van Jacobson style TCP/IP header compression in both the
748 transmit and the receive direction.
749 .TP
750 .B novjccomp
751 Disable the connection-ID compression option in Van Jacobson style
752 TCP/IP header compression.  With this option, pppd will not omit the
753 connection-ID byte from Van Jacobson compressed TCP/IP headers, nor
754 ask the peer to do so.
755 .TP
756 .B papcrypt
757 Indicates that all secrets in the /etc/ppp/pap-secrets file which are
758 used for checking the identity of the peer are encrypted, and thus
759 pppd should not accept a password which, before encryption, is
760 identical to the secret from the /etc/ppp/pap-secrets file.
761 .TP
762 .B pap-max-authreq \fIn
763 Set the maximum number of PAP authenticate-request transmissions to
764 \fIn\fR (default 10).
765 .TP
766 .B pap-restart \fIn
767 Set the PAP restart interval (retransmission timeout) to \fIn\fR
768 seconds (default 3).
769 .TP
770 .B pap-timeout \fIn
771 Set the maximum time that pppd will wait for the peer to authenticate
772 itself with PAP to \fIn\fR seconds (0 means no limit).
773 .TP
774 .B pass-filter \fIfilter-expression
775 Specifies a packet filter to applied to data packets being sent or
776 received to determine which packets should be allowed to pass.
777 Packets which are rejected by the filter are silently discarded.  This
778 option can be used to prevent specific network daemons (such as
779 routed) using up link bandwidth, or to provide a basic firewall
780 capability.
781 The \fIfilter-expression\fR syntax is as described for tcpdump(1),
782 except that qualifiers which are inappropriate for a PPP link, such as
783 \fBether\fR and \fBarp\fR, are not permitted.  Generally the filter
784 expression should be enclosed in single-quotes to prevent whitespace
785 in the expression from being interpreted by the shell.  Note that it
786 is possible to apply different constraints to incoming and outgoing
787 packets using the \fBinbound\fR and \fBoutbound\fR qualifiers. This
788 option is currently only available under NetBSD, and then only if both
789 the kernel and pppd were compiled with PPP_FILTER defined.
790 .TP
791 .B persist
792 Do not exit after a connection is terminated; instead try to reopen
793 the connection. The \fBmaxfail\fR option still has an effect on
794 persistent connections.
795 .TP
796 .B plugin \fIfilename
797 Load the shared library object file \fIfilename\fR as a plugin.  This
798 is a privileged option.  If \fIfilename\fR does not contain a slash
799 (/), pppd will look in the \fB/usr/lib/pppd/\fIversion\fR directory
800 for the plugin, where
801 \fIversion\fR is the version number of pppd (for example, 2.4.2).
802 .TP
803 .B predictor1
804 Request that the peer compress frames that it sends using Predictor-1
805 compression, and agree to compress transmitted frames with Predictor-1
806 if requested.  This option has no effect unless the kernel driver
807 supports Predictor-1 compression.
808 .TP
809 .B privgroup \fIgroup-name
810 Allows members of group \fIgroup-name\fR to use privileged options.
811 This is a privileged option.  Use of this option requires care as
812 there is no guarantee that members of \fIgroup-name\fR cannot use pppd
813 to become root themselves.  Consider it equivalent to putting the
814 members of \fIgroup-name\fR in the kmem or disk group.
815 .TP
816 .B proxyarp
817 Add an entry to this system's ARP [Address Resolution Protocol] table
818 with the IP address of the peer and the Ethernet address of this
819 system.  This will have the effect of making the peer appear to other
820 systems to be on the local ethernet.
821 .TP
822 .B pty \fIscript
823 Specifies that the command \fIscript\fR is to be used to communicate
824 rather than a specific terminal device.  Pppd will allocate itself a
825 pseudo-tty master/slave pair and use the slave as its terminal
826 device.  The \fIscript\fR will be run in a child process with the
827 pseudo-tty master as its standard input and output.  An explicit
828 device name may not be given if this option is used.  (Note: if the
829 \fIrecord\fR option is used in conjuction with the \fIpty\fR option,
830 the child process will have pipes on its standard input and output.)
831 .TP
832 .B receive-all
833 With this option, pppd will accept all control characters from the
834 peer, including those marked in the receive asyncmap.  Without this
835 option, pppd will discard those characters as specified in RFC1662.
836 This option should only be needed if the peer is buggy.
837 .TP
838 .B record \fIfilename
839 Specifies that pppd should record all characters sent and received to
840 a file named \fIfilename\fR.  This file is opened in append mode,
841 using the user's user-ID and permissions.  This option is implemented
842 using a pseudo-tty and a process to transfer characters between the
843 pseudo-tty and the real serial device, so it will increase the latency
844 and CPU overhead of transferring data over the ppp interface.  The
845 characters are stored in a tagged format with timestamps, which can be
846 displayed in readable form using the pppdump(8) program.
847 .TP
848 .B remotename \fIname
849 Set the assumed name of the remote system for authentication purposes
850 to \fIname\fR.
851 .TP
852 .B refuse-chap
853 With this option, pppd will not agree to authenticate itself to the
854 peer using CHAP.
855 .TP
856 .B refuse-mschap
857 With this option, pppd will not agree to authenticate itself to the
858 peer using MS-CHAP.
859 .TP
860 .B refuse-mschap-v2
861 With this option, pppd will not agree to authenticate itself to the
862 peer using MS-CHAPv2.
863 .TP
864 .B refuse-pap
865 With this option, pppd will not agree to authenticate itself to the
866 peer using PAP.
867 .TP
868 .B require-chap
869 Require the peer to authenticate itself using CHAP [Challenge
870 Handshake Authentication Protocol] authentication.
871 .TP
872 .B require-mschap
873 Require the peer to authenticate itself using MS-CHAP [Microsft Challenge
874 Handshake Authentication Protocol] authentication.
875 .TP
876 .B require-mschap-v2
877 Require the peer to authenticate itself using MS-CHAPv2 [Microsft Challenge
878 Handshake Authentication Protocol, Version 2] authentication.
879 .TP
880 .B require-pap
881 Require the peer to authenticate itself using PAP [Password
882 Authentication Protocol] authentication.
883 .TP
884 .B show-password
885 When logging the contents of PAP packets, this option causes pppd to
886 show the password string in the log message.
887 .TP
888 .B silent
889 With this option, pppd will not transmit LCP packets to initiate a
890 connection until a valid LCP packet is received from the peer (as for
891 the `passive' option with ancient versions of pppd).
892 .TP
893 .B sync
894 Use synchronous HDLC serial encoding instead of asynchronous.
895 The device used by pppd with this option must have sync support.
896 Currently supports Microgate SyncLink adapters
897 under Linux and FreeBSD 2.2.8 and later.
898 .TP
899 .B updetach
900 With this option, pppd will detach from its controlling terminal once
901 it has successfully established the ppp connection (to the point where
902 the first network control protocol, usually the IP control protocol,
903 has come up).
904 .TP
905 .B usehostname
906 Enforce the use of the hostname (with domain name appended, if given)
907 as the name of the local system for authentication purposes (overrides
908 the \fIname\fR option).  This option is not normally needed since the
909 \fIname\fR option is privileged.
910 .TP
911 .B usepeerdns
912 Ask the peer for up to 2 DNS server addresses.  The addresses supplied
913 by the peer (if any) are passed to the /etc/ppp/ip-up script in the
914 environment variables DNS1 and DNS2.  In addition, pppd will create an
915 /etc/ppp/resolv.conf file containing one or two nameserver lines with
916 the address(es) supplied by the peer.
917 .TP
918 .B user \fIname
919 Sets the name used for authenticating the local system to the peer to
920 \fIname\fR.
921 .TP
922 .B vj-max-slots \fIn
923 Sets the number of connection slots to be used by the Van Jacobson
924 TCP/IP header compression and decompression code to \fIn\fR, which
925 must be between 2 and 16 (inclusive).
926 .TP
927 .B welcome \fIscript
928 Run the executable or shell command specified by \fIscript\fR before
929 initiating PPP negotiation, after the connect script (if any) has
930 completed.  A value for this option from a privileged source cannot be
931 overridden by a non-privileged user.
932 .TP
933 .B xonxoff
934 Use software flow control (i.e. XON/XOFF) to control the flow of data on
935 the serial port.
936 .SH OPTIONS FILES
937 Options can be taken from files as well as the command line.  Pppd
938 reads options from the files /etc/ppp/options, ~/.ppprc and
939 /etc/ppp/options.\fIttyname\fR (in that order) before processing the
940 options on the command line.  (In fact, the command-line options are
941 scanned to find the terminal name before the options.\fIttyname\fR
942 file is read.)  In forming the name of the options.\fIttyname\fR file,
943 the initial /dev/ is removed from the terminal name, and any remaining
944 / characters are replaced with dots.
945 .PP
946 An options file is parsed into a series of words, delimited by
947 whitespace.  Whitespace can be included in a word by enclosing the
948 word in double-quotes (").  A backslash (\\) quotes the following character.
949 A hash (#) starts a comment, which continues until the end of the
950 line.  There is no restriction on using the \fIfile\fR or \fIcall\fR
951 options within an options file.
952 .SH SECURITY
953 .I pppd
954 provides system administrators with sufficient access control that PPP
955 access to a server machine can be provided to legitimate users without
956 fear of compromising the security of the server or the network it's
957 on.  This control is provided through restrictions on which IP
958 addresses the peer may use, based on its authenticated identity (if
959 any), and through restrictions on which options a non-privileged user
960 may use.  Several of pppd's options are privileged, in particular
961 those which permit potentially insecure configurations; these options
962 are only accepted in files which are under the control of the system
963 administrator, or if pppd is being run by root.
964 .PP
965 The default behaviour of pppd is to allow an unauthenticated peer to
966 use a given IP address only if the system does not already have a
967 route to that IP address.  For example, a system with a
968 permanent connection to the wider internet will normally have a
969 default route, and thus all peers will have to authenticate themselves
970 in order to set up a connection.  On such a system, the \fIauth\fR
971 option is the default.  On the other hand, a system where the
972 PPP link is the only connection to the internet will not normally have
973 a default route, so the peer will be able to use almost any IP address
974 without authenticating itself.
975 .PP
976 As indicated above, some security-sensitive options are privileged,
977 which means that they may not be used by an ordinary non-privileged
978 user running a setuid-root pppd, either on the command line, in the
979 user's ~/.ppprc file, or in an options file read using the \fIfile\fR
980 option.  Privileged options may be used in /etc/ppp/options file or in
981 an options file read using the \fIcall\fR option.  If pppd is being
982 run by the root user, privileged options can be used without
983 restriction.
984 .PP
985 When opening the device, pppd uses either the invoking user's user ID
986 or the root UID (that is, 0), depending on whether the device name was
987 specified by the user or the system administrator.  If the device name
988 comes from a privileged source, that is, /etc/ppp/options or an
989 options file read using the \fIcall\fR option, pppd uses full root
990 privileges when opening the device.  Thus, by creating an appropriate
991 file under /etc/ppp/peers, the system administrator can allow users to
992 establish a ppp connection via a device which they would not normally
993 have permission to access.  Otherwise pppd uses the invoking user's
994 real UID when opening the device.
995 .SH AUTHENTICATION
996 Authentication is the process whereby one peer convinces the other of
997 its identity.  This involves the first peer sending its name to the
998 other, together with some kind of secret information which could only
999 come from the genuine authorized user of that name.  In such an
1000 exchange, we will call the first peer the "client" and the other the
1001 "server".  The client has a name by which it identifies itself to the
1002 server, and the server also has a name by which it identifies itself
1003 to the client.  Generally the genuine client shares some secret (or
1004 password) with the server, and authenticates itself by proving that it
1005 knows that secret.  Very often, the names used for authentication
1006 correspond to the internet hostnames of the peers, but this is not
1007 essential.
1008 .LP
1009 At present, pppd supports two authentication protocols: the Password
1010 Authentication Protocol (PAP) and the Challenge Handshake
1011 Authentication Protocol (CHAP).  PAP involves the client sending its
1012 name and a cleartext password to the server to authenticate itself.
1013 In contrast, the server initiates the CHAP authentication exchange by
1014 sending a challenge to the client (the challenge packet includes the
1015 server's name).  The client must respond with a response which
1016 includes its name plus a hash value derived from the shared secret and
1017 the challenge, in order to prove that it knows the secret.
1018 .LP
1019 The PPP protocol, being symmetrical, allows both peers to require the
1020 other to authenticate itself.  In that case, two separate and
1021 independent authentication exchanges will occur.  The two exchanges
1022 could use different authentication protocols, and in principle,
1023 different names could be used in the two exchanges.
1024 .LP
1025 The default behaviour of pppd is to agree to authenticate if
1026 requested, and to not require authentication from the peer.  However,
1027 pppd will not agree to authenticate itself with a particular protocol
1028 if it has no secrets which could be used to do so.
1029 .LP
1030 Pppd stores secrets for use in authentication in secrets
1031 files (/etc/ppp/pap-secrets for PAP, /etc/ppp/chap-secrets for
1032 CHAP/MS-CHAP/MS-CHAPv2).
1033 Both secrets files have the same format.  The secrets files can
1034 contain secrets for pppd to use in authenticating itself to other
1035 systems, as well as secrets for pppd to use when authenticating other
1036 systems to itself.
1037 .LP
1038 Each line in a secrets file contains one secret.  A given secret is
1039 specific to a particular combination of client and server - it can
1040 only be used by that client to authenticate itself to that server.
1041 Thus each line in a secrets file has at least 3 fields: the name of
1042 the client, the name of the server, and the secret.  These fields may
1043 be followed by a list of the IP addresses that the specified client
1044 may use when connecting to the specified server.
1045 .LP
1046 A secrets file is parsed into words as for a options file, so the
1047 client name, server name and secrets fields must each be one word,
1048 with any embedded spaces or other special characters quoted or
1049 escaped.  Note that case is significant in the client and server names
1050 and in the secret.
1051 .LP
1052 If the secret starts with an `@', what follows is assumed to be the
1053 name of a file from which to read the secret.  A "*" as the client or
1054 server name matches any name.  When selecting a secret, pppd takes the
1055 best match, i.e.  the match with the fewest wildcards.
1056 .LP
1057 Any following words on the same line are taken to be a list of
1058 acceptable IP addresses for that client.  If there are only 3 words on
1059 the line, or if the first word is "-", then all IP addresses are
1060 disallowed.  To allow any address, use "*".  A word starting with "!"
1061 indicates that the specified address is \fInot\fR acceptable.  An
1062 address may be followed by "/" and a number \fIn\fR, to indicate a
1063 whole subnet, i.e. all addresses which have the same value in the most
1064 significant \fIn\fR bits.  In this form, the address may be followed
1065 by a plus sign ("+") to indicate that one address from the subnet is
1066 authorized, based on the ppp network interface unit number in use.
1067 In this case, the host part of the address will be set to the unit
1068 number plus one.
1069 .LP
1070 Thus a secrets file contains both secrets for use in authenticating
1071 other hosts, plus secrets which we use for authenticating ourselves to
1072 others.  When pppd is authenticating the peer (checking the peer's
1073 identity), it chooses a secret with the peer's name in the first
1074 field and the name of the local system in the second field.  The
1075 name of the local system defaults to the hostname, with the domain
1076 name appended if the \fIdomain\fR option is used.  This default can be
1077 overridden with the \fIname\fR option, except when the
1078 \fIusehostname\fR option is used.
1079 .LP
1080 When pppd is choosing a secret to use in authenticating itself to the
1081 peer, it first determines what name it is going to use to identify
1082 itself to the peer.  This name can be specified by the user with the
1083 \fIuser\fR option.  If this option is not used, the name defaults to
1084 the name of the local system, determined as described in the previous
1085 paragraph.  Then pppd looks for a secret with this name in the first
1086 field and the peer's name in the second field.  Pppd will know the
1087 name of the peer if CHAP authentication is being used, because the
1088 peer will have sent it in the challenge packet.  However, if PAP is being
1089 used, pppd will have to determine the peer's name from the options
1090 specified by the user.  The user can specify the peer's name directly
1091 with the \fIremotename\fR option.  Otherwise, if the remote IP address
1092 was specified by a name (rather than in numeric form), that name will
1093 be used as the peer's name.  Failing that, pppd will use the null
1094 string as the peer's name.
1095 .LP
1096 When authenticating the peer with PAP, the supplied password is first
1097 compared with the secret from the secrets file.  If the password
1098 doesn't match the secret, the password is encrypted using crypt() and
1099 checked against the secret again.  Thus secrets for authenticating the
1100 peer can be stored in encrypted form if desired.  If the
1101 \fIpapcrypt\fR option is given, the first (unencrypted) comparison is
1102 omitted, for better security.
1103 .LP
1104 Furthermore, if the \fIlogin\fR option was specified, the username and
1105 password are also checked against the system password database.  Thus,
1106 the system administrator can set up the pap-secrets file to allow PPP
1107 access only to certain users, and to restrict the set of IP addresses
1108 that each user can use.  Typically, when using the \fIlogin\fR option,
1109 the secret in /etc/ppp/pap-secrets would be "", which will match any
1110 password supplied by the peer.  This avoids the need to have the same
1111 secret in two places.
1112 .LP
1113 Authentication must be satisfactorily completed before IPCP (or any
1114 other Network Control Protocol) can be started.  If the peer is
1115 required to authenticate itself, and fails to do so, pppd will
1116 terminated the link (by closing LCP).  If IPCP negotiates an
1117 unacceptable IP address for the remote host, IPCP will be closed.  IP
1118 packets can only be sent or received when IPCP is open.
1119 .LP
1120 In some cases it is desirable to allow some hosts which can't
1121 authenticate themselves to connect and use one of a restricted set of
1122 IP addresses, even when the local host generally requires
1123 authentication.  If the peer refuses to authenticate itself when
1124 requested, pppd takes that as equivalent to authenticating with PAP
1125 using the empty string for the username and password.  Thus, by adding
1126 a line to the pap-secrets file which specifies the empty string for
1127 the client and password, it is possible to allow restricted access to
1128 hosts which refuse to authenticate themselves.
1129 .SH ROUTING
1130 .LP
1131 When IPCP negotiation is completed successfully, pppd will inform the
1132 kernel of the local and remote IP addresses for the ppp interface.
1133 This is sufficient to create a host route to the remote end of the
1134 link, which will enable the peers to exchange IP packets.
1135 Communication with other machines generally requires further
1136 modification to routing tables and/or ARP (Address Resolution
1137 Protocol) tables.  In most cases the \fIdefaultroute\fR and/or
1138 \fIproxyarp\fR options are sufficient for this, but in some cases
1139 further intervention is required.  The /etc/ppp/ip-up script can be
1140 used for this.
1141 .LP
1142 Sometimes it is desirable to add a default route through the remote
1143 host, as in the case of a machine whose only connection to the
1144 Internet is through the ppp interface.  The \fIdefaultroute\fR option
1145 causes pppd to create such a default route when IPCP comes up, and
1146 delete it when the link is terminated.
1147 .LP
1148 In some cases it is desirable to use proxy ARP, for example on a
1149 server machine connected to a LAN, in order to allow other hosts to
1150 communicate with the remote host.  The \fIproxyarp\fR option causes
1151 pppd to look for a network interface on the same subnet as the remote
1152 host (an interface supporting broadcast and ARP, which is up and not a
1153 point-to-point or loopback interface).  If found, pppd creates a
1154 permanent, published ARP entry with the IP address of the remote host
1155 and the hardware address of the network interface found.
1156 .LP
1157 When the \fIdemand\fR option is used, the interface IP addresses have
1158 already been set at the point when IPCP comes up.  If pppd has not
1159 been able to negotiate the same addresses that it used to configure
1160 the interface (for example when the peer is an ISP that uses dynamic
1161 IP address assignment), pppd has to change the interface IP addresses
1162 to the negotiated addresses.  This may disrupt existing connections,
1163 and the use of demand dialling with peers that do dynamic IP address
1164 assignment is not recommended.
1165 .SH MULTILINK
1166 Multilink PPP provides the capability to combine two or more PPP links
1167 between a pair of machines into a single `bundle', which appears as a
1168 single virtual PPP link which has the combined bandwidth of the
1169 individual links.  Currently, multilink PPP is only supported under
1170 Linux.
1171 .LP
1172 Pppd detects that the link it is controlling is connected to the same
1173 peer as another link using the peer's endpoint discriminator and the
1174 authenticated identity of the peer (if it authenticates itself).  The
1175 endpoint discriminator is a block of data which is hopefully unique
1176 for each peer.  Several types of data can be used, including
1177 locally-assigned strings of bytes, IP addresses, MAC addresses,
1178 randomly strings of bytes, or E-164 phone numbers.  The endpoint
1179 discriminator sent to the peer by pppd can be set using the endpoint
1180 option.
1181 .LP
1182 In circumstances the peer may send no endpoint discriminator or a
1183 non-unique value.  The optional bundle option adds an extra string
1184 which is added to the peer's endpoint discriminator and authenticated
1185 identity when matching up links to be joined together in a bundle.
1186 The bundle option can also be used to allow the establishment of
1187 multiple bundles between the local system and the peer.  Pppd uses a
1188 TDB database in /var/run/pppd.tdb to match up links.
1189 .LP
1190 Assuming that multilink is enabled and the peer is willing to
1191 negotiate multilink, then when pppd is invoked to bring up the first
1192 link to the peer, it will detect that no other link is connected to
1193 the peer and create a new bundle, that is, another ppp network
1194 interface unit.  When another pppd is invoked to bring up another link
1195 to the peer, it will detect the existing bundle and join its link to
1196 it.  Currently, if the first pppd terminates (for example, because of
1197 a hangup or a received signal) the bundle is destroyed.
1198 .SH EXAMPLES
1199 .LP
1200 The following examples assume that the /etc/ppp/options file contains
1201 the \fIauth\fR option (as in the default /etc/ppp/options file in the
1202 ppp distribution).
1203 .LP
1204 Probably the most common use of pppd is to dial out to an ISP.  This
1205 can be done with a command such as
1206 .IP
1207 pppd call isp
1208 .LP
1209 where the /etc/ppp/peers/isp file is set up by the system
1210 administrator to contain something like this:
1211 .IP
1212 ttyS0 19200 crtscts
1213 .br
1214 connect '/usr/sbin/chat -v -f /etc/ppp/chat-isp'
1215 .br
1216 noauth
1217 .LP
1218 In this example, we are using chat to dial the ISP's modem and go
1219 through any logon sequence required.  The /etc/ppp/chat-isp file
1220 contains the script used by chat; it could for example contain
1221 something like this:
1222 .IP
1223 ABORT "NO CARRIER"
1224 .br
1225 ABORT "NO DIALTONE"
1226 .br
1227 ABORT "ERROR"
1228 .br
1229 ABORT "NO ANSWER"
1230 .br
1231 ABORT "BUSY"
1232 .br
1233 ABORT "Username/Password Incorrect"
1234 .br
1235 "" "at"
1236 .br
1237 OK "at&d0&c1"
1238 .br
1239 OK "atdt2468135"
1240 .br
1241 "name:" "^Umyuserid"
1242 .br
1243 "word:" "\\qmypassword"
1244 .br
1245 "ispts" "\\q^Uppp"
1246 .br
1247 "~-^Uppp-~"
1248 .LP
1249 See the chat(8) man page for details of chat scripts.
1250 .LP
1251 Pppd can also be used to provide a dial-in ppp service for users.  If
1252 the users already have login accounts, the simplest way to set up the
1253 ppp service is to let the users log in to their accounts and run pppd
1254 (installed setuid-root) with a command such as
1255 .IP
1256 pppd proxyarp
1257 .LP
1258 To allow a user to use the PPP facilities, you need to allocate an IP
1259 address for that user's machine and create an entry in
1260 /etc/ppp/pap-secrets or /etc/ppp/chap-secrets (depending on which
1261 authentication method the PPP implementation on the user's machine
1262 supports), so that the user's
1263 machine can authenticate itself.  For example, if Joe has a machine
1264 called "joespc" which is to be allowed to dial in to the machine
1265 called "server" and use the IP address joespc.my.net, you would add an
1266 entry like this to /etc/ppp/pap-secrets or /etc/ppp/chap-secrets:
1267 .IP
1268 joespc  server  "joe's secret"  joespc.my.net
1269 .LP
1270 Alternatively, you can create a username called (for example) "ppp",
1271 whose login shell is pppd and whose home directory is /etc/ppp.
1272 Options to be used when pppd is run this way can be put in
1273 /etc/ppp/.ppprc.
1274 .LP
1275 If your serial connection is any more complicated than a piece of
1276 wire, you may need to arrange for some control characters to be
1277 escaped.  In particular, it is often useful to escape XON (^Q) and
1278 XOFF (^S), using \fIasyncmap a0000\fR.  If the path includes a telnet,
1279 you probably should escape ^] as well (\fIasyncmap 200a0000\fR).  If
1280 the path includes an rlogin, you will need to use the \fIescape ff\fR
1281 option on the end which is running the rlogin client, since many
1282 rlogin implementations are not transparent; they will remove the
1283 sequence [0xff, 0xff, 0x73, 0x73, followed by any 8 bytes] from the
1284 stream.
1285 .SH DIAGNOSTICS
1286 .LP
1287 Messages are sent to the syslog daemon using facility LOG_DAEMON.
1288 (This can be overriden by recompiling pppd with the macro
1289 LOG_PPP defined as the desired facility.)  In order to see the error
1290 and debug messages, you will need to edit your /etc/syslog.conf file
1291 to direct the messages to the desired output device or file.
1292 .LP
1293 The \fIdebug\fR option causes the contents of all control packets sent
1294 or received to be logged, that is, all LCP, PAP, CHAP or IPCP packets.
1295 This can be useful if the PPP negotiation does not succeed or if
1296 authentication fails.
1297 If debugging is enabled at compile time, the \fIdebug\fR option also
1298 causes other debugging messages to be logged.
1299 .LP
1300 Debugging can also be enabled or disabled by sending a SIGUSR1 signal
1301 to the pppd process.  This signal acts as a toggle.
1302 .SH EXIT STATUS
1303 The exit status of pppd is set to indicate whether any error was
1304 detected, or the reason for the link being terminated.  The values
1305 used are:
1306 .TP
1307 .B 0
1308 Pppd has detached, or otherwise the connection was successfully
1309 established and terminated at the peer's request.
1310 .TP
1311 .B 1
1312 An immediately fatal error of some kind occurred, such as an essential
1313 system call failing, or running out of virtual memory.
1314 .TP
1315 .B 2
1316 An error was detected in processing the options given, such as two
1317 mutually exclusive options being used.
1318 .TP
1319 .B 3
1320 Pppd is not setuid-root and the invoking user is not root.
1321 .TP
1322 .B 4
1323 The kernel does not support PPP, for example, the PPP kernel driver is
1324 not included or cannot be loaded.
1325 .TP
1326 .B 5
1327 Pppd terminated because it was sent a SIGINT, SIGTERM or SIGHUP
1328 signal.
1329 .TP
1330 .B 6
1331 The serial port could not be locked.
1332 .TP
1333 .B 7
1334 The serial port could not be opened.
1335 .TP
1336 .B 8
1337 The connect script failed (returned a non-zero exit status).
1338 .TP
1339 .B 9
1340 The command specified as the argument to the \fIpty\fR option could
1341 not be run.
1342 .TP
1343 .B 10
1344 The PPP negotiation failed, that is, it didn't reach the point where
1345 at least one network protocol (e.g. IP) was running.
1346 .TP
1347 .B 11
1348 The peer system failed (or refused) to authenticate itself.
1349 .TP
1350 .B 12
1351 The link was established successfully and terminated because it was
1352 idle.
1353 .TP
1354 .B 13
1355 The link was established successfully and terminated because the
1356 connect time limit was reached.
1357 .TP
1358 .B 14
1359 Callback was negotiated and an incoming call should arrive shortly.
1360 .TP
1361 .B 15
1362 The link was terminated because the peer is not responding to echo
1363 requests.
1364 .TP
1365 .B 16
1366 The link was terminated by the modem hanging up.
1367 .TP
1368 .B 17
1369 The PPP negotiation failed because serial loopback was detected.
1370 .TP
1371 .B 18
1372 The init script failed (returned a non-zero exit status).
1373 .TP
1374 .B 19
1375 We failed to authenticate ourselves to the peer.
1376 .SH SCRIPTS
1377 Pppd invokes scripts at various stages in its processing which can be
1378 used to perform site-specific ancillary processing.  These scripts are
1379 usually shell scripts, but could be executable code files instead.
1380 Pppd does not wait for the scripts to finish.  The scripts are
1381 executed as root (with the real and effective user-id set to 0), so
1382 that they can do things such as update routing tables or run
1383 privileged daemons.  Be careful that the contents of these scripts do
1384 not compromise your system's security.  Pppd runs the scripts with
1385 standard input, output and error redirected to /dev/null, and with an
1386 environment that is empty except for some environment variables that
1387 give information about the link.  The environment variables that pppd
1388 sets are:
1389 .TP
1390 .B DEVICE
1391 The name of the serial tty device being used.
1392 .TP
1393 .B IFNAME
1394 The name of the network interface being used.
1395 .TP
1396 .B IPLOCAL
1397 The IP address for the local end of the link.  This is only set when
1398 IPCP has come up.
1399 .TP
1400 .B IPREMOTE
1401 The IP address for the remote end of the link.  This is only set when
1402 IPCP has come up.
1403 .TP
1404 .B PEERNAME
1405 The authenticated name of the peer.  This is only set if the peer
1406 authenticates itself.
1407 .TP
1408 .B SPEED
1409 The baud rate of the tty device.
1410 .TP
1411 .B ORIG_UID
1412 The real user-id of the user who invoked pppd.
1413 .TP
1414 .B PPPLOGNAME
1415 The username of the real user-id that invoked pppd. This is always set.
1416 .P
1417 For the ip-down and auth-down scripts, pppd also sets the following
1418 variables giving statistics for the connection:
1419 .TP
1420 .B CONNECT_TIME
1421 The number of seconds from when the PPP negotiation started until the
1422 connection was terminated.
1423 .TP
1424 .B BYTES_SENT
1425 The number of bytes sent (at the level of the serial port) during the
1426 connection.
1427 .TP
1428 .B BYTES_RCVD
1429 The number of bytes received (at the level of the serial port) during
1430 the connection.
1431 .TP
1432 .B LINKNAME
1433 The logical name of the link, set with the \fIlinkname\fR option.
1434 .P
1435 Pppd invokes the following scripts, if they exist.  It is not an error
1436 if they don't exist.
1437 .TP
1438 .B /etc/ppp/auth-up
1439 A program or script which is executed after the remote system
1440 successfully authenticates itself.  It is executed with the parameters
1441 .IP
1442 \fIinterface-name peer-name user-name tty-device speed\fR
1443 .IP
1444 Note that this script is not executed if the peer doesn't authenticate
1445 itself, for example when the \fInoauth\fR option is used.
1446 .TP
1447 .B /etc/ppp/auth-down
1448 A program or script which is executed when the link goes down, if
1449 /etc/ppp/auth-up was previously executed.  It is executed in the same
1450 manner with the same parameters as /etc/ppp/auth-up.
1451 .TP
1452 .B /etc/ppp/ip-up
1453 A program or script which is executed when the link is available for
1454 sending and receiving IP packets (that is, IPCP has come up).  It is
1455 executed with the parameters
1456 .IP
1457 \fIinterface-name tty-device speed local-IP-address
1458 remote-IP-address ipparam\fR
1459 .TP
1460 .B /etc/ppp/ip-down
1461 A program or script which is executed when the link is no longer
1462 available for sending and receiving IP packets.  This script can be
1463 used for undoing the effects of the /etc/ppp/ip-up script.  It is
1464 invoked in the same manner and with the same parameters as the ip-up
1465 script.
1466 .TP
1467 .B /etc/ppp/ipv6-up
1468 Like /etc/ppp/ip-up, except that it is executed when the link is available 
1469 for sending and receiving IPv6 packets. It is executed with the parameters
1470 .IP
1471 \fIinterface-name tty-device speed local-link-local-address
1472 remote-link-local-address ipparam\fR
1473 .TP
1474 .B /etc/ppp/ipv6-down
1475 Similar to /etc/ppp/ip-down, but it is executed when IPv6 packets can no
1476 longer be transmitted on the link. It is executed with the same parameters 
1477 as the ipv6-up script.
1478 .TP
1479 .B /etc/ppp/ipx-up
1480 A program or script which is executed when the link is available for
1481 sending and receiving IPX packets (that is, IPXCP has come up).  It is
1482 executed with the parameters
1483 .IP
1484 \fIinterface-name tty-device speed network-number local-IPX-node-address
1485 remote-IPX-node-address local-IPX-routing-protocol remote-IPX-routing-protocol
1486 local-IPX-router-name remote-IPX-router-name ipparam pppd-pid\fR 
1487 .IP
1488 The local-IPX-routing-protocol and remote-IPX-routing-protocol field
1489 may be one of the following:
1490 .IP
1491 NONE      to indicate that there is no routing protocol
1492 .br
1493 RIP       to indicate that RIP/SAP should be used
1494 .br
1495 NLSP      to indicate that Novell NLSP should be used
1496 .br
1497 RIP NLSP  to indicate that both RIP/SAP and NLSP should be used
1498 .TP
1499 .B /etc/ppp/ipx-down
1500 A program or script which is executed when the link is no longer
1501 available for sending and receiving IPX packets.  This script can be
1502 used for undoing the effects of the /etc/ppp/ipx-up script.  It is
1503 invoked in the same manner and with the same parameters as the ipx-up
1504 script.
1505 .SH FILES
1506 .TP
1507 .B /var/run/ppp\fIn\fB.pid \fR(BSD or Linux), \fB/etc/ppp/ppp\fIn\fB.pid \fR(others)
1508 Process-ID for pppd process on ppp interface unit \fIn\fR.
1509 .TP
1510 .B /var/run/ppp-\fIname\fB.pid \fR(BSD or Linux),
1511 \fB/etc/ppp/ppp-\fIname\fB.pid \fR(others)
1512 Process-ID for pppd process for logical link \fIname\fR (see the
1513 \fIlinkname\fR option).
1514 .TP
1515 .B /etc/ppp/pap-secrets
1516 Usernames, passwords and IP addresses for PAP authentication.  This
1517 file should be owned by root and not readable or writable by any other
1518 user.  Pppd will log a warning if this is not the case.
1519 .TP
1520 .B /etc/ppp/chap-secrets
1521 Names, secrets and IP addresses for CHAP/MS-CHAP/MS-CHAPv2 authentication.
1522 As for /etc/ppp/pap-secrets, this file should be owned by root and not
1523 readable or writable by any other user.  Pppd will log a warning if
1524 this is not the case.
1525 .TP
1526 .B /etc/ppp/options
1527 System default options for pppd, read before user default options or
1528 command-line options.
1529 .TP
1530 .B ~/.ppprc
1531 User default options, read before /etc/ppp/options.\fIttyname\fR.
1532 .TP
1533 .B /etc/ppp/options.\fIttyname
1534 System default options for the serial port being used, read after
1535 ~/.ppprc.  In forming the \fIttyname\fR part of this
1536 filename, an initial /dev/ is stripped from the port name (if
1537 present), and any slashes in the remaining part are converted to
1538 dots.
1539 .TP
1540 .B /etc/ppp/peers
1541 A directory containing options files which may contain privileged
1542 options, even if pppd was invoked by a user other than root.  The
1543 system administrator can create options files in this directory to
1544 permit non-privileged users to dial out without requiring the peer to
1545 authenticate, but only to certain trusted peers.
1546 .SH SEE ALSO
1547 .TP
1548 .B RFC1144
1549 Jacobson, V.
1550 \fICompressing TCP/IP headers for low-speed serial links.\fR
1551 February 1990.
1552 .TP
1553 .B RFC1321
1554 Rivest, R.
1555 .I The MD5 Message-Digest Algorithm.
1556 April 1992.
1557 .TP
1558 .B RFC1332
1559 McGregor, G.
1560 .I PPP Internet Protocol Control Protocol (IPCP).
1561 May 1992.
1562 .TP
1563 .B RFC1334
1564 Lloyd, B.; Simpson, W.A.
1565 .I PPP authentication protocols.
1566 October 1992.
1567 .TP
1568 .B RFC1661
1569 Simpson, W.A.
1570 .I The Point\-to\-Point Protocol (PPP).
1571 July 1994.
1572 .TP
1573 .B RFC1662
1574 Simpson, W.A.
1575 .I PPP in HDLC-like Framing.
1576 July 1994.
1577 .TP
1578 .B RFC2472
1579 Haskin, D.
1580 .I IP Version 6 over PPP
1581 December 1998.
1582 .SH NOTES
1583 The following signals have the specified effect when sent to pppd.
1584 .TP
1585 .B SIGINT, SIGTERM
1586 These signals cause pppd to terminate the link (by closing LCP),
1587 restore the serial device settings, and exit.
1588 .TP
1589 .B SIGHUP
1590 This signal causes pppd to terminate the link, restore the serial
1591 device settings, and close the serial device.  If the \fIpersist\fR or
1592 \fIdemand\fR option has been specified, pppd will try to reopen the
1593 serial device and start another connection (after the holdoff period).
1594 Otherwise pppd will exit.  If this signal is received during the
1595 holdoff period, it causes pppd to end the holdoff period immediately.
1596 .TP
1597 .B SIGUSR1
1598 This signal toggles the state of the \fIdebug\fR option.
1599 .TP
1600 .B SIGUSR2
1601 This signal causes pppd to renegotiate compression.  This can be
1602 useful to re-enable compression after it has been disabled as a result
1603 of a fatal decompression error.  (Fatal decompression errors generally
1604 indicate a bug in one or other implementation.)
1605
1606 .SH AUTHORS
1607 Paul Mackerras (Paul.Mackerras@cs.anu.edu.au), based on earlier work by
1608 Drew Perkins,
1609 Brad Clements,
1610 Karl Fox,
1611 Greg Christy,
1612 and
1613 Brad Parker.