NAME | SYNOPSIS | FEATURES | DESCRIPTION | OPTIONS | OPERANDS | OPTIONS FILES | SECURITY | AUTHENTICATION | ROUTING | EXAMPLES | DIAGNOSTICS | FILES | ATTRIBUTES | SEE ALSO
C_INIT
commandPPP
The Point-to-Point Protocol (PPP) provides a method for transmitting datagrams over serial point-to-point links. PPP is composed of three parts: a method for encapsulating datagrams over serial links, an extensible Link Control Protocol (LCP), and a family of Network Control Protocols (NCP) for establishing and configuring different network layer protocols.
The encapsulation scheme is provided by driver code in the microkernel. pppd provides the basic LCP, authentication support, and an NCP for establishing and configuring the Internet Protocol (IP) called the IP Control Protocol (IPCP).
pppd supports the following frequently used options:
Set the async character map to map. The map describes which control characters cannot be sucessfully received over the serial line. pppd asks the peer to send these characters as a two-byte escape sequence. The argument is a 32-bit hex number with each bit representing a character to escape. Bit 0 (00000001) represents the character 0x00; bit 31 (80000000) represents the character 0x1f or ^_. If multiple asyncmap options are given, the values are ORed together. If no asyncmap option is given, no async character map is negotiated for the receive direction; the peer should then escape all control characters. To escape transmitted characters, use the escape option.
Require the peer to authenticate itself before allowing network packets to be sent or received.
Run the executable command to set up the serial line. command typically uses chat(1M) to dial the modem and start the remote PPP session. This option is privileged if the noauth option is used.
Attempt dial-out connection to remote system no more than the specified number of times (default = 1).If the connection is not made, pppd exits. Requires that persist be specified.
Use hardware flow control, RTS/CTS, to control the flow of data on the serial port. If neither the crscts nor the nocrscts option is given, the hardware flow control setting for the serial port is left unchanged.
Add a default route to the system routing tables, using the peer as the gateway, when IPCP is successfully completed. This entry is removed when the PPP connection is broken. This option is privileged if the nodefaultroute option is also specified.
Run the executable command after pppd has terminated the link. command must identify a user-supplied actor that is executed by pppd through an afexec(2K) call. command can, for example, issue commands to the modem to cause it to hang up if hardware modem control signals are not available. command is not run if the modem has already hung up. This option is privileged if the noauth option is used.
Specifies that certain characters should be escaped on transmission (regardless of whether the peer requests them to be escaped with its async control character map). The characters to be escaped are specified as a list of hex numbers separated by commas. Note that almost any character may be specified for the escape option. This is unlike the asyncmap option, which only allows control characters to be specified. The characters that may not be escaped are those with hex values: 0x20, 0x3f and 0x5e.
Read options from the file name, whose format is specified below. The file must be readable by the user who invokes pppd.
Specifies that pppd should create a UUCP-style lock file for the serial device to ensure exclusive access to the device.
Set the Maximum Receive Unit (MRU) value to number. pppd asks the peer to send packets of no more than number bytes. The minimum MRU value is 128. The default MRU value is 1500. A value of 296 is recommended for slow links (40 bytes for the TCP/IP header and 40 bytes for the data).
Set the Maximum Transmit Unit (MTU) value to number. Unless a peer requests a smaller value via MRU negotiation, pppd requests that the microkernel networking code send data packets of no more than number bytes through the PPP network interface.
Enables the passive option in LCP. With this option, pppd attempts to initiate a connection. If no reply is received from the peer, pppd waits passively for a valid LCP packet from the peer, instead of exiting, as it would without the option.
pppd also supports the following options:
Set the local and remote IP addresses. Either one may be omitted. The IP addresses can be specified with a host name, or in decimal dot notation such as 129.157.197.83. The default local address is the first IP address of the system unless the noipdefault option is given. The remote address is obtained from the peer if not specified in any option. Therefore, in simple cases this option is not required. If a local or remote IP address is specified with this option, pppd does not accept a different value from the peer in the IPCP negotiation, unless the ipcp-accept-local or ipcp-accept-remote options are given.
Request that the peer compress packets that it sends, using the BSD-Compress scheme, with a maximum code size of nr bits, and agree to compress packets sent to the peer with a maximum code size of nt bits. If nt is not specified, it defaults to the value given for nr. Values in the range 9 to 15 may be used for nr and nt. Larger values give better compression but consume more microkernel memory for compression dictionaries. Alternatively, a value of 0 for nr or nt disables compression in the corresponding direction. Use nobsdcomp or bsdcomp 0 to disable BSD-Compress compression entirely.
Challenge the peer every number seconds.
Set the maximum number of CHAP challenge transmissions to number (default = 10).
Set the CHAP restart interval (retransmission timeout for challenges) to number seconds.
Enable connection debugging facilities. If this option is given, pppd logs the contents of all control packets sent or received in a readable form. Packets are sent to stdout
and the microkernel log.
Disable asyncmap negotiation, forcing all control characters to be escaped in both the transmit and receive directions.
Disable Maximum Receive Unit (MRU) negitiation. With this option, pppd uses the default MRU value of 1500 bytes in both the transmit and receive directions.
Request that the peer compress packets that it sends, using the Deflate scheme, with a maximum window size of 2nr bytes, and agree to compress packets sent to the peer with a maximum window size of 2nt bytes. If nt is not specified, it defaults to the value given for nr. Values in the 8 to 15 range may be used for nr and nt. Larger values give better compression but consume more microkernel memory for compression dictionaries. Alternatively, a value of 0 for nr or nt disables compression in the corresponding direction. Use nodeflate or deflate 0 to disable Deflate compression entirely.
Note: pppd requests Deflate compression in preference to BSD-Compress if the peer can do either.
Initiate the link only on demand, that is, when data traffic is present. With this option, the remote IP address must be specified by the user on the command line or in an options file. pppd initially configures the interface and enables it for IP traffic without connecting to the peer. When traffic is available, pppd connects to the peer and performs negotiation, authentication and so forth. When this is completed, pppd begins passing data packets, (IP packets), across the link.
Append the domain name d to the local host name for authentication purposes. For example, if gethostname(2POSIX) returns the name lethe, but the fully qualified domain name is lethe.France.Sun.COM, you could specify domain France.Sun.COM. In this case, pppd would use the name lethe.France.Sun.COM for looking up secrets in the secrets file, and as the default name to send to the peer when authenticating itself to the peer. This option is privileged.
Specifies the number of seconds to wait before re-initiating the link after it terminates. This option only has an effect if the demand or persist option is used. The holdoff period is not applied if the link terminates because it is idle.
Specifies that pppd should disconnect if the link is idle for number seconds. The link is idle when no data packets, (s IP packets), are being sent or received.
It is not advisable to use this option with the persist option without the demand option. If the active-filter option is given, data packets that are rejected by the specified activity filter also count as the link being idle.
Accept the remote IP address specified by the peer, even if the local IP address is specified by another option.
Accept the local IP address specified by the peer, even if the remote IP address is specified by another option.
Set the maximum number of IPCP configure-request transmissions to number (default = 10).
Set the maximum number of IPCP configure-NAKs returned before starting to send configure-Rejects instead to number (default = 10).
Set the maximum number of IPCP terminate-request transmissions to number (default = 3).
Set the IPCP restart interval to number seconds (default = 3).
Enable debugging code in the microkernel-level PPP driver. number is the sum of the following values: 1 to enable general debug messages, 2 to request that the contents of received packets be printed and 4 to request that the contents of transmitted packets be printed. Messages printed by the microkernel are logged by syslog(2K) to a file as directed in the /etc/syslog.conf configuration file.
Presume the peer to be dead if number LCP requests are sent without receiving a valid LCP echo-reply. If this happens, pppd terminates the connection. Use of this option requires a non-zero value for lcp-echo-interval. This option can be used to enable pppd to terminate after the physical connection has been broken, such as after the modem hangs up, in situations where no hardware modem control lines are available.
Send an LCP echo-request frame to the peer every number seconds. Normally, the peer should respond to the echo-request by sending an echo-reply. This option can be used with lcp-echo-failure to detect that the peer is no longer connected.
Set the maximum number of LCP configure-request transmissions to number (default = 10).
Set the maximum number of LCP configure-NAKs returned before starting to send configure-Rejects instead to number (default = 10).
Set the maximum number of LCP terminate request transmissions to number (default = 3).
Set the LCP restart interval (transmission timeout) to number seconds (default = 3).
Do not use the modem control lines. Here, pppd ignores the state of the Carrier Detect (CD) signal from the modem and does not change the state of the Data Terminal Ready (DTR) signal.
Terminate the connection when it has been available for network traffic for number seconds, that is, number seconds after the first network protocol comes up.
Use the modem control lines. This option is the default. With this option, pppd waits for the Carrier Detect (CD) signal from the modem to be asserted when opening the serial device (unless a connect command is specified), and drops the Data Terminal Ready (DTR) signal briefly when the connection is terminated and before executing the connection command.
Allow pppd to supply one or two Domain Name Server (DNS) addresses to Microsoft Windows clients. The first instance of this option specifies the primary DNS address. The second instance, if given, specifies the secondary DNS address.
This option was present in older versions of pppd under the name dns-addr.
Allow pppd to supply one or two Windows Internet Name Services(WINS) addresses to Samba or Microsoft Windows clients. The first instance of this option specifies the primary WINS address. The second instance, if given, specifies the secondary WINS address.
Set the name of the local system for authentication purposes to name. This is a privileged option. With this option, pppd uses lines in the secrets files having name as the second field when looking for a secret to use in authenticating with the peer. In addition, unless overridden by the user option, name is used as the name to send to the peer when authenticating the local system to the peer.
pppd does not append the domain name to name.
Set the interface netmask to number, a 32-bit netmask in decimal dot notation, such as 255.255.255.0. If this option is given, the value specified is ORed with the default netmask. The default netmask is chosen based on the negotiated remote IP address. It is the appropriate network mask for the class of the remote IP address, ORed with the netmasks for any non-point-to-point network interfaces in the system that are not on the same network.
Disable Address/Control compression in both send and receive directions.
Do not require the peer to authenticate itself. This option is privileged if the auth option is specified in the options file.
Disable BSD-Compress compression. pppddoes not request or agree to compress packets using the BSD-Compress scheme.
Disable Compression Control Protocol (CCP) negotiation. This option should only be required if the peer is buggy and requests from pppd for CCP negotiation cause problems.
Disable hardware flow control, RTS/CTS, on the serial port. If neither the crtscts nor nocrtscts option is given, the hardware flow control setting for the serial port is left unchanged.
Disable the defaultroute option. The system administrator requiring to prevent users from creating default routes with pppd can do so by placing this option in the options file, which is either /image/sys_bank/options or /etc/ppp/options.
Disable Deflate compression. pppd does not request or agree to compress packets using the Deflate scheme.
Do not detach from the controlling terminal. Without this option, if a serial device other than the terminal on the standard input is specified, pppd forks to become a background process.
Disable IPCP negotiation and IP communication. This option should only be required if the peer is buggy requests from pppd for IPCP negotiation causse problems.
Disables the default behavior when no local IP address is specified. This is to determine the local IP address from the hostname. With this option, the peer must supply the local IP address during IPCP negotiation unless it is specified explicitly on the command line or in an options file.
Disable magic number negotiation. With this option, pppd cannot detect a looped-back line. This option should only be required if the peer is buggy.
Disable protocol field compression negotiation in both send and receive directions.
Exit once a connection has been made and terminated. This is the default behavior unless the demand or persist option has been specified.
Do not accept or agree to Predictor-1 compression.
Disable the proxyarp option. The system administrator requiring to prevent users from creating proxy ARP entries with pppd can do so by placing this option in /etc/ppp/options.
Disable Van Jacobson-style TCP/IP header compression in both send and receive directions.
Disable the connection-ID compression option in Van Jacobson-style TCP/IP header compression. With this option, pppd does not omit the connection-ID byte from Van Jacobson-style TCP/IP headers, nor does it ask the peer to do so.
Indicates that all secrets in the /etc/ppp/pap-secrets file used for checking the identity of the peer are encrypted, and therefore pppd should not accept a password which, before encryption, is identical to the secret from the /etc/ppp/pap-secrets file.
Set the maximum number of PAP authenticate-request transmissions to number (default = 10).
Set the PAP restart interval to number seconds (default = 3).
Set the maximum time that pppd will wait for the peer to authenticate itself with PAP to number seconds (0 indicates no limit).
Do not exit after a connection is terminated. Instead, try to open the connection again.
Request that the peer compress frames sent using Predictor-1 compression, and agree to compress transmitted frames with Predictor-1, if requested. This option has no effect unless the microkernel driver supports Predictor-1 compression.
Add an entry to the local system Address Resolution Protocol (ARP) table with the IP address of the peer and the Ethernet address of this system. This has the effect of making the peer appear to other systems on the local Ethernet.
Set the assumed name of the remote system for authentication purposes to name.
Do not agree to authenticate the local system to the peer using CHAP.
Do not agree to authenticate the local system to the peer using PAP.
Require the peer to authenticate itself using Challenge Handshake Authentication Protocol (CHAP) authentication.
Require the peer to authenticate itself using Password Authentication Protocol (PAP) authentication.
Do not transmit LCP packets to initiate a connection until a valid LCP packet is received from the peer, similar to the passive option for older versions of pppd.
Enforce the use of the hostname with the domain name appended, if available, as the name of the local system for authentication purposes. Overrides the name option.
Sets the name used for authentication of the local system to the peer to name.
Sets the number of connection slots to be used by Van Jacobson-style TCP/IP header compression and decompression code to a number between 2 and 16, inclusive.
Run the executable or shell command specified by script before initiating PPP negotiation, after the connect script, if any, has completed. This option is privileged if the noauth option is used.
Use software flow control, XON/XOFF, to control the flow of data on the serial port.
pppd supports the following operands:
Communicate over the named device. The string /dev/ is prepended if necessary. This operand is mandatory.
Set the baud rate to speed, a decimal number. The default speed is 9600.
Options can be taken from files as well as the command line. pppd reads options from options files found in /image/sys_bank or /etc/ppp, respectively, before processing the options on the command line.
An options file is parsed into a series of words, delimited by whitespace. Whitespace can be included in a word by enclosing the word in double-quotes ("). A backslash (\) quotes the following character. A hash (#) starts a comment, which continues until the end of the line. No restriction exists to prevent the use of file or call options within an options file.
pppd provides system administrators with sufficient access control that PPP access to a server machine can be provided to legitimate users without fear of compromising the security of the server or the network it is on. In part this is provided by the options file, where the administrator can place options to restrict the ways in which pppd can be used, and in part by the PAP and CHAP secrets files, where the administrator can restrict the set of IP addresses which individual users may use.
Authentication is the process whereby one peer convinces the other of its identity. This involves the first peer sending its name to the other, together with some kind of secret information which could only come from the genuine authorized user of that name. In such an exchange, the first peer is called the "client" and the other the "server". The client has a name by which it identifies itself to the server, and the server also has a name by which it identifies itself to the client. Generally, the genuine client shares some secret (or password) with the server, and authenticates itself by proving that it knows that secret. Very often, the names used for authentication correspond to the internet hostnames of the peers, but this is not essential.
At present, pppd supports two authentication protocols: the Password Authentication Protocol (PAP) and the Challenge Handshake Authentication Protocol (CHAP). PAP involves the client sending its name and a cleartext password to the server to authenticate itself. In contrast, the server initiates the CHAP authentication exchange by sending a challenge to the client (the challenge packet includes the name of the server). The client must respond with a response which includes its name plus a hash value derived from the shared secret and the challenge, in order to prove that it knows the secret.
The PPP protocol, being symmetrical, allows both peers to require the other to authenticate itself. In that case, two separate and independent authentication exchanges will occur. The two exchanges could use different authentication protocols, and in principle, different names could be used in the two exchanges.
The default behavior of pppd is to agree to authenticate if requested, and to not require authentication from the peer. However, pppd does not agree to authenticate itself with a particular protocol if it has no secrets which could be used to do so.
pppd stores secrets for use in authentication in secrets files (pap.scr for PAP, chap.scr for CHAP found in either /image/sys_bank, if included in the system image, or /etc/ppp, respectively). Both secrets files have the same format. The secrets files can contain secrets for pppd to use in authenticating itself to other systems, as well as secrets for pppd to use when authenticating other systems to itself.
Each line in a secrets file contains one secret. A given secret is specific to a particular combination of client and server - it can only be used by that client to authenticate itself to that server. Thus each line in a secrets file has at least three fields: the name of the client, the name of the server, and the secret. These fields may be followed by a list of the IP addresses that the specified client may use when connecting to the specified server.
A secrets file is parsed into words as for an options file, so the client name, server name and secrets fields must each be one word, with any embedded spaces or other special characters quoted or escaped. Any following words on the same line are taken to be a list of acceptable IP addresses for that client, or an override for local:remote addresses (the same format used on the command line or in the options file) when on a line that contains a specific client name (not a wildcard nor empty). If there are only three words on the line, or if the first word is -, then all IP addresses are disallowed. To allow any address, use *. A word starting with ! indicates that the specified address is not acceptable. An address may be followed by / and a number, to indicate a whole subnet, such as all addresses which have the same value in the most significant number bits. Note that case is significant in the client and server names and in the secret.
If the secret starts with an @, what follows is assumed to be the name of a file from which to read the secret. A * as the client or server name matches any name. When selecting a secret, pppd takes the best match, that is, the match with the fewest wildcards.
Thus a secrets file contains both secrets for use in authenticating other hosts, plus secrets which we use for authenticating ourselves to others. When pppd is authenticating the peer (checking the peer's identity), it chooses a secret with the peer's name in the first field and the name of the local system in the second field. The name of the local system defaults to the hostname, with the domain name appended if the domain option is used. This default can be overridden with the name option, except when the usehostname option is used.
When pppd is choosing a secret to use in authenticating itself to the peer, it first determines what name it is going to use to identify itself to the peer. This name can be specified by the user with the user option. If this option is not used, the name defaults to the name of the local system, determined as described in the previous paragraph. Then pppd looks for a secret with this name in the first field and the peer's name in the second field. pppd will know the name of the peer if CHAP authentication is being used, because the peer will have sent it in the challenge packet. However, if PAP is being used, pppd will have to determine the peer's name from the options specified by the user. The user can specify the peer's name directly with the remotename option. Otherwise, if the remote IP address was specified by a name (rather than in numeric form), that name will be used as the peer's name. Failing that, pppd will use the null string as the peer's name.
When authenticating the peer with PAP, the password supplied is first compared with the secret from the secrets file. If the password doesn't match the secret, the password is encrypted using crypt() and checked against the secret again. Thus secrets for authenticating the peer can be stored in encrypted form if desired. If the papcrypt option is given, the first (unencrypted) comparison is omitted, for better security.
Authentication must be satisfactorily completed before IPCP (or any other Network Control Protocol) can be started. If the peer is required to authenticate itself, and fails to do so, pppd will terminated the link (by closing LCP). If IPCP negotiates an unacceptable IP address for the remote host, IPCP will be closed. IP packets can only be sent or received when IPCP is open.
In some cases it is desirable to allow some hosts which cannot authenticate themselves to connect and use one of a restricted set of IP addresses, even when the local host generally requires authentication. If the peer refuses to authenticate itself when requested, pppd treats it as equivalent to authenticating with PAP using the empty string for the username and password. Thus, by adding a line to the pap-secrets file that specifies the empty string for the client and password, it is possible to allow restricted access to hosts which refuse to authenticate themselves.
When IPCP negotiation is completed successfully, pppd will inform the microkernel of the local and remote IP addresses for the PPP interface. This is sufficient to create a host route to the remote end of the link, which enables the peers to exchange IP packets. Communication with other machines generally requires further modification to routing tables or ARP (Address Resolution Protocol) tables. In most cases the defaultroute or proxyarp options are sufficient for this.
Sometimes it is desirable to add a default route through the remote host, as in the case of a machine whose only connection to the Internet is through the PPP interface. The defaultroute option causes pppd to create this type of default route when IPCP comes up, and delete it when the link is terminated.
In some cases it is desirable to use a proxy ARP, for example on a server machine connected to a LAN, in order to allow other hosts to communicate with the remote host. The proxyarp option causes pppd to look for a network interface on the same subnet as the remote host (an interface supporting broadcast and ARP, which is up and not a point-to-point or loopback interface). If found, pppd creates a permanent, published ARP entry with the IP address of the remote host and the hardware address of the network interface found.
When the demand option is used, the interface IP addresses have already been set at the point when IPCP comes up. If pppd has not been able to negotiate the same addresses that it used to configure the interface (for example when the peer is an ISP that uses dynamic IP address assignment), pppd has to change the interface IP addresses to the negotiated addresses. This may disrupt existing connections, and the use of demand dialing with peers that do dynamic IP address assignment is not recommended.
pppd /dev/tty01 connect "/image/sys_bank/chat -v -f /image/sys_bank/chat.cmd"
In this example, chat is used to dial the modem. /image/sys_bank/chat.cmd contains the chat commands. For example:
ABORT BUSY ABORT 'NO CARRIER' TIMEOUT 5 '' ATZ OK ATDT10009 TIMEOUT 40 CONNECT
See the chat(1M) man page for details regarding chat scripts.
If your serial connection is any more complicated, you must arrange for some control characters to be escaped. In particular, it is often useful to escape XON (^Q) and XOFF (^S), using asyncmap a0000. If the path includes a telnet, you should escape ^] as well, using asyncmap 200a0000.
Messages are sent to stdout
and to the microkernel log, which can be viewed using the microkernel debugging tool.
The debug option causes the contents of all control packets sent or 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 if authentication fails. If debugging is enabled at compile time, the debug option also causes other debugging messages to be logged.
pppd looks for files first in /image/sys_bank, and then in /etc/ppp. The choice is abbreviated below as directory.
Names, secrets and IP addresses for CHAP authentication. This file should be owned by root and not readable or writable by any other user. pppd logs a warning if this is not the case.
System default options for pppd. Read before command-line options.
Usernames, secrets and IP addresses for PAP authentication. This file should be owned by root and not readable or writable by any other user. pppd logs a warning if this is not the case.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
chat(1M), pppclose(1M), pppstart(1M), pppstop(1M)
Jacobson, V. Compressing TCP/IP headers for low-speed serial links. February 1990.
Rivest, R. The MD5 Message-Digest Algorithm. April 1992.
McGregor, G. PPP Internet Protocol Control Protocol (IPCP). May 1992.
Lloyd, B. Simpson, W. A. PPP authentication protocols. October 1992.
Simpson, W. A. The Point-to-Point Protocol (PPP). July 1994.
Simpson, W. A. PPP in HDLC-like Framing. July 1994.
NAME | SYNOPSIS | FEATURES | DESCRIPTION | OPTIONS | OPERANDS | OPTIONS FILES | SECURITY | AUTHENTICATION | ROUTING | EXAMPLES | DIAGNOSTICS | FILES | ATTRIBUTES | SEE ALSO