]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/ppp/ppp.8
mdoc(7) police:
[FreeBSD/FreeBSD.git] / usr.sbin / ppp / ppp.8
1 .\"
2 .\" Copyright (c) 2001 Brian Somers <brian@Awfulhak.org>
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .\" $FreeBSD$
27 .\"
28 .Dd September 20, 1995
29 .Dt PPP 8
30 .Os
31 .Sh NAME
32 .Nm ppp
33 .Nd Point to Point Protocol (a.k.a. user-ppp)
34 .Sh SYNOPSIS
35 .Nm
36 .Op Fl Va mode
37 .Op Fl nat
38 .Op Fl quiet
39 .Op Fl unit Ns Ar N
40 .Op Ar system ...
41 .Sh DESCRIPTION
42 This is a user process
43 .Em PPP
44 software package.
45 Normally,
46 .Em PPP
47 is implemented as a part of the kernel (e.g., as managed by
48 .Xr pppd 8 )
49 and it's thus somewhat hard to debug and/or modify its behaviour.
50 However, in this implementation
51 .Em PPP
52 is done as a user process with the help of the
53 tunnel device driver (tun).
54 .Pp
55 The
56 .Fl nat
57 flag does the equivalent of a
58 .Dq nat enable yes ,
59 enabling
60 .Nm Ns No 's
61 network address translation features.
62 This allows
63 .Nm
64 to act as a NAT or masquerading engine for all machines on an internal
65 LAN.
66 Refer to
67 .Xr libalias 3
68 for details.
69 .Pp
70 The
71 .Fl quiet
72 flag tells
73 .Nm
74 to be silent at startup rather than displaying the mode and interface
75 to standard output.
76 .Pp
77 The
78 .Fl unit
79 flag tells
80 .Nm
81 to only attempt to open
82 .Pa /dev/tun Ns Ar N .
83 Normally,
84 .Nm
85 will start with a value of 0 for
86 .Ar N ,
87 and keep trying to open a tunnel device by incrementing the value of
88 .Ar N
89 by one each time until it succeeds.
90 If it fails three times in a row
91 because the device file is missing, it gives up.
92 .Pp
93 The following
94 .Va mode Ns No s
95 are understood by
96 .Nm :
97 .Bl -tag -width XXX -offset XXX
98 .It Fl auto
99 .Nm
100 opens the tun interface, configures it then goes into the background.
101 The link isn't brought up until outgoing data is detected on the tun
102 interface at which point
103 .Nm
104 attempts to bring up the link.
105 Packets received (including the first one) while
106 .Nm
107 is trying to bring the link up will remain queued for a default of
108 2 minutes.
109 See the
110 .Dq set choked
111 command below.
112 .Pp
113 In
114 .Fl auto
115 mode, at least one
116 .Dq system
117 must be given on the command line (see below) and a
118 .Dq set ifaddr
119 must be done in the system profile that specifies a peer IP address to
120 use when configuring the interface.
121 Something like
122 .Dq 10.0.0.1/0
123 is usually appropriate.
124 See the
125 .Dq pmdemand
126 system in
127 .Pa /usr/share/examples/ppp/ppp.conf.sample
128 for an example.
129 .It Fl background
130 Here,
131 .Nm
132 attempts to establish a connection with the peer immediately.
133 If it succeeds,
134 .Nm
135 goes into the background and the parent process returns an exit code
136 of 0.
137 If it fails,
138 .Nm
139 exits with a non-zero result.
140 .It Fl foreground
141 In foreground mode,
142 .Nm
143 attempts to establish a connection with the peer immediately, but never
144 becomes a daemon.
145 The link is created in background mode.
146 This is useful if you wish to control
147 .Nm Ns No 's
148 invocation from another process.
149 .It Fl direct
150 This is used for receiving incoming connections.
151 .Nm
152 ignores the
153 .Dq set device
154 line and uses descriptor 0 as the link.
155 .Pp
156 If callback is configured,
157 .Nm
158 will use the
159 .Dq set device
160 information when dialing back.
161 .It Fl dedicated
162 This option is designed for machines connected with a dedicated
163 wire.
164 .Nm
165 will always keep the device open and will never use any configured
166 chat scripts.
167 .It Fl ddial
168 This mode is equivalent to
169 .Fl auto
170 mode except that
171 .Nm
172 will bring the link back up any time it's dropped for any reason.
173 .It Fl interactive
174 This is a no-op, and gives the same behaviour as if none of the above
175 modes have been specified.
176 .Nm
177 loads any sections specified on the command line then provides an
178 interactive prompt.
179 .El
180 .Pp
181 One or more configuration entries or systems
182 (as specified in
183 .Pa /etc/ppp/ppp.conf )
184 may also be specified on the command line.
185 .Nm
186 will read the
187 .Dq default
188 system from
189 .Pa /etc/ppp/ppp.conf
190 at startup, followed by each of the systems specified on the command line.
191 .Sh Major Features
192 .Bl -diag
193 .It Provides an interactive user interface.
194 Using its command mode, the user can
195 easily enter commands to establish the connection with the remote end, check
196 the status of connection and close the connection.
197 All functions can also be optionally password protected for security.
198 .It Supports both manual and automatic dialing.
199 Interactive mode has a
200 .Dq term
201 command which enables you to talk to the device directly.
202 When you are connected to the remote peer and it starts to talk
203 .Em PPP ,
204 .Nm
205 detects it and switches to packet mode automatically.
206 Once you have
207 determined the proper sequence for connecting with the remote host, you
208 can write a chat script to define the necessary dialing and login
209 procedure for later convenience.
210 .It Supports on-demand dialup capability.
211 By using
212 .Fl auto
213 mode,
214 .Nm
215 will act as a daemon and wait for a packet to be sent over the
216 .Em PPP
217 link.
218 When this happens, the daemon automatically dials and establishes the
219 connection.
220 In almost the same manner
221 .Fl ddial
222 mode (direct-dial mode) also automatically dials and establishes the
223 connection.
224 However, it differs in that it will dial the remote site
225 any time it detects the link is down, even if there are no packets to be
226 sent.
227 This mode is useful for full-time connections where we worry less
228 about line charges and more about being connected full time.
229 A third
230 .Fl dedicated
231 mode is also available.
232 This mode is targeted at a dedicated link between two machines.
233 .Nm
234 will never voluntarily quit from dedicated mode - you must send it the
235 .Dq quit all
236 command via its diagnostic socket.
237 A
238 .Dv SIGHUP
239 will force an LCP renegotiation, and a
240 .Dv SIGTERM
241 will force it to exit.
242 .It Supports client callback.
243 .Nm
244 can use either the standard LCP callback protocol or the Microsoft
245 CallBack Control Protocol (ftp://ftp.microsoft.com/developr/rfc/cbcp.txt).
246 .It Supports NAT or packet aliasing.
247 Packet aliasing (a.k.a. IP masquerading) allows computers on a
248 private, unregistered network to access the Internet.
249 The
250 .Em PPP
251 host acts as a masquerading gateway.
252 IP addresses as well as TCP and
253 UDP port numbers are NAT'd for outgoing packets and de-NAT'd for
254 returning packets.
255 .It Supports background PPP connections.
256 In background mode, if
257 .Nm
258 successfully establishes the connection, it will become a daemon.
259 Otherwise, it will exit with an error.
260 This allows the setup of
261 scripts that wish to execute certain commands only if the connection
262 is successfully established.
263 .It Supports server-side PPP connections.
264 In direct mode,
265 .Nm
266 acts as server which accepts incoming
267 .Em PPP
268 connections on stdin/stdout.
269 .It "Supports PAP and CHAP (rfc 1994, 2433 and 2759) authentication.
270 With PAP or CHAP, it is possible to skip the Unix style
271 .Xr login 1
272 procedure, and use the
273 .Em PPP
274 protocol for authentication instead.
275 If the peer requests Microsoft CHAP authentication and
276 .Nm
277 is compiled with DES support, an appropriate MD4/DES response will be
278 made.
279 .It Supports RADIUS (rfc 2138) authentication.
280 An extension to PAP and CHAP,
281 .Em \&R Ns No emote
282 .Em \&A Ns No ccess
283 .Em \&D Ns No ial
284 .Em \&I Ns No n
285 .Em \&U Ns No ser
286 .Em \&S Ns No ervice
287 allows authentication information to be stored in a central or
288 distributed database along with various per-user framed connection
289 characteristics.
290 If
291 .Pa libradius
292 is available at compile time,
293 .Nm
294 will use it to make
295 .Em RADIUS
296 requests when configured to do so.
297 .It Supports Proxy Arp.
298 .Nm
299 can be configured to make one or more proxy arp entries on behalf of
300 the peer.
301 This allows routing from the peer to the LAN without
302 configuring each machine on that LAN.
303 .It Supports packet filtering.
304 User can define four kinds of filters: the
305 .Em in
306 filter for incoming packets, the
307 .Em out
308 filter for outgoing packets, the
309 .Em dial
310 filter to define a dialing trigger packet and the
311 .Em alive
312 filter for keeping a connection alive with the trigger packet.
313 .It Tunnel driver supports bpf.
314 The user can use
315 .Xr tcpdump 1
316 to check the packet flow over the
317 .Em PPP
318 link.
319 .It Supports PPP over TCP and PPP over UDP.
320 If a device name is specified as
321 .Em host Ns No : Ns Em port Ns
322 .Xo
323 .Op / Ns tcp|udp ,
324 .Xc
325 .Nm
326 will open a TCP or UDP connection for transporting data rather than using a
327 conventional serial device.
328 UDP connections force
329 .Nm
330 into synchronous mode.
331 .It Supports PPP over ISDN.
332 If
333 .Nm
334 is given a raw B-channel i4b device to open as a link, it's able to talk
335 to the
336 .Xr isdnd 8
337 daemon to establish an ISDN connection.
338 .It Supports PPP over Ethernet (rfc 2516).
339 If
340 .Nm
341 is given a device specification of the format
342 .No PPPoE: Ns Ar iface Ns Xo
343 .Op \&: Ns Ar provider Ns
344 .Xc
345 and if
346 .Xr netgraph 4
347 is available,
348 .Nm
349 will attempt talk
350 .Em PPP
351 over Ethernet to
352 .Ar provider
353 using the
354 .Ar iface
355 network interface.
356 .Pp
357 On systems that do not support
358 .Xr netgraph 4 ,
359 an external program such as
360 .Xr pppoe 8
361 may be used.
362 .It "Supports IETF draft Predictor-1 (rfc 1978) and DEFLATE (rfc 1979) compression."
363 .Nm
364 supports not only VJ-compression but also Predictor-1 and DEFLATE compression.
365 Normally, a modem has built-in compression (e.g., v42.bis) and the system
366 may receive higher data rates from it as a result of such compression.
367 While this is generally a good thing in most other situations, this
368 higher speed data imposes a penalty on the system by increasing the
369 number of serial interrupts the system has to process in talking to the
370 modem and also increases latency.
371 Unlike VJ-compression, Predictor-1 and DEFLATE compression pre-compresses
372 .Em all
373 network traffic flowing through the link, thus reducing overheads to a
374 minimum.
375 .It Supports Microsoft's IPCP extensions (rfc 1877).
376 Name Server Addresses and NetBIOS Name Server Addresses can be negotiated
377 with clients using the Microsoft
378 .Em PPP
379 stack (i.e., Win95, WinNT)
380 .It Supports Multi-link PPP (rfc 1990)
381 It is possible to configure
382 .Nm
383 to open more than one physical connection to the peer, combining the
384 bandwidth of all links for better throughput.
385 .It Supports MPPE (draft-ietf-pppext-mppe)
386 MPPE is Microsoft Point to Point Encryption scheme.
387 It is possible to configure
388 .Nm
389 to participate in Microsoft's Windows VPN.
390 For now,
391 .Nm
392 can only get encryption keys from CHAP 81 authentication.
393 .Nm
394 must be compiled with DES for MPPE to operate.
395 .El
396 .Sh PERMISSIONS
397 .Nm
398 is installed as user
399 .Dv root
400 and group
401 .Dv network ,
402 with permissions
403 .Dv 04554 .
404 By default,
405 .Nm
406 will not run if the invoking user id is not zero.
407 This may be overridden by using the
408 .Dq allow users
409 command in
410 .Pa /etc/ppp/ppp.conf .
411 When running as a normal user,
412 .Nm
413 switches to user id 0 in order to alter the system routing table, set up
414 system lock files and read the ppp configuration files.
415 All external commands (executed via the "shell" or "!bg" commands) are executed
416 as the user id that invoked
417 .Nm .
418 Refer to the
419 .Sq ID0
420 logging facility if you're interested in what exactly is done as user id
421 zero.
422 .Sh GETTING STARTED
423 When you first run
424 .Nm
425 you may need to deal with some initial configuration details.
426 .Bl -bullet
427 .It
428 Your kernel must include a tunnel device (the GENERIC kernel includes
429 one by default).
430 If it doesn't, or if you require more than one tun
431 interface, you'll need to rebuild your kernel with the following line in
432 your kernel configuration file:
433 .Pp
434 .Dl pseudo-device tun N
435 .Pp
436 where
437 .Ar N
438 is the maximum number of
439 .Em PPP
440 connections you wish to support.
441 .It
442 Check your
443 .Pa /dev
444 directory for the tunnel device entries
445 .Pa /dev/tunN ,
446 where
447 .Sq N
448 represents the number of the tun device, starting at zero.
449 If they don't exist, you can create them by running "sh ./MAKEDEV tunN".
450 This will create tun devices 0 through
451 .Ar N .
452 .It
453 Make sure that your system has a group named
454 .Dq network
455 in the
456 .Pa /etc/group
457 file and that the group contains the names of all users expected to use
458 .Nm .
459 Refer to the
460 .Xr group 5
461 manual page for details.
462 Each of these users must also be given access using the
463 .Dq allow users
464 command in
465 .Pa /etc/ppp/ppp.conf .
466 .It
467 Create a log file.
468 .Nm
469 uses
470 .Xr syslog 3
471 to log information.
472 A common log file name is
473 .Pa /var/log/ppp.log .
474 To make output go to this file, put the following lines in the
475 .Pa /etc/syslog.conf
476 file:
477 .Bd -literal -offset indent
478 !ppp
479 *.*<TAB>/var/log/ppp.log
480 .Ed
481 .Pp
482 It is possible to have more than one
483 .Em PPP
484 log file by creating a link to the
485 .Nm
486 executable:
487 .Pp
488 .Dl # cd /usr/sbin
489 .Dl # ln ppp ppp0
490 .Pp
491 and using
492 .Bd -literal -offset indent
493 !ppp0
494 *.*<TAB>/var/log/ppp0.log
495 .Ed
496 .Pp
497 in
498 .Pa /etc/syslog.conf .
499 Don't forget to send a
500 .Dv HUP
501 signal to
502 .Xr syslogd 8
503 after altering
504 .Pa /etc/syslog.conf .
505 .It
506 Although not strictly relevant to
507 .Nm Ns No 's
508 operation, you should configure your resolver so that it works correctly.
509 This can be done by configuring a local DNS
510 (using
511 .Xr named 8 )
512 or by adding the correct
513 .Sq nameserver
514 lines to the file
515 .Pa /etc/resolv.conf .
516 Refer to the
517 .Xr resolv.conf 5
518 manual page for details.
519 .Pp
520 Alternatively, if the peer supports it,
521 .Nm
522 can be configured to ask the peer for the nameserver address(es) and to
523 update
524 .Pa /etc/resolv.conf
525 automatically.
526 Refer to the
527 .Dq enable dns
528 and
529 .Dq resolv
530 commands below for details.
531 .El
532 .Sh MANUAL DIALING
533 In the following examples, we assume that your machine name is
534 .Dv awfulhak .
535 when you invoke
536 .Nm
537 (see
538 .Sx PERMISSIONS
539 above) with no arguments, you are presented with a prompt:
540 .Bd -literal -offset indent
541 ppp ON awfulhak>
542 .Ed
543 .Pp
544 The
545 .Sq ON
546 part of your prompt should always be in upper case.
547 If it is in lower case, it means that you must supply a password using the
548 .Dq passwd
549 command.
550 This only ever happens if you connect to a running version of
551 .Nm
552 and have not authenticated yourself using the correct password.
553 .Pp
554 You can start by specifying the device name and speed:
555 .Bd -literal -offset indent
556 ppp ON awfulhak> set device /dev/cuaa0
557 ppp ON awfulhak> set speed 38400
558 .Ed
559 .Pp
560 Normally, hardware flow control (CTS/RTS) is used.
561 However, under
562 certain circumstances (as may happen when you are connected directly
563 to certain PPP-capable terminal servers), this may result in
564 .Nm
565 hanging as soon as it tries to write data to your communications link
566 as it is waiting for the CTS (clear to send) signal - which will never
567 come.
568 Thus, if you have a direct line and can't seem to make a
569 connection, try turning CTS/RTS off with
570 .Dq set ctsrts off .
571 If you need to do this, check the
572 .Dq set accmap
573 description below too - you'll probably need to
574 .Dq set accmap 000a0000 .
575 .Pp
576 Usually, parity is set to
577 .Dq none ,
578 and this is
579 .Nm Ns No 's
580 default.
581 Parity is a rather archaic error checking mechanism that is no
582 longer used because modern modems do their own error checking, and most
583 link-layer protocols (that's what
584 .Nm
585 is) use much more reliable checking mechanisms.
586 Parity has a relatively
587 huge overhead (a 12.5% increase in traffic) and as a result, it is always
588 disabled
589 (set to
590 .Dq none )
591 when
592 .Dv PPP
593 is opened.
594 However, some ISPs (Internet Service Providers) may use
595 specific parity settings at connection time (before
596 .Dv PPP
597 is opened).
598 Notably, Compuserve insist on even parity when logging in:
599 .Bd -literal -offset indent
600 ppp ON awfulhak> set parity even
601 .Ed
602 .Pp
603 You can now see what your current device settings look like:
604 .Bd -literal -offset indent
605 ppp ON awfulhak> show physical
606 Name: deflink
607  State:           closed
608  Device:          N/A
609  Link Type:       interactive
610  Connect Count:   0
611  Queued Packets:  0
612  Phone Number:    N/A
613
614 Defaults:
615  Device List:     /dev/cuaa0
616  Characteristics: 38400bps, cs8, even parity, CTS/RTS on
617
618 Connect time: 0 secs
619 0 octets in, 0 octets out
620 Overall 0 bytes/sec
621 ppp ON awfulhak>
622 .Ed
623 .Pp
624 The term command can now be used to talk directly to the device:
625 .Bd -literal -offset indent
626 ppp ON awfulhak> term
627 at
628 OK
629 atdt123456
630 CONNECT
631 login: myispusername
632 Password: myisppassword
633 Protocol: ppp
634 .Ed
635 .Pp
636 When the peer starts to talk in
637 .Em PPP ,
638 .Nm
639 detects this automatically and returns to command mode.
640 .Bd -literal -offset indent
641 ppp ON awfulhak>               # No link has been established
642 Ppp ON awfulhak>               # We've connected & finished LCP
643 PPp ON awfulhak>               # We've authenticated
644 PPP ON awfulhak>               # We've agreed IP numbers
645 .Ed
646 .Pp
647 If it does not, it's probable that the peer is waiting for your end to
648 start negotiating.
649 To force
650 .Nm
651 to start sending
652 .Em PPP
653 configuration packets to the peer, use the
654 .Dq ~p
655 command to drop out of terminal mode and enter packet mode.
656 .Pp
657 If you never even receive a login prompt, it is quite likely that the
658 peer wants to use PAP or CHAP authentication instead of using Unix-style
659 login/password authentication.
660 To set things up properly, drop back to
661 the prompt and set your authentication name and key, then reconnect:
662 .Bd -literal -offset indent
663 ~.
664 ppp ON awfulhak> set authname myispusername
665 ppp ON awfulhak> set authkey myisppassword
666 ppp ON awfulhak> term
667 at
668 OK
669 atdt123456
670 CONNECT
671 .Ed
672 .Pp
673 You may need to tell ppp to initiate negotiations with the peer here too:
674 .Bd -literal -offset indent
675 ~p
676 ppp ON awfulhak>               # No link has been established
677 Ppp ON awfulhak>               # We've connected & finished LCP
678 PPp ON awfulhak>               # We've authenticated
679 PPP ON awfulhak>               # We've agreed IP numbers
680 .Ed
681 .Pp
682 You are now connected!
683 Note that
684 .Sq PPP
685 in the prompt has changed to capital letters to indicate that you have
686 a peer connection.
687 If only some of the three Ps go uppercase, wait until
688 either everything is uppercase or lowercase.
689 If they revert to lowercase, it means that
690 .Nm
691 couldn't successfully negotiate with the peer.
692 A good first step for troubleshooting at this point would be to
693 .Bd -literal -offset indent
694 ppp ON awfulhak> set log local phase lcp ipcp
695 .Ed
696 .Pp
697 and try again.
698 Refer to the
699 .Dq set log
700 command description below for further details.
701 If things fail at this point,
702 it is quite important that you turn logging on and try again.
703 It is also
704 important that you note any prompt changes and report them to anyone trying
705 to help you.
706 .Pp
707 When the link is established, the show command can be used to see how
708 things are going:
709 .Bd -literal -offset indent
710 PPP ON awfulhak> show physical
711 * Modem related information is shown here *
712 PPP ON awfulhak> show ccp
713 * CCP (compression) related information is shown here *
714 PPP ON awfulhak> show lcp
715 * LCP (line control) related information is shown here *
716 PPP ON awfulhak> show ipcp
717 * IPCP (IP) related information is shown here *
718 PPP ON awfulhak> show link
719 * Link (high level) related information is shown here *
720 PPP ON awfulhak> show bundle
721 * Logical (high level) connection related information is shown here *
722 .Ed
723 .Pp
724 At this point, your machine has a host route to the peer.
725 This means
726 that you can only make a connection with the host on the other side
727 of the link.
728 If you want to add a default route entry (telling your
729 machine to send all packets without another routing entry to the other
730 side of the
731 .Em PPP
732 link), enter the following command:
733 .Bd -literal -offset indent
734 PPP ON awfulhak> add default HISADDR
735 .Ed
736 .Pp
737 The string
738 .Sq HISADDR
739 represents the IP address of the connected peer.
740 If the
741 .Dq add
742 command fails due to an existing route, you can overwrite the existing
743 route using
744 .Bd -literal -offset indent
745 PPP ON awfulhak> add! default HISADDR
746 .Ed
747 .Pp
748 This command can also be executed before actually making the connection.
749 If a new IP address is negotiated at connection time,
750 .Nm
751 will update your default route accordingly.
752 .Pp
753 You can now use your network applications (ping, telnet, ftp etc.)
754 in other windows or terminals on your machine.
755 If you wish to reuse the current terminal, you can put
756 .Nm
757 into the background using your standard shell suspend and background
758 commands (usually
759 .Dq ^Z
760 followed by
761 .Dq bg ) .
762 .Pp
763 Refer to the
764 .Sx PPP COMMAND LIST
765 section for details on all available commands.
766 .Sh AUTOMATIC DIALING
767 To use automatic dialing, you must prepare some Dial and Login chat scripts.
768 See the example definitions in
769 .Pa /usr/share/examples/ppp/ppp.conf.sample
770 (the format of
771 .Pa /etc/ppp/ppp.conf
772 is pretty simple).
773 Each line contains one comment, inclusion, label or command:
774 .Bl -bullet
775 .It
776 A line starting with a
777 .Pq Dq #
778 character is treated as a comment line.
779 Leading whitespace are ignored when identifying comment lines.
780 .It
781 An inclusion is a line beginning with the word
782 .Sq !include .
783 It must have one argument - the file to include.
784 You may wish to
785 .Dq !include ~/.ppp.conf
786 for compatibility with older versions of
787 .Nm .
788 .It
789 A label name starts in the first column and is followed by
790 a colon
791 .Pq Dq \&: .
792 .It
793 A command line must contain a space or tab in the first column.
794 .El
795 .Pp
796 The
797 .Pa /etc/ppp/ppp.conf
798 file should consist of at least a
799 .Dq default
800 section.
801 This section is always executed.
802 It should also contain
803 one or more sections, named according to their purpose, for example,
804 .Dq MyISP
805 would represent your ISP, and
806 .Dq ppp-in
807 would represent an incoming
808 .Nm
809 configuration.
810 You can now specify the destination label name when you invoke
811 .Nm .
812 Commands associated with the
813 .Dq default
814 label are executed, followed by those associated with the destination
815 label provided.
816 When
817 .Nm
818 is started with no arguments, the
819 .Dq default
820 section is still executed.
821 The load command can be used to manually load a section from the
822 .Pa /etc/ppp/ppp.conf
823 file:
824 .Bd -literal -offset indent
825 ppp ON awfulhak> load MyISP
826 .Ed
827 .Pp
828 Note, no action is taken by
829 .Nm
830 after a section is loaded, whether it's the result of passing a label on
831 the command line or using the
832 .Dq load
833 command.
834 Only the commands specified for that label in the configuration
835 file are executed.
836 However, when invoking
837 .Nm
838 with the
839 .Fl background ,
840 .Fl ddial ,
841 or
842 .Fl dedicated
843 switches, the link mode tells
844 .Nm
845 to establish a connection.
846 Refer to the
847 .Dq set mode
848 command below for further details.
849 .Pp
850 Once the connection is made, the
851 .Sq ppp
852 portion of the prompt will change to
853 .Sq PPP :
854 .Bd -literal -offset indent
855 # ppp MyISP
856 \&...
857 ppp ON awfulhak> dial
858 Ppp ON awfulhak>
859 PPp ON awfulhak>
860 PPP ON awfulhak>
861 .Ed
862 .Pp
863 The Ppp prompt indicates that
864 .Nm
865 has entered the authentication phase.
866 The PPp prompt indicates that
867 .Nm
868 has entered the network phase.
869 The PPP prompt indicates that
870 .Nm
871 has successfully negotiated a network layer protocol and is in
872 a usable state.
873 .Pp
874 If the
875 .Pa /etc/ppp/ppp.linkup
876 file is available, its contents are executed
877 when the
878 .Em PPP
879 connection is established.
880 See the provided
881 .Dq pmdemand
882 example in
883 .Pa /usr/share/examples/ppp/ppp.conf.sample
884 which runs a script in the background after the connection is established
885 (refer to the
886 .Dq shell
887 and
888 .Dq bg
889 commands below for a description of possible substitution strings).
890 Similarly, when a connection is closed, the contents of the
891 .Pa /etc/ppp/ppp.linkdown
892 file are executed.
893 Both of these files have the same format as
894 .Pa /etc/ppp/ppp.conf .
895 .Pp
896 In previous versions of
897 .Nm ,
898 it was necessary to re-add routes such as the default route in the
899 .Pa ppp.linkup
900 file.
901 .Nm
902 now supports
903 .Sq sticky routes ,
904 where all routes that contain the
905 .Dv HISADDR
906 or
907 .Dv MYADDR
908 literals will automatically be updated when the values of
909 .Dv HISADDR
910 and/or
911 .Dv MYADDR
912 change.
913 .Sh BACKGROUND DIALING
914 If you want to establish a connection using
915 .Nm
916 non-interactively (such as from a
917 .Xr crontab 5
918 entry or an
919 .Xr at 1
920 job) you should use the
921 .Fl background
922 option.
923 When
924 .Fl background
925 is specified,
926 .Nm
927 attempts to establish the connection immediately.
928 If multiple phone
929 numbers are specified, each phone number will be tried once.
930 If the attempt fails,
931 .Nm
932 exits immediately with a non-zero exit code.
933 If it succeeds, then
934 .Nm
935 becomes a daemon, and returns an exit status of zero to its caller.
936 The daemon exits automatically if the connection is dropped by the
937 remote system, or it receives a
938 .Dv TERM
939 signal.
940 .Sh DIAL ON DEMAND
941 Demand dialing is enabled with the
942 .Fl auto
943 or
944 .Fl ddial
945 options.
946 You must also specify the destination label in
947 .Pa /etc/ppp/ppp.conf
948 to use.
949 It must contain the
950 .Dq set ifaddr
951 command to define the remote peers IP address.
952 (refer to
953 .Pa /usr/share/examples/ppp/ppp.conf.sample )
954 .Bd -literal -offset indent
955 # ppp -auto pmdemand
956 .Ed
957 .Pp
958 When
959 .Fl auto
960 or
961 .Fl ddial
962 is specified,
963 .Nm
964 runs as a daemon but you can still configure or examine its
965 configuration by using the
966 .Dq set server
967 command in
968 .Pa /etc/ppp/ppp.conf ,
969 (for example,
970 .Dq Li "set server +3000 mypasswd" )
971 and connecting to the diagnostic port as follows:
972 .Bd -literal -offset indent
973 # pppctl 3000   (assuming tun0)
974 Password:
975 PPP ON awfulhak> show who
976 tcp (127.0.0.1:1028) *
977 .Ed
978 .Pp
979 The
980 .Dq show who
981 command lists users that are currently connected to
982 .Nm
983 itself.
984 If the diagnostic socket is closed or changed to a different
985 socket, all connections are immediately dropped.
986 .Pp
987 In
988 .Fl auto
989 mode, when an outgoing packet is detected,
990 .Nm
991 will perform the dialing action (chat script) and try to connect
992 with the peer.
993 In
994 .Fl ddial
995 mode, the dialing action is performed any time the line is found
996 to be down.
997 If the connect fails, the default behaviour is to wait 30 seconds
998 and then attempt to connect when another outgoing packet is detected.
999 This behaviour can be changed using the
1000 .Dq set redial
1001 command:
1002 .Pp
1003 .No set redial Ar secs Ns Xo
1004 .Oo + Ns Ar inc Ns
1005 .Op - Ns Ar max Ns
1006 .Oc Ns Op . Ns Ar next
1007 .Op Ar attempts
1008 .Xc
1009 .Pp
1010 .Bl -tag -width attempts -compact
1011 .It Ar secs
1012 is the number of seconds to wait before attempting
1013 to connect again.
1014 If the argument is the literal string
1015 .Sq Li random ,
1016 the delay period is a random value between 1 and 30 seconds inclusive.
1017 .It Ar inc
1018 is the number of seconds that
1019 .Ar secs
1020 should be incremented each time a new dial attempt is made.
1021 The timeout reverts to
1022 .Ar secs
1023 only after a successful connection is established.
1024 The default value for
1025 .Ar inc
1026 is zero.
1027 .It Ar max
1028 is the maximum number of times
1029 .Nm
1030 should increment
1031 .Ar secs .
1032 The default value for
1033 .Ar max
1034 is 10.
1035 .It Ar next
1036 is the number of seconds to wait before attempting
1037 to dial the next number in a list of numbers (see the
1038 .Dq set phone
1039 command).
1040 The default is 3 seconds.
1041 Again, if the argument is the literal string
1042 .Sq Li random ,
1043 the delay period is a random value between 1 and 30 seconds.
1044 .It Ar attempts
1045 is the maximum number of times to try to connect for each outgoing packet
1046 that triggers a dial.
1047 The previous value is unchanged if this parameter is omitted.
1048 If a value of zero is specified for
1049 .Ar attempts ,
1050 .Nm
1051 will keep trying until a connection is made.
1052 .El
1053 .Pp
1054 So, for example:
1055 .Bd -literal -offset indent
1056 set redial 10.3 4
1057 .Ed
1058 .Pp
1059 will attempt to connect 4 times for each outgoing packet that causes
1060 a dial attempt with a 3 second delay between each number and a 10 second
1061 delay after all numbers have been tried.
1062 If multiple phone numbers
1063 are specified, the total number of attempts is still 4 (it does not
1064 attempt each number 4 times).
1065 .Pp
1066 Alternatively,
1067 .Pp
1068 .Bd -literal -offset indent
1069 set redial 10+10-5.3 20
1070 .Ed
1071 .Pp
1072 tells
1073 .Nm
1074 to attempt to connect 20 times.
1075 After the first attempt,
1076 .Nm
1077 pauses for 10 seconds.
1078 After the next attempt it pauses for 20 seconds
1079 and so on until after the sixth attempt it pauses for 1 minute.
1080 The next 14 pauses will also have a duration of one minute.
1081 If
1082 .Nm
1083 connects, disconnects and fails to connect again, the timeout starts again
1084 at 10 seconds.
1085 .Pp
1086 Modifying the dial delay is very useful when running
1087 .Nm
1088 in
1089 .Fl auto
1090 mode on both ends of the link.
1091 If each end has the same timeout,
1092 both ends wind up calling each other at the same time if the link
1093 drops and both ends have packets queued.
1094 At some locations, the serial link may not be reliable, and carrier
1095 may be lost at inappropriate times.
1096 It is possible to have
1097 .Nm
1098 redial should carrier be unexpectedly lost during a session.
1099 .Bd -literal -offset indent
1100 set reconnect timeout ntries
1101 .Ed
1102 .Pp
1103 This command tells
1104 .Nm
1105 to re-establish the connection
1106 .Ar ntries
1107 times on loss of carrier with a pause of
1108 .Ar timeout
1109 seconds before each try.
1110 For example,
1111 .Bd -literal -offset indent
1112 set reconnect 3 5
1113 .Ed
1114 .Pp
1115 tells
1116 .Nm
1117 that on an unexpected loss of carrier, it should wait
1118 .Ar 3
1119 seconds before attempting to reconnect.
1120 This may happen up to
1121 .Ar 5
1122 times before
1123 .Nm
1124 gives up.
1125 The default value of ntries is zero (no reconnect).
1126 Care should be taken with this option.
1127 If the local timeout is slightly
1128 longer than the remote timeout, the reconnect feature will always be
1129 triggered (up to the given number of times) after the remote side
1130 times out and hangs up.
1131 NOTE: In this context, losing too many LQRs constitutes a loss of
1132 carrier and will trigger a reconnect.
1133 If the
1134 .Fl background
1135 flag is specified, all phone numbers are dialed at most once until
1136 a connection is made.
1137 The next number redial period specified with the
1138 .Dq set redial
1139 command is honoured, as is the reconnect tries value.
1140 If your redial
1141 value is less than the number of phone numbers specified, not all
1142 the specified numbers will be tried.
1143 To terminate the program, type
1144 .Bd -literal -offset indent
1145 PPP ON awfulhak> close
1146 ppp ON awfulhak> quit all
1147 .Ed
1148 .Pp
1149 A simple
1150 .Dq quit
1151 command will terminate the
1152 .Xr pppctl 8
1153 or
1154 .Xr telnet 1
1155 connection but not the
1156 .Nm
1157 program itself.
1158 You must use
1159 .Dq quit all
1160 to terminate
1161 .Nm
1162 as well.
1163 .Sh RECEIVING INCOMING PPP CONNECTIONS (Method 1)
1164 To handle an incoming
1165 .Em PPP
1166 connection request, follow these steps:
1167 .Bl -enum
1168 .It
1169 Make sure the modem and (optionally)
1170 .Pa /etc/rc.serial
1171 is configured correctly.
1172 .Bl -bullet -compact
1173 .It
1174 Use Hardware Handshake (CTS/RTS) for flow control.
1175 .It
1176 Modem should be set to NO echo back (ATE0) and NO results string (ATQ1).
1177 .El
1178 .Pp
1179 .It
1180 Edit
1181 .Pa /etc/ttys
1182 to enable a
1183 .Xr getty 8
1184 on the port where the modem is attached.
1185 For example:
1186 .Pp
1187 .Dl ttyd1 Qo /usr/libexec/getty std.38400 Qc dialup on secure
1188 .Pp
1189 Don't forget to send a
1190 .Dv HUP
1191 signal to the
1192 .Xr init 8
1193 process to start the
1194 .Xr getty 8 :
1195 .Pp
1196 .Dl # kill -HUP 1
1197 .Pp
1198 It is usually also necessary to train your modem to the same DTR speed
1199 as the getty:
1200 .Bd -literal -offset indent
1201 # ppp
1202 ppp ON awfulhak> set device /dev/cuaa1
1203 ppp ON awfulhak> set speed 38400
1204 ppp ON awfulhak> term
1205 deflink: Entering terminal mode on /dev/cuaa1
1206 Type `~?' for help
1207 at
1208 OK
1209 at
1210 OK
1211 atz
1212 OK
1213 at
1214 OK
1215 ~.
1216 ppp ON awfulhak> quit
1217 .Ed
1218 .It
1219 Create a
1220 .Pa /usr/local/bin/ppplogin
1221 file with the following contents:
1222 .Bd -literal -offset indent
1223 #! /bin/sh
1224 exec /usr/sbin/ppp -direct incoming
1225 .Ed
1226 .Pp
1227 Direct mode
1228 .Pq Fl direct
1229 lets
1230 .Nm
1231 work with stdin and stdout.
1232 You can also use
1233 .Xr pppctl 8
1234 to connect to a configured diagnostic port, in the same manner as with
1235 client-side
1236 .Nm .
1237 .Pp
1238 Here, the
1239 .Ar incoming
1240 section must be set up in
1241 .Pa /etc/ppp/ppp.conf .
1242 .Pp
1243 Make sure that the
1244 .Ar incoming
1245 section contains the
1246 .Dq allow users
1247 command as appropriate.
1248 .It
1249 Prepare an account for the incoming user.
1250 .Bd -literal
1251 ppp:xxxx:66:66:PPP Login User:/home/ppp:/usr/local/bin/ppplogin
1252 .Ed
1253 .Pp
1254 Refer to the manual entries for
1255 .Xr adduser 8
1256 and
1257 .Xr vipw 8
1258 for details.
1259 .It
1260 Support for IPCP Domain Name Server and NetBIOS Name Server negotiation
1261 can be enabled using the
1262 .Dq accept dns
1263 and
1264 .Dq set nbns
1265 commands.
1266 Refer to their descriptions below.
1267 .El
1268 .Sh RECEIVING INCOMING PPP CONNECTIONS (Method 2)
1269 This method differs in that we use
1270 .Nm
1271 to authenticate the connection rather than
1272 .Xr login 1 :
1273 .Bl -enum
1274 .It
1275 Configure your default section in
1276 .Pa /etc/gettytab
1277 with automatic ppp recognition by specifying the
1278 .Dq pp
1279 capability:
1280 .Bd -literal
1281 default:\\
1282         :pp=/usr/local/bin/ppplogin:\\
1283         .....
1284 .Ed
1285 .It
1286 Configure your serial device(s), enable a
1287 .Xr getty 8
1288 and create
1289 .Pa /usr/local/bin/ppplogin
1290 as in the first three steps for method 1 above.
1291 .It
1292 Add either
1293 .Dq enable chap
1294 or
1295 .Dq enable pap
1296 (or both)
1297 to
1298 .Pa /etc/ppp/ppp.conf
1299 under the
1300 .Sq incoming
1301 label (or whatever label
1302 .Pa ppplogin
1303 uses).
1304 .It
1305 Create an entry in
1306 .Pa /etc/ppp/ppp.secret
1307 for each incoming user:
1308 .Bd -literal
1309 Pfred<TAB>xxxx
1310 Pgeorge<TAB>yyyy
1311 .Ed
1312 .El
1313 .Pp
1314 Now, as soon as
1315 .Xr getty 8
1316 detects a ppp connection (by recognising the HDLC frame headers), it runs
1317 .Dq /usr/local/bin/ppplogin .
1318 .Pp
1319 It is
1320 .Em VITAL
1321 that either PAP or CHAP are enabled as above.
1322 If they are not, you are
1323 allowing anybody to establish ppp session with your machine
1324 .Em without
1325 a password, opening yourself up to all sorts of potential attacks.
1326 .Sh AUTHENTICATING INCOMING CONNECTIONS
1327 Normally, the receiver of a connection requires that the peer
1328 authenticates itself.
1329 This may be done using
1330 .Xr login 1 ,
1331 but alternatively, you can use PAP or CHAP.
1332 CHAP is the more secure of the two, but some clients may not support it.
1333 Once you decide which you wish to use, add the command
1334 .Sq enable chap
1335 or
1336 .Sq enable pap
1337 to the relevant section of
1338 .Pa ppp.conf .
1339 .Pp
1340 You must then configure the
1341 .Pa /etc/ppp/ppp.secret
1342 file.
1343 This file contains one line per possible client, each line
1344 containing up to five fields:
1345 .Pp
1346 .Ar name Ar key Oo
1347 .Ar hisaddr Op Ar label Op Ar callback-number
1348 .Oc
1349 .Pp
1350 The
1351 .Ar name
1352 and
1353 .Ar key
1354 specify the client username and password.
1355 If
1356 .Ar key
1357 is
1358 .Dq \&*
1359 and PAP is being used,
1360 .Nm
1361 will look up the password database
1362 .Pq Xr passwd 5
1363 when authenticating.
1364 If the client does not offer a suitable response based on any
1365 .Ar name Ns No / Ns Ar key
1366 combination in
1367 .Pa ppp.secret ,
1368 authentication fails.
1369 .Pp
1370 If authentication is successful,
1371 .Ar hisaddr
1372 (if specified)
1373 is used when negotiating IP numbers.
1374 See the
1375 .Dq set ifaddr
1376 command for details.
1377 .Pp
1378 If authentication is successful and
1379 .Ar label
1380 is specified, the current system label is changed to match the given
1381 .Ar label .
1382 This will change the subsequent parsing of the
1383 .Pa ppp.linkup
1384 and
1385 .Pa ppp.linkdown
1386 files.
1387 .Pp
1388 If authentication is successful and
1389 .Ar callback-number
1390 is specified and
1391 .Dq set callback
1392 has been used in
1393 .Pa ppp.conf ,
1394 the client will be called back on the given number.
1395 If CBCP is being used,
1396 .Ar callback-number
1397 may also contain a list of numbers or a
1398 .Dq \&* ,
1399 as if passed to the
1400 .Dq set cbcp
1401 command.
1402 The value will be used in
1403 .Nm Ns No 's
1404 subsequent CBCP phase.
1405 .Sh PPP OVER TCP and UDP (a.k.a Tunnelling)
1406 Instead of running
1407 .Nm
1408 over a serial link, it is possible to
1409 use a TCP connection instead by specifying the host, port and protocol as the
1410 device:
1411 .Pp
1412 .Dl set device ui-gate:6669/tcp
1413 .Pp
1414 Instead of opening a serial device,
1415 .Nm
1416 will open a TCP connection to the given machine on the given
1417 socket.
1418 It should be noted however that
1419 .Nm
1420 doesn't use the telnet protocol and will be unable to negotiate
1421 with a telnet server.
1422 You should set up a port for receiving this
1423 .Em PPP
1424 connection on the receiving machine (ui-gate).
1425 This is done by first updating
1426 .Pa /etc/services
1427 to name the service:
1428 .Pp
1429 .Dl ppp-in 6669/tcp # Incoming PPP connections over TCP
1430 .Pp
1431 and updating
1432 .Pa /etc/inetd.conf
1433 to tell
1434 .Xr inetd 8
1435 how to deal with incoming connections on that port:
1436 .Pp
1437 .Dl ppp-in stream tcp nowait root /usr/sbin/ppp ppp -direct ppp-in
1438 .Pp
1439 Don't forget to send a
1440 .Dv HUP
1441 signal to
1442 .Xr inetd 8
1443 after you've updated
1444 .Pa /etc/inetd.conf .
1445 Here, we use a label named
1446 .Dq ppp-in .
1447 The entry in
1448 .Pa /etc/ppp/ppp.conf
1449 on ui-gate (the receiver) should contain the following:
1450 .Bd -literal -offset indent
1451 ppp-in:
1452  set timeout 0
1453  set ifaddr 10.0.4.1 10.0.4.2
1454 .Ed
1455 .Pp
1456 and the entry in
1457 .Pa /etc/ppp/ppp.linkup
1458 should contain:
1459 .Bd -literal -offset indent
1460 ppp-in:
1461  add 10.0.1.0/24 HISADDR
1462 .Ed
1463 .Pp
1464 It is necessary to put the
1465 .Dq add
1466 command in
1467 .Pa ppp.linkup
1468 to ensure that the route is only added after
1469 .Nm
1470 has negotiated and assigned addresses to its interface.
1471 .Pp
1472 You may also want to enable PAP or CHAP for security.
1473 To enable PAP, add the following line:
1474 .Bd -literal -offset indent
1475  enable PAP
1476 .Ed
1477 .Pp
1478 You'll also need to create the following entry in
1479 .Pa /etc/ppp/ppp.secret :
1480 .Bd -literal -offset indent
1481 MyAuthName MyAuthPasswd
1482 .Ed
1483 .Pp
1484 If
1485 .Ar MyAuthPasswd
1486 is a
1487 .Dq * ,
1488 the password is looked up in the
1489 .Xr passwd 5
1490 database.
1491 .Pp
1492 The entry in
1493 .Pa /etc/ppp/ppp.conf
1494 on awfulhak (the initiator) should contain the following:
1495 .Bd -literal -offset indent
1496 ui-gate:
1497  set escape 0xff
1498  set device ui-gate:ppp-in/tcp
1499  set dial
1500  set timeout 30
1501  set log Phase Chat Connect hdlc LCP IPCP CCP tun
1502  set ifaddr 10.0.4.2 10.0.4.1
1503 .Ed
1504 .Pp
1505 with the route setup in
1506 .Pa /etc/ppp/ppp.linkup :
1507 .Bd -literal -offset indent
1508 ui-gate:
1509  add 10.0.2.0/24 HISADDR
1510 .Ed
1511 .Pp
1512 Again, if you're enabling PAP, you'll also need this in the
1513 .Pa /etc/ppp/ppp.conf
1514 profile:
1515 .Bd -literal -offset indent
1516  set authname MyAuthName
1517  set authkey MyAuthKey
1518 .Ed
1519 .Pp
1520 We're assigning the address of 10.0.4.1 to ui-gate, and the address
1521 10.0.4.2 to awfulhak.
1522 To open the connection, just type
1523 .Pp
1524 .Dl awfulhak # ppp -background ui-gate
1525 .Pp
1526 The result will be an additional "route" on awfulhak to the
1527 10.0.2.0/24 network via the TCP connection, and an additional
1528 "route" on ui-gate to the 10.0.1.0/24 network.
1529 The networks are effectively bridged - the underlying TCP
1530 connection may be across a public network (such as the
1531 Internet), and the
1532 .Em PPP
1533 traffic is conceptually encapsulated
1534 (although not packet by packet) inside the TCP stream between
1535 the two gateways.
1536 .Pp
1537 The major disadvantage of this mechanism is that there are two
1538 "guaranteed delivery" mechanisms in place - the underlying TCP
1539 stream and whatever protocol is used over the
1540 .Em PPP
1541 link - probably TCP again.
1542 If packets are lost, both levels will
1543 get in each others way trying to negotiate sending of the missing
1544 packet.
1545 .Pp
1546 To avoid this overhead, it is also possible to do all this using
1547 UDP instead of TCP as the transport by simply changing the protocol
1548 from "tcp" to "udp".
1549 When using UDP as a transport,
1550 .Nm
1551 will operate in synchronous mode.
1552 This is another gain as the incoming
1553 data does not have to be rearranged into packets.
1554 .Pp
1555 Care should be taken when adding a default route through a tunneled
1556 setup like this.
1557 It is quite common for the default route
1558 (added in
1559 .Pa /etc/ppp/ppp.linkup )
1560 to end up routing the link's TCP connection through the tunnel,
1561 effectively garrotting the connection.
1562 To avoid this, make sure you add a static route for the benefit of
1563 the link:
1564 .Bd -literal -offset indent
1565 ui-gate:
1566  set escape 0xff
1567  set device ui-gate:ppp-in/tcp
1568  add ui-gate x.x.x.x
1569  .....
1570 .Ed
1571 .Pp
1572 where
1573 .Dq x.x.x.x
1574 is the IP number that your route to
1575 .Dq ui-gate
1576 would normally use.
1577 .Pp
1578 When routing your connection accross a public network such as the Internet,
1579 it is preferable to encrypt the data.
1580 This can be done with the help of the MPPE protocol, although currently this
1581 means that you will not be able to also compress the traffic as MPPE is
1582 implemented as a compression layer (thank Microsoft for this).
1583 To enable MPPE encryption, add the following lines to
1584 .Pa /etc/ppp/ppp.conf
1585 on the server:
1586 .Bd -literal -offset indent
1587   enable MSCHAPv2
1588   disable deflate pred1
1589   deny deflate pred1
1590 .Ed
1591 .Pp
1592 ensuring that you've put the requisite entry in
1593 .Pa /etc/ppp/ppp.secret
1594 (MSCHAPv2 is challenge based, so
1595 .Xr passwd 5
1596 cannot be used)
1597 .Pp
1598 MSCHAPv2 and MPPE are accepted by default, so the client end should work
1599 without any additional changes (although ensure you have
1600 .Dq set authname
1601 and
1602 .Dq set authkey
1603 in your profile).
1604 .Sh NETWORK ADDRESS TRANSLATION (PACKET ALIASING)
1605 The
1606 .Fl nat
1607 command line option enables network address translation (a.k.a. packet
1608 aliasing).
1609 This allows the
1610 .Nm
1611 host to act as a masquerading gateway for other computers over
1612 a local area network.
1613 Outgoing IP packets are NAT'd so that they appear to come from the
1614 .Nm
1615 host, and incoming packets are de-NAT'd so that they are routed
1616 to the correct machine on the local area network.
1617 NAT allows computers on private, unregistered subnets to have Internet
1618 access, although they are invisible from the outside world.
1619 In general, correct
1620 .Nm
1621 operation should first be verified with network address translation disabled.
1622 Then, the
1623 .Fl nat
1624 option should be switched on, and network applications (web browser,
1625 .Xr telnet 1 ,
1626 .Xr ftp 1 ,
1627 .Xr ping 8 ,
1628 .Xr traceroute 8 )
1629 should be checked on the
1630 .Nm
1631 host.
1632 Finally, the same or similar applications should be checked on other
1633 computers in the LAN.
1634 If network applications work correctly on the
1635 .Nm
1636 host, but not on other machines in the LAN, then the masquerading
1637 software is working properly, but the host is either not forwarding
1638 or possibly receiving IP packets.
1639 Check that IP forwarding is enabled in
1640 .Pa /etc/rc.conf
1641 and that other machines have designated the
1642 .Nm
1643 host as the gateway for the LAN.
1644 .Sh PACKET FILTERING
1645 This implementation supports packet filtering.
1646 There are four kinds of
1647 filters: the
1648 .Em in
1649 filter, the
1650 .Em out
1651 filter, the
1652 .Em dial
1653 filter and the
1654 .Em alive
1655 filter.
1656 Here are the basics:
1657 .Bl -bullet
1658 .It
1659 A filter definition has the following syntax:
1660 .Pp
1661 set filter
1662 .Ar name
1663 .Ar rule-no
1664 .Ar action
1665 .Op !\&
1666 .Oo
1667 .Op host
1668 .Ar src_addr Ns Op / Ns Ar width
1669 .Op Ar dst_addr Ns Op / Ns Ar width
1670 .Oc
1671 .Ar [ proto Op src Ar cmp port
1672 .Op dst Ar cmp port
1673 .Op estab
1674 .Op syn
1675 .Op finrst
1676 .Op timeout Ar secs ]
1677 .Bl -enum
1678 .It
1679 .Ar Name
1680 should be one of
1681 .Sq in ,
1682 .Sq out ,
1683 .Sq dial
1684 or
1685 .Sq alive .
1686 .It
1687 .Ar Rule-no
1688 is a numeric value between
1689 .Sq 0
1690 and
1691 .Sq 39
1692 specifying the rule number.
1693 Rules are specified in numeric order according to
1694 .Ar rule-no ,
1695 but only if rule
1696 .Sq 0
1697 is defined.
1698 .It
1699 .Ar Action
1700 may be specified as
1701 .Sq permit
1702 or
1703 .Sq deny ,
1704 in which case, if a given packet matches the rule, the associated action
1705 is taken immediately.
1706 .Ar Action
1707 can also be specified as
1708 .Sq clear
1709 to clear the action associated with that particular rule, or as a new
1710 rule number greater than the current rule.
1711 In this case, if a given
1712 packet matches the current rule, the packet will next be matched against
1713 the new rule number (rather than the next rule number).
1714 .Pp
1715 The
1716 .Ar action
1717 may optionally be followed with an exclamation mark
1718 .Pq Dq !\& ,
1719 telling
1720 .Nm
1721 to reverse the sense of the following match.
1722 .It
1723 .Op Ar src_addr Ns Op / Ns Ar width
1724 and
1725 .Op Ar dst_addr Ns Op / Ns Ar width
1726 are the source and destination IP number specifications.
1727 If
1728 .Op / Ns Ar width
1729 is specified, it gives the number of relevant netmask bits,
1730 allowing the specification of an address range.
1731 .Pp
1732 Either
1733 .Ar src_addr
1734 or
1735 .Ar dst_addr
1736 may be given the values
1737 .Dv MYADDR
1738 or
1739 .Dv HISADDR
1740 (refer to the description of the
1741 .Dq bg
1742 command for a description of these values).
1743 When these values are used,
1744 the filters will be updated any time the values change.
1745 This is similar to the behaviour of the
1746 .Dq add
1747 command below.
1748 .It
1749 .Ar Proto
1750 must be one of
1751 .Sq icmp ,
1752 .Sq igmp ,
1753 .Sq ipip ,
1754 .Sq ospf ,
1755 .Sq udp
1756 or
1757 .Sq tcp .
1758 .It
1759 .Ar Cmp
1760 is one of
1761 .Sq \&lt ,
1762 .Sq \&eq
1763 or
1764 .Sq \&gt ,
1765 meaning less-than, equal and greater-than respectively.
1766 .Ar Port
1767 can be specified as a numeric port or by service name from
1768 .Pa /etc/services .
1769 .It
1770 The
1771 .Sq estab ,
1772 .Sq syn ,
1773 and
1774 .Sq finrst
1775 flags are only allowed when
1776 .Ar proto
1777 is set to
1778 .Sq tcp ,
1779 and represent the TH_ACK, TH_SYN and TH_FIN or TH_RST TCP flags respectively.
1780 .It
1781 The timeout value adjusts the current idle timeout to at least
1782 .Ar secs
1783 seconds.
1784 If a timeout is given in the alive filter as well as in the in/out
1785 filter, the in/out value is used.
1786 If no timeout is given, the default timeout (set using
1787 .Ic set timeout
1788 and defaulting to 180 seconds) is used.
1789 .El
1790 .Pp
1791 .It
1792 Each filter can hold up to 40 rules, starting from rule 0.
1793 The entire rule set is not effective until rule 0 is defined,
1794 i.e., the default is to allow everything through.
1795 .It
1796 If no rule in a defined set of rules matches a packet, that packet will
1797 be discarded (blocked).
1798 If there are no rules in a given filter, the packet will be permitted.
1799 .It
1800 It's possible to filter based on the payload of UDP frames where those
1801 frames contain a
1802 .Em PROTO_IP
1803 .Em PPP
1804 frame header.
1805 See the
1806 .Ar filter-decapsulation
1807 option below for further details.
1808 .It
1809 Use
1810 .Dq set filter Ar name No -1
1811 to flush all rules.
1812 .El
1813 .Pp
1814 See
1815 .Pa /usr/share/examples/ppp/ppp.conf.sample .
1816 .Sh SETTING THE IDLE TIMER
1817 To check/set the idle timer, use the
1818 .Dq show bundle
1819 and
1820 .Dq set timeout
1821 commands:
1822 .Bd -literal -offset indent
1823 ppp ON awfulhak> set timeout 600
1824 .Ed
1825 .Pp
1826 The timeout period is measured in seconds, the default value for which
1827 is 180 seconds
1828 (or 3 min).
1829 To disable the idle timer function, use the command
1830 .Bd -literal -offset indent
1831 ppp ON awfulhak> set timeout 0
1832 .Ed
1833 .Pp
1834 In
1835 .Fl ddial
1836 and
1837 .Fl dedicated
1838 modes, the idle timeout is ignored.
1839 In
1840 .Fl auto
1841 mode, when the idle timeout causes the
1842 .Em PPP
1843 session to be
1844 closed, the
1845 .Nm
1846 program itself remains running.
1847 Another trigger packet will cause it to attempt to re-establish the link.
1848 .Sh PREDICTOR-1 and DEFLATE COMPRESSION
1849 .Nm
1850 supports both Predictor type 1 and deflate compression.
1851 By default,
1852 .Nm
1853 will attempt to use (or be willing to accept) both compression protocols
1854 when the peer agrees
1855 (or requests them).
1856 The deflate protocol is preferred by
1857 .Nm .
1858 Refer to the
1859 .Dq disable
1860 and
1861 .Dq deny
1862 commands if you wish to disable this functionality.
1863 .Pp
1864 It is possible to use a different compression algorithm in each direction
1865 by using only one of
1866 .Dq disable deflate
1867 and
1868 .Dq deny deflate
1869 (assuming that the peer supports both algorithms).
1870 .Pp
1871 By default, when negotiating DEFLATE,
1872 .Nm
1873 will use a window size of 15.
1874 Refer to the
1875 .Dq set deflate
1876 command if you wish to change this behaviour.
1877 .Pp
1878 A special algorithm called DEFLATE24 is also available, and is disabled
1879 and denied by default.
1880 This is exactly the same as DEFLATE except that
1881 it uses CCP ID 24 to negotiate.
1882 This allows
1883 .Nm
1884 to successfully negotiate DEFLATE with
1885 .Nm pppd
1886 version 2.3.*.
1887 .Sh CONTROLLING IP ADDRESS
1888 .Nm
1889 uses IPCP to negotiate IP addresses.
1890 Each side of the connection
1891 specifies the IP address that it's willing to use, and if the requested
1892 IP address is acceptable then
1893 .Nm
1894 returns ACK to the requester.
1895 Otherwise,
1896 .Nm
1897 returns NAK to suggest that the peer use a different IP address.
1898 When
1899 both sides of the connection agree to accept the received request (and
1900 send ACK), IPCP is set to the open state and a network level connection
1901 is established.
1902 To control this IPCP behaviour, this implementation has the
1903 .Dq set ifaddr
1904 command for defining the local and remote IP address:
1905 .Bd -ragged -offset indent
1906 .No set ifaddr Oo Ar src_addr Ns
1907 .Op / Ns Ar \&nn
1908 .Oo Ar dst_addr Ns Op / Ns Ar \&nn
1909 .Oo Ar netmask
1910 .Op Ar trigger_addr
1911 .Oc
1912 .Oc
1913 .Oc
1914 .Ed
1915 .Pp
1916 where,
1917 .Sq src_addr
1918 is the IP address that the local side is willing to use,
1919 .Sq dst_addr
1920 is the IP address which the remote side should use and
1921 .Sq netmask
1922 is the netmask that should be used.
1923 .Sq Src_addr
1924 defaults to the current
1925 .Xr hostname 1 ,
1926 .Sq dst_addr
1927 defaults to 0.0.0.0, and
1928 .Sq netmask
1929 defaults to whatever mask is appropriate for
1930 .Sq src_addr .
1931 It is only possible to make
1932 .Sq netmask
1933 smaller than the default.
1934 The usual value is 255.255.255.255, as
1935 most kernels ignore the netmask of a POINTOPOINT interface.
1936 .Pp
1937 Some incorrect
1938 .Em PPP
1939 implementations require that the peer negotiates a specific IP
1940 address instead of
1941 .Sq src_addr .
1942 If this is the case,
1943 .Sq trigger_addr
1944 may be used to specify this IP number.
1945 This will not affect the
1946 routing table unless the other side agrees with this proposed number.
1947 .Bd -literal -offset indent
1948 set ifaddr 192.244.177.38 192.244.177.2 255.255.255.255 0.0.0.0
1949 .Ed
1950 .Pp
1951 The above specification means:
1952 .Pp
1953 .Bl -bullet -compact
1954 .It
1955 I will first suggest that my IP address should be 0.0.0.0, but I
1956 will only accept an address of 192.244.177.38.
1957 .It
1958 I strongly insist that the peer uses 192.244.177.2 as his own
1959 address and won't permit the use of any IP address but 192.244.177.2.
1960 When the peer requests another IP address, I will always suggest that
1961 it uses 192.244.177.2.
1962 .It
1963 The routing table entry will have a netmask of 0xffffffff.
1964 .El
1965 .Pp
1966 This is all fine when each side has a pre-determined IP address, however
1967 it is often the case that one side is acting as a server which controls
1968 all IP addresses and the other side should go along with it.
1969 In order to allow more flexible behaviour, the
1970 .Dq set ifaddr
1971 command allows the user to specify IP addresses more loosely:
1972 .Pp
1973 .Dl set ifaddr 192.244.177.38/24 192.244.177.2/20
1974 .Pp
1975 A number followed by a slash
1976 .Pq Dq /
1977 represents the number of bits significant in the IP address.
1978 The above example means:
1979 .Pp
1980 .Bl -bullet -compact
1981 .It
1982 I'd like to use 192.244.177.38 as my address if it is possible, but I'll
1983 also accept any IP address between 192.244.177.0 and 192.244.177.255.
1984 .It
1985 I'd like to make him use 192.244.177.2 as his own address, but I'll also
1986 permit him to use any IP address between 192.244.176.0 and
1987 192.244.191.255.
1988 .It
1989 As you may have already noticed, 192.244.177.2 is equivalent to saying
1990 192.244.177.2/32.
1991 .It
1992 As an exception, 0 is equivalent to 0.0.0.0/0, meaning that I have no
1993 preferred IP address and will obey the remote peers selection.
1994 When using zero, no routing table entries will be made until a connection
1995 is established.
1996 .It
1997 192.244.177.2/0 means that I'll accept/permit any IP address but I'll
1998 try to insist that 192.244.177.2 be used first.
1999 .El
2000 .Sh CONNECTING WITH YOUR INTERNET SERVICE PROVIDER
2001 The following steps should be taken when connecting to your ISP:
2002 .Bl -enum
2003 .It
2004 Describe your providers phone number(s) in the dial script using the
2005 .Dq set phone
2006 command.
2007 This command allows you to set multiple phone numbers for
2008 dialing and redialing separated by either a pipe
2009 .Pq Dq \&|
2010 or a colon
2011 .Pq Dq \&: :
2012 .Bd -ragged -offset indent
2013 .No set phone Ar telno Ns Xo
2014 .Oo \&| Ns Ar backupnumber
2015 .Oc Ns ... Ns Oo : Ns Ar nextnumber
2016 .Oc Ns ...
2017 .Xc
2018 .Ed
2019 .Pp
2020 Numbers after the first in a pipe-separated list are only used if the
2021 previous number was used in a failed dial or login script.
2022 Numbers
2023 separated by a colon are used sequentially, irrespective of what happened
2024 as a result of using the previous number.
2025 For example:
2026 .Bd -literal -offset indent
2027 set phone "1234567|2345678:3456789|4567890"
2028 .Ed
2029 .Pp
2030 Here, the 1234567 number is attempted.
2031 If the dial or login script fails,
2032 the 2345678 number is used next time, but *only* if the dial or login script
2033 fails.
2034 On the dial after this, the 3456789 number is used.
2035 The 4567890
2036 number is only used if the dial or login script using the 3456789 fails.
2037 If the login script of the 2345678 number fails, the next number is still the
2038 3456789 number.
2039 As many pipes and colons can be used as are necessary
2040 (although a given site would usually prefer to use either the pipe or the
2041 colon, but not both).
2042 The next number redial timeout is used between all numbers.
2043 When the end of the list is reached, the normal redial period is
2044 used before starting at the beginning again.
2045 The selected phone number is substituted for the \\\\T string in the
2046 .Dq set dial
2047 command (see below).
2048 .It
2049 Set up your redial requirements using
2050 .Dq set redial .
2051 For example, if you have a bad telephone line or your provider is
2052 usually engaged (not so common these days), you may want to specify
2053 the following:
2054 .Bd -literal -offset indent
2055 set redial 10 4
2056 .Ed
2057 .Pp
2058 This says that up to 4 phone calls should be attempted with a pause of 10
2059 seconds before dialing the first number again.
2060 .It
2061 Describe your login procedure using the
2062 .Dq set dial
2063 and
2064 .Dq set login
2065 commands.
2066 The
2067 .Dq set dial
2068 command is used to talk to your modem and establish a link with your
2069 ISP, for example:
2070 .Bd -literal -offset indent
2071 set dial "ABORT BUSY ABORT NO\\\\sCARRIER TIMEOUT 4 \\"\\" \e
2072   ATZ OK-ATZ-OK ATDT\\\\T TIMEOUT 60 CONNECT"
2073 .Ed
2074 .Pp
2075 This modem "chat" string means:
2076 .Bl -bullet
2077 .It
2078 Abort if the string "BUSY" or "NO CARRIER" are received.
2079 .It
2080 Set the timeout to 4 seconds.
2081 .It
2082 Expect nothing.
2083 .It
2084 Send ATZ.
2085 .It
2086 Expect OK.
2087 If that's not received within the 4 second timeout, send ATZ
2088 and expect OK.
2089 .It
2090 Send ATDTxxxxxxx where xxxxxxx is the next number in the phone list from
2091 above.
2092 .It
2093 Set the timeout to 60.
2094 .It
2095 Wait for the CONNECT string.
2096 .El
2097 .Pp
2098 Once the connection is established, the login script is executed.
2099 This script is written in the same style as the dial script, but care should
2100 be taken to avoid having your password logged:
2101 .Bd -literal -offset indent
2102 set authkey MySecret
2103 set login "TIMEOUT 15 login:-\\\\r-login: awfulhak \e
2104   word: \\\\P ocol: PPP HELLO"
2105 .Ed
2106 .Pp
2107 This login "chat" string means:
2108 .Bl -bullet
2109 .It
2110 Set the timeout to 15 seconds.
2111 .It
2112 Expect "login:".
2113 If it's not received, send a carriage return and expect
2114 "login:" again.
2115 .It
2116 Send "awfulhak"
2117 .It
2118 Expect "word:" (the tail end of a "Password:" prompt).
2119 .It
2120 Send whatever our current
2121 .Ar authkey
2122 value is set to.
2123 .It
2124 Expect "ocol:" (the tail end of a "Protocol:" prompt).
2125 .It
2126 Send "PPP".
2127 .It
2128 Expect "HELLO".
2129 .El
2130 .Pp
2131 The
2132 .Dq set authkey
2133 command is logged specially.
2134 When
2135 .Ar command
2136 or
2137 .Ar chat
2138 logging is enabled, the actual password is not logged;
2139 .Sq ********
2140 is logged instead.
2141 .Pp
2142 Login scripts vary greatly between ISPs.
2143 If you're setting one up for the first time,
2144 .Em ENABLE CHAT LOGGING
2145 so that you can see if your script is behaving as you expect.
2146 .It
2147 Use
2148 .Dq set device
2149 and
2150 .Dq set speed
2151 to specify your serial line and speed, for example:
2152 .Bd -literal -offset indent
2153 set device /dev/cuaa0
2154 set speed 115200
2155 .Ed
2156 .Pp
2157 Cuaa0 is the first serial port on
2158 .Fx .
2159 If you're running
2160 .Nm
2161 on
2162 .Ox ,
2163 cua00 is the first.
2164 A speed of 115200 should be specified
2165 if you have a modem capable of bit rates of 28800 or more.
2166 In general, the serial speed should be about four times the modem speed.
2167 .It
2168 Use the
2169 .Dq set ifaddr
2170 command to define the IP address.
2171 .Bl -bullet
2172 .It
2173 If you know what IP address your provider uses, then use it as the remote
2174 address (dst_addr), otherwise choose something like 10.0.0.2/0 (see below).
2175 .It
2176 If your provider has assigned a particular IP address to you, then use
2177 it as your address (src_addr).
2178 .It
2179 If your provider assigns your address dynamically, choose a suitably
2180 unobtrusive and unspecific IP number as your address.
2181 10.0.0.1/0 would be appropriate.
2182 The bit after the / specifies how many bits of the
2183 address you consider to be important, so if you wanted to insist on
2184 something in the class C network 1.2.3.0, you could specify 1.2.3.1/24.
2185 .It
2186 If you find that your ISP accepts the first IP number that you suggest,
2187 specify third and forth arguments of
2188 .Dq 0.0.0.0 .
2189 This will force your ISP to assign a number.
2190 (The third argument will
2191 be ignored as it is less restrictive than the default mask for your
2192 .Sq src_addr .
2193 .El
2194 .Pp
2195 An example for a connection where you don't know your IP number or your
2196 ISPs IP number would be:
2197 .Bd -literal -offset indent
2198 set ifaddr 10.0.0.1/0 10.0.0.2/0 0.0.0.0 0.0.0.0
2199 .Ed
2200 .Pp
2201 .It
2202 In most cases, your ISP will also be your default router.
2203 If this is the case, add the line
2204 .Bd -literal -offset indent
2205 add default HISADDR
2206 .Ed
2207 .Pp
2208 to
2209 .Pa /etc/ppp/ppp.conf .
2210 .Pp
2211 This tells
2212 .Nm
2213 to add a default route to whatever the peer address is
2214 (10.0.0.2 in this example).
2215 This route is
2216 .Sq sticky ,
2217 meaning that should the value of
2218 .Dv HISADDR
2219 change, the route will be updated accordingly.
2220 .Pp
2221 Previous versions of
2222 .Nm
2223 required a similar entry in the
2224 .Pa /etc/ppp/ppp.linkup
2225 file.
2226 Since the advent of
2227 .Sq sticky routes ,
2228 this is no longer required.
2229 .It
2230 If your provider requests that you use PAP/CHAP authentication methods, add
2231 the next lines to your
2232 .Pa /etc/ppp/ppp.conf
2233 file:
2234 .Bd -literal -offset indent
2235 set authname MyName
2236 set authkey MyPassword
2237 .Ed
2238 .Pp
2239 Both are accepted by default, so
2240 .Nm
2241 will provide whatever your ISP requires.
2242 .Pp
2243 It should be noted that a login script is rarely (if ever) required
2244 when PAP or CHAP are in use.
2245 .It
2246 Ask your ISP to authenticate your nameserver address(es) with the line
2247 .Bd -literal -offset indent
2248 enable dns
2249 .Ed
2250 .Pp
2251 Do
2252 .Em NOT
2253 do this if you are running a local DNS unless you also either use
2254 .Dq resolv readonly
2255 or have
2256 .Dq resolv restore
2257 in
2258 .Pa /etc/ppp/ppp.linkdown ,
2259 as
2260 .Nm
2261 will simply circumvent its use by entering some nameserver lines in
2262 .Pa /etc/resolv.conf .
2263 .El
2264 .Pp
2265 Please refer to
2266 .Pa /usr/share/examples/ppp/ppp.conf.sample
2267 and
2268 .Pa /usr/share/examples/ppp/ppp.linkup.sample
2269 for some real examples.
2270 The pmdemand label should be appropriate for most ISPs.
2271 .Sh LOGGING FACILITY
2272 .Nm
2273 is able to generate the following log info either via
2274 .Xr syslog 3
2275 or directly to the screen:
2276 .Pp
2277 .Bl -tag -width XXXXXXXXX -offset XXX -compact
2278 .It Li All
2279 Enable all logging facilities.
2280 This generates a lot of log.
2281 The most common use of 'all' is as a basis, where you remove some facilities
2282 after enabling 'all' ('debug' and 'timer' are usually best disabled.)
2283 .It Li Async
2284 Dump async level packet in hex.
2285 .It Li CBCP
2286 Generate CBCP (CallBack Control Protocol) logs.
2287 .It Li CCP
2288 Generate a CCP packet trace.
2289 .It Li Chat
2290 Generate
2291 .Sq dial ,
2292 .Sq login ,
2293 .Sq logout
2294 and
2295 .Sq hangup
2296 chat script trace logs.
2297 .It Li Command
2298 Log commands executed either from the command line or any of the configuration
2299 files.
2300 .It Li Connect
2301 Log Chat lines containing the string "CONNECT".
2302 .It Li Debug
2303 Log debug information.
2304 .It Li DNS
2305 Log DNS QUERY packets.
2306 .It Li Filter
2307 Log packets permitted by the dial filter and denied by any filter.
2308 .It Li HDLC
2309 Dump HDLC packet in hex.
2310 .It Li ID0
2311 Log all function calls specifically made as user id 0.
2312 .It Li IPCP
2313 Generate an IPCP packet trace.
2314 .It Li LCP
2315 Generate an LCP packet trace.
2316 .It Li LQM
2317 Generate LQR reports.
2318 .It Li Phase
2319 Phase transition log output.
2320 .It Li Physical
2321 Dump physical level packet in hex.
2322 .It Li Sync
2323 Dump sync level packet in hex.
2324 .It Li TCP/IP
2325 Dump all TCP/IP packets.
2326 .It Li Timer
2327 Log timer manipulation.
2328 .It Li TUN
2329 Include the tun device on each log line.
2330 .It Li Warning
2331 Output to the terminal device.
2332 If there is currently no terminal,
2333 output is sent to the log file using syslogs
2334 .Dv LOG_WARNING .
2335 .It Li Error
2336 Output to both the terminal device
2337 and the log file using syslogs
2338 .Dv LOG_ERROR .
2339 .It Li Alert
2340 Output to the log file using
2341 .Dv LOG_ALERT .
2342 .El
2343 .Pp
2344 The
2345 .Dq set log
2346 command allows you to set the logging output level.
2347 Multiple levels can be specified on a single command line.
2348 The default is equivalent to
2349 .Dq set log Phase .
2350 .Pp
2351 It is also possible to log directly to the screen.
2352 The syntax is the same except that the word
2353 .Dq local
2354 should immediately follow
2355 .Dq set log .
2356 The default is
2357 .Dq set log local
2358 (i.e., only the un-maskable warning, error and alert output).
2359 .Pp
2360 If The first argument to
2361 .Dq set log Op local
2362 begins with a
2363 .Sq +
2364 or a
2365 .Sq -
2366 character, the current log levels are
2367 not cleared, for example:
2368 .Bd -literal -offset indent
2369 PPP ON awfulhak> set log phase
2370 PPP ON awfulhak> show log
2371 Log:   Phase Warning Error Alert
2372 Local: Warning Error Alert
2373 PPP ON awfulhak> set log +tcp/ip -warning
2374 PPP ON awfulhak> set log local +command
2375 PPP ON awfulhak> show log
2376 Log:   Phase TCP/IP Warning Error Alert
2377 Local: Command Warning Error Alert
2378 .Ed
2379 .Pp
2380 Log messages of level Warning, Error and Alert are not controllable
2381 using
2382 .Dq set log Op local .
2383 .Pp
2384 The
2385 .Ar Warning
2386 level is special in that it will not be logged if it can be displayed
2387 locally.
2388 .Sh SIGNAL HANDLING
2389 .Nm
2390 deals with the following signals:
2391 .Bl -tag -width "USR2"
2392 .It INT
2393 Receipt of this signal causes the termination of the current connection
2394 (if any).
2395 This will cause
2396 .Nm
2397 to exit unless it is in
2398 .Fl auto
2399 or
2400 .Fl ddial
2401 mode.
2402 .It HUP, TERM & QUIT
2403 These signals tell
2404 .Nm
2405 to exit.
2406 .It USR1
2407 This signal, tells
2408 .Nm
2409 to re-open any existing server socket, dropping all existing diagnostic
2410 connections.
2411 Sockets that couldn't previously be opened will be retried.
2412 .It USR2
2413 This signal, tells
2414 .Nm
2415 to close any existing server socket, dropping all existing diagnostic
2416 connections.
2417 .Dv SIGUSR1
2418 can still be used to re-open the socket.
2419 .El
2420 .Sh MULTI-LINK PPP
2421 If you wish to use more than one physical link to connect to a
2422 .Em PPP
2423 peer, that peer must also understand the
2424 .Em MULTI-LINK PPP
2425 protocol.
2426 Refer to RFC 1990 for specification details.
2427 .Pp
2428 The peer is identified using a combination of his
2429 .Dq endpoint discriminator
2430 and his
2431 .Dq authentication id .
2432 Either or both of these may be specified.
2433 It is recommended that
2434 at least one is specified, otherwise there is no way of ensuring that
2435 all links are actually connected to the same peer program, and some
2436 confusing lock-ups may result.
2437 Locally, these identification variables are specified using the
2438 .Dq set enddisc
2439 and
2440 .Dq set authname
2441 commands.
2442 The
2443 .Sq authname
2444 (and
2445 .Sq authkey )
2446 must be agreed in advance with the peer.
2447 .Pp
2448 Multi-link capabilities are enabled using the
2449 .Dq set mrru
2450 command (set maximum reconstructed receive unit).
2451 Once multi-link is enabled,
2452 .Nm
2453 will attempt to negotiate a multi-link connection with the peer.
2454 .Pp
2455 By default, only one
2456 .Sq link
2457 is available
2458 (called
2459 .Sq deflink ) .
2460 To create more links, the
2461 .Dq clone
2462 command is used.
2463 This command will clone existing links, where all
2464 characteristics are the same except:
2465 .Bl -enum
2466 .It
2467 The new link has its own name as specified on the
2468 .Dq clone
2469 command line.
2470 .It
2471 The new link is an
2472 .Sq interactive
2473 link.
2474 Its mode may subsequently be changed using the
2475 .Dq set mode
2476 command.
2477 .It
2478 The new link is in a
2479 .Sq closed
2480 state.
2481 .El
2482 .Pp
2483 A summary of all available links can be seen using the
2484 .Dq show links
2485 command.
2486 .Pp
2487 Once a new link has been created, command usage varies.
2488 All link specific commands must be prefixed with the
2489 .Dq link Ar name
2490 command, specifying on which link the command is to be applied.
2491 When only a single link is available,
2492 .Nm
2493 is smart enough not to require the
2494 .Dq link Ar name
2495 prefix.
2496 .Pp
2497 Some commands can still be used without specifying a link - resulting
2498 in an operation at the
2499 .Sq bundle
2500 level.
2501 For example, once two or more links are available, the command
2502 .Dq show ccp
2503 will show CCP configuration and statistics at the multi-link level, and
2504 .Dq link deflink show ccp
2505 will show the same information at the
2506 .Dq deflink
2507 link level.
2508 .Pp
2509 Armed with this information, the following configuration might be used:
2510 .Pp
2511 .Bd -literal -offset indent
2512 mp:
2513  set timeout 0
2514  set log phase chat
2515  set device /dev/cuaa0 /dev/cuaa1 /dev/cuaa2
2516  set phone "123456789"
2517  set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \\"\\" ATZ \e
2518            OK-AT-OK \\\\dATDT\\\\T TIMEOUT 45 CONNECT"
2519  set login
2520  set ifaddr 10.0.0.1/0 10.0.0.2/0 0.0.0.0 0.0.0.0
2521  set authname ppp
2522  set authkey ppppassword
2523
2524  set mrru 1500
2525  clone 1,2,3            # Create 3 new links - duplicates of the default
2526  link deflink remove    # Delete the default link (called ``deflink'')
2527 .Ed
2528 .Pp
2529 Note how all cloning is done at the end of the configuration.
2530 Usually, the link will be configured first, then cloned.
2531 If you wish all links
2532 to be up all the time, you can add the following line to the end of your
2533 configuration.
2534 .Pp
2535 .Bd -literal -offset indent
2536   link 1,2,3 set mode ddial
2537 .Ed
2538 .Pp
2539 If you want the links to dial on demand, this command could be used:
2540 .Pp
2541 .Bd -literal -offset indent
2542   link * set mode auto
2543 .Ed
2544 .Pp
2545 Links may be tied to specific names by removing the
2546 .Dq set device
2547 line above, and specifying the following after the
2548 .Dq clone
2549 command:
2550 .Pp
2551 .Bd -literal -offset indent
2552  link 1 set device /dev/cuaa0
2553  link 2 set device /dev/cuaa1
2554  link 3 set device /dev/cuaa2
2555 .Ed
2556 .Pp
2557 Use the
2558 .Dq help
2559 command to see which commands require context (using the
2560 .Dq link
2561 command), which have optional
2562 context and which should not have any context.
2563 .Pp
2564 When
2565 .Nm
2566 has negotiated
2567 .Em MULTI-LINK
2568 mode with the peer, it creates a local domain socket in the
2569 .Pa /var/run
2570 directory.
2571 This socket is used to pass link information (including
2572 the actual link file descriptor) between different
2573 .Nm
2574 invocations.
2575 This facilitates
2576 .Nm Ns No 's
2577 ability to be run from a
2578 .Xr getty 8
2579 or directly from
2580 .Pa /etc/gettydefs
2581 (using the
2582 .Sq pp=
2583 capability), without needing to have initial control of the serial
2584 line.
2585 Once
2586 .Nm
2587 negotiates multi-link mode, it will pass its open link to any
2588 already running process.
2589 If there is no already running process,
2590 .Nm
2591 will act as the master, creating the socket and listening for new
2592 connections.
2593 .Sh PPP COMMAND LIST
2594 This section lists the available commands and their effect.
2595 They are usable either from an interactive
2596 .Nm
2597 session, from a configuration file or from a
2598 .Xr pppctl 8
2599 or
2600 .Xr telnet 1
2601 session.
2602 .Bl -tag -width 2n
2603 .It accept|deny|enable|disable Ar option....
2604 These directives tell
2605 .Nm
2606 how to negotiate the initial connection with the peer.
2607 Each
2608 .Dq option
2609 has a default of either accept or deny and enable or disable.
2610 .Dq Accept
2611 means that the option will be ACK'd if the peer asks for it.
2612 .Dq Deny
2613 means that the option will be NAK'd if the peer asks for it.
2614 .Dq Enable
2615 means that the option will be requested by us.
2616 .Dq Disable
2617 means that the option will not be requested by us.
2618 .Pp
2619 .Dq Option
2620 may be one of the following:
2621 .Bl -tag -width 2n
2622 .It acfcomp
2623 Default: Enabled and Accepted.
2624 ACFComp stands for Address and Control Field Compression.
2625 Non LCP packets will usually have an address
2626 field of 0xff (the All-Stations address) and a control field of
2627 0x03 (the Unnumbered Information command).
2628 If this option is
2629 negotiated, these two bytes are simply not sent, thus minimising
2630 traffic.
2631 .Pp
2632 See
2633 .Pa rfc1662
2634 for details.
2635 .It chap Ns Op \&05
2636 Default: Disabled and Accepted.
2637 CHAP stands for Challenge Handshake Authentication Protocol.
2638 Only one of CHAP and PAP (below) may be negotiated.
2639 With CHAP, the authenticator sends a "challenge" message to its peer.
2640 The peer uses a one-way hash function to encrypt the
2641 challenge and sends the result back.
2642 The authenticator does the same, and compares the results.
2643 The advantage of this mechanism is that no
2644 passwords are sent across the connection.
2645 A challenge is made when the connection is first made.
2646 Subsequent challenges may occur.
2647 If you want to have your peer authenticate itself, you must
2648 .Dq enable chap .
2649 in
2650 .Pa /etc/ppp/ppp.conf ,
2651 and have an entry in
2652 .Pa /etc/ppp/ppp.secret
2653 for the peer.
2654 .Pp
2655 When using CHAP as the client, you need only specify
2656 .Dq AuthName
2657 and
2658 .Dq AuthKey
2659 in
2660 .Pa /etc/ppp/ppp.conf .
2661 CHAP is accepted by default.
2662 Some
2663 .Em PPP
2664 implementations use "MS-CHAP" rather than MD5 when encrypting the
2665 challenge.
2666 MS-CHAP is a combination of MD4 and DES.
2667 If
2668 .Nm
2669 was built on a machine with DES libraries available, it will respond
2670 to MS-CHAP authentication requests, but will never request them.
2671 .It deflate
2672 Default: Enabled and Accepted.
2673 This option decides if deflate
2674 compression will be used by the Compression Control Protocol (CCP).
2675 This is the same algorithm as used by the
2676 .Xr gzip 1
2677 program.
2678 Note: There is a problem negotiating
2679 .Ar deflate
2680 capabilities with
2681 .Xr pppd 8
2682 - a
2683 .Em PPP
2684 implementation available under many operating systems.
2685 .Nm pppd
2686 (version 2.3.1) incorrectly attempts to negotiate
2687 .Ar deflate
2688 compression using type
2689 .Em 24
2690 as the CCP configuration type rather than type
2691 .Em 26
2692 as specified in
2693 .Pa rfc1979 .
2694 Type
2695 .Ar 24
2696 is actually specified as
2697 .Dq PPP Magna-link Variable Resource Compression
2698 in
2699 .Pa rfc1975 Ns !
2700 .Nm
2701 is capable of negotiating with
2702 .Nm pppd ,
2703 but only if
2704 .Dq deflate24
2705 is
2706 .Ar enable Ns No d
2707 and
2708 .Ar accept Ns No ed .
2709 .It deflate24
2710 Default: Disabled and Denied.
2711 This is a variance of the
2712 .Ar deflate
2713 option, allowing negotiation with the
2714 .Xr pppd 8
2715 program.
2716 Refer to the
2717 .Ar deflate
2718 section above for details.
2719 It is disabled by default as it violates
2720 .Pa rfc1975 .
2721 .It dns
2722 Default: Disabled and Denied.
2723 This option allows DNS negotiation.
2724 .Pp
2725 If
2726 .Dq enable Ns No d,
2727 .Nm
2728 will request that the peer confirms the entries in
2729 .Pa /etc/resolv.conf .
2730 If the peer NAKs our request (suggesting new IP numbers),
2731 .Pa /etc/resolv.conf
2732 is updated and another request is sent to confirm the new entries.
2733 .Pp
2734 If
2735 .Dq accept Ns No ed,
2736 .Nm
2737 will answer any DNS queries requested by the peer rather than rejecting
2738 them.
2739 The answer is taken from
2740 .Pa /etc/resolv.conf
2741 unless the
2742 .Dq set dns
2743 command is used as an override.
2744 .It enddisc
2745 Default: Enabled and Accepted.
2746 This option allows control over whether we
2747 negotiate an endpoint discriminator.
2748 We only send our discriminator if
2749 .Dq set enddisc
2750 is used and
2751 .Ar enddisc
2752 is enabled.
2753 We reject the peers discriminator if
2754 .Ar enddisc
2755 is denied.
2756 .It LANMan|chap80lm
2757 Default: Disabled and Accepted.
2758 The use of this authentication protocol
2759 is discouraged as it partially violates the authentication protocol by
2760 implementing two different mechanisms (LANMan & NT) under the guise of
2761 a single CHAP type (0x80).
2762 .Dq LANMan
2763 uses a simple DES encryption mechanism and is the least secure of the
2764 CHAP alternatives (although is still more secure than PAP).
2765 .Pp
2766 Refer to the
2767 .Dq MSChap
2768 description below for more details.
2769 .It lqr
2770 Default: Disabled and Accepted.
2771 This option decides if Link Quality Requests will be sent or accepted.
2772 LQR is a protocol that allows
2773 .Nm
2774 to determine that the link is down without relying on the modems
2775 carrier detect.
2776 When LQR is enabled,
2777 .Nm
2778 sends the
2779 .Em QUALPROTO
2780 option (see
2781 .Dq set lqrperiod
2782 below) as part of the LCP request.
2783 If the peer agrees, both sides will
2784 exchange LQR packets at the agreed frequency, allowing detailed link
2785 quality monitoring by enabling LQM logging.
2786 If the peer doesn't agree,
2787 .Nm
2788 will send ECHO LQR requests instead.
2789 These packets pass no information of interest, but they
2790 .Em MUST
2791 be replied to by the peer.
2792 .Pp
2793 Whether using LQR or ECHO LQR,
2794 .Nm
2795 will abruptly drop the connection if 5 unacknowledged packets have been
2796 sent rather than sending a 6th.
2797 A message is logged at the
2798 .Em PHASE
2799 level, and any appropriate
2800 .Dq reconnect
2801 values are honoured as if the peer were responsible for dropping the
2802 connection.
2803 .It mppe
2804 Default: Enabled and Accepted.
2805 This is Microsoft Point to Point Encryption scheme.
2806 MPPE key size can be
2807 40-, 56- and 128-bits.
2808 Refer to
2809 .Dq set mppe
2810 command.
2811 .It MSChapV2|chap81
2812 Default: Disabled and Accepted.
2813 It is very similar to standard CHAP (type 0x05)
2814 except that it issues challenges of a fixed 16 bytes in length and uses a
2815 combination of MD4, SHA-1 and DES to encrypt the challenge rather than using the
2816 standard MD5 mechanism.
2817 .It MSChap|chap80nt
2818 Default: Disabled and Accepted.
2819 The use of this authentication protocol
2820 is discouraged as it partially violates the authentication protocol by
2821 implementing two different mechanisms (LANMan & NT) under the guise of
2822 a single CHAP type (0x80).
2823 It is very similar to standard CHAP (type 0x05)
2824 except that it issues challenges of a fixed 8 bytes in length and uses a
2825 combination of MD4 and DES to encrypt the challenge rather than using the
2826 standard MD5 mechanism.
2827 CHAP type 0x80 for LANMan is also supported - see
2828 .Dq enable LANMan
2829 for details.
2830 .Pp
2831 Because both
2832 .Dq LANMan
2833 and
2834 .Dq NT
2835 use CHAP type 0x80, when acting as authenticator with both
2836 .Dq enable Ns No d ,
2837 .Nm
2838 will rechallenge the peer up to three times if it responds using the wrong
2839 one of the two protocols.
2840 This gives the peer a chance to attempt using both protocols.
2841 .Pp
2842 Conversely, when
2843 .Nm
2844 acts as the authenticatee with both protocols
2845 .Dq accept Ns No ed ,
2846 the protocols are used alternately in response to challenges.
2847 .Pp
2848 Note: If only LANMan is enabled,
2849 .Xr pppd 8
2850 (version 2.3.5) misbehaves when acting as authenticatee.
2851 It provides both
2852 the NT and the LANMan answers, but also suggests that only the NT answer
2853 should be used.
2854 .It pap
2855 Default: Disabled and Accepted.
2856 PAP stands for Password Authentication Protocol.
2857 Only one of PAP and CHAP (above) may be negotiated.
2858 With PAP, the ID and Password are sent repeatedly to the peer until
2859 authentication is acknowledged or the connection is terminated.
2860 This is a rather poor security mechanism.
2861 It is only performed when the connection is first established.
2862 If you want to have your peer authenticate itself, you must
2863 .Dq enable pap .
2864 in
2865 .Pa /etc/ppp/ppp.conf ,
2866 and have an entry in
2867 .Pa /etc/ppp/ppp.secret
2868 for the peer (although see the
2869 .Dq passwdauth
2870 and
2871 .Dq set radius
2872 options below).
2873 .Pp
2874 When using PAP as the client, you need only specify
2875 .Dq AuthName
2876 and
2877 .Dq AuthKey
2878 in
2879 .Pa /etc/ppp/ppp.conf .
2880 PAP is accepted by default.
2881 .It pred1
2882 Default: Enabled and Accepted.
2883 This option decides if Predictor 1
2884 compression will be used by the Compression Control Protocol (CCP).
2885 .It protocomp
2886 Default: Enabled and Accepted.
2887 This option is used to negotiate
2888 PFC (Protocol Field Compression), a mechanism where the protocol
2889 field number is reduced to one octet rather than two.
2890 .It shortseq
2891 Default: Enabled and Accepted.
2892 This option determines if
2893 .Nm
2894 will request and accept requests for short
2895 (12 bit)
2896 sequence numbers when negotiating multi-link mode.
2897 This is only applicable if our MRRU is set (thus enabling multi-link).
2898 .It vjcomp
2899 Default: Enabled and Accepted.
2900 This option determines if Van Jacobson header compression will be used.
2901 .El
2902 .Pp
2903 The following options are not actually negotiated with the peer.
2904 Therefore, accepting or denying them makes no sense.
2905 .Bl -tag -width 2n
2906 .It filter-decapsulation
2907 Default: Disabled.
2908 When this option is enabled,
2909 .Nm
2910 will examine UDP frames to see if they actually contain a
2911 .Em PPP
2912 frame as their payload.
2913 If this is the case, all filters will operate on the payload rather
2914 than the actual packet.
2915 .Pp
2916 This is useful if you want to send PPPoUDP traffic over a
2917 .Em PPP
2918 link, but want that link to do smart things with the real data rather than
2919 the UDP wrapper.
2920 .Pp
2921 The UDP frame payload must not be compressed in any way, otherwise
2922 .Nm
2923 will not be able to interpret it.
2924 It's therefore recommended that you
2925 .Ic disable vj pred1 deflate
2926 and
2927 .Ic deny vj pred1 deflate
2928 in the configuration for the
2929 .Nm
2930 invocation with the udp link.
2931 .It idcheck
2932 Default: Enabled.
2933 When
2934 .Nm
2935 exchanges low-level LCP, CCP and IPCP configuration traffic, the
2936 .Em Identifier
2937 field of any replies is expected to be the same as that of the request.
2938 By default,
2939 .Nm
2940 drops any reply packets that do not contain the expected identifier
2941 field, reporting the fact at the respective log level.
2942 If
2943 .Ar idcheck
2944 is disabled,
2945 .Nm
2946 will ignore the identifier field.
2947 .It keep-session
2948 Default: Disabled.
2949 When
2950 .Nm
2951 runs as a Multi-link server, a different
2952 .Nm
2953 instance initially receives each connection.
2954 After determining that
2955 the link belongs to an already existing bundle (controlled by another
2956 .Nm
2957 invocation),
2958 .Nm
2959 will transfer the link to that process.
2960 .Pp
2961 If the link is a tty device or if this option is enabled,
2962 .Nm
2963 will not exit, but will change its process name to
2964 .Dq session owner
2965 and wait for the controlling
2966 .Nm
2967 to finish with the link and deliver a signal back to the idle process.
2968 This prevents the confusion that results from
2969 .Nm Ns No 's
2970 parent considering the link resource available again.
2971 .Pp
2972 For tty devices that have entries in
2973 .Pa /etc/ttys ,
2974 this is necessary to prevent another
2975 .Xr getty 8
2976 from being started, and for program links such as
2977 .Xr sshd 8 ,
2978 it prevents
2979 .Xr sshd 8
2980 from exiting due to the death of its child.
2981 As
2982 .Nm
2983 cannot determine its parents requirements (except for the tty case), this
2984 option must be enabled manually depending on the circumstances.
2985 .It loopback
2986 Default: Enabled.
2987 When
2988 .Ar loopback
2989 is enabled,
2990 .Nm
2991 will automatically loop back packets being sent
2992 out with a destination address equal to that of the
2993 .Em PPP
2994 interface.
2995 If disabled,
2996 .Nm
2997 will send the packet, probably resulting in an ICMP redirect from
2998 the other end.
2999 It is convenient to have this option enabled when
3000 the interface is also the default route as it avoids the necessity
3001 of a loopback route.
3002 .It passwdauth
3003 Default: Disabled.
3004 Enabling this option will tell the PAP authentication
3005 code to use the password database (see
3006 .Xr passwd 5 )
3007 to authenticate the caller if they cannot be found in the
3008 .Pa /etc/ppp/ppp.secret
3009 file.
3010 .Pa /etc/ppp/ppp.secret
3011 is always checked first.
3012 If you wish to use passwords from
3013 .Xr passwd 5 ,
3014 but also to specify an IP number or label for a given client, use
3015 .Dq \&*
3016 as the client password in
3017 .Pa /etc/ppp/ppp.secret .
3018 .It proxy
3019 Default: Disabled.
3020 Enabling this option will tell
3021 .Nm
3022 to proxy ARP for the peer.
3023 This means that
3024 .Nm
3025 will make an entry in the ARP table using
3026 .Dv HISADDR
3027 and the
3028 .Dv MAC
3029 address of the local network in which
3030 .Dv HISADDR
3031 appears.
3032 This allows other machines connecteed to the LAN to talk to
3033 the peer as if the peer itself was connected to the LAN.
3034 The proxy entry cannot be made unless
3035 .Dv HISADDR
3036 is an address from a LAN.
3037 .It proxyall
3038 Default: Disabled.
3039 Enabling this will tell
3040 .Nm
3041 to add proxy arp entries for every IP address in all class C or
3042 smaller subnets routed via the tun interface.
3043 .Pp
3044 Proxy arp entries are only made for sticky routes that are added
3045 using the
3046 .Dq add
3047 command.
3048 No proxy arp entries are made for the interface address itself
3049 (as created by the
3050 .Dq set ifaddr
3051 command).
3052 .It sroutes
3053 Default: Enabled.
3054 When the
3055 .Dq add
3056 command is used with the
3057 .Dv HISADDR
3058 or
3059 .Dv MYADDR
3060 values, entries are stored in the
3061 .Sq stick route
3062 list.
3063 Each time
3064 .Dv HISADDR
3065 or
3066 .Dv MYADDR
3067 change, this list is re-applied to the routing table.
3068 .Pp
3069 Disabling this option will prevent the re-application of sticky routes,
3070 although the
3071 .Sq stick route
3072 list will still be maintained.
3073 .It Op tcp Ns Xo
3074 .No mssfixup
3075 .Xc
3076 Default: Enabled.
3077 This option tells
3078 .Nm
3079 to adjust TCP SYN packets so that the maximum receive segment
3080 size is not greater than the amount allowed by the interface MTU.
3081 .It throughput
3082 Default: Enabled.
3083 This option tells
3084 .Nm
3085 to gather throughput statistics.
3086 Input and output is sampled over
3087 a rolling 5 second window, and current, best and total figures are retained.
3088 This data is output when the relevant
3089 .Em PPP
3090 layer shuts down, and is also available using the
3091 .Dq show
3092 command.
3093 Throughput statistics are available at the
3094 .Dq IPCP
3095 and
3096 .Dq physical
3097 levels.
3098 .It utmp
3099 Default: Enabled.
3100 Normally, when a user is authenticated using PAP or CHAP, and when
3101 .Nm
3102 is running in
3103 .Fl direct
3104 mode, an entry is made in the utmp and wtmp files for that user.
3105 Disabling this option will tell
3106 .Nm
3107 not to make any utmp or wtmp entries.
3108 This is usually only necessary if
3109 you require the user to both login and authenticate themselves.
3110 .It iface-alias
3111 Default: Enabled if
3112 .Fl nat
3113 is specified.
3114 This option simply tells
3115 .Nm
3116 to add new interface addresses to the interface rather than replacing them.
3117 The option can only be enabled if network address translation is enabled
3118 .Pq Dq nat enable yes .
3119 .Pp
3120 With this option enabled,
3121 .Nm
3122 will pass traffic for old interface addresses through the NAT engine
3123 (see
3124 .Xr libalias 3 ) ,
3125 resulting in the ability (in
3126 .Fl auto
3127 mode) to properly connect the process that caused the PPP link to
3128 come up in the first place.
3129 .Pp
3130 Disabling NAT with
3131 .Dq nat enable no
3132 will also disable
3133 .Sq iface-alias .
3134 .El
3135 .Pp
3136 .It add Ns Xo
3137 .Op !\&
3138 .Ar dest Ns Op / Ns Ar nn
3139 .Op Ar mask
3140 .Op Ar gateway
3141 .Xc
3142 .Ar Dest
3143 is the destination IP address.
3144 The netmask is specified either as a number of bits with
3145 .Ar /nn
3146 or as an IP number using
3147 .Ar mask .
3148 .Ar 0 0
3149 or simply
3150 .Ar 0
3151 with no mask refers to the default route.
3152 It is also possible to use the literal name
3153 .Sq default
3154 instead of
3155 .Ar 0 .
3156 .Ar Gateway
3157 is the next hop gateway to get to the given
3158 .Ar dest
3159 machine/network.
3160 Refer to the
3161 .Xr route 8
3162 command for further details.
3163 .Pp
3164 It is possible to use the symbolic names
3165 .Sq MYADDR
3166 or
3167 .Sq HISADDR
3168 as the destination, and
3169 .Sq HISADDR
3170 as the
3171 .Ar gateway .
3172 .Sq MYADDR
3173 is replaced with the interface address and
3174 .Sq HISADDR
3175 is replaced with the interface destination (peer) address.
3176 .Pp
3177 If the
3178 .Ar add!\&
3179 command is used
3180 (note the trailing
3181 .Dq !\& ) ,
3182 then if the route already exists, it will be updated as with the
3183 .Sq route change
3184 command (see
3185 .Xr route 8
3186 for further details).
3187 .Pp
3188 Routes that contain the
3189 .Dq HISADDR ,
3190 .Dq MYADDR ,
3191 .Dq DNS0 ,
3192 or
3193 .Dq DNS1
3194 constants are considered
3195 .Sq sticky .
3196 They are stored in a list (use
3197 .Dq show ipcp
3198 to see the list), and each time the value of
3199 .Dv HISADDR ,
3200 .Dv MYADDR ,
3201 .Dv DNS0 ,
3202 or
3203 .Dv DNS1
3204 changes, the appropriate routing table entries are updated.
3205 This facility may be disabled using
3206 .Dq disable sroutes .
3207 .It allow Ar command Op Ar args
3208 This command controls access to
3209 .Nm
3210 and its configuration files.
3211 It is possible to allow user-level access,
3212 depending on the configuration file label and on the mode that
3213 .Nm
3214 is being run in.
3215 For example, you may wish to configure
3216 .Nm
3217 so that only user
3218 .Sq fred
3219 may access label
3220 .Sq fredlabel
3221 in
3222 .Fl background
3223 mode.
3224 .Pp
3225 User id 0 is immune to these commands.
3226 .Bl -tag -width 2n
3227 .It allow user Ns Xo
3228 .Op s
3229 .Ar logname Ns No ...
3230 .Xc
3231 By default, only user id 0 is allowed access to
3232 .Nm .
3233 If this command is used, all of the listed users are allowed access to
3234 the section in which the
3235 .Dq allow users
3236 command is found.
3237 The
3238 .Sq default
3239 section is always checked first (even though it is only ever automatically
3240 loaded at startup).
3241 .Dq allow users
3242 commands are cumulative in a given section, but users allowed in any given
3243 section override users allowed in the default section, so it's possible to
3244 allow users access to everything except a given label by specifying default
3245 users in the
3246 .Sq default
3247 section, and then specifying a new user list for that label.
3248 .Pp
3249 If user
3250 .Sq *
3251 is specified, access is allowed to all users.
3252 .It allow mode Ns Xo
3253 .Op s
3254 .Ar mode Ns No ...
3255 .Xc
3256 By default, access using any
3257 .Nm
3258 mode is possible.
3259 If this command is used, it restricts the access
3260 .Ar modes
3261 allowed to load the label under which this command is specified.
3262 Again, as with the
3263 .Dq allow users
3264 command, each
3265 .Dq allow modes
3266 command overrides any previous settings, and the
3267 .Sq default
3268 section is always checked first.
3269 .Pp
3270 Possible modes are:
3271 .Sq interactive ,
3272 .Sq auto ,
3273 .Sq direct ,
3274 .Sq dedicated ,
3275 .Sq ddial ,
3276 .Sq background
3277 and
3278 .Sq * .
3279 .Pp
3280 When running in multi-link mode, a section can be loaded if it allows
3281 .Em any
3282 of the currently existing line modes.
3283 .El
3284 .Pp
3285 .It nat Ar command Op Ar args
3286 This command allows the control of the network address translation (also
3287 known as masquerading or IP aliasing) facilities that are built into
3288 .Nm .
3289 NAT is done on the external interface only, and is unlikely to make sense
3290 if used with the
3291 .Fl direct
3292 flag.
3293 .Pp
3294 If nat is enabled on your system (it may be omitted at compile time),
3295 the following commands are possible:
3296 .Bl -tag -width 2n
3297 .It nat enable yes|no
3298 This command either switches network address translation on or turns it off.
3299 The
3300 .Fl nat
3301 command line flag is synonymous with
3302 .Dq nat enable yes .
3303 .It nat addr Op Ar addr_local addr_alias
3304 This command allows data for
3305 .Ar addr_alias
3306 to be redirected to
3307 .Ar addr_local .
3308 It is useful if you own a small number of real IP numbers that
3309 you wish to map to specific machines behind your gateway.
3310 .It nat deny_incoming yes|no
3311 If set to yes, this command will refuse all incoming packets where an
3312 aliasing link doesn't already exist.
3313 Refer to the
3314 .Sx CONCEPTUAL BACKGROUND
3315 section of
3316 .Xr libalias 3
3317 for a description of what an
3318 .Dq aliasing link
3319 is.
3320 .Pp
3321 It should be noted under what circumstances an aliasing link is created by
3322 .Xr libalias 3 .
3323 It may be necessary to further protect your network from outside
3324 connections using the
3325 .Dq set filter
3326 or
3327 .Dq nat target
3328 commands.
3329 .It nat help|?
3330 This command gives a summary of available nat commands.
3331 .It nat log yes|no
3332 This option causes various NAT statistics and information to
3333 be logged to the file
3334 .Pa /var/log/alias.log .
3335 .It nat port Ar proto Ar targetIP Ns Xo
3336 .No : Ns Ar targetPort Ns
3337 .Oo
3338 .No - Ns Ar targetPort
3339 .Oc Ar aliasPort Ns
3340 .Oo
3341 .No - Ns Ar aliasPort
3342 .Oc Oo Ar remoteIP : Ns
3343 .Ar remotePort Ns
3344 .Oo
3345 .No - Ns Ar remotePort
3346 .Oc Ns
3347 .Oc
3348 .Xc
3349 This command causes incoming
3350 .Ar proto
3351 connections to
3352 .Ar aliasPort
3353 to be redirected to
3354 .Ar targetPort
3355 on
3356 .Ar targetIP .
3357 .Ar proto
3358 is either
3359 .Dq tcp
3360 or
3361 .Dq udp .
3362 .Pp
3363 A range of port numbers may be specified as shown above.
3364 The ranges must be of the same size.
3365 .Pp
3366 If
3367 .Ar remoteIP
3368 is specified, only data coming from that IP number is redirected.
3369 .Ar remotePort
3370 must either be
3371 .Dq 0
3372 (indicating any source port)
3373 or a range of ports the same size as the other ranges.
3374 .Pp
3375 This option is useful if you wish to run things like Internet phone on
3376 machines behind your gateway, but is limited in that connections to only
3377 one interior machine per source machine and target port are possible.
3378 .It nat proto Ar proto localIP Oo
3379 .Ar publicIP Op Ar remoteIP
3380 .Oc
3381 This command tells
3382 .Nm
3383 to redirect packets of protocol type
3384 .Ar proto
3385 (see
3386 .Xr protocols 5 )
3387 to the internall address
3388 .Ar localIP .
3389 .Pp
3390 If
3391 .Ar publicIP
3392 is specified, only packets destined for that address are matched,
3393 otherwise the default alias address is used.
3394 .Pp
3395 If
3396 .Ar remoteIP
3397 is specified, only packets matching that source address are matched,
3398 .Pp
3399 This command is useful for redirecting tunnel endpoints to an internal machine,
3400 for example:
3401 .Pp
3402 .Dl nat proto ipencap 10.0.0.1
3403 .It "nat proxy cmd" Ar arg Ns No ...
3404 This command tells
3405 .Nm
3406 to proxy certain connections, redirecting them to a given server.
3407 Refer to the description of
3408 .Fn PacketAliasProxyRule
3409 in
3410 .Xr libalias 3
3411 for details of the available commands.
3412 .It nat punch_fw Op Ar base count
3413 This command tells
3414 .Nm
3415 to punch holes in the firewall for FTP or IRC DCC connections.
3416 This is done dynamically by installing termporary firewall rules which
3417 allow a particular connection (and only that connection) to go through
3418 the firewall.
3419 The rules are removed once the corresponding connection terminates.
3420 .Pp
3421 A maximum of
3422 .Ar count
3423 rules starting from rule number
3424 .Ar base
3425 will be used for punching firewall holes.
3426 The range will be cleared when the
3427 .Dq nat punch_fw
3428 command is run.
3429 .Pp
3430 If no arguments are given, firewall punching is disabled.
3431 .It nat same_ports yes|no
3432 When enabled, this command will tell the network address translation engine to
3433 attempt to avoid changing the port number on outgoing packets.
3434 This is useful
3435 if you want to support protocols such as RPC and LPD which require
3436 connections to come from a well known port.
3437 .It nat target Op Ar address
3438 Set the given target address or clear it if no address is given.
3439 The target address is used by libalias to specify how to NAT incoming
3440 packets by default.
3441 If a target address is not set or if
3442 .Dq default
3443 is given, packets are not altered and are allowed to route to the internal
3444 network.
3445 .Pp
3446 The target address may be set to
3447 .Dq MYADDR ,
3448 in which case libalias will redirect all packets to the interface address.
3449 .It nat use_sockets yes|no
3450 When enabled, this option tells the network address translation engine to
3451 create a socket so that it can guarantee a correct incoming ftp data or
3452 IRC connection.
3453 .It nat unregistered_only yes|no
3454 Only alter outgoing packets with an unregistered source address.
3455 According to RFC 1918, unregistered source addresses
3456 are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.
3457 .El
3458 .Pp
3459 These commands are also discussed in the file
3460 .Pa README.nat
3461 which comes with the source distribution.
3462 .Pp
3463 .It Op !\& Ns Xo
3464 .No bg Ar command
3465 .Xc
3466 The given
3467 .Ar command
3468 is executed in the background with the following words replaced:
3469 .Bl -tag -width PEER_ENDDISC
3470 .It Li AUTHNAME
3471 This is replaced with the local
3472 .Ar authname
3473 value.
3474 See the
3475 .Dq set authname
3476 command below.
3477 .It Li COMPILATIONDATE
3478 This is replaced with the date on which
3479 .Nm
3480 was compiled.
3481 .It Li DNS0 & DNS1
3482 These are replaced with the primary and secondary nameserver IP numbers.
3483 If nameservers are negotiated by IPCP, the values of these macros will change.
3484 .It Li ENDDISC
3485 This is replaced with the local endpoint discriminator value.
3486 See the
3487 .Dq set enddisc
3488 command below.
3489 .It Li HISADDR
3490 This is replaced with the peers IP number.
3491 .It Li INTERFACE
3492 This is replaced with the name of the interface that's in use.
3493 .It Li LABEL
3494 This is replaced with the last label name used.
3495 A label may be specified on the
3496 .Nm
3497 command line, via the
3498 .Dq load
3499 or
3500 .Dq dial
3501 commands and in the
3502 .Pa ppp.secret
3503 file.
3504 .It Li MYADDR
3505 This is replaced with the IP number assigned to the local interface.
3506 .It Li PEER_ENDDISC
3507 This is replaced with the value of the peers endpoint discriminator.
3508 .It Li PROCESSID
3509 This is replaced with the current process id.
3510 .It Li VERSION
3511 This is replaced with the current version number of
3512 .Nm .
3513 .It Li USER
3514 This is replaced with the username that has been authenticated with PAP or
3515 CHAP.
3516 Normally, this variable is assigned only in -direct mode.
3517 This value is available irrespective of whether utmp logging is enabled.
3518 .El
3519 .Pp
3520 These substitutions are also done by the
3521 .Dq set proctitle
3522 command.
3523 .Pp
3524 If you wish to pause
3525 .Nm
3526 while the command executes, use the
3527 .Dq shell
3528 command instead.
3529 .It clear physical|ipcp Op current|overall|peak...
3530 Clear the specified throughput values at either the
3531 .Dq physical
3532 or
3533 .Dq ipcp
3534 level.
3535 If
3536 .Dq physical
3537 is specified, context must be given (see the
3538 .Dq link
3539 command below).
3540 If no second argument is given, all values are cleared.
3541 .It clone Ar name Ns Xo
3542 .Op \&, Ns Ar name Ns
3543 .No ...
3544 .Xc
3545 Clone the specified link, creating one or more new links according to the
3546 .Ar name
3547 argument(s).
3548 This command must be used from the
3549 .Dq link
3550 command below unless you've only got a single link (in which case that
3551 link becomes the default).
3552 Links may be removed using the
3553 .Dq remove
3554 command below.
3555 .Pp
3556 The default link name is
3557 .Dq deflink .
3558 .It close Op lcp|ccp Ns Op !\&
3559 If no arguments are given, the relevant protocol layers will be brought
3560 down and the link will be closed.
3561 If
3562 .Dq lcp
3563 is specified, the LCP layer is brought down, but
3564 .Nm
3565 will not bring the link offline.
3566 It is subsequently possible to use
3567 .Dq term
3568 (see below)
3569 to talk to the peer machine if, for example, something like
3570 .Dq slirp
3571 is being used.
3572 If
3573 .Dq ccp
3574 is specified, only the relevant compression layer is closed.
3575 If the
3576 .Dq !\&
3577 is used, the compression layer will remain in the closed state, otherwise
3578 it will re-enter the STOPPED state, waiting for the peer to initiate
3579 further CCP negotiation.
3580 In any event, this command does not disconnect the user from
3581 .Nm
3582 or exit
3583 .Nm .
3584 See the
3585 .Dq quit
3586 command below.
3587 .It delete Ns Xo
3588 .Op !\&
3589 .Ar dest
3590 .Xc
3591 This command deletes the route with the given
3592 .Ar dest
3593 IP address.
3594 If
3595 .Ar dest
3596 is specified as
3597 .Sq ALL ,
3598 all non-direct entries in the routing table for the current interface,
3599 and all
3600 .Sq sticky route
3601 entries are deleted.
3602 If
3603 .Ar dest
3604 is specified as
3605 .Sq default ,
3606 the default route is deleted.
3607 .Pp
3608 If the
3609 .Ar delete!\&
3610 command is used
3611 (note the trailing
3612 .Dq !\& ) ,
3613 .Nm
3614 will not complain if the route does not already exist.
3615 .It dial|call Op Ar label Ns Xo
3616 .No ...
3617 .Xc
3618 This command is the equivalent of
3619 .Dq load label
3620 followed by
3621 .Dq open ,
3622 and is provided for backwards compatibility.
3623 .It down Op Ar lcp|ccp
3624 Bring the relevant layer down ungracefully, as if the underlying layer
3625 had become unavailable.
3626 It's not considered polite to use this command on
3627 a Finite State Machine that's in the OPEN state.
3628 If no arguments are
3629 supplied, the entire link is closed (or if no context is given, all links
3630 are terminated).
3631 If
3632 .Sq lcp
3633 is specified, the
3634 .Em LCP
3635 layer is terminated but the device is not brought offline and the link
3636 is not closed.
3637 If
3638 .Sq ccp
3639 is specified, only the relevant compression layer(s) are terminated.
3640 .It help|? Op Ar command
3641 Show a list of available commands.
3642 If
3643 .Ar command
3644 is specified, show the usage string for that command.
3645 .It ident Op Ar text Ns No ...
3646 Identify the link to the peer using
3647 .Ar text .
3648 If
3649 .Ar text
3650 is empty, link identification is disabled.
3651 It is possible to use any of the words described for the
3652 .Ic bg
3653 command above.
3654 Refer to the
3655 .Ic sendident
3656 command for details of when
3657 .Nm
3658 identifies itself to the peer.
3659 .It iface Ar command Op args
3660 This command is used to control the interface used by
3661 .Nm .
3662 .Ar Command
3663 may be one of the following:
3664 .Bl -tag -width 2n
3665 .It iface add Ns Xo
3666 .Op !\&
3667 .Ar addr Ns Op / Ns Ar bits
3668 .Op Ar peer
3669 .Xc
3670 .It iface add Ns Xo
3671 .Op !\&
3672 .Ar addr
3673 .Ar mask
3674 .Ar peer
3675 .Xc
3676 Add the given
3677 .Ar addr mask peer
3678 combination to the interface.
3679 Instead of specifying
3680 .Ar mask ,
3681 .Ar /bits
3682 can be used
3683 (with no space between it and
3684 .Ar addr ) .
3685 If the given address already exists, the command fails unless the
3686 .Dq !\&
3687 is used - in which case the previous interface address entry is overwritten
3688 with the new one, allowing a change of netmask or peer address.
3689 .Pp
3690 If only
3691 .Ar addr
3692 is specified,
3693 .Ar bits
3694 defaults to
3695 .Dq 32
3696 and
3697 .Ar peer
3698 defaults to
3699 .Dq 255.255.255.255 .
3700 This address (the broadcast address) is the only duplicate peer address that
3701 .Nm
3702 allows.
3703 .It iface clear
3704 If this command is used while
3705 .Nm
3706 is in the OPENED state or while in
3707 .Fl auto
3708 mode, all addresses except for the IPCP negotiated address are deleted
3709 from the interface.
3710 If
3711 .Nm
3712 is not in the OPENED state and is not in
3713 .Fl auto
3714 mode, all interface addresses are deleted.
3715 .Pp
3716 .It iface delete Ns Xo
3717 .Op !\& Ns
3718 .No |rm Ns Op !\&
3719 .Ar addr
3720 .Xc
3721 This command deletes the given
3722 .Ar addr
3723 from the interface.
3724 If the
3725 .Dq !\&
3726 is used, no error is given if the address isn't currently assigned to
3727 the interface (and no deletion takes place).
3728 .It iface show
3729 Shows the current state and current addresses for the interface.
3730 It is much the same as running
3731 .Dq ifconfig INTERFACE .
3732 .It iface help Op Ar sub-command
3733 This command, when invoked without
3734 .Ar sub-command ,
3735 will show a list of possible
3736 .Dq iface
3737 sub-commands and a brief synopsis for each.
3738 When invoked with
3739 .Ar sub-command ,
3740 only the synopsis for the given sub-command is shown.
3741 .El
3742 .It Op data Ns Xo
3743 .No link
3744 .Ar name Ns Op , Ns Ar name Ns
3745 .No ... Ar command Op Ar args
3746 .Xc
3747 This command may prefix any other command if the user wishes to
3748 specify which link the command should affect.
3749 This is only applicable after multiple links have been created in Multi-link
3750 mode using the
3751 .Dq clone
3752 command.
3753 .Pp
3754 .Ar Name
3755 specifies the name of an existing link.
3756 If
3757 .Ar name
3758 is a comma separated list,
3759 .Ar command
3760 is executed on each link.
3761 If
3762 .Ar name
3763 is
3764 .Dq * ,
3765 .Ar command
3766 is executed on all links.
3767 .It load Op Ar label Ns Xo
3768 .No ...
3769 .Xc
3770 Load the given
3771 .Ar label Ns No (s)
3772 from the
3773 .Pa ppp.conf
3774 file.
3775 If
3776 .Ar label
3777 is not given, the
3778 .Ar default
3779 label is used.
3780 .Pp
3781 Unless the
3782 .Ar label
3783 section uses the
3784 .Dq set mode ,
3785 .Dq open
3786 or
3787 .Dq dial
3788 commands,
3789 .Nm
3790 will not attempt to make an immediate connection.
3791 .It open Op lcp|ccp|ipcp
3792 This is the opposite of the
3793 .Dq close
3794 command.
3795 All closed links are immediately brought up apart from second and subsequent
3796 .Ar demand-dial
3797 links - these will come up based on the
3798 .Dq set autoload
3799 command that has been used.
3800 .Pp
3801 If the
3802 .Dq lcp
3803 argument is used while the LCP layer is already open, LCP will be
3804 renegotiated.
3805 This allows various LCP options to be changed, after which
3806 .Dq open lcp
3807 can be used to put them into effect.
3808 After renegotiating LCP,
3809 any agreed authentication will also take place.
3810 .Pp
3811 If the
3812 .Dq ccp
3813 argument is used, the relevant compression layer is opened.
3814 Again, if it is already open, it will be renegotiated.
3815 .Pp
3816 If the
3817 .Dq ipcp
3818 argument is used, the link will be brought up as normal, but if
3819 IPCP is already open, it will be renegotiated and the network
3820 interface will be reconfigured.
3821 .Pp
3822 It is probably not good practice to re-open the PPP state machines
3823 like this as it's possible that the peer will not behave correctly.
3824 It
3825 .Em is
3826 however useful as a way of forcing the CCP or VJ dictionaries to be reset.
3827 .It passwd Ar pass
3828 Specify the password required for access to the full
3829 .Nm
3830 command set.
3831 This password is required when connecting to the diagnostic port (see the
3832 .Dq set server
3833 command).
3834 .Ar Pass
3835 is specified on the
3836 .Dq set server
3837 command line.
3838 The value of
3839 .Ar pass
3840 is not logged when
3841 .Ar command
3842 logging is active, instead, the literal string
3843 .Sq ********
3844 is logged.
3845 .It quit|bye Op all
3846 If
3847 .Dq quit
3848 is executed from the controlling connection or from a command file,
3849 ppp will exit after closing all connections.
3850 Otherwise, if the user
3851 is connected to a diagnostic socket, the connection is simply dropped.
3852 .Pp
3853 If the
3854 .Ar all
3855 argument is given,
3856 .Nm
3857 will exit despite the source of the command after closing all existing
3858 connections.
3859 .It remove|rm
3860 This command removes the given link.
3861 It is only really useful in multi-link mode.
3862 A link must be in the
3863 .Dv CLOSED
3864 state before it is removed.
3865 .It rename|mv Ar name
3866 This command renames the given link to
3867 .Ar name .
3868 It will fail if
3869 .Ar name
3870 is already used by another link.
3871 .Pp
3872 The default link name is
3873 .Sq deflink .
3874 Renaming it to
3875 .Sq modem ,
3876 .Sq cuaa0
3877 or
3878 .Sq USR
3879 may make the log file more readable.
3880 .It resolv Ar command
3881 This command controls
3882 .Nm Ns No 's
3883 manipulation of the
3884 .Xr resolv.conf 5
3885 file.
3886 When
3887 .Nm
3888 starts up, it loads the contents of this file into memory and retains this
3889 image for future use.
3890 .Ar command
3891 is one of the following:
3892 .Bl -tag -width readonly
3893 .It Em readonly
3894 Treat
3895 .Pa /etc/resolv.conf
3896 as read only.
3897 If
3898 .Dq dns
3899 is enabled,
3900 .Nm
3901 will still attempt to negotiate nameservers with the peer, making the results
3902 available via the
3903 .Dv DNS0
3904 and
3905 .Dv DNS1
3906 macros.
3907 This is the opposite of the
3908 .Dq resolv writable
3909 command.
3910 .It Em reload
3911 Reload
3912 .Pa /etc/resolv.conf
3913 into memory.
3914 This may be necessary if for example a DHCP client overwrote
3915 .Pa /etc/resolv.conf .
3916 .It Em restore
3917 Replace
3918 .Pa /etc/resolv.conf
3919 with the version originally read at startup or with the last
3920 .Dq resolv reload
3921 command.
3922 This is sometimes a useful command to put in the
3923 .Pa /etc/ppp/ppp.linkdown
3924 file.
3925 .It Em rewrite
3926 Rewrite the
3927 .Pa /etc/resolv.conf
3928 file.
3929 This command will work even if the
3930 .Dq resolv readonly
3931 command has been used.
3932 It may be useful as a command in the
3933 .Pa /etc/ppp/ppp.linkup
3934 file if you wish to defer updating
3935 .Pa /etc/resolv.conf
3936 until after other commands have finished.
3937 .It Em writable
3938 Allow
3939 .Nm
3940 to update
3941 .Pa /etc/resolv.conf
3942 if
3943 .Dq dns
3944 is enabled and
3945 .Nm
3946 successfully negotiates a DNS.
3947 This is the opposite of the
3948 .Dq resolv readonly
3949 command.
3950 .El
3951 .It save
3952 This option is not (yet) implemented.
3953 .It sendident
3954 This command tells
3955 .Nm
3956 to identify itself to the peer.
3957 The link must be in LCP state or higher.
3958 If no identity has been set (via the
3959 .Ic ident
3960 command),
3961 .Ic sendident
3962 will fail.
3963 .Pp
3964 When an identity has been set,
3965 .Nm
3966 will automatically identify itself when it sends or receives a configure
3967 reject, when negotiation fails or when LCP reaches the opened state.
3968 .Pp
3969 Received identification packets are logged to the LCP log (see
3970 .Ic set log
3971 for details) and are never responded to.
3972 .It set Ns Xo
3973 .Op up
3974 .Ar var value
3975 .Xc
3976 This option allows the setting of any of the following variables:
3977 .Bl -tag -width 2n
3978 .It set accmap Ar hex-value
3979 ACCMap stands for Asynchronous Control Character Map.
3980 This is always
3981 negotiated with the peer, and defaults to a value of 00000000 in hex.
3982 This protocol is required to defeat hardware that depends on passing
3983 certain characters from end to end (such as XON/XOFF etc).
3984 .Pp
3985 For the XON/XOFF scenario, use
3986 .Dq set accmap 000a0000 .
3987 .It set Op auth Ns Xo
3988 .No key Ar value
3989 .Xc
3990 This sets the authentication key (or password) used in client mode
3991 PAP or CHAP negotiation to the given value.
3992 It also specifies the
3993 password to be used in the dial or login scripts in place of the
3994 .Sq \eP
3995 sequence, preventing the actual password from being logged.
3996 If
3997 .Ar command
3998 or
3999 .Ar chat
4000 logging is in effect,
4001 .Ar value
4002 is logged as
4003 .Sq ********
4004 for security reasons.
4005 .Pp
4006 If the first character of
4007 .Ar value
4008 is an exclamation mark
4009 .Pq Dq !\& ,
4010 .Nm
4011 treats the remainder of the string as a program that must be executed
4012 to determine the
4013 .Dq authname
4014 and
4015 .Dq authkey
4016 values.
4017 .Pp
4018 If the
4019 .Dq !\&
4020 is doubled up
4021 (to
4022 .Dq !! ) ,
4023 it is treated as a single literal
4024 .Dq !\& ,
4025 otherwise, ignoring the
4026 .Dq !\& ,
4027 .Ar value
4028 is parsed as a program to execute in the same was as the
4029 .Dq !bg
4030 command above, substituting special names in the same manner.
4031 Once executed,
4032 .Nm
4033 will feed the program three lines of input, each terminated by a newline
4034 character:
4035 .Bl -bullet
4036 .It
4037 The host name as sent in the CHAP challenge.
4038 .It
4039 The challenge string as sent in the CHAP challenge.
4040 .It
4041 The locally defined
4042 .Dq authname .
4043 .El
4044 .Pp
4045 Two lines of output are expected:
4046 .Bl -bullet
4047 .It
4048 The
4049 .Dq authname
4050 to be sent with the CHAP response.
4051 .It
4052 The
4053 .Dq authkey ,
4054 which is encrypted with the challenge and request id, the answer being sent
4055 in the CHAP response packet.
4056 .El
4057 .Pp
4058 When configuring
4059 .Nm
4060 in this manner, it's expected that the host challenge is a series of ASCII
4061 digits or characters.
4062 An encryption device or Secure ID card is usually
4063 required to calculate the secret appropriate for the given challenge.
4064 .It set authname Ar id
4065 This sets the authentication id used in client mode PAP or CHAP negotiation.
4066 .Pp
4067 If used in
4068 .Fl direct
4069 mode with CHAP enabled,
4070 .Ar id
4071 is used in the initial authentication challenge and should normally be set to
4072 the local machine name.
4073 .It set autoload Xo
4074 .Ar min-percent max-percent period
4075 .Xc
4076 These settings apply only in multi-link mode and default to zero, zero and
4077 five respectively.
4078 When more than one
4079 .Ar demand-dial
4080 (also known as
4081 .Fl auto )
4082 mode link is available, only the first link is made active when
4083 .Nm
4084 first reads data from the tun device.
4085 The next
4086 .Ar demand-dial
4087 link will be opened only when the current bundle throughput is at least
4088 .Ar max-percent
4089 percent of the total bundle bandwidth for
4090 .Ar period
4091 seconds.
4092 When the current bundle throughput decreases to
4093 .Ar min-percent
4094 percent or less of the total bundle bandwidth for
4095 .Ar period
4096 seconds, a
4097 .Ar demand-dial
4098 link will be brought down as long as it's not the last active link.
4099 .Pp
4100 Bundle throughput is measured as the maximum of inbound and outbound
4101 traffic.
4102 .Pp
4103 The default values cause
4104 .Ar demand-dial
4105 links to simply come up one at a time.
4106 .Pp
4107 Certain devices cannot determine their physical bandwidth, so it
4108 is sometimes necessary to use the
4109 .Dq set bandwidth
4110 command (described below) to make
4111 .Dq set autoload
4112 work correctly.
4113 .It set bandwidth Ar value
4114 This command sets the connection bandwidth in bits per second.
4115 .Ar value
4116 must be greater than zero.
4117 It is currently only used by the
4118 .Dq set autoload
4119 command above.
4120 .It set callback Ar option Ns No ...
4121 If no arguments are given, callback is disabled, otherwise,
4122 .Nm
4123 will request (or in
4124 .Fl direct
4125 mode, will accept) one of the given
4126 .Ar option Ns No s .
4127 In client mode, if an
4128 .Ar option
4129 is NAK'd
4130 .Nm
4131 will request a different
4132 .Ar option ,
4133 until no options remain at which point
4134 .Nm
4135 will terminate negotiations (unless
4136 .Dq none
4137 is one of the specified
4138 .Ar option ) .
4139 In server mode,
4140 .Nm
4141 will accept any of the given protocols - but the client
4142 .Em must
4143 request one of them.
4144 If you wish callback to be optional, you must include
4145 .Ar none
4146 as an option.
4147 .Pp
4148 The
4149 .Ar option Ns No s
4150 are as follows (in this order of preference):
4151 .Pp
4152 .Bl -tag -width Ds
4153 .It auth
4154 The callee is expected to decide the callback number based on
4155 authentication.
4156 If
4157 .Nm
4158 is the callee, the number should be specified as the fifth field of
4159 the peers entry in
4160 .Pa /etc/ppp/ppp.secret .
4161 .It cbcp
4162 Microsoft's callback control protocol is used.
4163 See
4164 .Dq set cbcp
4165 below.
4166 .Pp
4167 If you wish to negotiate
4168 .Ar cbcp
4169 in client mode but also wish to allow the server to request no callback at
4170 CBCP negotiation time, you must specify both
4171 .Ar cbcp
4172 and
4173 .Ar none
4174 as callback options.
4175 .It E.164 *| Ns Xo
4176 .Ar number Ns Op , Ns Ar number Ns
4177 .No ...
4178 .Xc
4179 The caller specifies the
4180 .Ar number .
4181 If
4182 .Nm
4183 is the callee,
4184 .Ar number
4185 should be either a comma separated list of allowable numbers or a
4186 .Dq \&* ,
4187 meaning any number is permitted.
4188 If
4189 .Nm
4190 is the caller, only a single number should be specified.
4191 .Pp
4192 Note, this option is very unsafe when used with a
4193 .Dq \&*
4194 as a malicious caller can tell
4195 .Nm
4196 to call any (possibly international) number without first authenticating
4197 themselves.
4198 .It none
4199 If the peer does not wish to do callback at all,
4200 .Nm
4201 will accept the fact and continue without callback rather than terminating
4202 the connection.
4203 This is required (in addition to one or more other callback
4204 options) if you wish callback to be optional.
4205 .El
4206 .Pp
4207 .It set cbcp Oo
4208 .No *| Ns Ar number Ns Oo
4209 .No , Ns Ar number Ns ...\& Oc
4210 .Op Ar delay Op Ar retry
4211 .Oc
4212 If no arguments are given, CBCP (Microsoft's CallBack Control Protocol)
4213 is disabled - ie, configuring CBCP in the
4214 .Dq set callback
4215 command will result in
4216 .Nm
4217 requesting no callback in the CBCP phase.
4218 Otherwise,
4219 .Nm
4220 attempts to use the given phone
4221 .Ar number Ns No (s).
4222 .Pp
4223 In server mode
4224 .Pq Fl direct ,
4225 .Nm
4226 will insist that the client uses one of these numbers, unless
4227 .Dq \&*
4228 is used in which case the client is expected to specify the number.
4229 .Pp
4230 In client mode,
4231 .Nm
4232 will attempt to use one of the given numbers (whichever it finds to
4233 be agreeable with the peer), or if
4234 .Dq \&*
4235 is specified,
4236 .Nm
4237 will expect the peer to specify the number.
4238 .It set cd Oo
4239 .No off| Ns Ar seconds Ns Op !\&
4240 .Oc
4241 Normally,
4242 .Nm
4243 checks for the existence of carrier depending on the type of device
4244 that has been opened:
4245 .Bl -tag -width XXX -offset XXX
4246 .It Terminal Devices
4247 Carrier is checked one second after the login script is complete.
4248 If it's not set,
4249 .Nm
4250 assumes that this is because the device doesn't support carrier (which
4251 is true for most
4252 .Dq laplink
4253 NULL-modem cables), logs the fact and stops checking
4254 for carrier.
4255 .Pp
4256 As ptys don't support the TIOCMGET ioctl, the tty device will switch all
4257 carrier detection off when it detects that the device is a pty.
4258 .It ISDN (i4b) Devices
4259 Carrier is checked once per second for 6 seconds.
4260 If it's not set after
4261 the sixth second, the connection attempt is considered to have failed and
4262 the device is closed.
4263 Carrier is always required for i4b devices.
4264 .It PPPoE (netgraph) Devices
4265 Carrier is checked once per second for 5 seconds.
4266 If it's not set after
4267 the fifth second, the connection attempt is considered to have failed and
4268 the device is closed.
4269 Carrier is always required for PPPoE devices.
4270 .El
4271 .Pp
4272 All other device types don't support carrier.
4273 Setting a carrier value will
4274 result in a warning when the device is opened.
4275 .Pp
4276 Some modems take more than one second after connecting to assert the carrier
4277 signal.
4278 If this delay isn't increased, this will result in
4279 .Nm Ns No 's
4280 inability to detect when the link is dropped, as
4281 .Nm
4282 assumes that the device isn't asserting carrier.
4283 .Pp
4284 The
4285 .Dq set cd
4286 command overrides the default carrier behaviour.
4287 .Ar seconds
4288 specifies the maximum number of seconds that
4289 .Nm
4290 should wait after the dial script has finished before deciding if
4291 carrier is available or not.
4292 .Pp
4293 If
4294 .Dq off
4295 is specified,
4296 .Nm
4297 will not check for carrier on the device, otherwise
4298 .Nm
4299 will not proceed to the login script until either carrier is detected
4300 or until
4301 .Ar seconds
4302 has elapsed, at which point
4303 .Nm
4304 assumes that the device will not set carrier.
4305 .Pp
4306 If no arguments are given, carrier settings will go back to their default
4307 values.
4308 .Pp
4309 If
4310 .Ar seconds
4311 is followed immediately by an exclamation mark
4312 .Pq Dq !\& ,
4313 .Nm
4314 will
4315 .Em require
4316 carrier.
4317 If carrier is not detected after
4318 .Ar seconds
4319 seconds, the link will be disconnected.
4320 .It set choked Op Ar timeout
4321 This sets the number of seconds that
4322 .Nm
4323 will keep a choked output queue before dropping all pending output packets.
4324 If
4325 .Ar timeout
4326 is less than or equal to zero or if
4327 .Ar timeout
4328 isn't specified, it is set to the default value of
4329 .Em 120 seconds .
4330 .Pp
4331 A choked output queue occurs when
4332 .Nm
4333 has read a certain number of packets from the local network for transmission,
4334 but cannot send the data due to link failure (the peer is busy etc.).
4335 .Nm
4336 will not read packets indefinitely.
4337 Instead, it reads up to
4338 .Em 30
4339 packets (or
4340 .Em 30 No +
4341 .Em nlinks No *
4342 .Em 2
4343 packets in multi-link mode), then stops reading the network interface
4344 until either
4345 .Ar timeout
4346 seconds have passed or at least one packet has been sent.
4347 .Pp
4348 If
4349 .Ar timeout
4350 seconds pass, all pending output packets are dropped.
4351 .It set ctsrts|crtscts on|off
4352 This sets hardware flow control.
4353 Hardware flow control is
4354 .Ar on
4355 by default.
4356 .It set deflate Ar out-winsize Op Ar in-winsize
4357 This sets the DEFLATE algorithms default outgoing and incoming window
4358 sizes.
4359 Both
4360 .Ar out-winsize
4361 and
4362 .Ar in-winsize
4363 must be values between
4364 .Em 8
4365 and
4366 .Em 15 .
4367 If
4368 .Ar in-winsize
4369 is specified,
4370 .Nm
4371 will insist that this window size is used and will not accept any other
4372 values from the peer.
4373 .It set dns Op Ar primary Op Ar secondary
4374 This command specifies DNS overrides for the
4375 .Dq accept dns
4376 command.
4377 Refer to the
4378 .Dq accept
4379 command description above for details.
4380 This command does not affect the IP numbers requested using
4381 .Dq enable dns .
4382 .It set device|line Xo
4383 .Ar value Ns No ...
4384 .Xc
4385 This sets the device(s) to which
4386 .Nm
4387 will talk to the given
4388 .Dq value .
4389 .Pp
4390 All ISDN and serial device names are expected to begin with
4391 .Pa /dev/ .
4392 ISDN devices are usually called
4393 .Pa i4brbchX
4394 and serial devices are usually called
4395 .Pa cuaXX .
4396 .Pp
4397 If
4398 .Dq value
4399 does not begin with
4400 .Pa /dev/ ,
4401 it must either begin with an exclamation mark
4402 .Pq Dq !\& ,
4403 be of the format
4404 .No PPPoE: Ns Ar iface Ns Xo
4405 .Op \&: Ns Ar provider Ns
4406 .Xc
4407 (on
4408 .Xr netgraph 4
4409 enabled systems), or be of the format
4410 .Sm off
4411 .Ar host : port Op /tcp|udp .
4412 .Sm on
4413 .Pp
4414 If it begins with an exclamation mark, the rest of the device name is
4415 treated as a program name, and that program is executed when the device
4416 is opened.
4417 Standard input, output and error are fed back to
4418 .Nm
4419 and are read and written as if they were a regular device.
4420 .Pp
4421 If a
4422 .No PPPoE: Ns Ar iface Ns Xo
4423 .Op \&: Ns Ar provider Ns
4424 .Xc
4425 specification is given,
4426 .Nm
4427 will attempt to create a
4428 .Em PPP
4429 over Ethernet connection using the given
4430 .Ar iface
4431 interface by using
4432 .Xr netgraph 4 .
4433 If
4434 .Xr netgraph 4
4435 is not available,
4436 .Nm
4437 will attempt to load it using
4438 .Xr kldload 2 .
4439 If this fails, an external program must be used such as the
4440 .Xr pppoe 8
4441 program available under OpenBSD.
4442 The given
4443 .Ar provider
4444 is passed as the service name in the PPPoE Discovery Initiation (PADI)
4445 packet.
4446 If no provider is given, an empty value will be used.
4447 Refer to
4448 .Xr netgraph 4
4449 and
4450 .Xr ng_pppoe 4
4451 for further details.
4452 .Pp
4453 If a
4454 .Ar host Ns No : Ns Ar port Ns Oo
4455 .No /tcp|udp
4456 .Oc
4457 specification is given,
4458 .Nm
4459 will attempt to connect to the given
4460 .Ar host
4461 on the given
4462 .Ar port .
4463 If a
4464 .Dq /tcp
4465 or
4466 .Dq /udp
4467 suffix is not provided, the default is
4468 .Dq /tcp .
4469 Refer to the section on
4470 .Em PPP OVER TCP and UDP
4471 above for further details.
4472 .Pp
4473 If multiple
4474 .Dq values
4475 are specified,
4476 .Nm
4477 will attempt to open each one in turn until it succeeds or runs out of
4478 devices.
4479 .It set dial Ar chat-script
4480 This specifies the chat script that will be used to dial the other
4481 side.
4482 See also the
4483 .Dq set login
4484 command below.
4485 Refer to
4486 .Xr chat 8
4487 and to the example configuration files for details of the chat script
4488 format.
4489 It is possible to specify some special
4490 .Sq values
4491 in your chat script as follows:
4492 .Bl -tag -width 2n
4493 .It Li \ec
4494 When used as the last character in a
4495 .Sq send
4496 string, this indicates that a newline should not be appended.
4497 .It Li \ed
4498 When the chat script encounters this sequence, it delays two seconds.
4499 .It Li \ep
4500 When the chat script encounters this sequence, it delays for one quarter of
4501 a second.
4502 .It Li \en
4503 This is replaced with a newline character.
4504 .It Li \er
4505 This is replaced with a carriage return character.
4506 .It Li \es
4507 This is replaced with a space character.
4508 .It Li \et
4509 This is replaced with a tab character.
4510 .It Li \eT
4511 This is replaced by the current phone number (see
4512 .Dq set phone
4513 below).
4514 .It Li \eP
4515 This is replaced by the current
4516 .Ar authkey
4517 value (see
4518 .Dq set authkey
4519 above).
4520 .It Li \eU
4521 This is replaced by the current
4522 .Ar authname
4523 value (see
4524 .Dq set authname
4525 above).
4526 .El
4527 .Pp
4528 Note that two parsers will examine these escape sequences, so in order to
4529 have the
4530 .Sq chat parser
4531 see the escape character, it is necessary to escape it from the
4532 .Sq command parser .
4533 This means that in practice you should use two escapes, for example:
4534 .Bd -literal -offset indent
4535 set dial "... ATDT\\\\T CONNECT"
4536 .Ed
4537 .Pp
4538 It is also possible to execute external commands from the chat script.
4539 To do this, the first character of the expect or send string is an
4540 exclamation mark
4541 .Pq Dq !\& .
4542 If a literal exclamation mark is required, double it up to
4543 .Dq !!\&
4544 and it will be treated as a single literal
4545 .Dq !\& .
4546 When the command is executed, standard input and standard output are
4547 directed to the open device (see the
4548 .Dq set device
4549 command), and standard error is read by
4550 .Nm
4551 and substituted as the expect or send string.
4552 If
4553 .Nm
4554 is running in interactive mode, file descriptor 3 is attached to
4555 .Pa /dev/tty .
4556 .Pp
4557 For example (wrapped for readability):
4558 .Bd -literal -offset indent
4559 set login "TIMEOUT 5 \\"\\" \\"\\" login:--login: ppp \e
4560 word: ppp \\"!sh \\\\-c \\\\\\"echo \\\\-n label: >&2\\\\\\"\\" \e
4561 \\"!/bin/echo in\\" HELLO"
4562 .Ed
4563 .Pp
4564 would result in the following chat sequence (output using the
4565 .Sq set log local chat
4566 command before dialing):
4567 .Bd -literal -offset indent
4568 Dial attempt 1 of 1
4569 dial OK!
4570 Chat: Expecting:
4571 Chat: Sending:
4572 Chat: Expecting: login:--login:
4573 Chat: Wait for (5): login:
4574 Chat: Sending: ppp
4575 Chat: Expecting: word:
4576 Chat: Wait for (5): word:
4577 Chat: Sending: ppp
4578 Chat: Expecting: !sh \\-c "echo \\-n label: >&2"
4579 Chat: Exec: sh -c "echo -n label: >&2"
4580 Chat: Wait for (5): !sh \\-c "echo \\-n label: >&2" --> label:
4581 Chat: Exec: /bin/echo in
4582 Chat: Sending:
4583 Chat: Expecting: HELLO
4584 Chat: Wait for (5): HELLO
4585 login OK!
4586 .Ed
4587 .Pp
4588 Note (again) the use of the escape character, allowing many levels of
4589 nesting.
4590 Here, there are four parsers at work.
4591 The first parses the original line, reading it as three arguments.
4592 The second parses the third argument, reading it as 11 arguments.
4593 At this point, it is
4594 important that the
4595 .Dq \&-
4596 signs are escaped, otherwise this parser will see them as constituting
4597 an expect-send-expect sequence.
4598 When the
4599 .Dq !\&
4600 character is seen, the execution parser reads the first command as three
4601 arguments, and then
4602 .Xr sh 1
4603 itself expands the argument after the
4604 .Fl c .
4605 As we wish to send the output back to the modem, in the first example
4606 we redirect our output to file descriptor 2 (stderr) so that
4607 .Nm
4608 itself sends and logs it, and in the second example, we just output to stdout,
4609 which is attached directly to the modem.
4610 .Pp
4611 This, of course means that it is possible to execute an entirely external
4612 .Dq chat
4613 command rather than using the internal one.
4614 See
4615 .Xr chat 8
4616 for a good alternative.
4617 .Pp
4618 The external command that is executed is subjected to the same special
4619 word expansions as the
4620 .Dq !bg
4621 command.
4622 .It set enddisc Op label|IP|MAC|magic|psn value
4623 This command sets our local endpoint discriminator.
4624 If set prior to LCP negotiation, and if no
4625 .Dq disable enddisc
4626 command has been used,
4627 .Nm
4628 will send the information to the peer using the LCP endpoint discriminator
4629 option.
4630 The following discriminators may be set:
4631 .Bl -tag -width indent
4632 .It Li label
4633 The current label is used.
4634 .It Li IP
4635 Our local IP number is used.
4636 As LCP is negotiated prior to IPCP, it is
4637 possible that the IPCP layer will subsequently change this value.
4638 If
4639 it does, the endpoint discriminator stays at the old value unless manually
4640 reset.
4641 .It Li MAC
4642 This is similar to the
4643 .Ar IP
4644 option above, except that the MAC address associated with the local IP
4645 number is used.
4646 If the local IP number is not resident on any Ethernet
4647 interface, the command will fail.
4648 .Pp
4649 As the local IP number defaults to whatever the machine host name is,
4650 .Dq set enddisc mac
4651 is usually done prior to any
4652 .Dq set ifaddr
4653 commands.
4654 .It Li magic
4655 A 20 digit random number is used.
4656 Care should be taken when using magic numbers as restarting
4657 .Nm
4658 or creating a link using a different
4659 .Nm
4660 invocation will also use a different magic number and will therefore not
4661 be recognised by the peer as belonging to the same bundle.
4662 This makes it unsuitable for
4663 .Fl direct
4664 connections.
4665 .It Li psn Ar value
4666 The given
4667 .Ar value
4668 is used.
4669 .Ar Value
4670 should be set to an absolute public switched network number with the
4671 country code first.
4672 .El
4673 .Pp
4674 If no arguments are given, the endpoint discriminator is reset.
4675 .It set escape Ar value...
4676 This option is similar to the
4677 .Dq set accmap
4678 option above.
4679 It allows the user to specify a set of characters that will be
4680 .Sq escaped
4681 as they travel across the link.
4682 .It set filter dial|alive|in|out Ar rule-no Xo
4683 .No permit|deny|clear| Ns Ar rule-no
4684 .Op !\&
4685 .Oo Op host
4686 .Ar src_addr Ns Op / Ns Ar width
4687 .Op Ar dst_addr Ns Op / Ns Ar width
4688 .Oc [ tcp|udp|ospf|ipip|igmp|icmp Op src lt|eq|gt Ar port
4689 .Op dst lt|eq|gt Ar port
4690 .Op estab
4691 .Op syn
4692 .Op finrst
4693 .Op timeout Ar secs ]
4694 .Xc
4695 .Nm
4696 supports four filter sets.
4697 The
4698 .Em alive
4699 filter specifies packets that keep the connection alive - resetting the
4700 idle timer.
4701 The
4702 .Em dial
4703 filter specifies packets that cause
4704 .Nm
4705 to dial when in
4706 .Fl auto
4707 mode.
4708 The
4709 .Em in
4710 filter specifies packets that are allowed to travel
4711 into the machine and the
4712 .Em out
4713 filter specifies packets that are allowed out of the machine.
4714 .Pp
4715 Filtering is done prior to any IP alterations that might be done by the
4716 NAT engine on outgoing packets and after any IP alterations that might
4717 be done by the NAT engine on incoming packets.
4718 By default all empty filter sets allow all packets to pass.
4719 Rules are processed in order according to
4720 .Ar rule-no
4721 (unless skipped by specifying a rule number as the
4722 .Ar action ) .
4723 Up to 40 rules may be given for each set.
4724 If a packet doesn't match
4725 any of the rules in a given set, it is discarded.
4726 In the case of
4727 .Em in
4728 and
4729 .Em out
4730 filters, this means that the packet is dropped.
4731 In the case of
4732 .Em alive
4733 filters it means that the packet will not reset the idle timer (even if
4734 the
4735 .Ar in Ns No / Ns Ar out
4736 filter has a
4737 .Dq timeout
4738 value) and in the case of
4739 .Em dial
4740 filters it means that the packet will not trigger a dial.
4741 A packet failing to trigger a dial will be dropped rather than queued.
4742 Refer to the
4743 section on
4744 .Sx PACKET FILTERING
4745 above for further details.
4746 .It set hangup Ar chat-script
4747 This specifies the chat script that will be used to reset the device
4748 before it is closed.
4749 It should not normally be necessary, but can
4750 be used for devices that fail to reset themselves properly on close.
4751 .It set help|? Op Ar command
4752 This command gives a summary of available set commands, or if
4753 .Ar command
4754 is specified, the command usage is shown.
4755 .It set ifaddr Oo Ar myaddr Ns
4756 .Op / Ns Ar \&nn
4757 .Oo Ar hisaddr Ns Op / Ns Ar \&nn
4758 .Oo Ar netmask
4759 .Op Ar triggeraddr
4760 .Oc Oc
4761 .Oc
4762 This command specifies the IP addresses that will be used during
4763 IPCP negotiation.
4764 Addresses are specified using the format
4765 .Pp
4766 .Dl a.b.c.d/nn
4767 .Pp
4768 Where
4769 .Dq a.b.c.d
4770 is the preferred IP, but
4771 .Ar nn
4772 specifies how many bits of the address we will insist on.
4773 If
4774 .No / Ns Ar nn
4775 is omitted, it defaults to
4776 .Dq /32
4777 unless the IP address is 0.0.0.0 in which case it defaults to
4778 .Dq /0 .
4779 .Pp
4780 If you wish to assign a dynamic IP number to the peer,
4781 .Ar hisaddr
4782 may also be specified as a range of IP numbers in the format
4783 .Bd -ragged -offset indent
4784 .Ar \&IP Ns Oo \&- Ns Ar \&IP Ns Xo
4785 .Oc Ns Oo , Ns Ar \&IP Ns
4786 .Op \&- Ns Ar \&IP Ns
4787 .Oc Ns ...
4788 .Xc
4789 .Ed
4790 .Pp
4791 for example:
4792 .Pp
4793 .Dl set ifaddr 10.0.0.1 10.0.1.2-10.0.1.10,10.0.1.20
4794 .Pp
4795 will only negotiate
4796 .Dq 10.0.0.1
4797 as the local IP number, but may assign any of the given 10 IP
4798 numbers to the peer.
4799 If the peer requests one of these numbers,
4800 and that number is not already in use,
4801 .Nm
4802 will grant the peers request.
4803 This is useful if the peer wants
4804 to re-establish a link using the same IP number as was previously
4805 allocated (thus maintaining any existing tcp or udp connections).
4806 .Pp
4807 If the peer requests an IP number that's either outside
4808 of this range or is already in use,
4809 .Nm
4810 will suggest a random unused IP number from the range.
4811 .Pp
4812 If
4813 .Ar triggeraddr
4814 is specified, it is used in place of
4815 .Ar myaddr
4816 in the initial IPCP negotiation.
4817 However, only an address in the
4818 .Ar myaddr
4819 range will be accepted.
4820 This is useful when negotiating with some
4821 .Dv PPP
4822 implementations that will not assign an IP number unless their peer
4823 requests
4824 .Dq 0.0.0.0 .
4825 .Pp
4826 It should be noted that in
4827 .Fl auto
4828 mode,
4829 .Nm
4830 will configure the interface immediately upon reading the
4831 .Dq set ifaddr
4832 line in the config file.
4833 In any other mode, these values are just
4834 used for IPCP negotiations, and the interface isn't configured
4835 until the IPCP layer is up.
4836 .Pp
4837 Note that the
4838 .Ar HISADDR
4839 argument may be overridden by the third field in the
4840 .Pa ppp.secret
4841 file once the client has authenticated itself
4842 (if PAP or CHAP are
4843 .Dq enabled ) .
4844 Refer to the
4845 .Sx AUTHENTICATING INCOMING CONNECTIONS
4846 section for details.
4847 .Pp
4848 In all cases, if the interface is already configured,
4849 .Nm
4850 will try to maintain the interface IP numbers so that any existing
4851 bound sockets will remain valid.
4852 .It set ifqueue Ar packets
4853 Set the maximum number of packets that
4854 .Nm
4855 will read from the tunnel interface while data cannot be sent to any of
4856 the available links.
4857 This queue limit is necessary to flow control outgoing data as the tunnel
4858 interface is likely to be far faster than the combined links available to
4859 .Nm .
4860 .Pp
4861 If
4862 .Ar packets
4863 is set to a value less than the number of links,
4864 .Nm
4865 will read up to that value regardless.
4866 This prevents any possible latency problems.
4867 .Pp
4868 The default value for
4869 .Ar packets
4870 is
4871 .Dq 30 .
4872 .It set ccpretry|ccpretries Oo Ar timeout
4873 .Op Ar reqtries Op Ar trmtries
4874 .Oc
4875 .It set chapretry|chapretries Oo Ar timeout
4876 .Op Ar reqtries
4877 .Oc
4878 .It set ipcpretry|ipcpretries Oo Ar timeout
4879 .Op Ar reqtries Op Ar trmtries
4880 .Oc
4881 .It set lcpretry|lcpretries Oo Ar timeout
4882 .Op Ar reqtries Op Ar trmtries
4883 .Oc
4884 .It set papretry|papretries Oo Ar timeout
4885 .Op Ar reqtries
4886 .Oc
4887 These commands set the number of seconds that
4888 .Nm
4889 will wait before resending Finite State Machine (FSM) Request packets.
4890 The default
4891 .Ar timeout
4892 for all FSMs is 3 seconds (which should suffice in most cases).
4893 .Pp
4894 If
4895 .Ar reqtries
4896 is specified, it tells
4897 .Nm
4898 how many configuration request attempts it should make while receiving
4899 no reply from the peer before giving up.
4900 The default is 5 attempts for
4901 CCP, LCP and IPCP and 3 attempts for PAP and CHAP.
4902 .Pp
4903 If
4904 .Ar trmtries
4905 is specified, it tells
4906 .Nm
4907 how many terminate requests should be sent before giving up waiting for the
4908 peers response.
4909 The default is 3 attempts.
4910 Authentication protocols are
4911 not terminated and it is therefore invalid to specify
4912 .Ar trmtries
4913 for PAP or CHAP.
4914 .Pp
4915 In order to avoid negotiations with the peer that will never converge,
4916 .Nm
4917 will only send at most 3 times the configured number of
4918 .Ar reqtries
4919 in any given negotiation session before giving up and closing that layer.
4920 .It set log Xo
4921 .Op local
4922 .Op +|- Ns
4923 .Ar value Ns No ...
4924 .Xc
4925 This command allows the adjustment of the current log level.
4926 Refer to the Logging Facility section for further details.
4927 .It set login Ar chat-script
4928 This
4929 .Ar chat-script
4930 compliments the dial-script.
4931 If both are specified, the login
4932 script will be executed after the dial script.
4933 Escape sequences available in the dial script are also available here.
4934 .It set logout Ar chat-script
4935 This specifies the chat script that will be used to logout
4936 before the hangup script is called.
4937 It should not normally be necessary.
4938 .It set lqrperiod Ar frequency
4939 This command sets the
4940 .Ar frequency
4941 in seconds at which
4942 .Em LQR
4943 or
4944 .Em ECHO LQR
4945 packets are sent.
4946 The default is 30 seconds.
4947 You must also use the
4948 .Dq enable lqr
4949 command if you wish to send LQR requests to the peer.
4950 .It set mode Ar interactive|auto|ddial|background
4951 This command allows you to change the
4952 .Sq mode
4953 of the specified link.
4954 This is normally only useful in multi-link mode,
4955 but may also be used in uni-link mode.
4956 .Pp
4957 It is not possible to change a link that is
4958 .Sq direct
4959 or
4960 .Sq dedicated .
4961 .Pp
4962 Note: If you issue the command
4963 .Dq set mode auto ,
4964 and have network address translation enabled, it may be useful to
4965 .Dq enable iface-alias
4966 afterwards.
4967 This will allow
4968 .Nm
4969 to do the necessary address translations to enable the process that
4970 triggers the connection to connect once the link is up despite the
4971 peer assigning us a new (dynamic) IP address.
4972 .It set mppe Op 40|56|128|* Op stateless|stateful|*
4973 This option selects the encryption parameters used when negotiation
4974 MPPE.
4975 MPPE can be disabled entirely with the
4976 .Dq disable mppe
4977 command.
4978 If no arguments are given,
4979 .Nm
4980 will attempt to negotiate a stateful link with a 128 bit key, but
4981 will agree to whatever the peer requests (including no encryption
4982 at all).
4983 .Pp
4984 If any arguments are given,
4985 .Nm
4986 will
4987 .Em insist
4988 on using MPPE and will close the link if it's rejected by the peer.
4989 .Pp
4990 The first argument specifies the number of bits that
4991 .Nm
4992 should insist on during negotiations and the second specifies whether
4993 .Nm
4994 should insist on stateful or stateless mode.
4995 In stateless mode, the
4996 encryption dictionary is re-initialised with every packet according to
4997 an encryption key that is changed with every packet.
4998 In stateful mode,
4999 the encryption dictionary is re-initialised every 256 packets or after
5000 the loss of any data and the key is changed every 256 packets.
5001 Stateless mode is less efficient but is better for unreliable transport
5002 layers.
5003 .It set mrru Op Ar value
5004 Setting this option enables Multi-link PPP negotiations, also known as
5005 Multi-link Protocol or MP.
5006 There is no default MRRU (Maximum Reconstructed Receive Unit) value.
5007 If no argument is given, multi-link mode is disabled.
5008 .It set mru Xo
5009 .Op max Ns Op imum
5010 .Op Ar value
5011 .Xc
5012 The default MRU (Maximum Receive Unit) is 1500.
5013 If it is increased, the other side *may* increase its MTU.
5014 In theory there is no point in decreasing the MRU to below the default as the
5015 .Em PPP
5016 protocol says implementations *must* be able to accept packets of at
5017 least 1500 octets.
5018 .Pp
5019 If the
5020 .Dq maximum
5021 keyword is used,
5022 .Nm
5023 will refuse to negotiate a higher value.
5024 The maximum MRU can be set to 2048 at most.
5025 Setting a maximum of less than 1500 violates the
5026 .Em PPP
5027 rfc, but may sometimes be necessary.
5028 For example,
5029 .Em PPPoE
5030 imposes a maximum of 1492 due to hardware limitations.
5031 .Pp
5032 If no argument is given, 1500 is assumed.
5033 A value must be given when
5034 .Dq maximum
5035 is specified.
5036 .It set mtu Xo
5037 .Op max Ns Op imum
5038 .Op Ar value
5039 .Xc
5040 The default MTU is 1500.
5041 At negotiation time,
5042 .Nm
5043 will accept whatever MRU the peer requests (assuming it's
5044 not less than 296 bytes or greater than the assigned maximum).
5045 If the MTU is set,
5046 .Nm
5047 will not accept MRU values less than
5048 .Ar value .
5049 When negotiations are complete, the MTU is used when writing to the
5050 interface, even if the peer requested a higher value MRU.
5051 This can be useful for
5052 limiting your packet size (giving better bandwidth sharing at the expense
5053 of more header data).
5054 .Pp
5055 If the
5056 .Dq maximum
5057 keyword is used,
5058 .Nm
5059 will refuse to negotiate a higher value.
5060 The maximum MTU can be set to 2048 at most.
5061 .Pp
5062 If no
5063 .Ar value
5064 is given, 1500, or whatever the peer asks for is used.
5065 A value must be given when
5066 .Dq maximum
5067 is specified.
5068 .It set nbns Op Ar x.x.x.x Op Ar y.y.y.y
5069 This option allows the setting of the Microsoft NetBIOS name server
5070 values to be returned at the peers request.
5071 If no values are given,
5072 .Nm
5073 will reject any such requests.
5074 .It set openmode active|passive Op Ar delay
5075 By default,
5076 .Ar openmode
5077 is always
5078 .Ar active
5079 with a one second
5080 .Ar delay .
5081 That is,
5082 .Nm
5083 will always initiate LCP/IPCP/CCP negotiation one second after the line
5084 comes up.
5085 If you want to wait for the peer to initiate negotiations, you
5086 can use the value
5087 .Ar passive .
5088 If you want to initiate negotiations immediately or after more than one
5089 second, the appropriate
5090 .Ar delay
5091 may be specified here in seconds.
5092 .It set parity odd|even|none|mark
5093 This allows the line parity to be set.
5094 The default value is
5095 .Ar none .
5096 .It set phone Ar telno Ns Xo
5097 .Oo \&| Ns Ar backupnumber
5098 .Oc Ns ... Ns Oo : Ns Ar nextnumber
5099 .Oc Ns ...
5100 .Xc
5101 This allows the specification of the phone number to be used in
5102 place of the \\\\T string in the dial and login chat scripts.
5103 Multiple phone numbers may be given separated either by a pipe
5104 .Pq Dq \&|
5105 or a colon
5106 .Pq Dq \&: .
5107 .Pp
5108 Numbers after the pipe are only dialed if the dial or login
5109 script for the previous number failed.
5110 .Pp
5111 Numbers after the colon are tried sequentially, irrespective of
5112 the reason the line was dropped.
5113 .Pp
5114 If multiple numbers are given,
5115 .Nm
5116 will dial them according to these rules until a connection is made, retrying
5117 the maximum number of times specified by
5118 .Dq set redial
5119 below.
5120 In
5121 .Fl background
5122 mode, each number is attempted at most once.
5123 .It set Op proc Ns Xo
5124 .No title Op Ar value
5125 .Xc
5126 The current process title as displayed by
5127 .Xr ps 1
5128 is changed according to
5129 .Ar value .
5130 If
5131 .Ar value
5132 is not specified, the original process title is restored.
5133 All the
5134 word replacements done by the shell commands (see the
5135 .Dq bg
5136 command above) are done here too.
5137 .Pp
5138 Note, if USER is required in the process title, the
5139 .Dq set proctitle
5140 command must appear in
5141 .Pa ppp.linkup ,
5142 as it is not known when the commands in
5143 .Pa ppp.conf
5144 are executed.
5145 .It set radius Op Ar config-file
5146 This command enables RADIUS support (if it's compiled in).
5147 .Ar config-file
5148 refers to the radius client configuration file as described in
5149 .Xr radius.conf 5 .
5150 If PAP or CHAP are
5151 .Dq enable Ns No d ,
5152 .Nm
5153 behaves as a
5154 .Em \&N Ns No etwork
5155 .Em \&A Ns No ccess
5156 .Em \&S Ns No erver
5157 and uses the configured RADIUS server to authenticate rather than
5158 authenticating from the
5159 .Pa ppp.secret
5160 file or from the passwd database.
5161 .Pp
5162 If neither PAP or CHAP are enabled,
5163 .Dq set radius
5164 will do nothing.
5165 .Pp
5166 .Nm
5167 uses the following attributes from the RADIUS reply:
5168 .Bl -tag -width XXX -offset XXX
5169 .It RAD_FRAMED_IP_ADDRESS
5170 The peer IP address is set to the given value.
5171 .It RAD_FRAMED_IP_NETMASK
5172 The tun interface netmask is set to the given value.
5173 .It RAD_FRAMED_MTU
5174 If the given MTU is less than the peers MRU as agreed during LCP
5175 negotiation, *and* it is less that any configured MTU (see the
5176 .Dq set mru
5177 command), the tun interface MTU is set to the given value.
5178 .It RAD_FRAMED_COMPRESSION
5179 If the received compression type is
5180 .Dq 1 ,
5181 .Nm
5182 will request VJ compression during IPCP negotiations despite any
5183 .Dq disable vj
5184 configuration command.
5185 .It RAD_FRAMED_ROUTE
5186 The received string is expected to be in the format
5187 .Ar dest Ns Op / Ns Ar bits
5188 .Ar gw
5189 .Op Ar metrics .
5190 Any specified metrics are ignored.
5191 .Dv MYADDR
5192 and
5193 .Dv HISADDR
5194 are understood as valid values for
5195 .Ar dest
5196 and
5197 .Ar gw ,
5198 .Dq default
5199 can be used for
5200 .Ar dest
5201 to sepcify the default route, and
5202 .Dq 0.0.0.0
5203 is understood to be the same as
5204 .Dq default
5205 for
5206 .Ar dest
5207 and
5208 .Dv HISADDR
5209 for
5210 .Ar gw .
5211 .Pp
5212 For example, a returned value of
5213 .Dq 1.2.3.4/24 0.0.0.0 1 2 -1 3 400
5214 would result in a routing table entry to the 1.2.3.0/24 network via
5215 .Dv HISADDR
5216 and a returned value of
5217 .Dq 0.0.0.0 0.0.0.0
5218 or
5219 .Dq default HISADDR
5220 would result in a default route to
5221 .Dv HISADDR .
5222 .Pp
5223 All RADIUS routes are applied after any sticky routes are applied, making
5224 RADIUS routes override configured routes.
5225 This also applies for RADIUS routes that don't include the
5226 .Dv MYADDR
5227 or
5228 .Dv HISADDR
5229 keywords.
5230 .Pp
5231 .El
5232 Values received from the RADIUS server may be viewed using
5233 .Dq show bundle .
5234 .It set reconnect Ar timeout ntries
5235 Should the line drop unexpectedly (due to loss of CD or LQR
5236 failure), a connection will be re-established after the given
5237 .Ar timeout .
5238 The line will be re-connected at most
5239 .Ar ntries
5240 times.
5241 .Ar Ntries
5242 defaults to zero.
5243 A value of
5244 .Ar random
5245 for
5246 .Ar timeout
5247 will result in a variable pause, somewhere between 1 and 30 seconds.
5248 .It set recvpipe Op Ar value
5249 This sets the routing table RECVPIPE value.
5250 The optimum value is just over twice the MTU value.
5251 If
5252 .Ar value
5253 is unspecified or zero, the default kernel controlled value is used.
5254 .It set redial Ar secs Ns Xo
5255 .Oo + Ns Ar inc Ns
5256 .Op - Ns Ar max Ns
5257 .Oc Ns Op . Ns Ar next
5258 .Op Ar attempts
5259 .Xc
5260 .Nm
5261 can be instructed to attempt to redial
5262 .Ar attempts
5263 times.
5264 If more than one phone number is specified (see
5265 .Dq set phone
5266 above), a pause of
5267 .Ar next
5268 is taken before dialing each number.
5269 A pause of
5270 .Ar secs
5271 is taken before starting at the first number again.
5272 A literal value of
5273 .Dq Li random
5274 may be used here in place of
5275 .Ar secs
5276 and
5277 .Ar next ,
5278 causing a random delay of between 1 and 30 seconds.
5279 .Pp
5280 If
5281 .Ar inc
5282 is specified, its value is added onto
5283 .Ar secs
5284 each time
5285 .Nm
5286 tries a new number.
5287 .Ar secs
5288 will only be incremented at most
5289 .Ar max
5290 times.
5291 .Ar max
5292 defaults to 10.
5293 .Pp
5294 Note, the
5295 .Ar secs
5296 delay will be effective, even after
5297 .Ar attempts
5298 has been exceeded, so an immediate manual dial may appear to have
5299 done nothing.
5300 If an immediate dial is required, a
5301 .Dq !\&
5302 should immediately follow the
5303 .Dq open
5304 keyword.
5305 See the
5306 .Dq open
5307 description above for further details.
5308 .It set sendpipe Op Ar value
5309 This sets the routing table SENDPIPE value.
5310 The optimum value is just over twice the MTU value.
5311 If
5312 .Ar value
5313 is unspecified or zero, the default kernel controlled value is used.
5314 .It "set server|socket" Ar TcpPort Ns No \&| Ns Xo
5315 .Ar LocalName Ns No |none|open|closed
5316 .Op password Op Ar mask
5317 .Xc
5318 This command tells
5319 .Nm
5320 to listen on the given socket or
5321 .Sq diagnostic port
5322 for incoming command connections.
5323 .Pp
5324 The word
5325 .Dq none
5326 instructs
5327 .Nm
5328 to close any existing socket and clear the socket configuration.
5329 The word
5330 .Dq open
5331 instructs
5332 .Nm
5333 to attempt to re-open the port.
5334 The word
5335 .Dq closed
5336 instructs
5337 .Nm
5338 to close the open port.
5339 .Pp
5340 If you wish to specify a local domain socket,
5341 .Ar LocalName
5342 must be specified as an absolute file name, otherwise it is assumed
5343 to be the name or number of a TCP port.
5344 You may specify the octal umask to be used with a local domain socket.
5345 Refer to
5346 .Xr umask 2
5347 for umask details.
5348 Refer to
5349 .Xr services 5
5350 for details of how to translate TCP port names.
5351 .Pp
5352 You must also specify the password that must be entered by the client
5353 (using the
5354 .Dq passwd
5355 variable above) when connecting to this socket.
5356 If the password is
5357 specified as an empty string, no password is required for connecting clients.
5358 .Pp
5359 When specifying a local domain socket, the first
5360 .Dq %d
5361 sequence found in the socket name will be replaced with the current
5362 interface unit number.
5363 This is useful when you wish to use the same
5364 profile for more than one connection.
5365 .Pp
5366 In a similar manner TCP sockets may be prefixed with the
5367 .Dq +
5368 character, in which case the current interface unit number is added to
5369 the port number.
5370 .Pp
5371 When using
5372 .Nm
5373 with a server socket, the
5374 .Xr pppctl 8
5375 command is the preferred mechanism of communications.
5376 Currently,
5377 .Xr telnet 1
5378 can also be used, but link encryption may be implemented in the future, so
5379 .Xr telnet 1
5380 should be avoided.
5381 .Pp
5382 Note;
5383 .Dv SIGUSR1
5384 and
5385 .Dv SIGUSR2
5386 interact with the diagnostic socket.
5387 .It set speed Ar value
5388 This sets the speed of the serial device.
5389 If speed is specified as
5390 .Dq sync ,
5391 .Nm
5392 treats the device as a synchronous device.
5393 .Pp
5394 Certain device types will know whether they should be specified as
5395 synchronous or asynchronous.
5396 These devices will override incorrect
5397 settings and log a warning to this effect.
5398 .It set stopped Op Ar LCPseconds Op Ar CCPseconds
5399 If this option is set,
5400 .Nm
5401 will time out after the given FSM (Finite State Machine) has been in
5402 the stopped state for the given number of
5403 .Dq seconds .
5404 This option may be useful if the peer sends a terminate request,
5405 but never actually closes the connection despite our sending a terminate
5406 acknowledgement.
5407 This is also useful if you wish to
5408 .Dq set openmode passive
5409 and time out if the peer doesn't send a Configure Request within the
5410 given time.
5411 Use
5412 .Dq set log +lcp +ccp
5413 to make
5414 .Nm
5415 log the appropriate state transitions.
5416 .Pp
5417 The default value is zero, where
5418 .Nm
5419 doesn't time out in the stopped state.
5420 .Pp
5421 This value should not be set to less than the openmode delay (see
5422 .Dq set openmode
5423 above).
5424 .It set timeout Ar idleseconds Op Ar mintimeout
5425 This command allows the setting of the idle timer.
5426 Refer to the section titled
5427 .Sx SETTING THE IDLE TIMER
5428 for further details.
5429 .Pp
5430 If
5431 .Ar mintimeout
5432 is specified,
5433 .Nm
5434 will never idle out before the link has been up for at least that number
5435 of seconds.
5436 .It set urgent Xo
5437 .Op tcp|udp|none
5438 .Oo Op +|- Ns
5439 .Ar port
5440 .Oc No ...
5441 .Xc
5442 This command controls the ports that
5443 .Nm
5444 prioritizes when transmitting data.
5445 The default priority TCP ports
5446 are ports 21 (ftp control), 22 (ssh), 23 (telnet), 513 (login), 514 (shell),
5447 543 (klogin) and 544 (kshell).
5448 There are no priority UDP ports by default.
5449 See
5450 .Xr services 5
5451 for details.
5452 .Pp
5453 If neither
5454 .Dq tcp
5455 or
5456 .Dq udp
5457 are specified,
5458 .Dq tcp
5459 is assumed.
5460 .Pp
5461 If no
5462 .Ar port Ns No s
5463 are given, the priority port lists are cleared (although if
5464 .Dq tcp
5465 or
5466 .Dq udp
5467 is specified, only that list is cleared).
5468 If the first
5469 .Ar port
5470 argument is prefixed with a plus
5471 .Pq Dq \&+
5472 or a minus
5473 .Pq Dq \&- ,
5474 the current list is adjusted, otherwise the list is reassigned.
5475 .Ar port Ns No s
5476 prefixed with a plus or not prefixed at all are added to the list and
5477 .Ar port Ns No s
5478 prefixed with a minus are removed from the list.
5479 .Pp
5480 If
5481 .Dq none
5482 is specified, all priority port lists are disabled and even
5483 .Dv IPTOS_LOWDELAY
5484 packets are not prioritised.
5485 .It set vj slotcomp on|off
5486 This command tells
5487 .Nm
5488 whether it should attempt to negotiate VJ slot compression.
5489 By default, slot compression is turned
5490 .Ar on .
5491 .It set vj slots Ar nslots
5492 This command sets the initial number of slots that
5493 .Nm
5494 will try to negotiate with the peer when VJ compression is enabled (see the
5495 .Sq enable
5496 command above).
5497 It defaults to a value of 16.
5498 .Ar Nslots
5499 must be between
5500 .Ar 4
5501 and
5502 .Ar 16
5503 inclusive.
5504 .El
5505 .Pp
5506 .It shell|! Op Ar command
5507 If
5508 .Ar command
5509 is not specified a shell is invoked according to the
5510 .Dv SHELL
5511 environment variable.
5512 Otherwise, the given
5513 .Ar command
5514 is executed.
5515 Word replacement is done in the same way as for the
5516 .Dq !bg
5517 command as described above.
5518 .Pp
5519 Use of the ! character
5520 requires a following space as with any of the other commands.
5521 You should note that this command is executed in the foreground;
5522 .Nm
5523 will not continue running until this process has exited.
5524 Use the
5525 .Dv bg
5526 command if you wish processing to happen in the background.
5527 .It show Ar var
5528 This command allows the user to examine the following:
5529 .Bl -tag -width 2n
5530 .It show bundle
5531 Show the current bundle settings.
5532 .It show ccp
5533 Show the current CCP compression statistics.
5534 .It show compress
5535 Show the current VJ compression statistics.
5536 .It show escape
5537 Show the current escape characters.
5538 .It show filter Op Ar name
5539 List the current rules for the given filter.
5540 If
5541 .Ar name
5542 is not specified, all filters are shown.
5543 .It show hdlc
5544 Show the current HDLC statistics.
5545 .It show help|?
5546 Give a summary of available show commands.
5547 .It show iface
5548 Show the current interface information
5549 (the same as
5550 .Dq iface show ) .
5551 .It show ipcp
5552 Show the current IPCP statistics.
5553 .It show layers
5554 Show the protocol layers currently in use.
5555 .It show lcp
5556 Show the current LCP statistics.
5557 .It show Op data Ns Xo
5558 .No link
5559 .Xc
5560 Show high level link information.
5561 .It show links
5562 Show a list of available logical links.
5563 .It show log
5564 Show the current log values.
5565 .It show mem
5566 Show current memory statistics.
5567 .It show physical
5568 Show low level link information.
5569 .It show mp
5570 Show Multi-link information.
5571 .It show proto
5572 Show current protocol totals.
5573 .It show route
5574 Show the current routing tables.
5575 .It show stopped
5576 Show the current stopped timeouts.
5577 .It show timer
5578 Show the active alarm timers.
5579 .It show version
5580 Show the current version number of
5581 .Nm .
5582 .El
5583 .Pp
5584 .It term
5585 Go into terminal mode.
5586 Characters typed at the keyboard are sent to the device.
5587 Characters read from the device are displayed on the screen.
5588 When a remote
5589 .Em PPP
5590 peer is detected,
5591 .Nm
5592 automatically enables Packet Mode and goes back into command mode.
5593 .El
5594 .Sh MORE DETAILS
5595 .Bl -bullet
5596 .It
5597 Read the example configuration files.
5598 They are a good source of information.
5599 .It
5600 Use
5601 .Dq help ,
5602 .Dq nat \&? ,
5603 .Dq enable \&? ,
5604 .Dq set ?\&
5605 and
5606 .Dq show ?\&
5607 to get online information about what's available.
5608 .It
5609 The following URLs contain useful information:
5610 .Bl -bullet -compact
5611 .It
5612 http://www.FreeBSD.org/FAQ/userppp.html
5613 .It
5614 http://www.FreeBSD.org/handbook/userppp.html
5615 .El
5616 .Pp
5617 .El
5618 .Sh FILES
5619 .Nm
5620 refers to four files:
5621 .Pa ppp.conf ,
5622 .Pa ppp.linkup ,
5623 .Pa ppp.linkdown
5624 and
5625 .Pa ppp.secret .
5626 These files are placed in the
5627 .Pa /etc/ppp
5628 directory.
5629 .Bl -tag -width 2n
5630 .It Pa /etc/ppp/ppp.conf
5631 System default configuration file.
5632 .It Pa /etc/ppp/ppp.secret
5633 An authorisation file for each system.
5634 .It Pa /etc/ppp/ppp.linkup
5635 A file to check when
5636 .Nm
5637 establishes a network level connection.
5638 .It Pa /etc/ppp/ppp.linkdown
5639 A file to check when
5640 .Nm
5641 closes a network level connection.
5642 .It Pa /var/log/ppp.log
5643 Logging and debugging information file.
5644 Note, this name is specified in
5645 .Pa /etc/syslogd.conf .
5646 See
5647 .Xr syslog.conf 5
5648 for further details.
5649 .It Pa /var/spool/lock/LCK..*
5650 tty port locking file.
5651 Refer to
5652 .Xr uucplock 3
5653 for further details.
5654 .It Pa /var/run/tunN.pid
5655 The process id (pid) of the
5656 .Nm
5657 program connected to the tunN device, where
5658 .Sq N
5659 is the number of the device.
5660 .It Pa /var/run/ttyXX.if
5661 The tun interface used by this port.
5662 Again, this file is only created in
5663 .Fl background ,
5664 .Fl auto
5665 and
5666 .Fl ddial
5667 modes.
5668 .It Pa /etc/services
5669 Get port number if port number is using service name.
5670 .It Pa /var/run/ppp-authname-class-value
5671 In multi-link mode, local domain sockets are created using the peer
5672 authentication name
5673 .Pq Sq authname ,
5674 the peer endpoint discriminator class
5675 .Pq Sq class
5676 and the peer endpoint discriminator value
5677 .Pq Sq value .
5678 As the endpoint discriminator value may be a binary value, it is turned
5679 to HEX to determine the actual file name.
5680 .Pp
5681 This socket is used to pass links between different instances of
5682 .Nm .
5683 .El
5684 .Sh SEE ALSO
5685 .Xr at 1 ,
5686 .Xr ftp 1 ,
5687 .Xr gzip 1 ,
5688 .Xr hostname 1 ,
5689 .Xr login 1 ,
5690 .Xr tcpdump 1 ,
5691 .Xr telnet 1 ,
5692 .Xr kldload 2 ,
5693 .Xr libalias 3 ,
5694 .Xr syslog 3 ,
5695 .Xr uucplock 3 ,
5696 .Xr netgraph 4 ,
5697 .Xr ng_pppoe 4 ,
5698 .Xr crontab 5 ,
5699 .Xr group 5 ,
5700 .Xr passwd 5 ,
5701 .Xr protocols 5 ,
5702 .Xr radius.conf 5 ,
5703 .Xr resolv.conf 5 ,
5704 .Xr syslog.conf 5 ,
5705 .Xr adduser 8 ,
5706 .Xr chat 8 ,
5707 .Xr getty 8 ,
5708 .Xr inetd 8 ,
5709 .Xr init 8 ,
5710 .Xr isdn 8 ,
5711 .Xr named 8 ,
5712 .Xr ping 8 ,
5713 .Xr pppctl 8 ,
5714 .Xr pppd 8 ,
5715 .Xr pppoe 8 ,
5716 .Xr route 8 ,
5717 .Xr sshd 8 ,
5718 .Xr syslogd 8 ,
5719 .Xr traceroute 8 ,
5720 .Xr vipw 8
5721 .Sh HISTORY
5722 This program was originally written by
5723 .An Toshiharu OHNO Aq tony-o@iij.ad.jp ,
5724 and was submitted to
5725 .Fx 2.0.5
5726 by
5727 .An Atsushi Murai Aq amurai@spec.co.jp .
5728 .Pp
5729 It was substantially modified during 1997 by
5730 .An Brian Somers Aq brian@Awfulhak.org ,
5731 and was ported to
5732 .Ox
5733 in November that year
5734 (just after the 2.2 release).
5735 .Pp
5736 Most of the code was rewritten by
5737 .An Brian Somers
5738 in early 1998 when multi-link ppp support was added.