xref: /openbsd/usr.sbin/pppd/pppd.8 (revision 3cab2bb3)
1.\" $OpenBSD: pppd.8,v 1.46 2015/10/28 10:02:59 jmc Exp $
2.\" Id: pppd.8,v 1.27 1998/03/31 04:31:08 paulus Exp $
3.\"
4.\" Copyright (c) 1993-2003 Paul Mackerras <paulus@samba.org>
5.\"
6.\" Permission to use, copy, modify, and distribute this software for any
7.\" purpose with or without fee is hereby granted, provided that the above
8.\" copyright notice and this permission notice appear in all copies.
9.\"
10.\" THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
11.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17.\"
18.Dd $Mdocdate: October 28 2015 $
19.Dt PPPD 8
20.Os
21.Sh NAME
22.Nm pppd
23.Nd Point-to-Point Protocol daemon
24.Sh SYNOPSIS
25.Nm pppd
26.Op Ar tty_name
27.Op Ar speed
28.Op Ar options
29.Sh DESCRIPTION
30PPP is the protocol used for establishing internet links over dial-up
31modems, DSL connections, and many other types of point-to-point links.
32The
33.Nm
34daemon works together with the kernel
35.Xr ppp 4
36driver to establish and maintain a PPP link with another system
37(called the
38.Em peer )
39and to negotiate Internet Protocol (IP) addresses for each end of the link.
40.Nm
41can also authenticate the peer and/or supply authentication information
42to the peer.
43PPP can be used with other network protocols besides IP, but such use
44is becoming increasingly rare.
45.Sh FREQUENTLY USED OPTIONS
46.Bl -tag -width Ds
47.It Ar tty_name
48Use the serial port called
49.Ar ttyname
50to communicate with the peer.
51The string
52.Dq /dev/
53is prepended to
54.Ar ttyname
55to form the name of the device to open.
56If no device name is given, or if the name of the terminal
57connected to the standard input is given,
58.Nm
59will use that terminal, and will not fork to put itself in the background.
60This option is privileged if the
61.Cm noauth
62option is used.
63.It Ar speed
64An option that is a decimal number is taken as the desired baud rate
65for the serial device.
66On systems such as
67.Bx 4.4
68and
69.Ox ,
70any speed can be specified.
71Other systems (e.g., Linux, SunOS) only support the commonly used
72baud-rates.
73.It Cm active-filter Ar filter-expression
74Specifies a packet filter to be applied to data packets to determine
75which packets are to be regarded as link activity, and therefore reset
76the idle timer, or cause the link to be brought up in demand-dialling
77mode.
78This option is useful in conjunction with the
79.Cm idle
80option if there are packets being sent or received regularly over the link
81(for example, routing information packets)
82which would otherwise prevent the link from ever appearing to be idle.
83The
84.Ar filter-expression
85syntax is as described for
86.Xr tcpdump 8 ,
87except that qualifiers which are inappropriate for a PPP link, such as
88.Ar ether
89and
90.Ar arp ,
91are not permitted.
92Generally the filter expression should be enclosed in single quotes to
93prevent whitespace in the expression from being interpreted by the shell.
94.It Cm asyncmap Ar map
95This option sets the Async-Control-Character-Map (ACCM) for this end
96of the link.
97The ACCM is a set of 32 bits, one for each of the ASCII control characters
98with values from 0 to 31, where a 1 bit indicates that the corresponding
99control character should not be used in PPP packets sent to this system.
100The map is encoded as a hexadecimal number (without a leading 0x) where the
101least significant bit (00000001) represents character 0 and the
102most significant bit (80000000) represents character 31.
103.Nm
104will ask the peer to send these characters as a 2-byte escape sequence.
105If multiple
106.Cm asyncmap
107options are given, the values are ORed together.
108If no
109.Cm asyncmap
110option is given, no async character map will be negotiated for the receive
111direction; the peer should then escape
112.Em all
113control characters.
114To escape transmitted characters, use the
115.Cm escape
116option.
117.It Cm auth
118Require the peer to authenticate itself before allowing network
119packets to be sent or received.
120.It Cm call Ar name
121Read options from the file
122.Pa /etc/ppp/peers/name .
123This file may contain privileged options, such as
124.Cm noauth ,
125even if
126.Nm
127is not being run by root.
128The
129.Ar name
130string may not begin with
131.Qq /
132or include
133.Qq ..
134as a pathname component.
135The format of the options file is described below.
136.It Cm connect Ar script
137Usually there is something which needs to be done to prepare the link
138before the PPP protocol can be started; for instance, with a dial-up
139modem, commands need to be sent to the modem to dial the appropriate
140phone number.
141This option specifies an command for
142.Nm
143to execute (by passing it to a shell) before attempting to start PPP
144negotiation.
145The
146.Xr chat 8
147program is often useful here, as it provides a way to send arbitrary strings
148to a modem and respond to received characters.
149This option is privileged if the
150.Cm noauth
151option is used.
152.It Cm crtscts
153Specifies that
154.Nm
155should set the serial port to use hardware flow control using the RTS and CTS
156signals in the RS-232 interface.
157If neither the
158.Cm crtscts
159nor the
160.Cm nocrtscts
161option is given, the hardware flow control setting for the serial port
162is left unchanged.
163.It Cm defaultroute
164Add a default route to the system routing tables, using the peer as
165the gateway, when IPCP negotiation is successfully completed.
166This entry is removed when the PPP connection is broken.
167This option is privileged if the
168.Cm nodefaultroute
169option has been specified.
170.It Cm disconnect Ar script
171Execute the command specified by
172.Ar script ,
173by passing it to a shell,
174after
175.Nm
176has terminated the link.
177This command could, for example, issue commands to the modem to cause it
178to hang up if hardware modem control signals were not available.
179The disconnect script is not run if the modem has already hung up.
180This option is privileged if the
181.Cm noauth
182option is used.
183.It Cm escape Ar xx,yy,...
184Specifies that certain characters should be escaped on transmission
185(regardless of whether the peer requests them to be escaped with its
186async control character map).
187The characters to be escaped are specified as a list of hex numbers
188separated by commas.
189Note that almost any character can be specified for the
190.Cm escape
191option, unlike the
192.Cm asyncmap
193option which only allows control characters to be specified.
194The characters which may not be escaped are those with hex values
1950x20 \- 0x3f or 0x5e.
196.It Cm file Ar name
197Read options from file
198.Ar name
199(the format is described below).
200The file must be readable by the user who has invoked
201.Nm pppd .
202.It Cm lock
203Specifies that
204.Nm
205should create a UUCP-style lock file for the
206serial device to ensure exclusive access to the device.
207.It Cm mru Ar n
208Set the MRU (Maximum Receive Unit) value to
209.Ar n .
210.Nm
211will ask the peer to send packets of no more than
212.Ar n
213bytes.
214The value of
215.Ar n
216must be between 128 and 16384; the default is 1500.
217A value of 296 works well on very slow links
218(40 bytes for TCP/IP header + 256 bytes of data).
219Note that for the IPv6 protocol, the MRU must be at least 1280.
220.It Cm mtu Ar n
221Set the MTU (Maximum Transmit Unit) value to
222.Ar n .
223Unless the peer requests a smaller value via MRU negotiation,
224.Nm
225will request that the kernel networking code send data packets of no more than
226.Ar n
227bytes through the PPP network interface.
228Note that for the IPv6 protocol, the MTU must be at least 1280.
229.It Cm passive
230Enables the
231.Qq passive
232option in the LCP.
233With this option,
234.Nm
235will attempt to initiate a connection; if no reply is received from the peer,
236.Nm
237will then just wait passively for a valid LCP packet from the peer,
238instead of exiting, as it would without this option.
239.El
240.Sh OPTIONS
241.Bl -tag -width Ds
242.It Xo
243.Oo Ar local_IP_address Oc : Ns
244.Op Ar remote_IP_address
245.Xc
246Set the local and/or remote interface IP addresses.
247Either one may be omitted.
248The IP addresses can be specified with a host name or in
249decimal dot notation (e.g., 150.234.56.78).
250The default local address is the (first) IP address of the system (unless the
251.Cm noipdefault
252option is given).
253The remote address will be obtained from the peer
254if not specified in any option.
255Thus, in simple cases, this option is not required.
256If a local and/or remote IP address is specified with this option,
257.Nm
258will not accept a different value from the peer in the IPCP negotiation,
259unless the
260.Cm ipcp-accept-local
261and/or
262.Cm ipcp-accept-remote
263options are given, respectively.
264.It Cm bsdcomp Ar nr,nt
265Request that the peer compress packets that it sends, using the
266BSD-Compress scheme, with a maximum code size of
267.Ar nr
268bits, and agree to compress packets sent to the peer with
269a maximum code size of
270.Ar nt
271bits.
272If
273.Ar nt
274is not specified, it defaults to the value given for
275.Ar nr .
276Values in the range 9 to 15 may be used for
277.Ar nr
278and
279.Ar nt ;
280larger values give better compression but
281consume more kernel memory for compression dictionaries.
282Alternatively, a value of 0 for
283.Ar nr
284or
285.Ar nt
286disables compression in the corresponding direction.
287.Cm nobsdcomp
288or
289.Cm bsdcomp 0
290disables BSD-Compress compression entirely.
291.It Cm chap-interval Ar n
292If this option is given,
293.Nm
294will rechallenge the peer every
295.Ar n
296seconds.
297.It Cm chap-max-challenge Ar n
298Set the maximum number of CHAP challenge transmissions to
299.Ar n
300(default 10).
301.It Cm chap-restart Ar n
302Set the CHAP restart interval (retransmission timeout for challenges) to
303.Ar n
304seconds (default 3).
305.It Cm debug
306Enables connection debugging facilities.
307If this option is given,
308.Nm
309will log the contents of all control packets sent or received in a
310readable form.
311The packets are logged through
312.Xr syslogd 8
313with facility
314.Ar daemon
315and level
316.Ar debug .
317This information can be directed to a file by setting up
318.Pa /etc/syslog.conf
319appropriately (see
320.Xr syslog.conf 5 ) .
321.It Cm default-asyncmap
322Disable asyncmap negotiation, forcing all control characters to be
323escaped for both the transmit and the receive direction.
324.It Cm default-mru
325Disable MRU (Maximum Receive Unit) negotiation.
326With this option,
327.Nm
328will use the default MRU value of 1500 bytes for both the
329transmit and receive direction.
330.It Cm deflate Ar nr,nt
331Request that the peer compress packets that it sends, using the
332Deflate scheme, with a maximum window size of
333.Ar 2**nr
334bytes, and agree to compress packets sent to the peer with
335a maximum window size of
336.Ar 2**nt
337bytes.
338If
339.Ar nt
340is not specified, it defaults to the value given for
341.Ar nr .
342Values in the range 8 to 15 may be used for
343.Ar nr
344and
345.Ar nt ;
346larger values give better compression but consume more kernel memory
347for compression dictionaries.
348Alternatively, a value of 0 for
349.Ar nr
350or
351.Ar nt
352disables compression in the corresponding direction.
353Use
354.Cm nodeflate
355or
356.Cm deflate 0
357to disable Deflate compression entirely.
358(Note:
359.Nm
360requests Deflate compression in preference to BSD-Compress if the peer
361can do either.)
362.It Cm demand
363Initiate the link only on demand, i.e., when data traffic is present.
364With this option, the remote IP address must be specified by the user
365on the command line or in an options file.
366.Nm
367will initially configure the interface and enable it for IP traffic without
368connecting to the peer.
369When traffic is available,
370.Nm
371will connect to the peer and perform negotiation, authentication, etc.
372When this is completed,
373.Nm
374will commence passing data packets (i.e., IP packets) across the link.
375.Pp
376The
377.Cm demand
378option implies the
379.Cm persist
380option.
381If this behaviour is not desired, use the
382.Cm nopersist
383option after the
384.Cm demand
385option.
386The
387.Cm idle
388and
389.Cm holdoff
390options are also useful in conjunction with the
391.Cm demand
392option.
393.It Cm domain Ar d
394Append the domain name
395.Ar d
396to the local host name for authentication purposes.
397For example, if
398.Xr gethostname 3
399returns the name porsche, but the fully qualified domain name is
400porsche.Quotron.COM, you could specify
401.Cm domain Quotron.COM .
402.Nm
403would then use the name
404.Ar porsche.Quotron.COM
405for looking up secrets in the secrets file, and as the default name to
406send to the peer when authenticating itself to the peer.
407This option is privileged.
408.It Cm holdoff Ar n
409Specifies how many seconds to wait before re-initiating the link after
410it terminates.
411This option only has any effect if the
412.Cm persist
413or
414.Cm demand
415option is used.
416The holdoff period is not applied if the link was terminated
417because it was idle.
418.It Cm idle Ar n
419Specifies that
420.Nm
421should disconnect if the link is idle for
422.Ar n
423seconds.
424The link is idle when no data packets (i.e., IP packets) are
425being sent or received.
426Note: it is not advisable to use this option with the
427.Cm persist
428option without the
429.Cm demand
430option.
431If the
432.Cm active-filter
433option is given, data packets which are rejected by the specified
434activity filter also count as the link being idle.
435.It Cm ipcp-accept-local
436With this option,
437.Nm
438will accept the peer's idea of our local IP address,
439even if the local IP address was specified in an option.
440.It Cm ipcp-accept-remote
441With this option,
442.Nm
443will accept the peer's idea of its (remote) IP address,
444even if the remote IP address was specified in an option.
445.It Cm ipcp-max-configure Ar n
446Set the maximum number of IPCP configure-request transmissions to
447.Ar n
448(default 10).
449.It Cm ipcp-max-failure Ar n
450Set the maximum number of IPCP configure-NAKs returned before starting
451to send configure-Rejects to
452.Ar n
453(default 10).
454.It Cm ipcp-max-terminate Ar n
455Set the maximum number of IPCP terminate-request transmissions to
456.Ar n
457(default 3).
458.It Cm ipcp-restart Ar n
459Set the IPCP restart interval (retransmission timeout) to
460.Ar n
461seconds (default 3).
462.It Cm ipparam Ar string
463Provides an extra parameter to the ip-up and ip-down scripts.
464If this option is given, the
465.Ar string
466supplied is given as the 6th parameter to those scripts.
467.It Cm kdebug Ar n
468Enable debugging code in the kernel-level PPP driver.
469The argument
470.Ar n
471is a number which is the sum of the following values:
4721 to enable general debug messages,
4732 to request that the contents of received packets be printed,
474and 4 to request that the contents of transmitted packets be printed.
475On most systems, messages printed by the kernel are logged by
476.Xr syslogd 8
477to a file as directed in the
478.Pa /etc/syslog.conf
479configuration file.
480.It Cm lcp-echo-failure Ar n
481If this option is given,
482.Nm
483will presume the peer to be dead if
484.Ar n
485LCP echo-requests are sent without receiving a valid LCP echo-reply.
486If this happens,
487.Nm
488will terminate the connection.
489Use of this option requires a non-zero value for the
490.Cm lcp-echo-interval
491parameter.
492This option can be used to enable
493.Nm
494to terminate after the physical connection has been broken
495(e.g., the modem has hung up) in situations where no hardware modem
496control lines are available.
497.It Cm lcp-echo-interval Ar n
498If this option is given,
499.Nm
500will send an LCP echo-request frame to the peer every
501.Ar n
502seconds.
503Normally the peer should respond to the echo-request by sending an echo-reply.
504This option can be used with the
505.Cm lcp-echo-failure
506option to detect that the peer is no longer connected.
507.It Cm lcp-max-configure Ar n
508Set the maximum number of LCP configure-request transmissions to
509.Ar n
510(default 10).
511.It Cm lcp-max-failure Ar n
512Set the maximum number of LCP configure-NAKs returned before starting
513to send configure-Rejects to
514.Ar n
515(default 10).
516.It Cm lcp-max-terminate Ar n
517Set the maximum number of LCP terminate-request transmissions to
518.Ar n
519(default 3).
520.It Cm lcp-restart Ar n
521Set the LCP restart interval (retransmission timeout) to
522.Ar n
523seconds (default 3).
524.It Cm local
525Don't use the modem control lines.
526With this option,
527.Nm
528will ignore the state of the CD (Carrier Detect) signal from the modem
529and will not change the state of the DTR (Data Terminal Ready) signal.
530.It Cm login
531Use the system password database for authenticating the peer using
532PAP, and record the user in the system wtmp file.
533Note that the peer must have an entry in the
534.Pa /etc/ppp/pap-secrets
535file as well as the system password database to be allowed access.
536.It Cm maxconnect Ar n
537Terminate the connection when it has been available for network
538traffic for
539.Ar n
540seconds (i.e.,
541.Ar n
542seconds after the first network control protocol comes up).
543.It Cm modem
544Use the modem control lines.
545This option is the default.
546With this option,
547.Nm
548will wait for the CD (Carrier Detect) signal from the
549modem to be asserted when opening the serial device (unless a connect
550script is specified), and it will drop the DTR (Data Terminal Ready)
551signal briefly when the connection is terminated and before executing
552the connect script.
553On Ultrix, this option implies hardware flow control, as for the
554.Cm crtscts
555option.
556.It Cm modem_chat
557Use the modem control lines during the chat script.
558The default is to ignore the state of the CD (Carrier Detect) signal
559from the modem during the chat script.
560If you are using a
561.Xr cua 4
562device (as opposed to a
563.Xr tty 4
564device)
565you should set this option.
566You should not use this option with a dialback setup as it will cause
567the chat script to exit when carrier drops.
568.It Cm ms-dns Op Ar addr
569If
570.Nm
571is acting as a server for Microsoft Windows clients, this option allows
572.Nm
573to supply one or two DNS (Domain Name Server) addresses to the clients.
574The first instance of this option specifies the primary DNS address;
575the second instance (if given) specifies the secondary DNS address.
576(This option was present in some older versions of
577.Nm
578under the name
579.Cm dns-addr . )
580.It Cm ms-wins Op Ar addr
581If
582.Nm
583is acting as a server for Microsoft Windows or
584.Qq Samba
585clients,
586this option allows
587.Nm
588to supply one or two WINS (Windows Internet Name Services) server addresses
589to the clients.
590The first instance of this option specifies the primary WINS address;
591the second instance (if given) specifies the secondary WINS address.
592.It Cm name Ar name
593Set the name of the local system for authentication purposes to
594.Ar name .
595This is a privileged option.
596With this option,
597.Nm
598will use lines in the secrets files which have
599.Ar name
600as the second field when looking for a secret to use
601in authenticating the peer.
602In addition, unless overridden with the
603.Cm user
604option,
605.Ar name
606will be used as the name to send to the peer when authenticating the
607local system to the peer.
608(Note that
609.Nm
610does not append the domain name to
611.Ar name . )
612.It Cm netmask Ar n
613Set the interface netmask to
614.Ar n ,
615a 32-bit netmask in
616.Dq decimal dot
617notation (e.g. 255.255.255.0).
618If this option is given, the value specified is ORed with the default netmask.
619The default netmask is chosen based on the negotiated remote IP address;
620it is the appropriate network mask for the class of the remote IP address,
621ORed with the netmasks for any non point-to-point network interfaces in the
622system which are on the same network.
623(Note: on some platforms,
624.Nm
625will always use 255.255.255.255 for the netmask, if that is the only
626appropriate value for a point-to-point interface.)
627.It Cm noaccomp
628Disable Address/Control compression in both directions (send and receive).
629.It Cm noauth
630Do not require the peer to authenticate itself.
631This option is privileged if the
632.Cm auth
633option is specified in
634.Pa /etc/ppp/options .
635.It Cm nobsdcomp
636Disables BSD-Compress compression;
637.Nm
638will not request or agree to compress packets using the BSD-Compress scheme.
639.It Cm noccp
640Disable CCP (Compression Control Protocol) negotiation.
641This option should only be required if the peer is buggy and gets confused by
642requests from
643.Nm
644for CCP negotiation.
645.It Cm nocrtscts
646Disable hardware flow control (i.e., RTS/CTS) on the serial port.
647If neither the
648.Cm crtscts
649nor the
650.Cm nocrtscts
651option is given, the hardware flow control setting for the serial port
652is left unchanged.
653.It Cm nodefaultroute
654Disable the
655.Cm defaultroute
656option.
657The system administrator who wishes to prevent users from creating
658default routes with
659.Nm
660can do so by placing this option in the
661.Pa /etc/ppp/options
662file.
663.It Cm nodeflate
664Disables Deflate compression;
665.Nm
666will not request or agree to compress packets using the Deflate scheme.
667.It Cm nodetach
668Don't detach from the controlling terminal.
669Without this option, if a serial device other than the terminal
670on the standard input is specified,
671.Nm
672will fork to become a background process.
673.It Cm noip
674Disable IPCP negotiation and IP communication.
675This option should only be required if the peer is buggy and gets confused
676by requests from
677.Nm
678for IPCP negotiation.
679.It Cm noipdefault
680Disables the default behaviour when no local IP address is specified,
681which is to determine (if possible) the local IP address from the hostname.
682With this option, the peer will have to supply the local IP
683address during IPCP negotiation (unless it was specified explicitly
684on the command line or in an options file).
685.It Cm nomagic
686Disable magic number negotiation.
687With this option,
688.Nm
689cannot detect a looped-back line.
690This option should only be needed if the peer is buggy.
691.It Cm nopcomp
692Disable protocol field compression negotiation in both the receive and
693the transmit direction.
694.It Cm nopersist
695Exit once a connection has been made and terminated.
696This is the default unless the
697.Cm persist
698or
699.Cm demand
700option has been specified.
701.It Cm nopredictor1
702Do not accept or agree to Predictor-1 compression.
703.It Cm noproxyarp
704Disable the
705.Cm proxyarp
706option.
707The system administrator who wishes to prevent users from creating
708proxy ARP entries with
709.Nm
710can do so by placing this option in the
711.Pa /etc/ppp/options
712file.
713.It Cm novj
714Disable Van Jacobson style TCP/IP header compression in both the
715transmit and the receive direction.
716.It Cm novjccomp
717Disable the connection-ID compression option in Van Jacobson style
718TCP/IP header compression.
719With this option,
720.Nm
721will not omit the connection-ID byte from Van Jacobson compressed
722TCP/IP headers, nor ask the peer to do so.
723.It Cm papcrypt
724Indicates that all secrets in the
725.Pa /etc/ppp/pap-secrets
726file which are used for checking the identity of the peer are encrypted,
727and thus
728.Nm
729should not accept a password which, before encryption,
730is identical to the secret from the
731.Pa /etc/ppp/pap-secrets
732file.
733.It Cm pap-max-authreq Ar n
734Set the maximum number of PAP authenticate-request transmissions to
735.Ar n
736(default 10).
737.It Cm pap-restart Ar n
738Set the PAP restart interval (retransmission timeout) to
739.Ar n
740seconds (default 3).
741.It Cm pap-timeout Ar n
742Set the maximum time that
743.Nm
744will wait for the peer to authenticate itself with PAP to
745.Ar n
746seconds (0 means no limit).
747.It Cm pass-filter Ar filter-expression
748Specifies a packet filter to apply to data packets being sent or
749received to determine which packets should be allowed to pass.
750Packets which are rejected by the filter are silently discarded.
751This option can be used to prevent specific network protocols
752using up link bandwidth, or to provide a basic firewall capability.
753The
754.Ar filter-expression
755syntax is as described for
756.Xr tcpdump 8 ,
757except that qualifiers which are inappropriate for a PPP link, such as
758.Ar ether
759and
760.Ar arp ,
761are not permitted.
762Generally the filter expression should be enclosed in single quotes to prevent
763whitespace in the expression from being interpreted by the shell.
764Note that it is possible to apply different constraints to incoming and
765outgoing packets using the
766.Cm inbound
767and
768.Cm outbound
769qualifiers.
770.It Cm persist
771Do not exit after a connection is terminated; instead try to reopen
772the connection.
773.It Cm predictor1
774Request that the peer compress frames that it sends using Predictor-1
775compression, and agree to compress transmitted frames with Predictor-1
776if requested.
777This option has no effect unless the kernel driver supports Predictor-1
778compression.
779.It Cm proxyarp
780Add an entry to this system's ARP (Address Resolution Protocol) table
781with the IP address of the peer and the Ethernet address of this system.
782This will have the effect of making the peer appear to other
783systems to be on the local Ethernet.
784.It Cm remotename Ar name
785Set the assumed name of the remote system for authentication purposes to
786.Ar name .
787.It Cm refuse-chap
788With this option,
789.Nm
790will not agree to authenticate itself to the peer using CHAP.
791.It Cm refuse-pap
792With this option,
793.Nm
794will not agree to authenticate itself to the peer using PAP.
795.It Cm require-chap
796Require the peer to authenticate itself using CHAP
797(Challenge Handshake Authentication Protocol) authentication.
798.It Cm require-pap
799Require the peer to authenticate itself using PAP
800(Password Authentication Protocol) authentication.
801.It Cm silent
802With this option,
803.Nm
804will not transmit LCP packets to initiate a connection until a valid LCP
805packet is received from the peer (as for the `passive' option with ancient
806versions of
807.Nm pppd ) .
808.It Cm usehostname
809Enforce the use of the hostname (with domain name appended, if given)
810as the name of the local system for authentication purposes (overrides the
811.Cm name
812option).
813.It Cm user Ar name
814Sets the name used for authenticating the local system to the peer to
815.Ar name .
816.It Cm vj-max-slots Ar n
817Sets the number of connection slots to be used by the Van Jacobson
818TCP/IP header compression and decompression code to
819.Ar n ,
820which must be between 2 and 16, inclusive.
821.It Cm welcome Ar script
822Run the executable or shell command specified by
823.Ar script
824before initiating PPP negotiation, after the connect script (if any) has
825completed.
826This option is privileged if the
827.Cm noauth
828option is used.
829.It Cm xonxoff
830Use software flow control (i.e., XON/XOFF) to control the flow of data on
831the serial port.
832.El
833.Sh OPTIONS FILES
834Options can be taken from files as well as the command line.
835.Nm
836reads options from the files
837.Pa /etc/ppp/options , ~/.ppprc
838and
839.Pf /etc/ppp/options. Ar ttyname
840(in that order) before processing the options on the command line.
841(In fact, the command-line options are scanned to find the terminal name
842before the
843.Pf options. Ar ttyname
844file is read.)
845In forming the name of the
846.Pf options. Ar ttyname
847file,
848the initial /dev/ is removed from the terminal name, and any remaining
849/ characters are replaced with dots.
850.Pp
851An options file is parsed into a series of words, delimited by whitespace.
852Whitespace can be included in a word by enclosing the word in double-quotes (").
853A backslash (\e) quotes the following character.
854A hash (#) starts a comment, which continues until the end of the line.
855There is no restriction on using the
856.Cm file
857or
858.Cm call
859options within an options file.
860.Sh SECURITY
861Users must be in group
862.Qq network
863to be able to use
864.Nm pppd .
865.Pp
866.Nm
867provides system administrators with sufficient access control that PPP
868access to a server machine can be provided to legitimate users without
869fear of compromising the security of the server or the network it's on.
870In part this is provided by the
871.Pa /etc/ppp/options file ,
872where the administrator can place options to restrict the ways in which
873.Nm
874can be used, and in part by the PAP and CHAP secrets files, where the
875administrator can restrict the set of IP addresses which individual
876users may use.
877.Pp
878The normal way that
879.Nm
880should be set up is to have the
881.Cm auth
882option in the
883.Pa /etc/ppp/options
884file.
885(This may become the default in later releases.)
886If users wish to use
887.Nm
888to dial out to a peer which will refuse to authenticate itself
889(such as an internet service provider), the system administrator should
890create an options file under
891.Pa /etc/ppp/peers
892containing the
893.Cm noauth
894option, the name of the serial port to use, and the
895.Cm connect
896option (if required), plus any other appropriate options.
897In this way,
898.Nm
899can be set up to allow non-privileged users to make unauthenticated
900connections only to trusted peers.
901.Pp
902As indicated above, some security-sensitive options are privileged,
903which means that they may not be used by an ordinary non-privileged
904user running a setuid-root
905.Nm pppd ,
906either on the command line, in the user's
907.Pa ~/.ppprc
908file, or in an options file read using the
909.Cm file
910option.
911Privileged options may be used in the
912.Pa /etc/ppp/options
913file or in an options file read using the
914.Cm call
915option.
916If
917.Nm
918is being run by the root user, privileged options can be used without
919restriction.
920.Sh AUTHENTICATION
921Authentication is the process whereby one peer convinces the other of
922its identity.
923This involves the first peer sending its name to the other,
924together with some kind of secret information which could only
925come from the genuine authorized user of that name.
926In such an exchange, we will call the first peer the
927.Qq client
928and the other the
929.Qq server .
930The client has a name by which it identifies itself to the server,
931and the server also has a name by which it identifies itself to the client.
932Generally the genuine client shares some secret (or password) with the server,
933and authenticates itself by proving that it knows that secret.
934Very often, the names used for authentication correspond to the internet
935hostnames of the peers, but this is not essential.
936.Pp
937At present,
938.Nm
939supports two authentication protocols:
940the Password Authentication Protocol (PAP)
941and the Challenge Handshake Authentication Protocol (CHAP).
942PAP involves the client sending its name and a cleartext password
943to the server to authenticate itself.
944In contrast, the server initiates the CHAP authentication exchange by
945sending a challenge to the client (the challenge packet includes the
946server's name).
947The client must respond with a response which includes its name
948plus a hash value derived from the shared secret and the challenge,
949in order to prove that it knows the secret.
950.Pp
951The PPP protocol, being symmetrical, allows both peers to require the
952other to authenticate itself.
953In that case, two separate and independent authentication exchanges
954will occur.
955The two exchanges could use different authentication protocols,
956and in principle, different names could be used in the two exchanges.
957.Pp
958The default behaviour of
959.Nm
960is to agree to authenticate if requested, and to not require authentication
961from the peer.
962However,
963.Nm
964will not agree to authenticate itself with a particular protocol
965if it has no secrets which could be used to do so.
966.Pp
967.Nm
968stores secrets for use in authentication in secrets files
969.Pf ( Pa /etc/ppp/pap-secrets
970for PAP,
971.Pa /etc/ppp/chap-secrets
972for CHAP).
973Both secrets files have the same format.
974The secrets files can contain secrets for
975.Nm
976to use in authenticating itself to other systems, as well as secrets for
977.Nm
978to use when authenticating other systems to itself.
979.Pp
980Each line in a secrets file contains one secret.
981Any following words on the same line are taken to be a list
982of acceptable IP addresses for that client.
983If there are only 3 words on the line, or if the first word is
984.Qq \- ,
985then all IP addresses are disallowed.
986To allow any address, use
987.Qq * .
988A word starting with
989.Qq \&!
990indicates that the specified address is
991.Em not
992acceptable.
993An address may be followed by
994.Qq /
995and a number
996.Ar n ,
997to indicate a whole subnet, i.e., all addresses which have the same value
998in the most significant
999.Ar n
1000bits.
1001Case is significant in the client and server names and in the secret.
1002.Pp
1003If the secret starts with an `@', what follows is assumed to be the
1004name of a file from which to read the secret.
1005A
1006.Qq *
1007as the client or server name matches any name.
1008When selecting a secret,
1009.Nm
1010takes the best match, i.e., the match with the fewest wildcards.
1011.Pp
1012Thus a secrets file contains both secrets for use in authenticating
1013other hosts, plus secrets which we use for authenticating ourselves to
1014others.
1015When
1016.Nm
1017is authenticating the peer (checking the peer's identity), it chooses a
1018secret with the peer's name in the first field and the name of the local
1019system in the second field.
1020The name of the local system defaults to the hostname, with the domain
1021name appended if the
1022.Cm domain
1023option is used.
1024This default can be overridden with the
1025.Cm name
1026option, except when the
1027.Cm usehostname
1028option is used.
1029.Pp
1030When
1031.Nm
1032is choosing a secret to use in authenticating itself to the peer,
1033it first determines what name it is going to use to identify
1034itself to the peer.
1035This name can be specified by the user with the
1036.Cm user
1037option.
1038If this option is not used, the name defaults to the name of the local system,
1039determined as described in the previous paragraph.
1040Then
1041.Nm
1042looks for a secret with this name in the first field and the peer's name
1043in the second field.
1044.Nm
1045will know the name of the peer if CHAP authentication is being used, because
1046the peer will have sent it in the challenge packet.
1047However, if PAP is being used,
1048.Nm
1049will have to determine the peer's name from the options specified by the user.
1050The user can specify the peer's name directly with the
1051.Cm remotename
1052option.
1053Otherwise, if the remote IP address was specified by a name
1054(rather than in numeric form), that name will be used as the peer's name.
1055Failing that,
1056.Nm
1057will use the null string as the peer's name.
1058.Pp
1059When authenticating the peer with PAP, the supplied password is first
1060compared with the secret from the secrets file.
1061If the password doesn't match the secret, the password is encrypted using
1062.Xr crypt 3
1063and checked against the secret again.
1064Thus secrets for authenticating the peer can be stored in encrypted form
1065if desired.
1066If the
1067.Cm papcrypt
1068option is given, the first (unencrypted) comparison is omitted,
1069for better security.
1070.Pp
1071Furthermore, if the
1072.Cm login
1073option was specified, the username and password are also checked against
1074the system password database.
1075Thus, the system administrator can set up the pap-secrets file to allow PPP
1076access only to certain users, and to restrict the set of IP addresses
1077that each user can use.
1078Typically, when using the
1079.Cm login
1080option, the secret in
1081.Pa /etc/ppp/pap-secrets
1082would be
1083.Pq ,
1084which will match any password supplied by the peer.
1085This avoids the need to have the same secret in two places.
1086.Pp
1087Authentication must be satisfactorily completed before IPCP
1088(or any other Network Control Protocol) can be started.
1089If the peer is required to authenticate itself, and fails to do so,
1090.Nm
1091will terminate the link (by closing LCP).
1092If IPCP negotiates an unacceptable IP address for the remote host,
1093IPCP will be closed.
1094IP packets can only be sent or received when IPCP is open.
1095.Pp
1096In some cases it is desirable to allow some hosts which can't
1097authenticate themselves to connect and use one of a restricted set of
1098IP addresses, even when the local host generally requires authentication.
1099If the peer refuses to authenticate itself when requested,
1100.Nm
1101takes that as equivalent to authenticating with PAP
1102using the empty string for the username and password.
1103Thus, by adding a line to the pap-secrets file which specifies the empty
1104string for the client and password, it is possible to allow restricted
1105access to hosts which refuse to authenticate themselves.
1106.Sh ROUTING
1107When IPCP negotiation is completed successfully,
1108.Nm
1109will inform the kernel of the local and remote IP addresses for the PPP
1110interface.
1111This is sufficient to create a host route to the remote end of the
1112link, which will enable the peers to exchange IP packets.
1113Communication with other machines generally requires further
1114modification to routing tables and/or ARP
1115(Address Resolution Protocol) tables.
1116In most cases the
1117.Cm defaultroute
1118and/or
1119.Cm proxyarp
1120options are sufficient for this, but in some cases
1121further intervention is required.
1122The
1123.Pa /etc/ppp/ip-up
1124script can be used for this.
1125.Pp
1126Sometimes it is desirable to add a default route through the remote
1127host, as in the case of a machine whose only connection to the
1128Internet is through the PPP interface.
1129The
1130.Cm defaultroute
1131option causes
1132.Nm
1133to create such a default route when IPCP comes up, and
1134delete it when the link is terminated.
1135.Pp
1136In some cases it is desirable to use proxy ARP, for example on a
1137server machine connected to a LAN, in order to allow other hosts to
1138communicate with the remote host.
1139The
1140.Cm proxyarp
1141option causes
1142.Nm
1143to look for a network interface on the same subnet as the remote
1144host (an interface supporting broadcast and ARP, which is up and not a
1145point-to-point or loopback interface).
1146If found,
1147.Nm
1148creates a permanent, published ARP entry with the IP address of the remote host
1149and the hardware address of the network interface found.
1150.Pp
1151When the
1152.Cm demand
1153option is used, the interface IP addresses have
1154already been set at the point when IPCP comes up.
1155If
1156.Nm
1157has not been able to negotiate the same addresses that it used to configure
1158the interface (for example when the peer is an ISP that uses dynamic
1159IP address assignment),
1160.Nm
1161has to change the interface IP addresses to the negotiated addresses.
1162This may disrupt existing connections, and the use of demand dialling with
1163peers that do dynamic IP address assignment is not recommended.
1164.Sh SCRIPTS
1165.Nm
1166invokes scripts at various stages in its processing which can be
1167used to perform site-specific ancillary processing.
1168These scripts are usually shell scripts, but could be executable code files
1169instead.
1170.Nm
1171does not wait for the scripts to finish.
1172.\" The scripts are executed as root (with the real and effective user ID set to 0),
1173.\" so that they can do things such as update routing tables or run
1174.\" privileged daemons.
1175.\" Be careful that the contents of these scripts do not compromise your system's
1176.\" security.
1177.Nm
1178runs the scripts with standard input, output and error redirected to
1179.Pa /dev/null ,
1180and with an environment that is empty except for some environment variables
1181that give information about the link.
1182The environment variables that
1183.Nm
1184sets are:
1185.Bl -tag -width "PEERNAME"
1186.It Ev DEVICE
1187The name of the serial tty device being used.
1188.It Ev IFNAME
1189The name of the network interface being used.
1190.It Ev IPLOCAL
1191The IP address for the local end of the link.
1192This is only set when IPCP has come up.
1193.It Ev IPREMOTE
1194The IP address for the remote end of the link.
1195This is only set when IPCP has come up.
1196.It Ev PEERNAME
1197The authenticated name of the peer.
1198This is only set if the peer authenticates itself.
1199.It Ev SPEED
1200The baud rate of the tty device.
1201.It Ev UID
1202The real user ID of the user who invoked
1203.Nm pppd .
1204.El
1205.Pp
1206.Nm
1207invokes the following scripts, if they exist.
1208It is not an error if they don't exist.
1209.Bl -tag -width Ds
1210.It Pa /etc/ppp/auth-up
1211A program or script which is executed after the remote system
1212successfully authenticates itself.
1213It is executed with the parameters
1214.Pp
1215.Ar interface-name peer-name user-name tty-device speed
1216.Pp
1217Note that this script is not executed if the peer doesn't authenticate
1218itself, for example when the
1219.Cm noauth
1220option is used.
1221.It Pa /etc/ppp/auth-down
1222A program or script which is executed when the link goes down, if
1223.Pa /etc/ppp/auth-up
1224was previously executed.
1225It is executed in the same manner with the same parameters as
1226.Pa /etc/ppp/auth-up .
1227.It Pa /etc/ppp/ip-up
1228A program or script which is executed when the link is available for
1229sending and receiving IP packets (that is, IPCP has come up).
1230It is executed with the parameters
1231.Pp
1232.Ar interface-name tty-device speed local-IP-address remote-IP-address ipparam
1233.It Pa /etc/ppp/ip-down
1234A program or script which is executed when the link is no longer
1235available for sending and receiving IP packets.
1236This script can be used for undoing the effects of the
1237.Pa /etc/ppp/ip-up
1238script.
1239It is invoked in the same manner and with the same parameters as the ip-up
1240script.
1241.El
1242.Sh FILES
1243.Bl -tag -width Ds
1244.It Pa /etc/ppp/pap-secrets
1245Usernames, passwords and IP addresses for PAP authentication.
1246This file should be owned by root and not readable or writable by any other
1247user.
1248.Nm
1249will log a warning if this is not the case.
1250.It Pa /etc/ppp/chap-secrets
1251Names, secrets and IP addresses for CHAP authentication.
1252As for
1253.Pa /etc/ppp/pap-secrets ,
1254this file should be owned by root and not readable or writable
1255by any other user.
1256.Nm
1257will log a warning if this is not the case.
1258.It Pa /etc/ppp/options
1259System default options for
1260.Nm pppd ,
1261read before user default options or command-line options.
1262.It Pa ~/.ppprc
1263User default options, read before
1264.Pf /etc/ppp/options. Ar ttyname .
1265.It Pa /etc/ppp/options. Ns Ar ttyname
1266System default options for the serial port being used, read after
1267.Pa ~/.ppprc .
1268In forming the
1269.Ar ttyname
1270part of this filename, an initial /dev/ is stripped from the port name (if
1271present), and any slashes in the remaining part are converted to dots.
1272.It Pa /etc/ppp/peers
1273A directory containing options files which may contain privileged
1274options, even if
1275.Nm
1276was invoked by a user other than root.
1277The system administrator can create options files in this directory to
1278permit non-privileged users to dial out without requiring the peer to
1279authenticate, but only to certain trusted peers.
1280.El
1281.Sh EXAMPLES
1282The following examples assume that the
1283.Pa /etc/ppp/options
1284file contains the
1285.Cm auth
1286option (as in the default
1287.Pa /etc/ppp/options
1288file in the PPP distribution).
1289.Pp
1290Probably the most common use of
1291.Nm
1292is to dial out to an ISP.
1293This can be done with a command such as
1294.Pp
1295.Dl pppd call isp
1296.Pp
1297where the
1298.Pa /etc/ppp/peers/isp
1299file is set up by the system administrator to contain something like this:
1300.Bd -literal -offset indent
1301ttyS0 19200 crtscts
1302connect '/usr/sbin/chat -v -f /etc/ppp/chat-isp'
1303noauth
1304.Ed
1305.Pp
1306In this example, we are using chat to dial the ISP's modem and go
1307through any logon sequence required.
1308The
1309.Pa /etc/ppp/chat-isp
1310file contains the script used by chat; it could for example contain
1311something like this:
1312.Bd -literal -offset indent
1313ABORT "NO CARRIER"
1314ABORT "NO DIALTONE"
1315ABORT "ERROR"
1316ABORT "NO ANSWER"
1317ABORT "BUSY"
1318ABORT "Username/Password Incorrect"
1319"" "at"
1320OK "at&d0&c1"
1321OK "atdt2468135"
1322"name:" "^Umyuserid"
1323"word:" "\eqmypassword"
1324"ispts" "\eq^Uppp"
1325"~-^Uppp-~"
1326.Ed
1327.Pp
1328See the
1329.Xr chat 8
1330man page for details of chat scripts.
1331.Pp
1332.Nm
1333can also be used to provide a dial-in PPP service for users.
1334If the users already have login accounts, the simplest way to set up the
1335PPP service is to let the users log in to their accounts and run
1336.Nm
1337(installed setuid-root) with a command such as
1338.Pp
1339.Dl pppd proxyarp
1340.Pp
1341To allow a user to use the PPP facilities, you need to allocate an IP
1342address for that user's machine and create an entry in
1343.Pa /etc/ppp/pap-secrets
1344or
1345.Pa /etc/ppp/chap-secrets
1346(depending on which authentication method the PPP implementation on the
1347user's machine supports), so that the user's
1348machine can authenticate itself.
1349For example, if Joe has a machine called
1350.Qq joespc
1351which is to be allowed to dial in to the machine called
1352.Qq server
1353and use the IP address joespc.my.net, you would add an entry like this to
1354.Pa /etc/ppp/pap-secrets
1355or
1356.Pa /etc/ppp/chap-secrets :
1357.Pp
1358.Dl joespc	server	"joe's secret"	joespc.my.net
1359.Pp
1360Alternatively, you can create a username called (for example)
1361.Qq ppp ,
1362whose login shell is
1363.Nm
1364and whose home directory is
1365.Pa /etc/ppp .
1366Options to be used when
1367.Nm
1368is run this way can be put in
1369.Pa /etc/ppp/.ppprc .
1370.Pp
1371If your serial connection is any more complicated than a piece of
1372wire, you may need to arrange for some control characters to be escaped.
1373In particular, it is often useful to escape XON (^Q) and
1374XOFF (^S), using
1375.Cm asyncmap a0000 .
1376If the path includes a telnet, you probably should escape ^] as well
1377.Cm ( asyncmap 200a0000 ) .
1378If the path includes an rlogin, you will need to use the
1379.Cm escape ff
1380option on the end which is running the rlogin client, since many
1381rlogin implementations are not transparent; they will remove the
1382sequence (0xff, 0xff, 0x73, 0x73, followed by any 8 bytes) from the stream.
1383.Sh DIAGNOSTICS
1384Messages are sent to the
1385.Xr syslogd 8
1386daemon using facility
1387.Dv LOG_DAEMON .
1388(This can be overridden by recompiling
1389.Nm
1390with the macro
1391.Dv LOG_PPP
1392defined as the desired facility.)
1393See the
1394.Xr syslogd 8
1395documentation for details of where the syslog daemon will write the
1396messages.
1397On most systems, the syslog daemon uses the
1398.Pa /etc/syslog.conf
1399file to specify the destination(s) for syslog messages.
1400You may need to edit that file to suit.
1401.Pp
1402The
1403.Cm debug
1404option causes the contents of all control packets sent
1405or received to be logged, that is, all LCP, PAP, CHAP or IPCP packets.
1406This can be useful if the PPP negotiation does not succeed or if
1407authentication fails.
1408If debugging is enabled at compile time, the
1409.Cm debug
1410option also causes other debugging messages to be logged.
1411.Pp
1412Debugging can also be enabled or disabled by sending a SIGUSR1 signal
1413to the
1414.Nm
1415process.
1416This signal acts as a toggle.
1417.Sh SEE ALSO
1418.Xr cua 4 ,
1419.Xr ppp 4 ,
1420.Xr tty 4 ,
1421.Xr chat 8 ,
1422.Xr syslogd 8 ,
1423.Xr tcpdump 8
1424.Rs
1425.%A V. Jacobson
1426.%D February 1990
1427.%R RFC 1144
1428.%T Compressing TCP/IP Headers for Low-Speed Serial Links
1429.Re
1430.Rs
1431.%A R. Rivest
1432.%D April 1992
1433.%R RFC 1321
1434.%T The MD5 Message-Digest Algorithm
1435.Re
1436.Rs
1437.%A G. McGregor
1438.%D May 1992
1439.%R RFC 1332
1440.%T The PPP Internet Protocol Control Protocol (IPCP)
1441.Re
1442.Rs
1443.%A B. Lloyd
1444.%A W. Simpson
1445.%D October 1992
1446.%R RFC 1334
1447.%T PPP Authentication Protocols
1448.Re
1449.Rs
1450.%A W. Simpson
1451.%D July 1994
1452.%R RFC 1661
1453.%T The Point-to-Point Protocol (PPP)
1454.Re
1455.Rs
1456.%A W. Simpson
1457.%D July 1994
1458.%R RFC 1662
1459.%T PPP in HDLC-like Framing
1460.Re
1461.Rs
1462.%A W. Simpson
1463.%D August 1996
1464.%R RFC 1994
1465.%T PPP Challenge Handshake Authentication Protocol (CHAP)
1466.Re
1467.Sh NOTES
1468Some limited degree of control can be exercised over a running
1469.Nm
1470process by sending it a signal from the list below.
1471.Bl -tag -width Ds
1472.It SIGINT , SIGTERM
1473These signals cause
1474.Nm
1475to terminate the link (by closing LCP), restore the serial device settings,
1476and exit.
1477.It SIGHUP
1478This signal causes
1479.Nm
1480to terminate the link, restore the serial device settings,
1481and close the serial device.
1482If the
1483.Cm persist
1484or
1485.Cm demand
1486option has been specified,
1487.Nm
1488will try to reopen the serial device and start another connection
1489(after the holdoff period).
1490Otherwise
1491.Nm
1492will exit.
1493If this signal is received during the holdoff period, it causes
1494.Nm
1495to end the holdoff period immediately.
1496.It SIGUSR1
1497This signal toggles the state of the
1498.Cm debug
1499option.
1500.It SIGUSR2
1501This signal causes
1502.Nm
1503to renegotiate compression.
1504This can be useful to re-enable compression after it has been disabled
1505as a result of a fatal decompression error.
1506(Fatal decompression errors generally indicate a bug
1507in one or other implementation.)
1508.El
1509.Sh AUTHORS
1510.An Paul Mackerras Aq Mt Paul.Mackerras@samba.org ,
1511based on earlier work by Drew Perkins, Brad Clements, Karl Fox, Greg Christy,
1512and Brad Parker.
1513.Sh BUGS
1514Scripts should be run as root,
1515but are not.
1516