MAN page from Old RedHat 5.X ppp-2.3.3-4.i386.rpm
PPPD
Section: Maintenance Commands (8)
Index NAME
pppd - Point to Point Protocol daemon
SYNOPSIS
pppd[
tty_name] [
speed] [
options]
DESCRIPTION
The Point-to-Point Protocol (PPP) provides a method for transmittingdatagrams over serial point-to-point links. PPPis composed of three parts: a method for encapsulating datagrams overserial links, an extensible Link Control Protocol (LCP), anda family of Network Control Protocols (NCP) for establishingand configuring different network-layer protocols.
The encapsulation scheme is provided by driver code in the kernel.Pppd provides the basic LCP, authentication support, and an NCP forestablishing and configuring the Internet Protocol (IP) (called the IPControl Protocol, IPCP).
FREQUENTLY USED OPTIONS
- <tty_name>
- Communicate over the named device. The string "/dev/" is prepended ifnecessary. If no device name is given, or if the name of the terminalconnected to the standard input is given, pppdwill use that terminal, and will not fork to put itself in thebackground. This option is privileged if the noauth option isused.
- <speed>
- Set the baud rate to <speed> (a decimal number). On systems such as4.4BSD and NetBSD, any speed can be specified. Other systems(e.g. SunOS) allow only a limited set of speeds.
- active-filter filter-expression
- Specifies a packet filter to be applied to data packets to determinewhich packets are to be regarded as link activity, and therefore resetthe idle timer, or cause the link to be brought up in demand-diallingmode. This option is useful in conjunction with theidle option if there are packets being sent or receivedregularly over the link (for example, routing information packets)which would otherwise prevent the link from ever appearing to be idle.The filter-expression syntax is as described for tcpdump(1),except that qualifiers which are inappropriate for a PPP link, such asether and arp, are not permitted. Generally the filterexpression should be enclosed in single-quotes to prevent whitespacein the expression from being interpreted by the shell. This optionis currently only available under NetBSD, and then onlyif both the kernel and pppd were compiled with PPP_FILTER defined.
- asyncmap <map>
- Set the async character map to <map>. This map describes whichcontrol characters cannot be successfully received over the serialline. Pppd will ask the peer to send these characters as a 2-byteescape sequence. The argument is a 32 bit hex number with each bitrepresenting a character to escape. Bit 0 (00000001) represents thecharacter 0x00; bit 31 (80000000) represents the character 0x1f or ^_.If multiple asyncmap options are given, the values are ORedtogether. If no asyncmap option is given, no async charactermap will be negotiated for the receive direction; the peer should thenescape all control characters. To escape transmittedcharacters, use the escape option.
- auth
- Require the peer to authenticate itself before allowing networkpackets to be sent or received.
- call name
- Read options from the file /etc/ppp/peers/name. This file maycontain privileged options, such as noauth, even if pppdis not being run by root. The name string may not begin with /or include .. as a pathname component. The format of the options fileis described below.
- connect script
- Use the executable or shell command specified by script to setup the serial line. This script would typically use the chat(8)program to dial the modem and start the remote ppp session. Thisoption is privileged if the noauth option is used.
- crtscts
- Use hardware flow control (i.e. RTS/CTS) to control the flow of dataon the serial port. If neither the crtscts nor thenocrtscts option is given, the hardware flow control settingfor the serial port is left unchanged.
- defaultroute
- Add a default route to the system routing tables, using the peer asthe gateway, when IPCP negotiation is successfully completed.This entry is removed when the PPP connection is broken. This optionis privileged if the nodefaultroute option has been specified.
- disconnect script
- Run the executable or shell command specified by script afterpppd has terminated the link. This script could, for example, issuecommands to the modem to cause it to hang up if hardware modem controlsignals were not available. The disconnect script is not run if themodem has already hung up. This option is privileged if thenoauth option is used.
- escape xx,yy,...
- Specifies that certain characters should be escaped on transmission(regardless of whether the peer requests them to be escaped with itsasync control character map). The characters to be escaped arespecified as a list of hex numbers separated by commas. Note thatalmost any character can be specified for the escape option,unlike the asyncmap option which only allows control charactersto be specified. The characters which may not be escaped are thosewith hex values 0x20 - 0x3f or 0x5e.
- file name
- Read options from file name (the format is described below).The file must be readable by the user who has invoked pppd.
- lock
- Specifies that pppd should create a UUCP-style lock file for theserial device to ensure exclusive access to the device.
- mru n
- Set the MRU [Maximum Receive Unit] value to n. Pppdwill ask the peer to send packets of no more than n bytes. Theminimum MRU value is 128. The default MRU value is 1500. A value of296 is recommended for slow links (40 bytes for TCP/IP header + 256bytes of data).
- mtu n
- Set the MTU [Maximum Transmit Unit] value to n. Unless thepeer requests a smaller value via MRU negotiation, pppd willrequest that the kernel networking code send data packets of no morethan n bytes through the PPP network interface.
- passive
- Enables the "passive" option in the LCP. With this option, pppd willattempt to initiate a connection; if no reply is received from thepeer, pppd will then just wait passively for a valid LCP packet fromthe peer, instead of exiting, as it would without this option.
OPTIONS
- <local_IP_address>:<remote_IP_address>
- Set the local and/or remote interface IP addresses. Either one may beomitted. The IP addresses can be specified with a host name or indecimal dot notation (e.g. 150.234.56.78). The default localaddress is the (first) IP address of the system (unless thenoipdefaultoption is given). The remote address will be obtained from the peerif not specified in any option. Thus, in simple cases, this option isnot required. If a local and/or remote IP address is specified withthis option, pppdwill not accept a different value from the peer in the IPCPnegotiation, unless the ipcp-accept-local and/oripcp-accept-remote options are given, respectively.
- bsdcomp nr,nt
- Request that the peer compress packets that it sends, using theBSD-Compress scheme, with a maximum code size of nr bits, andagree to compress packets sent to the peer with a maximum code size ofnt bits. If nt is not specified, it defaults to the valuegiven for nr. Values in the range 9 to 15 may be used fornr and nt; larger values give better compression butconsume more kernel memory for compression dictionaries.Alternatively, a value of 0 for nr or nt disablescompression in the corresponding direction. Use nobsdcomp orbsdcomp 0 to disable BSD-Compress compression entirely.
- chap-interval n
- If this option is given, pppd will rechallenge the peer every nseconds.
- chap-max-challenge n
- Set the maximum number of CHAP challenge transmissions to n(default 10).
- chap-restart n
- Set the CHAP restart interval (retransmission timeout for challenges)to n seconds (default 3).
- debug
- Enables connection debugging facilities.If this option is given, pppd will log the contents of allcontrol packets sent or received in a readable form. The packets arelogged through syslog with facility daemon and leveldebug. This information can be directed to a file by setting up/etc/syslog.conf appropriately (see syslog.conf(5)).
- default-asyncmap
- Disable asyncmap negotiation, forcing all control characters to beescaped for both the transmit and the receive direction.
- default-mru
- Disable MRU [Maximum Receive Unit] negotiation. With this option,pppd will use the default MRU value of 1500 bytes for both thetransmit and receive direction.
- deflate nr,nt
- Request that the peer compress packets that it sends, using theDeflate scheme, with a maximum window size of 2**nr bytes, andagree to compress packets sent to the peer with a maximum window sizeof 2**nt bytes. If nt is not specified, it defaults tothe value given for nr. Values in the range 8 to 15 may be usedfor nr and nt; larger values give better compression butconsume more kernel memory for compression dictionaries.Alternatively, a value of 0 for nr or nt disablescompression in the corresponding direction. Use nodeflate ordeflate 0 to disable Deflate compression entirely. (Note: pppdrequests Deflate compression in preference to BSD-Compress if the peercan do either.)
- demand
- Initiate the link only on demand, i.e. when data traffic is present.With this option, the remote IP address must be specified by the useron the command line or in an options file. Pppd will initiallyconfigure the interface and enable it for IP traffic withoutconnecting to the peer. When traffic is available, pppd willconnect to the peer and perform negotiation, authentication, etc.When this is completed, pppd will commence passing data packets(i.e., IP packets) across the link.
The demand option implies the persist option. If thisbehaviour is not desired, use the nopersist option after thedemand option. The idle and holdoffoptions are also useful in conjuction with the demand option.
- domain d
- Append the domain name d to the local host name for authenticationpurposes. For example, if gethostname() returns the name porsche, butthe fully qualified domain name is porsche.Quotron.COM, you couldspecify domain Quotron.COM. Pppd would then use the nameporsche.Quotron.COM for looking up secrets in the secrets file,and as the default name to send to the peer when authenticating itselfto the peer. This option is privileged.
- holdoff n
- Specifies how many seconds to wait before re-initiating the link afterit terminates. This option only has any effect if the persistor demand option is used. The holdoff period is not applied ifthe link was terminated because it was idle.
- idle n
- Specifies that pppd should disconnect if the link is idle for nseconds. The link is idle when no data packets (i.e. IP packets) arebeing sent or received. Note: it is not advisable to use this optionwith the persist option without the demand option.If the active-filteroption is given, data packets which are rejected by the specifiedactivity filter also count as the link being idle.
- ipcp-accept-local
- With this option, pppd will accept the peer's idea of our local IPaddress, even if the local IP address was specified in an option.
- ipcp-accept-remote
- With this option, pppd will accept the peer's idea of its (remote) IPaddress, even if the remote IP address was specified in an option.
- ipcp-max-configure n
- Set the maximum number of IPCP configure-request transmissions ton (default 10).
- ipcp-max-failure n
- Set the maximum number of IPCP configure-NAKs returned before startingto send configure-Rejects instead to n (default 10).
- ipcp-max-terminate n
- Set the maximum number of IPCP terminate-request transmissions ton (default 3).
- ipcp-restart n
- Set the IPCP restart interval (retransmission timeout) to nseconds (default 3).
- ipparam string
- Provides an extra parameter to the ip-up and ip-down scripts. If thisoption is given, the string supplied is given as the 6thparameter to those scripts.
- ipx
- Enable the IPXCP and IPX protocols. This option is presently onlysupported under Linux, and only if your kernel has been configured toinclude IPX support.
- ipx-network n
- Set the IPX network number in the IPXCP configure request frame ton, a hexadecimal number (without a leading 0x). There is novalid default. If this option is not specified, the network number isobtained from the peer. If the peer does not have the network number,the IPX protocol will not be started.
- ipx-node n:m
- Set the IPX node numbers. The two node numbers are separated from eachother with a colon character. The first number n is the localnode number. The second number m is the peer's node number. Eachnode number is a hexadecimal number, at most 10 digits long. The nodenumbers on the ipx-network must be unique. There is no validdefault. If this option is not specified then the node numbers areobtained from the peer.
- ipx-router-name <string>
- Set the name of the router. This is a string and is sent to the peeras information data.
- ipx-routing n
- Set the routing protocol to be received by this option. More than oneinstance of ipx-routing may be specified. The 'none'option (0) may be specified as the only instance of ipx-routing. Thevalues may be 0 for NONE, 2 for RIP/SAP, and4 for NLSP.
- ipxcp-accept-local
- Accept the peer's NAK for the node number specified in the ipx-nodeoption. If a node number was specified, and non-zero, the default isto insist that the value be used. If you include this option then youwill permit the peer to override the entry of the node number.
- ipxcp-accept-network
- Accept the peer's NAK for the network number specified in theipx-network option. If a network number was specified, and non-zero, thedefault is to insist that the value be used. If you include thisoption then you will permit the peer to override the entry of the nodenumber.
- ipxcp-accept-remote
- Use the peer's network number specified in the configure requestframe. If a node number was specified for the peer and this option wasnot specified, the peer will be forced to use the value which you havespecified.
- ipxcp-max-configure n
- Set the maximum number of IPXCP configure request frames which thesystem will send to n. The default is 10.
- ipxcp-max-failure n
- Set the maximum number of IPXCP NAK frames which the local system willsend before it rejects the options. The default value is 3.
- ipxcp-max-terminate n
- Set the maximum nuber of IPXCP terminate request frames before thelocal system considers that the peer is not listening to them. Thedefault value is 3.
- kdebug n
- Enable debugging code in the kernel-level PPP driver. The argumentn is a number which is the sum of the following values: 1 toenable general debug messages, 2 to request that the contents ofreceived packets be printed, and 4 to request that the contents oftransmitted packets be printed. On most systems, messages printed bythe kernel are logged by syslog(1) to a file as directed in the/etc/syslog.conf configuration file.
- lcp-echo-failure n
- If this option is given, pppd will presume the peer to be deadif n LCP echo-requests are sent without receiving a valid LCPecho-reply. If this happens, pppd will terminate theconnection. Use of this option requires a non-zero value for thelcp-echo-interval parameter. This option can be used to enablepppd to terminate after the physical connection has been broken(e.g., the modem has hung up) in situations where no hardware modemcontrol lines are available.
- lcp-echo-interval n
- If this option is given, pppd will send an LCP echo-request frame tothe peer every n seconds. Normally the peer should respond tothe echo-request by sending an echo-reply. This option can be usedwith the lcp-echo-failure option to detect that the peer is nolonger connected.
- lcp-max-configure n
- Set the maximum number of LCP configure-request transmissions ton (default 10).
- lcp-max-failure n
- Set the maximum number of LCP configure-NAKs returned before startingto send configure-Rejects instead to n (default 10).
- lcp-max-terminate n
- Set the maximum number of LCP terminate-request transmissions ton (default 3).
- lcp-restart n
- Set the LCP restart interval (retransmission timeout) to nseconds (default 3).
- local
- Don't use the modem control lines. With this option, pppd will ignorethe state of the CD (Carrier Detect) signal from the modem and willnot change the state of the DTR (Data Terminal Ready) signal.
- login
- Use the system password database for authenticating the peer usingPAP, and record the user in the system wtmp file. Note that the peermust have an entry in the /etc/ppp/pap-secrets file as well as thesystem password database to be allowed access.
- maxconnect n
- Terminate the connection when it has been available for networktraffic for n seconds (i.e. n seconds after the firstnetwork control protocol comes up).
- modem
- Use the modem control lines. This option is the default. With thisoption, pppd will wait for the CD (Carrier Detect) signal from themodem to be asserted when opening the serial device (unless a connectscript is specified), and it will drop the DTR (Data Terminal Ready)signal briefly when the connection is terminated and before executingthe connect script. On Ultrix, this option implies hardware flowcontrol, as for the crtscts option.
- ms-dns <addr>
- If pppd is acting as a server for Microsoft Windows clients, thisoption allows pppd to supply one or two DNS (Domain Name Server)addresses to the clients. The first instance of this option specifiesthe primary DNS address; the second instance (if given) specifies thesecondary DNS address. (This option was present in some olderversions of pppd under the name dns-addr.)
- ms-wins <addr>
- If pppd is acting as a server for Microsoft Windows or "Samba"clients, this option allows pppd to supply one or two WINS (WindowsInternet Name Services) server addresses to the clients. The firstinstance of this option specifies the primary WINS address; the secondinstance (if given) specifies the secondary WINS address.
- name name
- Set the name of the local system for authentication purposes toname. This is a privileged option. With this option, pppd willuse lines in the secrets files which have name as the secondfield when looking for a secret to use in authenticating the peer. Inaddition, unless overridden with the user option, namewill be used as the name to send to the peer when authenticating thelocal system to the peer. (Note that pppd does not append the domainname to name.)
- netmask n
- Set the interface netmask to n, a 32 bit netmask in "decimal dot"notation (e.g. 255.255.255.0). If this option is given, the valuespecified is ORed with the default netmask. The default netmask ischosen based on the negotiated remote IP address; it is theappropriate network mask for the class of the remote IP address, ORedwith the netmasks for any non point-to-point network interfaces in thesystem which are on the same network.
- noaccomp
- Disable Address/Control compression in both directions (send andreceive).
- noauth
- Do not require the peer to authenticate itself. This option isprivileged if the auth option is specified in /etc/ppp/options.
- nobsdcomp
- Disables BSD-Compress compression; pppd will not request oragree to compress packets using the BSD-Compress scheme.
- noccp
- Disable CCP (Compression Control Protocol) negotiation. This optionshould only be required if the peer is buggy and gets confused byrequests from pppd for CCP negotiation.
- nocrtscts
- Disable hardware flow control (i.e. RTS/CTS) on the serial port. Ifneither the crtscts nor the nocrtscts option is given,the hardware flow control setting for the serial port is leftunchanged.
- nodefaultroute
- Disable the defaultroute option. The system administrator whowishes to prevent users from creating default routes with pppdcan do so by placing this option in the /etc/ppp/options file.
- nodeflate
- Disables Deflate compression; pppd will not request or agree tocompress packets using the Deflate scheme.
- nodetach
- Don't detach from the controlling terminal. Without this option, if aserial device other than the terminal on the standard input isspecified, pppd will fork to become a background process.
- noip
- Disable IPCP negotiation and IP communication. This option shouldonly be required if the peer is buggy and gets confused by requestsfrom pppd for IPCP negotiation.
- noipdefault
- Disables the default behaviour when no local IP address is specified,which is to determine (if possible) the local IP address from thehostname. With this option, the peer will have to supply the local IPaddress during IPCP negotiation (unless it specified explicitly on thecommand line or in an options file).
- noipx
- Disable the IPXCP and IPX protocols. This option should only berequired if the peer is buggy and gets confused by requests from pppdfor IPXCP negotiation.
- nomagic
- Disable magic number negotiation. With this option, pppd cannotdetect a looped-back line. This option should only be needed if thepeer is buggy.
- nopcomp
- Disable protocol field compression negotiation in both the receive andthe transmit direction.
- nopersist
- Exit once a connection has been made and terminated. This is thedefault unless the persist or demand option has beenspecified.
- nopredictor1
- Do not accept or agree to Predictor-1 comprssion.
- noproxyarp
- Disable the proxyarp option. The system administrator whowishes to prevent users from creating proxy ARP entries with pppd cando so by placing this option in the /etc/ppp/options file.
- novj
- Disable Van Jacobson style TCP/IP header compression in both thetransmit and the receive direction.
- novjccomp
- Disable the connection-ID compression option in Van Jacobson styleTCP/IP header compression. With this option, pppd will not omit theconnection-ID byte from Van Jacobson compressed TCP/IP headers, norask the peer to do so.
- papcrypt
- Indicates that all secrets in the /etc/ppp/pap-secrets file which areused for checking the identity of the peer are encrypted, and thuspppd should not accept a password which, before encryption, isidentical to the secret from the /etc/ppp/pap-secrets file.
- pap-max-authreq n
- Set the maximum number of PAP authenticate-request transmissions ton (default 10).
- pap-restart n
- Set the PAP restart interval (retransmission timeout) to nseconds (default 3).
- pap-timeout n
- Set the maximum time that pppd will wait for the peer to authenticateitself with PAP to n seconds (0 means no limit).
- pass-filter filter-expression
- Specifies a packet filter to applied to data packets being sent orreceived to determine which packets should be allowed to pass.Packets which are rejected by the filter are silently discarded. Thisoption can be used to prevent specific network daemons (such asrouted) using up link bandwidth, or to provide a basic firewallcapability.The filter-expression syntax is as described for tcpdump(1),except that qualifiers which are inappropriate for a PPP link, such asether and arp, are not permitted. Generally the filterexpression should be enclosed in single-quotes to prevent whitespacein the expression from being interpreted by the shell. Note that itis possible to apply different constraints to incoming and outgoingpackets using the inbound and outbound qualifiers. Thisoption is currently only available under NetBSD, and then only if boththe kernel and pppd were compiled with PPP_FILTER defined.
- persist
- Do not exit after a connection is terminated; instead try to reopenthe connection.
- predictor1
- Request that the peer compress frames that it sends using Predictor-1compression, and agree to compress transmitted frames with Predictor-1if requested. This option has no effect unless the kernel driversupports Predictor-1 compression.
- proxyarp
- Add an entry to this system's ARP [Address Resolution Protocol] tablewith the IP address of the peer and the Ethernet address of thissystem. This will have the effect of making the peer appear to othersystems to be on the local ethernet.
- remotename name
- Set the assumed name of the remote system for authentication purposesto name.
- refuse-chap
- With this option, pppd will not agree to authenticate itself to thepeer using CHAP.
- refuse-pap
- With this option, pppd will not agree to authenticate itself to thepeer using PAP.
- require-chap
- Require the peer to authenticate itself using CHAP [ChallengeHandshake Authentication Protocol] authentication.
- require-pap
- Require the peer to authenticate itself using PAP [PasswordAuthentication Protocol] authentication.
- silent
- With this option, pppd will not transmit LCP packets to initiate aconnection until a valid LCP packet is received from the peer (as forthe `passive' option with ancient versions of pppd).
- usehostname
- Enforce the use of the hostname (with domain name appended, if given)as the name of the local system for authentication purposes (overridesthe name option).
- user name
- Sets the name used for authenticating the local system to the peer toname.
- vj-max-slots n
- Sets the number of connection slots to be used by the Van JacobsonTCP/IP header compression and decompression code to n, whichmust be between 2 and 16 (inclusive).
- welcome script
- Run the executable or shell command specified by script beforeinitiating PPP negotiation, after the connect script (if any) hascompleted. This option is privileged if the noauth option isused.
- xonxoff
- Use software flow control (i.e. XON/XOFF) to control the flow of data onthe serial port.
OPTIONS FILES
Options can be taken from files as well as the command line. Pppdreads options from the files /etc/ppp/options, ~/.ppprc and/etc/ppp/options.
ttyname (in that order) before processing theoptions on the command line. (In fact, the command-line options arescanned to find the terminal name before the options.
ttynamefile is read.) In forming the name of the options.
ttyname file,the initial /dev/ is removed from the terminal name, and any remaining/ characters are replaced with dots.
An options file is parsed into a series of words, delimited bywhitespace. Whitespace can be included in a word by enclosing theword in quotes ("). A backslash (\) quotes the following character.A hash (#) starts a comment, which continues until the end of theline. There is no restriction on using the file or calloptions within an options file.
SECURITY
pppdprovides system administrators with sufficient access control that PPPaccess to a server machine can be provided to legitimate users withoutfear of compromising the security of the server or the network it'son. In part this is provided by the /etc/ppp/options file, where theadministrator can place options to restrict the ways in which pppd canbe used, and in part by the PAP and CHAP secrets files, where theadministrator can restrict the set of IP addresses which individualusers may use.
The normal way that pppd should be set up is to have the authoption in the /etc/ppp/options file. (This may become the default inlater releases.) If users wish to use pppd to dial out to a peerwhich will refuse to authenticate itself (such as an internet serviceprovider), the system administrator should create an options fileunder /etc/ppp/peers containing the noauth option, the name ofthe serial port to use, and the connect option (if required),plus any other appropriate options. In this way, pppd can be set upto allow non-privileged users to make unauthenticated connections onlyto trusted peers.
As indicated above, some security-sensitive options are privileged,which means that they may not be used by an ordinary non-privilegeduser running a setuid-root pppd, either on the command line, in theuser's ~/.ppprc file, or in an options file read using the fileoption. Privileged options may be used in /etc/ppp/options file or inan options file read using the call option. If pppd is beingrun by the root user, privileged options can be used withoutrestriction.
AUTHENTICATION
Authentication is the process whereby one peer convinces the other ofits identity. This involves the first peer sending its name to theother, together with some kind of secret information which could onlycome from the genuine authorized user of that name. In such anexchange, we will call the first peer the "client" and the other the"server". The client has a name by which it identifies itself to theserver, and the server also has a name by which it identifies itselfto the client. Generally the genuine client shares some secret (orpassword) with the server, and authenticates itself by proving that itknows that secret. Very often, the names used for authenticationcorrespond to the internet hostnames of the peers, but this is notessential.
At present, pppd supports two authentication protocols: the PasswordAuthentication Protocol (PAP) and the Challenge HandshakeAuthentication Protocol (CHAP). PAP involves the client sending itsname and a cleartext password to the server to authenticate itself.In contrast, the server initiates the CHAP authentication exchange bysending a challenge to the client (the challenge packet includes theserver's name). The client must respond with a response whichincludes its name plus a hash value derived from the shared secret andthe challenge, in order to prove that it knows the secret.
The PPP protocol, being symmetrical, allows both peers to require theother to authenticate itself. In that case, two separate andindependent authentication exchanges will occur. The two exchangescould use different authentication protocols, and in principle,different names could be used in the two exchanges.
The default behaviour of pppd is to agree to authenticate ifrequested, and to not require authentication from the peer. However,pppd will not agree to authenticate itself with a particular protocolif it has no secrets which could be used to do so.
Pppd stores secrets for use in authentication in secretsfiles (/etc/ppp/pap-secrets for PAP, /etc/ppp/chap-secrets for CHAP).Both secrets files have the same format. The secrets files cancontain secrets for pppd to use in authenticating itself to othersystems, as well as secrets for pppd to use when authenticating othersystems to itself.
Each line in a secrets file contains one secret. A given secret isspecific to a particular combination of client and server - it canonly be used by that client to authenticate itself to that server.Thus each line in a secrets file has at least 3 fields: the name ofthe client, the name of the server, and the secret. These fields maybe followed by a list of the IP addresses that the specified clientmay use when connecting to the specified server.
A secrets file is parsed into words as for a options file, so theclient name, server name and secrets fields must each be one word,with any embedded spaces or other special characters quoted orescaped. Any following words on the same line are taken to be a listof acceptable IP addresses for that client. If there are only 3 wordson the line, or if the first word is "-", then all IP addresses aredisallowed. To allow any address, use "*".A word starting with "!" indicates that thespecified address is not acceptable. An address may be followedby "/" and a number n, to indicate a whole subnet, i.e. alladdresses which have the same value in the most significant nbits. Note that case is significant in the client and server namesand in the secret.
If the secret starts with an `@', what follows is assumed to be thename of a file from which to read the secret. A "*" as the client orserver name matches any name. When selecting a secret, pppd takes thebest match, i.e. the match with the fewest wildcards.
Thus a secrets file contains both secrets for use in authenticatingother hosts, plus secrets which we use for authenticating ourselves toothers. When pppd is authenticating the peer (checking the peer'sidentity), it chooses a secret with the peer's name in the firstfield and the name of the local system in the second field. Thename of the local system defaults to the hostname, with the domainname appended if the domain option is used. This default can beoverridden with the name option, except when theusehostname option is used.
When pppd is choosing a secret to use in authenticating itself to thepeer, it first determines what name it is going to use to identifyitself to the peer. This name can be specified by the user with theuser option. If this option is not used, the name defaults tothe name of the local system, determined as described in the previousparagraph. Then pppd looks for a secret with this name in the firstfield and the peer's name in the second field. Pppd will know thename of the peer if CHAP authentication is being used, because thepeer will have sent it in the challenge packet. However, if PAP is beingused, pppd will have to determine the peer's name from the optionsspecified by the user. The user can specify the peer's name directlywith the remotename option. Otherwise, if the remote IP addresswas specified by a name (rather than in numeric form), that name willbe used as the peer's name. Failing that, pppd will use the nullstring as the peer's name.
When authenticating the peer with PAP, the supplied password is firstcompared with the secret from the secrets file. If the passworddoesn't match the secret, the password is encrypted using crypt() andchecked against the secret again. Thus secrets for authenticating thepeer can be stored in encrypted form if desired. If thepapcrypt option is given, the first (unencrypted) comparison isomitted, for better security.
Furthermore, if the login option was specified, the username andpassword are also checked against the system password database. Thus,the system administrator can set up the pap-secrets file to allow PPPaccess only to certain users, and to restrict the set of IP addressesthat each user can use. Typically, when using the login option,the secret in /etc/ppp/pap-secrets would be "", which will match anypassword supplied by the peer. This avoids the need to have the samesecret in two places.
Authentication must be satisfactorily completed before IPCP (or anyother Network Control Protocol) can be started. If the peer isrequired to authenticate itself, and fails to do so, pppd willterminated the link (by closing LCP). If IPCP negotiates anunacceptable IP address for the remote host, IPCP will be closed. IPpackets can only be sent or received when IPCP is open.
In some cases it is desirable to allow some hosts which can'tauthenticate themselves to connect and use one of a restricted set ofIP addresses, even when the local host generally requiresauthentication. If the peer refuses to authenticate itself whenrequested, pppd takes that as equivalent to authenticating with PAPusing the empty string for the username and password. Thus, by addinga line to the pap-secrets file which specifies the empty string forthe client and password, it is possible to allow restricted access tohosts which refuse to authenticate themselves.
ROUTING
When IPCP negotiation is completed successfully, pppd will inform thekernel of the local and remote IP addresses for the ppp interface.This is sufficient to create a host route to the remote end of thelink, which will enable the peers to exchange IP packets.Communication with other machines generally requires furthermodification to routing tables and/or ARP (Address ResolutionProtocol) tables. In most cases the defaultroute and/orproxyarp options are sufficient for this, but in some casesfurther intervention is required. The /etc/ppp/ip-up script can beused for this.
Sometimes it is desirable to add a default route through the remotehost, as in the case of a machine whose only connection to theInternet is through the ppp interface. The defaultroute optioncauses pppd to create such a default route when IPCP comes up, anddelete it when the link is terminated.
In some cases it is desirable to use proxy ARP, for example on aserver machine connected to a LAN, in order to allow other hosts tocommunicate with the remote host. The proxyarp option causespppd to look for a network interface on the same subnet as the remotehost (an interface supporting broadcast and ARP, which is up and not apoint-to-point or loopback interface). If found, pppd creates apermanent, published ARP entry with the IP address of the remote hostand the hardware address of the network interface found.
When the demand option is used, the interface IP addresses havealready been set at the point when IPCP comes up. If pppd has notbeen able to negotiate the same addresses that it used to configurethe interface (for example when the peer is an ISP that uses dynamicIP address assignment), pppd has to change the interface IP addressesto the negotiated addresses. This may disrupt existing connections,and the use of demand dialling with peers that do dynamic IP addressassignment is not recommended.
EXAMPLES
The following examples assume that the /etc/ppp/options file containsthe auth option (as in the default /etc/ppp/options file in theppp distribution).
Probably the most common use of pppd is to dial out to an ISP. Thiscan be done with a command such as
- pppd call isp
where the /etc/ppp/peers/isp file is set up by the systemadministrator to contain something like this:
- ttyS0 19200 crtscts
connect '/usr/sbin/chat -v -f /etc/ppp/chat-isp'
noauth
In this example, we are using chat to dial the ISP's modem and gothrough any logon sequence required. The /etc/ppp/chat-isp filecontains the script used by chat; it could for example containsomething like this:
- ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
ABORT "BUSY"
ABORT "Username/Password Incorrect"
"" "at"
OK "at&d0&c1"
OK "atdt2468135"
"name:" "^Umyuserid"
"word:" "\qmypassword"
"ispts" "\q^Uppp"
"~-^Uppp-~"
See the chat(8) man page for details of chat scripts.
Pppd can also be used to provide a dial-in ppp service for users. Ifthe users already have login accounts, the simplest way to set up theppp service is to let the users log in to their accounts and run pppd(installed setuid-root) with a command such as
- pppd proxyarp
To allow a user to use the PPP facilities, you need to allocate an IPaddress for that user's machine and create an entry in/etc/ppp/pap-secrets or /etc/ppp/chap-secrets (depending on whichauthentication method the PPP implementation on the user's machinesupports), so that the user'smachine can authenticate itself. For example, if Joe has a machinecalled "joespc" which is to be allowed to dial in to the machinecalled "server" and use the IP address joespc.my.net, you would add anentry like this to /etc/ppp/pap-secrets or /etc/ppp/chap-secrets:
- joespc server "joe's secret" joespc.my.net
Alternatively, you can create a username called (for example) "ppp",whose login shell is pppd and whose home directory is /etc/ppp.Options to be used when pppd is run this way can be put in/etc/ppp/.ppprc.
If your serial connection is any more complicated than a piece ofwire, you may need to arrange for some control characters to beescaped. In particular, it is often useful to escape XON (^Q) andXOFF (^S), using asyncmap a0000. If the path includes a telnet,you probably should escape ^] as well (asyncmap 200a0000). Ifthe path includes an rlogin, you will need to use the escape ffoption on the end which is running the rlogin client, since manyrlogin implementations are not transparent; they will remove thesequence [0xff, 0xff, 0x73, 0x73, followed by any 8 bytes] from thestream.
DIAGNOSTICS
Messages are sent to the syslog daemon using facility LOG_DAEMON.(This can be overriden by recompiling pppd with the macroLOG_PPP defined as the desired facility.) In order to see the errorand debug messages, you will need to edit your /etc/syslog.conf fileto direct the messages to the desired output device or file.
The debug option causes the contents of all control packets sentor received to be logged, that is, all LCP, PAP, CHAP or IPCP packets.This can be useful if the PPP negotiation does not succeed or ifauthentication fails.If debugging is enabled at compile time, the debug option alsocauses other debugging messages to be logged.
Debugging can also be enabled or disabled by sending a SIGUSR1 signalto the pppd process. This signal acts as a toggle.
FILES
- /var/run/pppn.pid (BSD or Linux), /etc/ppp/pppn.pid (others)
- Process-ID for pppd process on ppp interface unit n.
- /etc/ppp/auth-up
- A program or script which is executed after the remote systemsuccessfully authenticates itself. It is executed with the parameters
- interface-name peer-name user-name tty-device speed
- and with its standard input, output and error redirected to/dev/null. This program or script is executed with the real andeffective user-IDs set to root, and with an empty environment. (Notethat this script is not executed if the peer doesn't authenticateitself, for example when the noauth option is used.)
- /etc/ppp/auth-down
- A program or script which is executed when the link goes down, if/etc/ppp/auth-up was previously executed. It is executed in the samemanner with the same parameters as /etc/ppp/auth-up.
- /etc/ppp/ip-up
- A program or script which is executed when the link is available forsending and receiving IP packets (that is, IPCP has come up). It isexecuted with the parameters
- interface-name tty-device speed local-IP-addressremote-IP-address ipparam
- and with its standard input,output and error streams redirected to /dev/null.
- This program or script is executed with the real and effectiveuser-IDs set to root. This is so that it can be used to manipulateroutes, run privileged daemons (e.g. sendmail), etc. Becareful that the contents of the /etc/ppp/ip-up and /etc/ppp/ip-downscripts do not compromise your system's security.
- This program or script is executed with an empty environment, so youmust either specify a PATH or use full pathnames.
- /etc/ppp/ip-down
- A program or script which is executed when the link is no longeravailable for sending and receiving IP packets. This script can beused for undoing the effects of the /etc/ppp/ip-up script. It isinvoked in the same manner and with the same parameters as the ip-upscript, and the same security considerations apply.
- /etc/ppp/ipx-up
- A program or script which is executed when the link is available forsending and receiving IPX packets (that is, IPXCP has come up). It isexecuted with the parameters
- interface-name tty-device speed network-number local-IPX-node-addressremote-IPX-node-address local-IPX-routing-protocol remote-IPX-routing-protocollocal-IPX-router-name remote-IPX-router-name ipparam pppd-pid
- and with its standard input,output and error streams redirected to /dev/null.
- The local-IPX-routing-protocol and remote-IPX-routing-protocol fieldmay be one of the following:
- NONE to indicate that there is no routing protocol
RIP to indicate that RIP/SAP should be used
NLSP to indicate that Novell NLSP should be used
RIP NLSP to indicate that both RIP/SAP and NLSP should be used
- This program or script is executed with the real and effectiveuser-IDs set to root, and with an empty environment. This is sothat it can be used to manipulate routes, run privileged daemons (e.g.ripd), etc. Be careful that the contents of the /etc/ppp/ipx-upand /etc/ppp/ipx-down scripts do not compromise your system'ssecurity.
- /etc/ppp/ipx-down
- A program or script which is executed when the link is no longeravailable for sending and receiving IPX packets. This script can beused for undoing the effects of the /etc/ppp/ipx-up script. It isinvoked in the same manner and with the same parameters as the ipx-upscript, and the same security considerations apply.
- /etc/ppp/pap-secrets
- Usernames, passwords and IP addresses for PAP authentication. Thisfile should be owned by root and not readable or writable by any otheruser. Pppd will log a warning if this is not the case.
- /etc/ppp/chap-secrets
- Names, secrets and IP addresses for CHAP authentication. As for/etc/ppp/pap-secrets, this file should be owned by root and notreadable or writable by any other user. Pppd will log a warning ifthis is not the case.
- /etc/ppp/options
- System default options for pppd, read before user default options orcommand-line options.
- ~/.ppprc
- User default options, read before /etc/ppp/options.ttyname.
- /etc/ppp/options.ttyname
- System default options for the serial port being used, read after~/.ppprc. In forming the ttyname part of thisfilename, an initial /dev/ is stripped from the port name (ifpresent), and any slashes in the remaining part are converted todots.
- /etc/ppp/peers
- A directory containing options files which may contain privilegedoptions, even if pppd was invoked by a user other than root. Thesystem administrator can create options files in this directory topermit non-privileged users to dial out without requiring the peer toauthenticate, but only to certain trusted peers.
SEE ALSO
- RFC1144
- Jacobson, V.Compressing TCP/IP headers for low-speed serial links.February 1990.
- RFC1321
- Rivest, R.The MD5 Message-Digest Algorithm.April 1992.
- RFC1332
- McGregor, G.PPP Internet Protocol Control Protocol (IPCP).May 1992.
- RFC1334
- Lloyd, B.; Simpson, W.A.PPP authentication protocols.October 1992.
- RFC1661
- Simpson, W.A.The Point-to-Point Protocol (PPP).July 1994.
- RFC1662
- Simpson, W.A.PPP in HDLC-like Framing.July 1994.
NOTES
The following signals have the specified effect when sent to pppd.
- SIGINT, SIGTERM
- These signals cause pppd to terminate the link (by closing LCP),restore the serial device settings, and exit.
- SIGHUP
- This signal causes pppd to terminate the link, restore the serialdevice settings, and close the serial device. If the persist ordemand option has been specified, pppd will try to reopen theserial device and start another connection (after the holdoff period).Otherwise pppd will exit. If this signal is received during theholdoff period, it causes pppd to end the holdoff period immediately.
- SIGUSR1
- This signal toggles the state of the debug option.
- SIGUSR2
- This signal causes pppd to renegotiate compression. This can beuseful to re-enable compression after it has been disabled as a resultof a fatal decompression error. (Fatal decompression errors generallyindicate a bug in one or other implementation.)
AUTHORS
Paul Mackerras (Paul.MackerrasAATTcs.anu.edu.au), based on earlier work byDrew Perkins,Brad Clements,Karl Fox,Greg Christy,andBrad Parker.
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- FREQUENTLY USED OPTIONS
- OPTIONS
- OPTIONS FILES
- SECURITY
- AUTHENTICATION
- ROUTING
- EXAMPLES
- DIAGNOSTICS
- FILES
- SEE ALSO
- NOTES
- AUTHORS
This document was created byman2html,using the manual pages.