MorningStar PPP User's Guide
- Serial Connections
- Common pppd Options
- IP Routing Tips
- Configuring PPP to Test a Connection
- Security Techniques
- Appendixes
© 1996 The Santa Cruz Operation, Inc.
© 1991-1996 Morning Star Technologies, Inc.
All rights reserved.
No part of this publication may be reproduced, transmitted, stored in a retrieval
system, nor translated into any human or computer language, in any form or
by any means, electronic, mechanical, magnetic, optical, chemical, manual, or
otherwise, without the prior written permission of the copyright owner, The Santa
Cruz Operation, Inc., 400 Encinal Street, Santa Cruz, California, 95060,
USA. Copyright infringement is a serious matter under the United States and
foreign Copyright Laws.
Information in this document is subject to change without notice and does
not represent a commitment on the part of The Santa Cruz Operation, Inc.
SCO, the SCO logo, The Santa Cruz Operation, ODT, ODT, Panner, SCO
Global Access, SCO MultiView, SCO Visual Tcl, Skunkware, VP/ix,
SCO OpenServer, UnixWare, SCO OK, and the SCO OK logo are trademarks
or registered trademarks of The Santa Cruz Operation, Inc. in the United States
and other countries. Windows Friendly and Wintif are trademarks of IXI
Limited. Visionware is a registered trademark of Visionware Limited.
UNIX is a registered trademark in the United States and other countries,
licensed exclusively through X/Open Company Limited. All other brand or
product names are or may be trademarks of, and are used to identify
products or services of, their respective owners.
The software that accompanies this publication is commercial computer software
and, together with any related documentation, is subject to the restrictions on
US Government use as set forth below. If this procurement is for a DOD
agency, the following DFAR Restricted Rights Legend applies:
RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the
Government is subject to restrictions as set forth in subparagraph (c)(1)(ii)
of Rights in Technical Data and Computer Software Clause at DFARS
252.227-7013. Contractor/Manufacturer is The Santa Cruz Operation,
Inc., 400 Encinal Street, Santa Cruz, CA 95060.
If this procurement is for a civilian government agency, this FAR Restricted
Rights Legend applies:
RESTRICTED RIGHTS LEGEND: This computer software is submitted
with restricted rights under Government Contract No. _________ (and
Subcontract No. ________, if appropriate). It may not be used, reproduced,
or disclosed by the Government except as provided in paragraph (g)(3)(i)
of FAR Clause 52.227-14 alt III or as otherwise expressly stated in the
contract. Contractor/Manufacturer is The Santa Cruz Operation, Inc.,
400 Encinal Street, Santa Cruz, CA 95060.
The copyrighted software that accompanies this publication is licensed to
the End User only for use in strict accordance with the End User License
Agreement, which should be read carefully before commencing use
of the software.
Document Version: 1.1
11 October 1996
Properly installed and configured, MST PPP and your system's serial port
connections allow you to transmit data to remote locations through a modem
or null-modem cable. Modems convert the system's digital signals to the analog
signals which are transmitted over telephone company equipment. Most systems
are equipped with internal modems, although you can use a cable to connect an
external modem or other system to a serial port.
This section on serial connections includes information about types of
transmission, proper cabling between serial ports, and modem configuration.
The information is general and the MST PPP manual is not a substitute for
specific instructions that were provided with your system and/or the modem
you plan to use for dialup communications. The system and modem manuals
should take precedence if you have any questions about configuration and
equipment.
However, where possible, we have supplied advice derived from our testing of
MST PPP on many types of equipment and operating systems.
Serial transmission uses a single channel to send data as a series of signal
elements over a span of time. Parallel transmission, the alternative, sends
signal elements over multiple channels simultaneously. However, serial
transmission is a better solution than parallel transmission over almost any
distance. Parallel does work well when sending information from a workstation
to a local desktop printer, because the machines can easily be connected by a
six- to ten-foot cable with multiple transmission channels. However, it is
usually prohibitively expensive to use long multi-channel cable for parallel
transmission. Therefore, most data transmissions between remote locations are
serial, including those supported by MST PPP.
Data transmitted serially must be recognizable; so, in some fashion, the remote
end must be able to correctly separate the elements it receives. Simply, this
becomes a matter of timing, which can be synchronous or asynchronous.
Synchronous transmission requires two perfectly matched external clocks. Each
end of the connection times the transmission elements by its own clock. For
example, each end agrees that a new message will contain a certain number of
elements that will begin at a prearranged interval. Therefore, if the ends
agree that new messages will begin every five seconds, the receiving end knows
that each element it receives at five, ten, fifteen, and twenty seconds will be
the start of a new message. The drawback to synchronous transmission is the
necessity to keep the clocks at each end in sync with each other.
Asynchronous transmission does utilize timing, so it is not
unsynchronous, but the timing is continuously reset using elements of
the data transmitted. Through negotiations, each end agrees that a particular
message will signal the start of a transmission. As in synchronous
transmission, each message that is not a "start" message contains a
certain number of elements, delivered at a prearranged interval. The difference
is that a "start" message controls the timing, not two clocks which
must be kept in sync. Timing begins when a "start" message is
received. This prevents the decay of local and remote synchronization over time.
The de facto standard serial interface is a RS 232 port. The Electronics
Industries Association's developed RS 232 standards in 1969 and they have been
updated several times. Each pin, or wire, used by an RS 232 connection passes a
particular type of signal between data terminal equipment (DTE) and data
circuit-terminating equipment (DCE). DTE is the computer system and DCE is the
modem.
The types of signaling carried by the RS 232 interface are listed below:
Signal
|
Description
|
Signal Ground (SG) |
Common electrical ground path for all interface circuits |
Transmit Data (TD)
|
Command codes or data sent from DTE to DCE ; won't be sent unless RTS, CTS, DSR and DTR are set to on
|
Receive Data (RD)
|
DCE responses to DTE commands or data received from a remote DCE
|
Request To Send (RTS)
|
Set to on, the DTE tells the DCE to remain in transmit mode; set to off, the DTE tells the DCE to receive
|
Clear To Send (CTS)
|
Set to on, the DCE reports it is ready to receive; set to off, the DCE tells the DTE not to transmit
|
Data Set Ready (DSR)
|
Set to on, the DCE reports it is ready to operate
|
Data Terminal Ready (DTR)
|
Set to on, the DTE tells the DCE to connect to a communications channel;
required to be on for automatic answering by DCE; set to off the DTE tells the
DCE to break the connection when it has finished the current transmission
|
Ring Indicator (RI)
|
Set to on, the DCE reports it detects the presence of a ringing signal on the
communications channel; set to off the DCE indicates the absence of a ringing
signal
|
Carrier Detect (CD)
|
Set to on, the DCE reports receiving a signal from the communications channel
that a connection can be established
|
The RS 232 standard utilizes 9-pins for signaling, although many serial
interfaces provide 25. The other 16 pins can be used for testing or secondary
signaling. Smaller, 9 pin connectors, support standard signaling and save space.
25-pin connectors, or DB-25, use pins 2 though 8 and pins 20 and 22 as shown:
Pin
|
Signal
|
Signal Direction
|
1
|
Protective Ground
|
both
|
2
|
Transmit Data (TD)
|
from DTE
|
3
|
Receive Data (RD)
|
from DCE
|
4
|
Request To Send (RTS)
|
from DTE
|
5
|
Clear To Send (CTS)
|
from DCE
|
6
|
Data Set Ready (DSR)
|
from DCE
|
7
|
Signal Ground
|
both
|
8
|
Carrier Detect (CD)
|
from DCE
|
20
|
Data Terminal Ready (DTR)
|
from DTE
|
22
|
Ring Indicator (RI)
|
from DCE
|
Standard 9-pin connectors, called DB-9, use the following pin setup:
Pin
|
Signal
|
Signal Direction
|
1
|
Carrier Detect (CD)
|
from DCE
|
2
|
Receive Data (RD)
|
from DCE
|
3
|
Transmit Data (TD)
|
from DTE
|
4
|
Data Terminal Ready (DTR)
|
from DTE
|
5
|
Signal Ground
|
both
|
6
|
Data Set Ready (DSR)
|
from DCE
|
7
|
Request To Send (RTS)
|
from DTE
|
8
|
Clear To Send (CTS)
|
from DCE
|
9
|
Ring Indicator (RI)
|
from DCE
|
This wiring diagram shows the standard conversion from DB-9 to DB-25:
Signal
|
DB-9 Pin
|
DB-25 Pin
|
Carrier Detect (CD)
|
1
|
8
|
Receive Data (RD)
|
2
|
3
|
Transmit Data (TD)
|
3
|
2
|
Data Terminal Ready (DTR)
|
4
|
20
|
Ground
|
5
|
7
|
Data Set Ready (DSR)
|
6
|
6
|
Request To Send (RTS)
|
7
|
4
|
Clear To Send (CTS)
|
8
|
5
|
Ring Indicator (RI)
|
9
|
22
|
Some UNIXÒ machines provide MiniDIN-8 connectors for serial ports. Lacking
the RS 232 standard number of pins, some pin wires are not connected on these
machines. Though these MiniDIN-8 connectors look like connectors on
Apple ÒMacintoshÒproducts, they are not the same. Do not attempt to
use a MacÔ modem cable on these UNIX machines.
Two systems' serial ports can be directly connected by a null-modem cable.
Null-modem cables connect pins of one machine to their symmetric counterparts
on another machine. For example, pin 2, the Transmit Data (TD) pin of machine
A, is paired with the pin 3, the Receive Data (RD) of machine B. If this is not
done, both machines would try to use pin 2 to transmit data and neither could
receive the others transmission. Sometimes only pins 2, 3, and 7 are connected
in a null-modem cable, but hardware handshaking may require optional
connections of other pins. Data Set Ready (DSR) and Carrier Detect (CD),
pins 6 and 8, may be joined together and connected to the other machine's
Data Terminal Ready pin, number 20.
The table below shows typical null-modem pin connections between two DB-25
ports. Please read the system-specific information under Configuring
Serial Ports if you have a system which provides a MiniDIN-8 serial
port connector. More information about null-modem connections for MiniDIN-8
connectors appears there.
DTE Signal
|
DTE
Pin
|
DCE
Pin
|
DCE Signal
|
Protective Ground
|
1
|
1
|
Protective Ground
|
Ground
|
7
|
7
|
Ground
|
Transmit Data (TD)
|
2
|
3
|
Receive Data (RD)
|
Receive Data (RD)
|
3
|
2
|
Transmit Data (TD)
|
Data Set Ready (DSR) & Carrier Detect (CD)
|
6+8
|
20
|
Data Terminal Ready (DTR)
|
Data Terminal Ready (DTR
|
20
|
6+8
|
Data Set Ready (DSR) & Carrier Detect (CD)
|
Request To Send (RTS)
|
4
|
5
|
Clear To Send (CTS)
|
Clear To Send (CTS)
|
5
|
4
|
Request To Send (RTS)
|
MST PPP works well with any number of brand-name, non-proprietary, dial up
modems. Modems for dial up protocols like PPP should conform to non-proprietary
standards because the local user will probably have little knowledge of the
equipment at the remote end of the connection. A non-proprietary modem's
ability to match carrier speed will make a usable connection with whatever
type of modem is operating at the other end of a connection.
See "Supported modems" in Chapter 7 of
SCO Internet FastStart
for a list of supported modems.
This section discusses, generally, a few features of modem performance and
configuration. Beyond speed of transmission, these features include error
correction, data compression, flow control, command mode, and S registers.
Everyone knows that people appreciate a modem for three things. Speed, speed,
and speed. This is the easiest feature to understand. The higher the number
associated with the modem, the faster the data transmits. There are two ways to
gauge modem speed. One figure, usually between 9600 and 28800 BPS, measures the
amount of data which can be transmitted or received between modems. The other,
a much higher figure, perhaps 38400 to 115200 BPS, describes data throughput
between a system and its modem. You will use the this type of speed when you
configure MST PPP, choosing the highest modem throughput that can be supported
by the system. Typically, this speed will be 115200. The figure can be found
in the file
/usr/include/sys/termio.h
.
This allows you to receive the maximum advantage of the modem's data compression capability.
Enable data compression if your modem supports it, unless your application
performs better without it. Data compression maximizes the amount of
information crossing a PPP connection. Generally, executable files do not
compress well and files which have been compressed before transmission are
difficult, but most protocols provide at least 2:1 compression ratios for
other types of data. Microcom, Inc.'s Microcom Networking Protocol 5 (MNP 5)
protocol can double the data transmitted, and MNP 7 offers 3 to 1 compression.
CCCIT-sanctioned V.42bis can compress data 4 to 1 under the best conditions. If
your modem offers a choice between an MNP protocol and V.42bis, choose the
latter. In addition to having a better compression algorithm, it works better
with pre-compressed data streams.
Run the serial port at its maximum speed to gain the most benefit from
in-modem data compression. Usually this is 115200 BPS. Some modem's data
compression adds significant latency to data throughput, adversely affecting
interactive responsiveness between local and remote users. Experiment with
your modem and the type of data you transmit to find the best configuration.
MST PPP supports several other kinds of compression that work at different
layers of the communications stack. For more information on the following types
of compression supported by MST PPP, see the MST_PPP manual pages.
-
HDLC
Frame
-
Address, Control and Protocol Fields
-
Van Jacobson
TCP
Header
-
PPP
Link
-
Predictor-1
In addition to data compression protocols, Microcom, Inc. developed
error -correction protocols with similar names. Its MNP4 is one of two
major protocols for error correction. The other is Link Access Procedure for
Modems (LAPM). Many modems support one of the two, or both. Some manufacturers
have developed their own proprietary error-control protocols, but the
CCCIT V.42 standard requires a modem support MNP4 and/or LAPM to be
compliant or compatible with the standard. The receiving and transmitting
modems negotiate to discover the highest level of error- correction protocol
each can support.
Error correction verifies data that has traveled across the communications
connection. Noisy lines destroy data in transmission, especially when the
transmission is high speed. Depending on the protocol, bits, bytes or packets
are subjected to some form cyclical redundancy check to ensure the integrity
of the received data. The connection's receiving end informs the transmitting
end when the data has been damaged. The protocol used determines whether just
the corrupted data, or all data sent since the error was discovered, is
transmitted again. MNP 4 and later protocols can also respond to poor
transmission quality by causing the data to be shipped in smaller packets,
increasing the number of checks and decreasing the amount of data corrupted by
line bursts.
Flow control provides the modem a buffer for storing received data from the
system. This is beneficial because data transmission between the modem and
system or between two systems connected by a null-modem cable, is much faster
than transmission between modems. Flow control keeps system-to-modem data from
being lost during the modem-to-modem transmission.
Flow control can be provided by system software or modem hardware. Although the
MST PPP daemon's default status is no flow control, you should use one of the
two types if your system supports flow control. Given the option, choose
hardware flow control.
Hardware flow control is managed by the Request To Send (RTS) and Clear To
Send (CTS) signals. If you use hardware control, make sure a connecting cable
carries both signals. Indicate to MST PPP that you wish to use hardware flow
control by adding the option rtscts to the
pppd
command line. Some operating systems require using a special tty device to
enable hardware flow control. Use the option xonxoff to choose software flow
control. Another method for choosing flow control is to specify rtscts or
xonxoff in the
Devices
file.
If you configure for software control, make sure both ends of the PPP
connection have the 0x000A0000 bits turned on in their Async Control
Character Maps. This is the default for MST PPP. A computer and modem using
software flow control can talk to a computer and modem using hardware flow
control, but both ends must have the asyncmap set to accommodate software
flow control.
Most modems are intelligent and recognize commands sent to them by the system
during DTE to DCE transmission. Commands are different than signals exchanged
by the DTE and DCE, like RTS and CTS. Generally, signals indicate the state of
the DTE or DCE. Commands tell the modem to perform special tasks or modify
dialing procedures. Common commands cause the modem to answer an incoming call,
use touch-tone dialing, terminate the current connection, or pause before
sending the next number in a string. The modem recognizes system commands
because they are preceded by the characters AT. Therefore, the commands are
referred to as the AT command set.
Common
Commands
|
Description
|
A
|
answer incoming call; overrides S0 register
|
E
n
|
echo command; E0 disables echo to monitor; E1 enables echo
|
H
n
|
switch hook control; H0 hangs up; H1 goes on-line
|
O
|
switch from command mode to data mode
|
X
n
|
select call progress code set
|
&C
n
|
select Carrier Detect
option
|
&F
n
|
load factory setting number
n
|
&V
|
list modem's stored configuration files
|
&W
n
|
save current modem settings as
n
|
\N
n
|
select error control mode
|
\Q
n
|
select serial port flow control
|
S registers are settings stored in the modem's memory. The S register format is S
r=n
where
r
is the register's number and
n
is the register's value. For example, S0=1 indicates the modem should
answer an incoming call after the first ring. S7=30 tells the modem to wait
30 seconds after dialing before establishing a connection.
There are 256 possible S registers, although some are reserved and many are
not used at all. Each manufacturer has a proprietary license to use S
registers as it likes, but some registers are fairly consistent. Some are
shown in the table below, although there is no guarantee they will match your
modem's settings. The best advice is to review your system or modem
documentation to determine the meanings and values of your modem's S registers.
S Register
|
Description
|
S0
|
in auto answer mode, which ring to answer on
|
S1
|
ring counter
|
S2
|
escape character; default is +
|
S3
|
carriage return character; default ASCII 13
|
S4
|
line feed character; default is ASCII 10
|
S5
|
backspace character; default is ASCII 18
|
S7
|
seconds to wait after dialing to establish a connection
|
S9
|
tenths of seconds to wait before issuing carrier detect signal
|
S46
|
select error control and data compression
|
-
Choose the highest asynchronous serial speed both modem and computer can support
-
Enable
error correction
If possible, choose CCITT V.42 for compatibility with CCITT V.42bis data compression.
We recommend CCITT V.42 bis for higher maximum compression ratios and handling of pre-compressed data streams.
Note:
Although error correction and data compression are desirable features, they are the first features you should disable when diagnosing problems.
Use hardware instead of software flow control if possible.
-
Use default modem parameters for purposes outside PPP protocol, including other inbound applications
Try the following suggestions to configure bi-directional modems and to allow modem use by other applications, such as uucp, tip, cu and remote logins:
-
Set S0 register value at 1 to answer after one ring.
-
Lock the DTE interface to the selected speed. Many modems do not support a speed register, but you can store the current value with the &W command.
-
Disable modem printing of result codes when processing incoming calls. You may have to disable result codes, too. Start the dialer with ""ATE1 or its equivalent.
-
Set the modem to print extended result codes, like Busy, when dialing out. Better dialer performance is possible. Enter this in the
Dialers
file, if necessary.
-
Set the modem so it only asserts the Carrier Detect (CD) signal when the carrier is established with another modem.
-
Set the modem to disconnect the call and restore its saved values when the computer de-asserts the Data Terminal Ready (DTR) signal.
The file Dialers is installed in the /usr/lib/uucp directory. It
contains dialer descriptions for several
modems including register setup and switch setting summaries. You may
wish to create a
separate list of modem descriptions in a file
named Dialers.local. You can use the descriptions
from Dialers to guide you as you create entries in the Dialers.local file.
Entries in Dialers.local will take precedence over entries
in Dialers. See the
ppp.Dialers(MST_PPP) manual page for more
information about setting up dialer entries. Also see
"Configuring Modems" in Chapter 7 of the SCO Internet FastStart book.
Since your modems will likely be used for purposes besides PPP (such as
UUCP or interactive users), it's best to set their default parameters to
accommodate dial-in applications and have outgoing UUCP or PPP dialers
change them if necessary. The PPP-specific register settings in Dialers
or Dialers.local ensure that an otherwise general-purpose modem
will work as well as possible with MST PPP, for the duration of the PPP session.
In the next section, you will find some suggestions for Telebit modem
settings which have worked well during Morning Star's testing procedures. The
examples here show the complete register settings for a Telebit T1600 and a
description of what the settings accomplish. Following this information are
some command strings which will provide the proper register settings for
Telebit's T1600, Qblazer, and T3000 modems. Most modems should provide
equivalent settings. Check your user guide for help in composing the command
string for similar settings.
During testing, we used the following commands to configure settings for a trio of Telebit modems and discovered the settings work quite well.
T1600: at &f s0=1s7=120s48=1s51=6s58=2s59=15s61=0s63=2tq2x12&c1&d3&s1 &w
T3000: at &f9 s0=1s7=120s48=1s51=6s58=2s59=15s61=0s63=1tq2x12&c1&d3&s1 &w
Qblazer: at &f s0=1s7=120s48=1s51=6s58=2s59=15s61=0s63=2tq0x4&c1&d3&s1 &w
The commands produced the following list of settings for the Telebit T1600. The list is the output from the command AT&V.
at&v
T1600 - Version LA1.00 -Active Configuration
B1 E1 L0 M0 Q2 T V1 X12 Y0
&C1 &D3 &G0 &J0 &L0 &Q0 &R3 &S1 &T4 &X0
S000:1 S001=0 S002=43 S003=13 S004=10 S005=8 S006=2 S007:120
S008=2 S009=6 S010=14 S011=70 S012=50 S018=0 S025=5 S026=1
S038=0 S041=0 S045=0 S046=0 S047=4 S048:1 S050=0 S051:6
S056=17 S057=19 S058:2 S059:15 S060=0 S061:0 S062=15 S063:2
S064=0 S068=255 S069=0 S090=0 S093=8 S094=1 S100=0 S102=0
S104=0 S105=1 S111=255 S112=1 S180=2 S181=1 S183=25 S190=1
S253=10 S254=255 S255=255 OK
The table below shows the features and S register values set by the T1600
commands. Many of these settings, particularly the S registers, only apply to
Telebit modems. However, your own modem will likely respond to a different
command or register value in the same way the T1600 does to these. Use your
modem's command set and register semantics to set features like RTS/CTS
hardware flow control. Refer to
Dialers
for descriptions of several more modem configurations.
Command
or setting
|
Result
|
&f
|
load factory default settings
|
s0=1
|
answer after one ring
|
s7=120
|
wait 120 seconds for a valid carrier tone to be sent from the remote modem
|
s48=1
|
compare all eight bits when checking for control characters
|
s51=6
|
latch the DTE interface at 38400 BPS
|
s58=2
|
use full-duplex RTS/CTS flow control so the modem sends data to the DTE when RTS is on and will not send data to the DTE when RTS is off
|
s59=15
|
use the following result code suffixes:
Possible link protocol suffixes: nothing, REL, or LAPM
Possible compression suffixes: nothing or COMP
|
s61=0
|
local reaction to a break signal on the serial interface is the same as specified in S63
|
s63=2
|
discard buffered data and send the break signal when a break signal is transmitted by the local DTE during an error controlled connection
|
q2
|
report result codes when originating a call, but do not return result codes when answering a call
|
t
|
use DTMF tone dialing
|
x12
|
result codes include the following: BUSY, DIALING, ERROR, NO CARRIER, NO DIALTONE, OK, RING, RRING, CONNECT 300, CONNECT 1200, CONNECT 2400, CONNECT 4800, CONNECT 7200, CONNECT 9600, CONNECT 12000, CONNECT 14400, CONNECT 19200, and CONNECT 38400
|
&c1
|
turn ON the DCD signal when a remote modem carrier is detected and turn DCD OFF when the carrier is dropped
|
&d3
|
recall the current user configuration parameters from nonvolatile memory and enter command mode when the DTR signal is switched from ON to OFF
|
&s1
|
turn DSR ON after the answer tone is detected and leave it ON throughout the connection
|
&w
|
save the current configuration settings to nonvolatile RAM
|
In addition to in-modem data compression, Morning Star PPP supports compression at several different layers of the communications stack.
The PPP frame format is based on the established HDLC
format. Synchronous PPP links almost always use the full PPP/HDLC frame because the links' hardware supports it, but lower-speed asynchronous links typically handle framing in software and several of the fields carry the same contents in each message. Therefore it makes sense to amend the full HDLC frame for asynchronous PPP.
A full PPP frame contains the HDLC ALLSTATIONS value (0xFF) in the Address field, and the HDLC unnumbered Information value (0x03) in the Control field. These fields are unnecessary because they always carry the same information and increase the latency of a low-speed link. During the Link Control Protocol phase, asynchronous PPP links usually negotiate to drop both fields. When the LCP layer is opened, the fields are not transmitted in PPP frames.
The two-octet PPP Protocol field in an asynchronous PPP frame tells the receiving PPP whether the incoming frame carries an IP network datagram, a Link Quality Report, a link option (re)negotiation, or any of several other types of data. Though option negotiations and other link-level traffic always require two octets, most of an established link's traffic is network-layer (e.g. IP) datagrams. PPPs network-layer protocol field values always place a null octet (0x00) before the octet that distinguishes IP (0x21) from Appletalk (0x29) datagrams. That octet almost always contains the same value (0x00), and asynchronous PPP links usually negotiate it away to reduce latency.
Each layer a TCP
/IP
datagram passes through adds a header to the user data. For example, many streams can potentially pass between two hosts. Therefore, in addition to its source and destination addresses, each packet contains a tag to identify which stream it belongs to. These headers are very large, and a comparison between successive packets reveals strong similarities.
RFC 1144 "VJ" TCP header compression reduces the packet header size by transmitting only the header segments that change from one packet to the next. TCP and IP header overhead is reduced from over 40 octets to as few as 4. TCP header compression has a dramatic effect on interactive responsiveness over low-speed links, because it reduces a typical single-character telnet or rlogin packet from over 40 octets to 5 or 6 octets. It has a much smaller effect on batch data throughput, like X bitmap displays, or FTP or rcp file transfers. That sort of data flows in much larger packets. Reducing frame size from 1500 to 1460 octets produces a much smaller percentage improvement than a reduction from 45 to 5 octets.
The option vjslots followed by a numerical value between 3 and 256 sets the number of compression slots for Van Jacobson compression. The default is 16 slots.
TCP header compression is enabled by default on async PPP and SLIP links, and disabled by default on synchronous PPP links.
Like in-modem data compression, PPP link compression reduces the amount of data that must flow across a low-bandwidth telephone line, thus increasing its effective bandwidth. Since PPP link compression in pppd is performed on the UNIX system, less data flows across the serial interface. This is advantageous in the following situations:
-
the host's serial interfaces are incapable of high asynchronous data rates.
-
the host's inefficient serial I/O subsystem causes an onerous interrupt load on the host processor.
-
two computers are directly connected and there are no modems to compress the data.
-
The modem or CSU/DSU communication device doesn't support data compression.
PPP link compression over modems that support V.42bis compression may provide no performance advantage, except in cases where the link's bandwidth is limited by slow serial interfaces.
Predictor-1 compresses typical binary data 1.5:1, absorbs relatively little of the host's CPU, and adds very little latency to interactive traffic. It's well suited to wringing even better performance from higher-speed synchronous PPP connections.
The Stac LZS algorithm for data compression is an IETF
compression standard for PPP. The algorithm can maintain
an average 2:1 compression ratio and, depending on the type
of data that's being compressed, the ratio may be as high
as 3:1 or 5:1 . The Stac LZS algorithm is based on the Lempel-Ziv
algorithm and is the same as that used in Stac Electronics retail software.
Although most implementations of PPP occur over asynchronous dial up connections, PPP can be used for synchronous transmission over high-speed serial interfaces. It can also be used on dedicated line s and constantly open telephone lines. The latter is a dial up connection, but it is not on-demand.
Morning Star PPP can run in synchronous mode using a high-speed serial interface at line speeds up to T1 (1.544Mb/s). To prepare your UNIX system to use a high-speed interface, follow the instructions in the hardware installation guide.
If you use MST PPP over an interface like MSTs SnapLink, connecting in synchronous mode at T1 speeds to another host or router using port 0 and emulating SCSI disk device 2 on its own SnapLink, use a /usr/lib/mstppp/Systems entry like this:
hostname Any;5 rsd2a/0 1536000
The Devices entry looks like this:
Direct rsd2a/0 1536000
Use pppd's dedicated argument if the PPP
implementation uses asynchronous serial connections that are always
available. These connections often use high-speed asynchronous
short-haul modems over a building or campus wiring plant.
dedicated instructs pppd to never give up on the
connection. If the peer tells pppd to disconnect, pppd
will continuously attempt to reconnect and connectivity is reestablished
as soon as possible if one end of the link goes down.
If there is a fatal disconnect, through LQM failures or loss of the Carrier Detect
signal, pppd closes the device and consults the Systems file
to find another entry matching the peer's name on the pppd command
line. If no additional entries exist, then pppd waits for the call retry
delay to pass and tries the original connection again. Normally, no
getty or login process is run on a dedicated line device
and both ends of the circuit actively try to connect to their peer. Each
machine's Autostart script should contain aline like:
pppd local:remote auto dedicated
The Systems file should specify a device name like tty1a in the
"device" field. "ACU" (for Any Call Unit) should not be used. For example:
remote Any tty1A 38400 0
The Devices file should contain a line like:
Direct tty1a 38400 rtscts
The Dialers file is not consulted when "Direct" is found in the "dialer" field of the Devices file.. See the discussion below regarding line failovers and using an auto-dial modem as a backup link.
The Automatic Failover option is a dial-up backup that maintains connectivity
so that IP traffic can continue when a synchronous or dedicated
asynchronous connection is dropped. User services will continue even
if the dedicated line becomes unavailable, although the user
may notice the link is slower.
To set up the dial-up connection, add an entry referencing a dialup modem
after the entry for the dedicated link in the Systems file. The added
line might look like the following:
remote Any ACU 19200 5551212 in:--in: pppback word: password
You also need an entry in the Devices file that accesses a device
the modem is attached to. Instead of using "Direct" in the "dialer" field,
substitute a dialer entry for your modem. For example:
USR-SPORTSTER tty1A 19200 rtscts
In this example, the Dialers file would have a "USR-SPORTSTER"
dialer entry to use to dial out. The modem would be attached to a
serial port which is accessed through device "tty1A" with a DTE speed of 19200.
By default, pppd asks the peer to send LCP Link-Quality-Report
messages. When the dedicated line fails, pppd stops receiving the
reports. pppd terminates the connection when the lack of Link
Quality Reports drives measured link quality below the configured
threshold. After unsuccessfully attempting to reestablish the connection
on the same line, pppd automatically fails over to the second entry in
the "Systems" file, and uses the modem to dial up and reestablish IP
traffic. Note that if the dedicated connection is restored, you must manually
cause the dialup modem to hangup the line. Then pppd attempts to
reconnect using the next entry in Systems file, or, if no additional
entries exist, pppd will wrap around to the first entry in
the file which is the dedicated connection .
Some PPP connections are always up. The system doesn't use pppd s on-demand dialing to reestablish a link for new traffic. This is not the same as using a dedicated line, because modems on constantly open connections must be dialed, or a login negotiated, before PPP frames can be exchanged. In the "constantly up " situation, use the up argument on pppd s command line. Up instructs pppd to make every effort to keep the connection up. For example, when the connection goes down, pppd will immediately redial the modem, rather than waiting for traffic demand. Don't use the up and idle arguments together.
MST PPP has been tested successfully with several other PPP implementations, routers and
terminal servers, including those shown in the alphabetical list below. MST PPP also runs successfully in SLIP mode with SLIP implementations in several types of terminal servers, PCs, LAN probes, Macintoshes, and other workstations
Following the list is configuration information which may be useful if your users connect to systems using some of these applications or hardware. The first section on configuration deals exclusively with Telebit( NetBlazer hubs, the second with PPP implementations, and the third with routers.
- 3Com( NETBuilder
- Brixton Systems BrxPPP
- Cisco AGS and CGS
- Free Perkins/Clements/Fox/Christy UNIX( system-base PPP
- FTP Software PC/TCP
- HP( LanProbe SLIP
- KA9Q
- Merit PPP servers
- Network Application Technology LANB-820
- Novell LAN WorkPlace for DOS(
- Proteon cnx500
- SCO( PPP
- Telebit NetBlazer
- Xylogics Annex-3
- Xyplex terminal servers
Telebit's NetBlazer software, version 1.41x11, has been successfully tested with MST PPP. Try this adjustment if your NetBlazer runs an earlier release: put novjcomp on the pppd command line.
Using NetBlazer in a LAN Hub or ISP POP
This extensive information about Telebit NetBlazer software provides insight into workstation and hub configurations for inbound and outbound connections between UNIX stations and NetBlazer hubs.
Configuring the NetBlazer to receive the call
This configuration can occur when several remote workstations dial into a NetBlazer serving as a hub for a LAN, or when connecting a remote workstation or LAN to the Internet through an IP connectivity vendor's NetBlazer point of presence (POP). The NetBlazer may be set up as if the UNIX machine were just another remote "dynamic-interface" NetBlazer, using the PPP encapsulation protocol in "packet mode".
- Configure the NetBlazer as described in chapter 3 of the NetBlazer Reference Manual, noting particularly the discussion of the ipdial command in the section on Setting Up Remote IP Destinations.
- Enter the UNIX system name when asked for the 'Name of dial IP interface to add'. MST PPP's authentication mechanisms have not been tested with the NetBlazer's 'crypto handshake'.
- Use PPP rather than SLIP.
- Specify 1500 for the MTU.
- Make note of the password when asked to enter the UNIX system's dial -in user's password. It must be included in the UNIX station's /usr/lib/mstppp/Systems entry describing how to dial into this NetBlazer.
Configuring the UNIX system to dial the call
- Use the UNIX system's name for the username provided by the login portion of the /usr/lib/mstppp/Systems file chat script.
- Use the password provided when establishing the NetBlazer's dial-in user, above.
- Use the $PPPHOME/Autostart shell script to start the MST PPP daemon, just as you would when calling another MST PPP site. $PPPHOME/Autostart is called from /etc/rc2.d/S89mstppp at boot time.
Configuring the NetBlazer to dial the call
This arrangement works if a hub NetBlazer needs to connect to several remote workstations on demand.
- Add the following entry to the NetBlazer's CHAT.TXT file:
#For a UNIX system running Morning Star Technologies PPP
#no crypto challenge/response, longer timeouts, short
#expect strings login shell script must 'echo Packet mode
#enabled' before 'exec pppd'
:unix
e1,20,30,2,in:
u2,5,100,3 s3,5,100,4,\r
e4,10,30,5,word:
o99,Packet mode enabled
p5,5,100,6
s6,5,100,7,\r
e7,20,30,99,Packet mode enabled
o32,in:
s30,5,100,31,\r\r
e31,20,100,32,in:
u32,5,100,33 s33,5,100,34,\r
e34,10,100,35,word:
o99,Packet mode enabled
p35,5,100,36
s36,5,100,37,\r
e37,20,100,99,Packet mode enabled
o100,in:
r99,0
r100,1
#
- Reboot the NetBlazer to cause any CHAT.TXT changes to take effect.
- Specify "unix" for the chat script, rather than the default "ics" when configuring NetBlazer's dynamic interface to call the UNIX system as described above in Configuring the NetBlazer to receive the call.
Configuring the UNIX system to receive the call
The following changes must be made to a UNIX system running MST PPP to accommodate inbound calls from a NetBlazer:
- Find an entry in /etc/gettydefs that sets up the serial port for 8 data bits and no parity2 .
Note: This parity change will adversely affect some users with other machines and other applications who attempt to dial into this port. Future releases of the Netblazer software may include the ability to talk to atypical 7-bit UNIX getty. If so, using an 8-bit gettydefs entry would be unnecessary and all normal UNIX dial-ins would work as expected. Check your NetBlazer documentation for more information.
- Then use that entry in your /etc/inittab file and /etc/conf/init.d/sio file. For example the 6 used below is an entry in the /etc/gettydefs file that uses an 8-bit word length at 9600 baud.
Se1A:234:respawn:/etc/getty tty1A -t60 6
- Create $PPPHOME/Login-netblazer, the NetBlazer connection 's login shell script, by following the example shown below. The login shell script must tell the NetBlazer 'Packet mode enabled' before the connection's PPP LCP option negotiation phase starts.
#!/bin/sh
PATH=/usr/lib/mstppp:/usr/bin:/etc:/bin
mesg n
stty -tostop
echo Packet mode enabled
exec pppd 'hostname': idle 130 rtscts
- Make sure it is executable:
# chmod 755 /usr/lib/mstppp/Login-netblazer
If the NetBlazer hangs up, it might be receiving too much text from the UNIX system before it sees the 'Packet Mode Enabled' welcome message. Keep that 'user' from seeing the /etc/motd by entering the command shown below where netblazer-login is the name of the NetBlazer's entry in the UNIX system's passwd database:
# touch ˜netblazer-login/.hushlogin
Several PPP implementations for UNIX systems are freely available, though not in the public domain. Many are based on work by Drew Perkins, Greg Clements, Karl Fox, Greg Christy, and other maintainers and contributors. They seem to share a common bug, as discussed in the section on Link Quality Monitoring above:
- Specify echolqm on the pppd command line or your link will be terminated within one minute of connection.
This section includes information about preparing a UNIX system for an inbound DOS PC and vice versa.
FTP Software's PC/TCP PPP (PC-227) versions 2.10 and 2.11 interoperate with MST PPP with some adjustments.
- Specify nolqm on the pppd command line. These versions of PC/TCP PPP do not correctly Configure-Reject LQM during LCP negotiations.
FTP Software's PC/TCP PPP version 2.05 requires these adjustments to interoperate with MST PPP:
- Specify both rfc1172-addresses and nolqm on the pppd command line.
Getting a UNIX system ready to receive a call from a DOS PC
- Specify the UNIX system's and the PC's IP addresses in the PC's login script.
- Specify passive, which will smooth the option negotiation process.
- Specify nolqm if the PC/TCP predates version 2.2.
- Do not specify an idle timer. PC/TCP can't re-open a timed-out connection.
Getting a DOS PC ready to dial into a UNIX system
Configure the PC as described in FTP Software's manual. No special arrangements are required to talk to a UNIX system running Morning Star PPP.
The Hewlett-Packard( HP( 4995A LanProbe II/Ethernet SLIP implementation interoperates with MST PPP running the SLIP option if you make this adjustment:
- Specify extra-slip-end on the pppd command line.
KA9Q NOS PPP for MS-DOS( interoperates with MST PPP with this adjustment:
- Specify nolqm on the pppd command line. Without this option, your link will be terminated within one minute of connection.
The PPP implementation included with SCO( TCP/IP version 1.2, which is also part of SCO Open Desktop( 2.0, interoperates with MST PPP with this adjustment:
- Specify asyncmap 0xffffffff on the MST pppd command line. SCO's PPP doesn't comply with RFC 1548's second full paragraph of section 5 and the associated Implementation Note.
SCO Open Desktop 3.0 with TCP/IP 1.2.1 solves the above problem. However, different adjustments must still be made:
- Specify either echolqm or nolqm on the MST pppd command line. SCO's PPP by default doesn't respond with a Configure-Reject during LCP negotiations.
- Handle IP addresses in one of the following two ways:
- Instruct the SCO PPP to send its IP address during IPCP negotiations
- Specify rfc1172-addresses or both the local and remote IP addresses on the MST pppd command line.
MST PPP interoperates with the Livingston Portmaster 2e terminal serverdial-up router. Use no special measures for the UNIX system to dial into the Portmaster. Portmaster's Login script for dialing into the UNIX system should resemble this:
#!/bin/sh
PATH=/usr/bin:/usr/etc:/usr/ucb:/usr/bsd:/etc:/bin
mesg n
stty -tostop
echo PPP
exec pppd 'hostname': idle 300 rtscts
MST PPP interoperates with Network Application Technology's LANB-820 router.
- You must specify the nomru, nomagic, noipaddress, and nolqm options on the pppd command line, or the NAT router will send malformed LCP Configure-Ack messages to MST PPP.
MST PPP Interoperates with version 4.1 of Novell's Lan WorkPlace for DOS.
- It appears that you must specify both the UNIX system's IP address, as well as the PC's IP address, on the MST pppd command line.
- Negotiations will progress a little faster if you specify rfc1172-addresses as well.
MST PPP interoperates with the Proteon cnx500 router, if the cnx500 is running software load 'V12.0c [PPP fix]', 12.1, or release 13.
MST PPP interoperates with the Xylogics Annex-3 communications server running v7.0.10beta of the Annex firmware.
- You must specify rfc1172-vj on the pppd command line, or your interactive responsiveness will suffer.
MST PPP interoperates with Xyplex terminal servers running PPP.
- You must specify either echolqm or nolqm on the pppd command line unless the Xyplex terminal server is running software "special" version V5-0-1S19.
The MST PPP daemon has nine sets of configuration options for fine-tuning PPP communications. The sets include over eighty different selections that affect daemon management, communications, link management, Internet Protocol, authentication, encryption, compression, logging and signaling. pppd running on most links is basic, defined by a handful of options, but the number of ways configuration can be tweaked means each daemon can be remarkably different, or merely personalized by a minor change of options.
This section addresses some of the more common, yet useful, options and reasons you might add them to the pppd command line. Most, like the active, passive, and idle timer options, control some aspect of link management. One important pppd option, filter, is discussed at length in the section on security later in the manual. Beyond this discussion of options for link management are short sections on synchronous PPP connections, MST PPP-supported compression options, and IP address assignment.
Link management options define how PPP establishes, maintains, and monitors a communications link. These factors, and the condition of the link, help PPP decide when to bring a link up and down in situations other than on-demand dialups.
MST PPP, like most PPP implementations, expects to actively initiate the negotiation process. By default, when a line is connected, pppd immediately sends PPP messages, anticipating that a PPP implementation on the other end is ready to negotiate. In auto mode, this directly follows completion of a Systems chat script login procedure. When pppd is not in auto mode, messages are sent when the daemon starts.
This is an example of the pppd command line for outbound passive connections:
pppd hostname:peer
auto passive
The default behavior works correctly in almost all situations. However, sometimes it's better to let the other end send its messages first when calling another system's dial up modem. A few PPP implementations get confused when a peer speaks first and negotiations may be slow if both ends are active. In these situations, assign pppd the passive option. The passive option makes pppd wait until the other end communicates before it sends messages.
Inbound
When a PPP that gets confused by the other end's active negotiations dials an MST PPP system, it would be wise to make the calling pppd passive if possible. However, if it is not possible, negotiations may proceed faster if the Login script invokes the passive option on the receiving pppd.
The idle option allows you to limit the number of seconds that can pass without receiving or transmitting the type of packets specified in the filter file's keepup field. The timer shuts down the link when the specified number of seconds elapse. The idle option works on both the calling and the answering pppd . If both have the idle option set, the end that specifies the shorter interval shuts down the line first. The default is to never shut down.
Don't invoke the idle option when pppd is talking to a system running PPP software that does not implement on-demand auto-dialing. The session may not stay intact if the link is taken down by the idle timer. These systems include those running most free PPP implementations, or MS-DOS PCs running FTP Softwares PC/TCP. When the other end is running MST PPP the session will remain when the idle timer takes the link down.
The two criteria for determining idle timer values are:
-
the cost of maintaining a connection
-
the scarcity of resources
Set a relatively brief idle timeout for the system placing a call if the connection carries a monetary cost per minute e.g., a long-distance telephone call. On the other hand, if the telephone billing scheme is based on the number of calls rather than their duration, set a longer idle timer, or none at all, on the calling system's pppd. Keep in mind that it can take 25 seconds or more to allocate a modem, dial out, complete the call, login to the remote system, and negotiate PPP connectivity. The minimum idle timer setting should be 30 seconds to accommodate the connection and negotiations. All ABORT and TIMEOUT strings must be written with the same thought in mind.
Set a relatively brief timeout for an answering system if it has too few modems to accommodate a large number of incoming connections. The answering system might also benefit from a shorter idle-timeout value if it acts as a hub and provides its services via a toll-free WATS (800) number. On the other hand, if it provides its services via a 976 or 900 number scheme, you may not want to specify any timeout interval since each unit of connection time increases the answering system's revenue.
The exec option invokes a command or shell script when a link is brought up or taken down. Exec can be used on the link's calling or answering end and the command or shell script is executed immediately when the link's state changes.
exec arguments
The first argument of the command or shell script invoked by exec is either "up" or "down". The second argument is the peer's IP address. exec's third and subsequent arguments are those with which pppd was invoked.
Security
pppd runs suid root and anything specified in the exec script is run as root. This can be a risk if mismanaged. Take appropriate security precautions with the exec script so it cannot be modified by non-root users.
Parent environment and session variables
The entire parent environment is exported to exec scripts. You should attempt to make the environment as small as possible because the environment will take up space for each pppd that is running. The script may also use variables that pppd sets that describe the current session. These variables include:
- VARIABLE
- DESCRIPTION
- PPPHOME
- AS YOU'D EXECT, BUT ALWAYS SET
- PPP_COMMANDLINE
- ALL ARGUMENTS FROM THE ORIGINAL COMMANDLINE
- PPP_LOCALADDR
- LOCAL ADDRESS OF LINK WHILE UP (NEGOTIATED)
- PPP_REMOTEADDR
- REMOTE ADDRESS WHILE UP
- PPP_NETMASK
- NETMASK WHILE UP
- PPP_ORIG_LOCALADDR
- ORIGINAL LOCAL ADDRESS (FROM COMMANDLINE)
- PPP_ORIG_REMOTEADDR
- ORIGINAL REMOTE ADDRESS
- PPP_ORIG_NETMASK
- ORIGINAL NETMASK
- PPP_INTERFACE
- NAME OF PPP INTERFACE (DUX)
- PPP_DEVICE
- NAME OF DEVICE BEING USED FOR SERIAL STREAM
- PPP_LOGFILE
- SELF EXPLANATORY
- PPP_ACCTFILE
- SELF EXPLANATORY
- PPP_AUTHNAME
- PEER NAME IF CHAP/PAP IS USED, ELSE "NAME" PARAMETER FROM COMMANDLINE, IF GIVEN, ELSE USERNAME OF USER THAT STARTED PPPD
- PPP_PID
- PPPD USER PROCESS PID
- PPP_SHUTDOWN
- SHUTDOWN REASON IF LINK IS GOING DOWN AND A SHUTDOWN REASON IS AVAILABLE, ELSE NON EXISTENT
Example
This example uses a Login shell script to invoke an executable shell script called $PPPHOME/Exec that causes sendmail to run its queue whenever a remote system establishes a connection, possibly triggering a delivery to the remote system.
Login shell script
#!/bin/sh
PATH=/usr/lib/mstppp:/usr/bin:/etc:/bin
PPPHOME=/usr/lib/mstppp
export PPPHOME PATH
mesg n
stty -tostop
exec pppd 'hostname': idle 130 rtscts exec $PPPHOME/Exec
Executable shell script $PPPHOME/Exec
#!/bin/sh
case "$1" in
up) echo link is up at 'date' > /dev/console ;
/usr/lib/sendmail -q < /dev/null ;;
down) echo link is down at 'date' > /dev/console ;;
esac
If you must link with a peer host that can't use the Point-to-Point Protocol, use the Serial Line Internet Protocol (SLIP) option. SLIP, a non-standard but popular protocol, is really only a framing convention for arranging IP packets on a link. Many other MST PPP pppd options are available when running the SLIP option. Automatic dialing, idle line hangup, packet filtering, the exec option, and most other management facilities can be invoked in conjunction with SLIP.
However, SLIP provides few of the PPP protocol's advanced facilities. Pppd invoked with the SLIP option cannot provide the following:
-
LCP and IPCP negotiations
-
PAP and CHAP authentication
-
Link Quality Monitoring
-
Asynchronous Control Character Mapping or the escape option
There are connection restrictions when running pppd with the SLIP option:
-
Links must be Asynchronous
-
Cannot be used with the HDLC 14 device driver
-
Connections must be completely transparent to all 8-bit character values
-
Flow control selection must be hardware or no flow control at all
-
Link must not interpret passing data as flow control
Unlike PPP, SLIP cannot perform IPCP negotiations. Therefore, a SLIP connection cannot be assigned an address by a peer at connection time. PPP can use tilde (~) in the pppd command line for this purpose. To obtain a similar "feature" a remote side SLIP connection must provide the IP address during the connection process and a new local address must be obtained using the /usr/lib/mstppp/Systems file "\A" chat script feature.
The /usr/bin/mstppp/Login script can tell the peer its address textually, just before invoking pppd, if you include something like this in the script:
#!/bin/sh
localaddr=`calculate`
peeraddr=`calculate`
echo my address is $localaddr and your address is $peeraddr
exec pppd $localaddr:$peeraddr slip idle 120 rtscts...
The incoming peer is responsible for parsing the "my address is" line, and doing something sensible with the addresses it finds there.
If you specify vjcomp and SLIP as pppd options, pppd will always use RFC 1144 "VJ " TCP header compression with the default 16 slots. This is useful for talking to `CSLIP', a SLIP protocol that allows compression. By default, pppd running with the SLIP option does not use "VJ' header compression, although it will start sending VJ-compressed packets if it first receives VJ-compressed messages from its peer. Header compression can be completely disabled with the novjcomp option. SLIP's default MRU and MTU (maximum receive unit and maximum transmission unit) are 1006.
You can use Morning Star PPP in its SLIP framing mode to dial into a Cisco Systems terminal server. Since the SLIP protocol supports no option negotiations, Cisco terminal servers print the incoming system's IP address in text on the serial line, before beginning the SLIP protocol. pppd parses when the `\A' token is inserted in the `expect' phase of the / usr/lib/mstppp/Systems file chat script. The daemon passes the assigned address to the UNIX end of the point-to-point networking interface. See /usr/lib/mstppp/Examples/Systems.ex for an example use of this facility.
koko
The Link Quality Monitoring option is defined in the PPP protocol specification. When the PPP implementation supports LQM, PPP can make policy decisions based the observed quality of the link between peers.
When LQM is invoked, pppd requests that the other end of the connection send Link Quality Report (LQR) packets back to the pppd . If the link goes down or is degraded, many, or all, of the LQR packets will be lost. This also indicates that data packets have been lost and the connection is too bad to warrant continued traffic. pppd counts the arriving LQRs, and if too many have been lost, pppd closes the connection. Link Quality Monitoring packets do not count against an idle line disconnection timer, since they are part of the Point-to-Point Protocol rather than user data.
Pppd bases its evaluation of the link status on the arguments of two associated options, lqinterval and lqthreshold. The value of the lqrinterval option tells pppd how often to request LQR packets from the peer machine. The default value is every ten seconds, or five per minute allowing for timing slop. Lqthreshold's argument is the minimum acceptable link quality. The default lqthreshold is one out of five packets. With the default values in place, the link will shut down if no LQR packets arrive during the previous minute.
The default LQM behavior, one successful packet out of five sent every minute, is fairly permissive. Pppd will be more demanding about line quality if you change the defaults. Either evaluation setting can be changed to make LQM more stringent. For example, you can demand that at least one LQR arrive per minute by specifying:
lqrinterval 5 lqthreshold 1/12
Or, you can demand that no more than one LQR be lost each minute by specifying:
lqrinterval 5 lqthreshold 11/12
pppd
will discover line failures more quickly if you decrease the lqrinterval because LQR's will arrive more frequentl. However, sending more LQR's, increases monitoring traffic, slowing down the transfer of user data. So you should remember to also consider raising the lqthreshold. If the lqthreshold is
lqthreshold 5/6',
no more than one LQR can be dropped per minute. If two LQRs in a row are dropped, pppd shuts down the line.
LQM is particularly useful for detecting and responding to total link failures. The response can include failover protection which switches the connection to an available dialup modem. Most total failures, e.g. a backhoe digging through the telephone company's cable, cause the connection's CSU/DSU or modem to de-assert the Carrier Detect signal. Pppd observes this as a hangup event.
But some failure modes, like misconfigured flow control and over-reliance on in-band XON/XOFF flow control, leave modems connected even though the PPP peers are unable to communicate. In this situation, the peers will observe a LQM failure and take appropriate action, usually disconnecting and redialing. LQM is also useful if an intercontinental telephone connection is of such poor quality that significant numbers of packets are damaged in transit. Again, the PPP implementations can decide, based on LQM measurements, to hang up and redial in hopes of getting a better connection. This is a very rare occurrence if your modems provide V.42 or MNP4 error correction,
but it does occasionally happen. Whatever the cause, the disconnection and redial operation can happen without user intervention or application awareness, because even if PPP frames are damaged or lost, the upper protocol layers will arrange for retransmission as needed to provide the user with a complete data stream. The user will simply experience a pause while the modems reestablish the connection.
If, during LCP option negotiation, the peer refuses to send Link Quality Reports, pppd will instead begin sending LCP Echo-Request messages at the requested lqrinterval and use the arriving LCP Echo-Response messages to make the link quality decision. If the peer doesn't correctly use a LCP Configure-Reject message to tell MST PPP to switch to LCP Echo-Requests, MST PPP can be given either the echolqm argument, to dispense with the negotiation phase and begin directly with Echo-Requests, or the nolqm argument, to disable link quality monitoring completely. At pppd's debugging verbosity level 4, the log file will receive summary messages like this:
5/7-13:45:27-1514 LQM: Pkt: 1/1 Oct: 53/53 LQRs: 5/5
This means that, during the last testing interval, this system transmitted one packet and received one packet. 53 octets crossed the link in each direction. And this system has received responses to all five of the most recent five Link Quality Report s it sent. The LQR packet is 36 octets long, and the default lqrinterval of ten seconds will cause the additional traffic to be unnoticed on most connections. However, if the application is very sensitive to speed and requires absolutely every bit of available line bandwidth, use the nolqm argument to disable Link Quality Monitoring.
The UNIX host's IP implementation sees MST PPP as a point-to-point network connection between two known addresses. If neither end-point resides on an IP-based local area network (LAN), packets will simply flow in both directions as soon as the PPP connection is established. When the PPP link connects a remote host to a LAN, or provides a connection between two LANs, or connects a host or a LAN to the worldwide Internet, the systems involved must be concerned with routing.
The examples below describe how to establish static routes when the machines boot. This is cumbersome, because any topology change requires that all machines even remotely involved must be reconfigured by editing their boot-time shell scripts. An alternative to static routes would be to use some automated system for updating all the hosts routing tables. This is usually implemented as a daemon running on all the hosts involved. Many networks use the RIP protocol and run in.routed on their UNIX systems. If you use in.routed to propagate routing information, you'll need to create a file called /etc/gateways (as described in routed(8)) on the system running pppd, and specify the PPP link as leading to a passive gateway.
Some sites prefer other routing protocols, and they use the Gate Daemon instead. If you use gated , you should invoke pppd with the netmask argument set to the same value as used on the LAN, if that subnet mask is different from the default for the class of your network.
There are two conventional approaches for connecting a set of standalone hosts to a LAN via PPP.
The method that will cause the least confusion is to assign a network or subnet for use by all the remote machines. For example, suppose the organization's class B network number is 134.19, and they are subnetting with a class C-sized network mask of 0xffffff00. The departmental LAN is subnet 134.19.5.0, populated by hosts alpha (134.19.5.22) and bravo (134.19.5.41). A modem is attached to one of alpha s serial ports, and alpha's Login shell script is the generic one described above. A laptop named nomad wishes to connect to the network.
Designate subnet 6 for remote machines. Assign nomad the IP address 134.19.6.17. The MST PPP daemon on nomad would be started in the PPPHOME/Autostart script.
pppd 134.19.6.17:134.19.5.22 auto idle 180
or, if all the names can be found in the local /etc/hosts (or resolved via NIS/YP, NetInfo, the Domain Name Service, or some other mechanism without first needing to bring up the PPP link), it could look like
pppd nomad:alpha auto idle 180
The next line in nomad's $PPPHOME/Autostart would set up an IP route through the dial-in gateway:
route add net 134.19.0.0 134.19.5.22 1
Alternatively, and necessarily if the LAN were also connected to the Internet:
route add default alpha 1
Similarly, the PPP daemon on alpha would be started as:
pppd alpha:nomad auto idle 180
bravo's /etc/rc2.d/P88USRDEFINE would contain a line like:
route add net 134.19.6.0 alpha 1
The Proxy ARP daemon can be used in a subnetted environment to accommodate hosts with older IP implementations that don't work correctly with subnetting. Suppose, in the `Separate Network' example above, the host bravo were running an older IP implementation. To enable bravo to find its way to nomad, one could run a proxy arpd on alpha and provide it the following proxytab configuration file:
#Proxy ARP table for proxyarpd
#Service provided for hosts on 134.19.5.0 that do not understand
#internet subnetting.
#
#Fields are:
#1)interface to service (same as on command line)
#2)net to tell attached hosts that we "are"
#3)host on net 1) to send traffic to (gateway)
#
le0 134.19.6.0 134.19.5.22
If a separate subnet number is unavailable for use by remote-access machines, it is possible to assign them addresses on the same subnet number as the departmental LAN. As above, suppose the organization's class B network number is 134.19, and they are subnetting with a class C-sized network mask of 0xffffff00. The departmental LAN is subnet 134.19.5.0, populated by hosts alpha (134.19.5.22) and bravo (134.19.5.41). A modem is attached to one of alpha's serial ports, and alpha's Login shell script is the generic one described above. A laptop named nomad wishes to connect to the network.
Assign nomad the IP address 134.19.5.114. The MST PPP daemon on nomad would be started in the $PPPHOME/Autostart script.
pppd 134.19.5.114:134.19.5.22 auto idle 180
or, if all the names can be found in the local /etc/hosts:
pppd nomad:alpha auto idle 180
The next line in nomad's $PPPHOME/Autostart would set up an IP route through the dial-in gateway:
route add net 134.19.0.0 134.19.5.22 1
Alternatively, and necessarily if the LAN were also connected to the Internet:
route add default alpha
Similarly, the PPP daemon on alpha would be started as:
pppd alpha:nomad auto idle 180
Alpha's /etc/rc2.d/S89mstppp would contain a line like:
arp -s nomad `ifconfig le0 | sed -n "/ether/s/ether//gp"` pub
(If your system's Ethernet interface is named something other than `le0', use that name instead.) This would add a permanent entry to alpha's ARP table, and cause it to be provided to other systems on the local Ethernet. Any time a host on that LAN tries to find the Ethernet address corresponding to nomad's IP address, the request will be answered with instructions to forward the packets to alpha. Since nomad appears to be directly connected to the LAN, no hosts on the LAN, nor on any other IP-connected network, would require routing table modifications.
Suppose gate-a (192.9.200.63) and ws-a (192.9.200.66) are on one LAN, with gate-a supporting a modem. Also suppose gate-b (134.19.14.29) and ws-b (134.19.14.102) are on another LAN across town, with gate-b supporting a modem.
gate-b's PPP daemon should be started as:
pppd gate-b:gate-a auto idle 130
and gate-b should have a route like:
route add net 192.9.200.0 gate-a
ws-b
should have a route like:
route add net 192.9.200.0 gate-b
Similarly, gate-a's PPP daemon should be started as:
pppd gate-a:gate-b auto idle 130
and gate-a should have a route like:
route add net 134.19.14.0 gate-b
or, depending upon the structure of LAN b, maybe:
route add net 134.19.0.0 gate-b
ws-a should have a route like:
route add net 134.19.14.0 gate-a
or, again depending upon the structure of LAN b, perhaps:
route add net 134.19.0.0 gate-a
If your LAN is connected to the Internet, or if you have arranged an account at a Point Of Presence (POP) of a PPP -or SLIP - talking Internet connectivity vendor (say, foo.net), then you should arrange for your default route to point through the gateway at the other end of the PPP connection. If hotel supported a modem to call a POP, it would start its PPP daemon like
pppd hotel:pop.foo.net auto idle 240
and would arrange a route as:
route add default pop.foo.net 1
Any hosts on the LAN `behind' hotel would set a route like:
route add default hotel 1
A machine's default route should point to the next machine along its path "outward " to the Internet. If hotel were a remote machine dialing into one machine in a complex corporate intranet, its default route should point to that hub machine, expecting that the hub will deal with the issues of routing hotel's packets to their destination, whether on the LAN or elsewhere on the corporate intranet or onto the Internet.
These files listed below may have been installed with your operating system. If not, examples of the files were. The example files end in the extension .ex , i.e., Systems.ex. Create Systems , Devices and Dialers and copy the lines you wish to use from the example files.
Autostart starts pppd's for on-demand outbound calls. Login is used for inbound ppp calls. The following files are used for outbound ppp calls:
-
/usr/lib/mstppp/Autostart
-
/usr/lib/mstppp/Systems
-
/usr/lib/mstppp/Devices
-
/usr/lib/mstppp/Dialers
Inbound ppp calls use one file:
-
/usr/lib/mstppp/Login-robin
This example may help describe how the Systems, Devices, and Dialers files work in conjunction to allow an on-demand outbound connection. Consider the analogy that can be drawn between the communication needs of a small business and the needs of a system which supports PPP connections.
Before opening the business, the owner assesses the company's communication needs. Obviously, its telecommunications system must support on-demand communications and inbound and outbound calling. The list of communications needs includes:
-
a means to access communications facilities
-
a device to provide an interface to the communications network
-
an efficient means of storing and dialing frequently dialed numbers
-
a list of those with whom the business may interact
How are these pieces of the business' telecommunications system analogous to the pieces of the PPP configuration? The table below provides the answer:
Need
|
Pizza Business System
|
PPP
Configuration
|
Communications access
|
a line to the telephone company's local switch over which inbound and outbound
calls are transmitted
Could also need a dedicated line for security alarm
|
the same
Could also handle a dedicated, or Direct connection
|
Interface device
|
the telephone to answer or place calls
|
the system's modem (device), listed in the PPP
Devices
file
|
Memory for dialing information
|
the telephone's memory for storing numbers for one-touch dialing
|
the PPP Dialers file containing modem dialing instructions
|
List of potential communications partners
|
a telephone directory including numbers, addresses, and contact names
|
the PPP
Systems
file containing numbers, logins, and passwords
|
Of course, the contemporary business could have many other communications needs, such as voice mail, fax machines, Internet service, etc. But those listed in the table are, at least, supportive of outbound, dialed connections. Hopefully they help illustrate the way the Systems, Devices, and Dialers files support on-demand, outbound PPP connections.
Throughout the following examples the local machine running MST PPP will be called robin. The peer, or remote neighbor, with which robin will establish an outbound connection to is called lark.
If you follow the steps outlined below, substituting names and addresses for your own local and remote machines, you will be able to test a simple PPP connection. These procedures are not comprehensive and contain minimal instructions about such things as setting up a packet filter for security. This, and configuration of other important PPP options, such as Link Management, Data Compression and Authentication, are explained elsewhere, and the manual pages in the appendix contain details on incorporating those features, and more, in your PPP configuration.
The steps for setting up an outbound PPP connection include:
-
Creating robin's AutoStart file
-
Adding entries to robin's Systems, Devices, and perhaps Dialers file
The steps for setting up an inbound PPP connection include:
-
Adding an entry to lark's /etc/passwd file which contains robin's password
-
Creating robin's login shell script, in this case, called /usr/lib/mstppp/Login-robin.
When these steps are completed and the system robin is re-booted, the following events will occur:
1. Autostart starts the daeomn for an on-demand connection from robin to lark.
2. If IP traffic is initiatied to lark, pppd will dial out to lark as follows:
3.
pppd searches the lines of the Systems file looking for an entry in the name field which matches lark's hostname or IP address.
4. When the match of a hostname or IP address is made, the Systems speed field provides an index to an entry in the Devices file with a matching speed.
5. The dialer field in Devices provides an index to an entry in the Dialers file.
6. Lark's phone number is dialed.
7. Robin's chat script (in the Systems file), sends robin's login name and password to lark.
8. Lark verifies robin's password by comparing it to the entry in the /etc/passwd file.
9. If the login is successful, /usr/lib/mstppp/Login-robin is run.
10. /usr/lib/mstppp/Login-robin will start pppd on lark, which
will comunicate with pppd on robin to negotiate and establish a
PPP connection.
When robin is booted a PPP daemon will be started for the outbond link to lark. There is no example /usr/lib/mstppp/Autostart file; you must create it. It contains the one line necessary to start pppd. In our example, here's what we would put in Autostart:
pppd robin:lark auto idle 150
The pppd started here has this connection configuration:
- local and remote hosts
- robin and lark
- daemon management option
- respond to the arrival of a packet by initiating a connection to peer (auto)
- link management option
- idle timer in effect (idle)
- idle timer value
- shut down the link if 150 seconds pass without receiving or transmitting a packet
Add this line to robin's /usr/lib/mstppp/Systems file:
199.199.199.2 Any ACU 38400 5551212 "" \r\d in:--in: \dprobin word: \qpassword
This provides the following configuration for robin's connection to lark:
call what host
|
lark
|
when
|
Any day any time (Any)
|
using what device
|
Any Call Unit that matches the speed in the next field (ACU)
|
at what DTE speed
|
38400 BPS (38400)
|
at what telephone number
|
5551212
|
expect what string
|
in: substring of login: if true, send next field. If false, send string between dashes followed by carriage return and expect in: Can be used to elicit a response out of peer.
|
send what string
|
send Probin followed by a carriage return (implicit)
|
expect what string
|
word: a substring of password:
|
send what string
|
mypasswd followed by a carriage return (implicit)
|
Add this line to robin's /usr/lib/mstppp/Devices file:
T1600 tty1A 38400 rtscts
This line provides this configuration for robin's connection to lark:
- use what modem
- Telebit model 1600 (T1600)
- on which system device
- outbound device (tty1A)
- at what speed
- 38400 BPS (38400)
- optional parameters
- hardware flow control (rtscts)
The /usr/lib/mstppp/Dialers file is already installed on robin. Here's what the Telebit 1600 entry looks like:
T1600 ABORT NO\sCARRIER ABORT NO\sDIALTONE ABORT BUSY \
ABORT RRING\r\n\r\nRRING\r\n\r\nRRING ABORT ERROR \
TIMEOUT 5 "" AT OK-AT-OK ATS111=0DT\T TIMEOUT 60 CONNECT
This elaborate dialer string will cause pppd to abort the connection attempt if any of several things go wrong with the telephone call, then will disable UUCP spoofing in the modem before dialing the destination telephone number. Look through the Dialers file for modem entries for your type of modem. If none are defined, use the dialer entry "GENERIC".
The peer's machine name, lark, is used as an index into the Systems file. The first matching entry found is used. The DTE speed in the Systems file is used as an index into the Devices file. Lastly, the dialer entry specified in the Devices file is used as an index into the Dialers file.
Although may bot initiate outbound calls, and therefore may not have to start pppd at boot time, it does need to be prepared for an inbounc connection from robin. To do this, add this entry to lark's /etc/passwd file and execute the following command:
Probin::105:42:Robin's PPP login:/usr/lib/mstppp:/usr/lib/mstppp/Login-robin
# passwd Probin
New password: some password
Retype new password: some password
#
The '105' in the password entry is a unique user ID (uid) for this PPP login. The '42' is the group ID (gid) associated with the 'ppp' group in lark's /etc/group file.
Robin's PPP user's login shell script can be located anywhere and named whatever you choose. For purposes of this illustration, the login script will be /usr/lib/mstppp/Login-robin.
Look carefully at the last line in the sample script shown below before you create the file and manually add the lines. Notice that the word 'hostname' is surrounded by backquotes, not regular quotes or apostrophes. `hostname`, with the backquotes, tells the system to insert the output of the command hostname in this space in the pppd command line. We recommend that you make sure backquotes are used by copying this script from /usr/lib/mstppp/Examples/Login.ex, rather than inserting them manually.
#!/bin/sh
# PPP login shell example for SystemV Unix
PATH=/usr/bin:/usr/lib/mstppp:/etc:/bin
PPPHOME=/usr/lib/mstppp
export PATH PPPHOME
mesg n
stty -tostop
exec pppd `hostname`:robin idle 150 rtscts
hostname will return lark, the current machine and robin is the peer. The idle timer is set to 150 seconds and pppd will use hardware flow control.
Following the creation of the shell script, make sure the script is executable with the following command:
# chmod 755 /usr/lib/mstppp/Login-robin
Lark's PPP daemon should be mode 4750, meaning it is suid root and executable by members of its group, but not by general users. Perform this test to find out if this is true:
# ls -l /usr/lib/mstppp/pppd
The results should look something like this:
-rwsr-x--- 1 root ppp 338527 Oct 2 07:37 /usr/lib/mstppp/pppd
If not, use chmod and chown to change mode and ownership as follows:
# chmod 4750 /usr/lib/mstppp/pppd
# chown root:ppp /usr/lib/mstppp/pppd
The PPP configuration is now complete. Follow these steps to test the outbound connection from robin to lark.
- You can either reboot your machine or run /usr/lib/mstppp/Sysinit to start pppd.
- Check to make sure pppd was started:
# more /usr/adm/pppd.log
8/4-14:14:43-14902 Morning Star Technologies PPP
8/4-14:14:43-14902 Version 2.0
8/4-14:14:43-14902 du0: pppd robin:lark auto idle 150
- Use telnet to bring up the link and type ^D to exit the login. There will be a half minute pause while robin dials the phone, the modems establish a carrier, the Systems chat script completes, the answering pppd is started on lark, and the two pppd's negotiate.
Pause
Connected to lark.
Escape character is '^]'.
(Operating system) (lark) (ttyp3)
lark login: ^Dconnection closed by foreign host.
The log file will be appended to and will show how the link was initiated:
8/4-14:14:53-14902 tcp 137.175.2.11/1204-> 131.187.1.131 \
telnet 40 syn bringup
8/4-14:14:54-14902 Dialing lark (cua 38400 5551212 T1600)
8/4-14:15:23-14902 PPP connected to 131.187.1.131
This log file snippet shows that the telnet session to lark caused the link to be initiated.
MST PPP is installed, configured, running and connected on both ends of our links. When the link is up, users should be able to access each peer machine using any TCP/IP application such as telnet, ftp, etc.
If either machine is connected to a local area network, you can set up IP routing on the two networks so that hosts on either network can communicate with hosts on the other, using machines on the ends of the PPP links as routers. Routing is discussed in later sections.
In most cases, all inbound PPP logins can use the same generic Login script. But if you want a host to start pppd with a special option like "require authentication", make that login account use a specific login shell tailored to that host. Call it /usr/lib/mstppp/Login-host, for example, and change the pppd line to reflect whatever options you wish to have:
exec pppd `hostname`:robin idle 130 rtscts requireauth
Note: A filter file is not necessary for pppd operation. It is only discussed here as an example on how you might use the Filter file.
The MST PPP Filter file specifies the ways in which static packet filtering handles outbound and inbound TCP packets. Though the filtering can be very complex if desired, a simple filter will suffice for demonstration purposes between robin and lark.
An example other than the one shown below is in /usr/lib/mstppp/Examples/Filter.ex and a lengthy explanation of static packet filtering is included in this manual.
Here is the Filter file to use for testing the robin-lark link:
default bringup !ntp !3/icmp !who
keepup !send !ntp !3/icmp !who
pass !route
log !nntp tcp/syn /recv
This filter says to:
bringup the connection for any traffic other than:
Network Time Protocol packets
ICMP Network Unreachable messages
packets from the in.rwhod daemon
|
(!ntp)
(!3/icmp)
(!who)
|
keepup the link for all packets except those sent by robin
and those that will not bringup the connection
|
(!send)
(!ntp) (!3/icmp) (!who)
|
pass
all packets except for RIP routing messages between in.routed daemons
|
(!route)
|
log
messages when an inbound TCP session is established except for NNTP connections
|
(tcp/syn /recv)
(!nntp)
|
In both Systems and Devices, pppd selects the first line that matches its search criteria. If the connection attempt fails while using the method described by that line, pppd will search for the next matching line. Pppd will report a failure only when all the criteria-matching lines have been tried and exhausted.
For example, suppose two lines in Systems differed only by the values in the telephone number field like this:
lark Any;50 ACU 38400 5551212 in:--in: Probin word: mypasswd
lark Any;50 ACU 38400 5551223 in:--in: Probin word: mypasswd
Pppd would first try to connect by dialing 5551212. If pppd received a BUSY from the modem, it would dial the second number, 5551223.
Similarly, suppose a host has two different modems attached which can be used for outbound calls. The Devices entries might look like this:
T3000 tty1A 38400 rtscts
USRv32bis tty1B 38400 rtscts
Pppd would try to call out through /dev/tty1A. But suppose it's busy because an incoming UUCP connection is on /dev/tty1B. pppd will try /dev/tty1B instead.
If an IP address is input on the pppd command line, the address is offered during IPCP negotiations. However, at connection time, some terminal servers and other peers wish to assign an address for the host running MST PPP to use for the duration of the connection. Instruct MST PPP to allow assignment of an address that's different from the one on the pppd command line, by including a line like the following:
pppd `hostname`:192.0.2.5 auto idle 300
Because SLIP does not perform any IPCP negotiations, the tilde option will not function. See Common pppd Options for more information.
When an answering pppd is invoked in Login, it is told a pair of IP addresses on the command line. In the Login script, use any means to decide what IP addresses are put on the command line. Have them looked up in a file or a database, calculated algorithmically based on the incoming connection's username or other distinguishing feature, or invoke a program to ask a BOOTP server. The pppd command line arguments provide the mechanism; your Login script provides the policy.
Here's an example Login script that uses the tty name to guarantee uniqueness of the addresses it assigns. This works fine for a small installation with few modem server serial ports and a fairly static configuration.
#!/bin/sh
TTY=`tty`
case $TTY in
/dev/tty1)
IP=192.0.2.1
;;
/dev/tty2)
IP=192.0.2.2
;;
esac
exec pppd `hostname`:$IP idle 300 rtscts
This script also uses the tty name to guarantee uniqueness of the addresses it assigns. You must define ttyN in your /etc/hosts file, NIS hosts map, NetInfo hosts map, or DNS database, according to the system used. This works better in a larger installation with more ports and a configuration that tends to change more often.
#!/bin/sh
TTY=`/bin/basename \`/bin/tty\``
exec pppd `hostname`:$TTY idle 300 rtscts
It's impractical to impose thorough security policies on each internal host of the networks linked by an MST PPP connection. But MST PPP's strong security features support a variety of techniques that strengthen your network's ability to prevent loss.
In most cases, a single connection can be supported by more than one of MST PPP's security features. For example, a connection might use the following:
-
Morning Star Technologies' packet filtering technology
-
Time to Call Restrictions
-
Dial Back
-
CHAP Authentication
-
SecureID
These features, and others, are discussed in the sections below.
We recommend that you establish a security policy before you write a packet filter. A security policy is a statement based on thorough analysis of access needs, vulnerabilities, and real, or perceived, threats to your assets. You must identify the types of network traffic associated with these issues before you can create a packet filter that supports your security policy.
Morning Star Technologies' flexible filter-writing mechanism will also support your policy as you create your filter. Our philosophy is to provide a mechanism that won't force policy changes for the sake of writing acceptable rules.
In general, all security policies are based on one of two opposing strategies. Both types of policies are supported by MST filters.
The first strategy permits a few specific services and blocks everything else. If you follow this philosophy, a service will be unavailable if you commit an error of omission. This is a fail-safe, or closed, policy.
The second strategy blocks only specific services and permits everything else. If you begin from this premise, an error of omission may leave you unintentionally vulnerable when a fragile service is not blocked.
If you need aid in developing security policies, or would like more general information about network security and packet filtering, we recommend you begin by reading two books, "Firewalls and Internet Security " by Bill Cheswick and Steve Bellovin and "Building Internet Firewalls" by Brent Chapman and Elizabeth Zwicky.
When pppd starts, the software checks for a filter file. If one is present, it is parsed and installed. The default filter filename for pppd isFilter'. If you want to give the file a different name, specify the new name as the argument for the pppd `filter' option. Only add the filter option if you want to change the name of the filter file.
A filter file contains rulesets for filtering packets. Each ruleset begins with one of the following:
-
an IP address
-
a hostname
-
the special keyword, default'
You may write a specific ruleset for each connecting host, or a default ruleset will be used. The pppd parser will search for a ruleset that matches the IP address or hostname of the remote PPP/SLIP host, called the peer. This usually corresponds to the IP address placed on the right hand side of the colon on the pppd command line.
Rulesets are designed on a per-connecting-host basis rather than a per-interface basis. This provides support for devices acting as PPP or SLIP routing hubs. A hub workstation allows multiple hosts to establish IP connections and may support multiple hosts establishing connections at different times on the same interface.
If a hub supports different classes of users, MST PPP filters allow you to define different access policies for each group. A single hub workstation may support all of the following PPP/SLIP connections, each defined by a different ruleset:
-
a connection to the home of a developer who is allowed to access multiple hosts and proprietary data
-
connections for a traveling sales team which only requires electronic mail access
-
connections to customers seeking support who may only access the anonymous FTP host
Default rulesets are permitted. They simplify configuration when a single machine supports similar multiple hosts/connections which can be controlled by the same security policy.
The order in which rulesets appear is important. Default rulesets should appear early in the file because, after they are parsed, the parser continues searching for more matching rulesets. However, when addresses or hostnames in packets and rulesets match, the packet is processed and the parser stops its search.
When a match is found and the `non-default' ruleset is processed, its individual filters replace any default filters "remembered" from earlier in the file. This means that packet filtering may behave differently if thedefault' rule appears early or late in the file.
A ruleset is made up of one to four filters which regulate the response to a packet. The filter's actions are defined by its initial keyword. Each type of filter may be used one time per connection. This table explains the keywords, the types of packets affected by the filters, and the filter's actions:
KEYWORD
|
PACKET TYPE
|
ACTION
|
bringup
|
outgoing dialup
|
defines packets which cause a connection to be established
|
keepup
|
inbound
and outbound
dialup
|
defines packets which cause the idle timer to be reset, preventing the connection from going down
|
pass
|
all packets
|
defines packets which are allowed to pass through the filter. packets which don 't pass don't bringup
|
log
|
all packets
|
defines the characteristics which will cause a message about a packet to be added to a log
file
|
Filters defined in a ruleset replace any previous default definition for that filter. Defined filters are not additive with a default filter. If one of the keyword filters does not appear in a ruleset, that filter is defined by its the most recently parsed default ruleset. If there is no previous default ruleset, the implicit default is `all', except for the log filter, which defaults to ` !all'.
Each filter is composed of a filter name followed by one or more stanzas (i.e., rules). Each packet passing through the interface is compared to the rules in the stanzas until a match is found, completing the filter operation. The ordering of the stanzas is therefore extremely important. Packets may match on many types of values, including:
-
host or network address
-
port number
-
protocol type
-
IP
option
-
TCP
SYN, FIN, ACK and RST bits
-
direction of traffic.
A stanza optionally begins with the negation operator, the exclamation mark (!). The mark is followed by one or more values and keywords, each separated by a slash (/). These value and keyword combinations create a specification for a packet.
An exclamation mark is a powerful specification in any filter rule. If an exclamation mark is placed at the beginning of a rule, it negates the action of the stanza's keyword. For example, compare the defaults for the Pass and Log filters:
Pass
all
Log
!all
The specification for Pass, and the lack of an exclamation mark, indicates the default is to pass all packets. On the other hand, the `!all' default designation for Log means no packets are logged.
Each filter ends with an implicit stanza. The implicit ending stanza is `all' if the last stanza specified is negated by beginning with `!'. The implicit ending stanza is `!all' if the last stanza is not negated. While this is convenient and makes it unnecessary to actually define the final "match everything else" stanza, it is a good idea to explicitly specify this stanza to avoid simple errors that can greatly change the meaning of a filter.
Each stanza represents a template used to find matching packets. The features you can place in your stanzas correspond to the fields in network messages. This allows you to filter at the IP level or the TCP /UDP/ICMP level.
The fields available at the IP level include the protocol (e.g., 1
[ICMP], 2 [IGMP], 6 [TCP], 8 [EGP], 17 [UDP], etc.), an address
(i.e., the source or destination address) and IP options (e.g., rr,
lsrr, etc.), and fragmentation.
MST does not provide a filter keyword for matching the version,
IHL, TOS, length, ID, TTL or checksum header fields.
ICMP messages may be filtered on the type and code fields.
In general, it is not a good idea to block all inbound or outbound ICMP messages because ICMP messages are an important way that status information is conveyed over an IP network. For instance, blocking ICMP Source Quench messages (Type 4), used to tell a packet source to slow down, can cause problems for other users and sites.
It is true that you should probably not permit ICMP Redirect messages (Type 5) to pass through your router since the routing on an internal node should not be changed by an external site.
If you want to block ping from being used for host discovery, then you should block inbound ICMP Echo packets (Type 8).
The TCP header fields available for matching include port numbers (i.e., the source or destination port), the presence of the SYN bit without ACK, and the ACK, FIN and RST bits.
MST does not provide a method for filtering on TCP options, the presence of URG/EOM bits in the TCP options, or other TCP header fields.
Establishing a TCP connection requires synchronization. Each side must send it's own initial sequence number, receive a confirming acknowledgment from the other end, receive the other end's initial sequence number and send the confirming acknowledgment.
The steps in the sequence look like this:
Step Path TCP
Bit
Message
1 A B SYN my sequence number is X
2 A B ACK your sequence number is X
3 A B SYN my sequence number is Y
4 A B ACK your sequence number is Y
Packets 2 and 3 are normally combined into a single "SYN ACK" packet. This is called a three way handshake.
The SYN bit is set, with no ACK bit set, to show a TCP connection request. By blocking packets with the SYN bit set in a single direction, you may permit TCP connections in a single direction.
The UDP header fields available are the source and destination port numbers.
UDP does not permit a router to differentiate between inbound packets requesting new services and inbound packets returning data to outbound requests. This means that static filters which allow inside users access to services based on UDP also allow outside users to access the same service inside your network.
If the diagrams and information shown above are difficult to follow, we highly recommend these books on networking and the TCP/IP protocols:
Title:
Computer Networks, 2nd edition
Author:
Andrew S. Tanenbaum
Publisher
: Prentice-Hall
Edition:
1988
ISBN:
0-13-162959-X
Title:
Internetworking with TCP
/IP
Vols I, II and III
Authors
: Douglas Comer and David Stevens
Publisher
: Prentice-Hall
Editions:
1991 - 2
ISBN:
0-13-468505-9 (I), 0-13-472242-6 (II), 0-13-474222-2 (III)
Title:
TCP
/IP
Illustrated: the protocols
Author
: W. Richard Stevens
Publisher
: Addison-Wesley
Edition
: 1994
ISBN
: 0-201-63346-9 (v.1)
Listed below are some general concepts to remember when writing a stanza:
-
Each stanza includes one or more numbers, addresses, or keywords, separated by slashes (/).
-
Each number, address, or keyword adds an additional qualifier to the stanza.
-
Each qualifier or pattern must match for the rule to be applied to the packet.
-
A stanza can be used to either permit or deny a matching packet.
-
Begin with the negation operator (!) to block or deny a packet.
-
Any stanza that is not negated permits matching packets.
-
Comments begin with a
`
#' character and extend through the end of the line.
The section below explains how different features of a stanza should be written and the ways you include them in a stanza to affect the operations of the filter. The features are described in subsections which include a general explanation, an example, and a comment on the action caused by the example. The comments are shown on the same line as the example and begin with a `#' character.
We recommend that readers who are unfamiliar with filtering take the time to read this section from beginning to end. The topics and examples build on one another. Therefore, skipping through the examples, you may see references to keywords you do not recognize or miss the significance of relationships between some keywords. These topics are covered:
-
Numbers and Addresses
-
Keywords
-
Directions of Packets
-
Time based Restrictions
-
ICMP
messages
-
Logging and Tracing
A number by itself, without an associated protocol name such as tcp or udp, represents an IP protocol number. IP protocol numbers have a range of 0-255 and are assigned by the Internet Assigned Number Authority (IANA). The current list of IP protocols can be found in the ASSIGNED NUMBERS RFC.
Example:
!89 # block Open Shortest Path First (OSPF) Interior Gateway
# Protocol (IGP)
An IP address may be represented in hexadecimal (e.g., 0xc0000201) or dotted quad (e.g., 192.0.2.1) notation and represent either a host address or a network address. Network addresses are simply used to represent contiguous ranges of hosts and therefore do not necessarily correspond to actual networks. A network address uses all zeros for the host portion of the address.
Example:
!192.168.199.1 # block packets to/from host 192.168.199.1
You must specify a netmask if the host portion of the network address does not match the "natural" netmask. A netmask may be represented in either hexadecimal or dotted quad notation. A network address must also be present or the netmask will be assumed to be an IP address.
Example:
10.7.123.0/255.255.255.0 # permit 10.7.123.0-10.7.123.255
Alternatively, you may specify the netmask after the address using a semicolon followed by the number of one bits in the network mask.
Example:
10.7.123.0;24 # permit 10.7.123.0-10.7.123.255
A number of keywords can describe features of the packets, including data within the packet header and the direction of travel.
Keywords exist for the most commonly used IP protocols, `tcp', `udp', and `icmp'. Use these keywords to prevent ambiguity when specifying port numbers or types. You must use `17/tcp' or `6/udp' to avoid ambiguity.
`udp' or `tcp' combined with a number represents a port number.
Example:
25/tcp # permit SMTP
mail
You may specify a range of ports using a hyphen-separated pair of numbers.
Example:
!0-1023/udp # block privileged UDP ports
Many systems provide a list of well known UDP and TCP port numbers in a services file or they supply contents of the file through a database service such as NIS or NetInfo. Filter stanzas may use the symbolic names for these port numbers.
Example:
smtp # permit SMTP (25/tcp) service
However, symbolic port names (i.e., services) can be ambiguous. For example, `domain' may be either
`tcp' or `udp' port 53. When using keywords that are specific to a protocol like TCP, you must add the `tcp' keyword to the stanza to avoid errors.
Example:
!domain/tcp
Services are not the same as applications or protocols. Specifying `!telnet in the filter file does not prevent the `telnet' application from talking to the `smtp' port on the host, nor does it prevent someone from using the telnet protocol to talk to a telnet daemon (telnetd) running on a port number other than 23.
`
icmp' with a single number represents an ICMP message type. `icmp' with two numbers represents a specific ICMP type and code combination. ICMP type and code values can be found in the ASSIGNED NUMBERS RFC3 or in the /usr/include/netinet/ip_icmp.h file directory on many systems.
Example :
!icmp/5 # block ICMP
Redirect messages
Example:
!3/0/icmp # block ICMP
Unreachable "bad net" messages
Frequently, a host acts as a router between two end points so packets may not originate or terminate at that host. Use the `src keyword to specify the point of origin or source and the `dst keyword to specify the endpoint or destination. The source or destination can be either an IP address or a service or port.
Example:
route/dst
# permit packets to UDP port 520 on any host
The `src or `dst keyword applies to all addresses and ports in the stanza. Thus, you cannot specify both the source port and destination address or vice versa in the same stanza using the `src or `dst keywords.
Example:
10.0.0.1/route/dst
# permit UDP packets to 10.0.0.1 port 520
Even more specific rules may be written by using the keywords `srcport', `dstport', `srcaddr', `dstaddr', `srcmask', and `dstmask' keywords in place of `src or `dst. The syntax of these keywords is `keyword=value'.
Example:
!srcaddr=10.7.127.0/srcmask=255.255.255.0/dstaddr=192.168.5.0
# block packets between the 10.7.127.0-10.7.127.255 and
# 192.168.5.0-192.168.5.255 networks
The workstation running the daemon is your point of reference regarding the direction of a packet. Packets written by the host are outbound, or sent, and are specified by the `send keyword. Packets read by the host are inbound, or received, and are specified by the `recv keyword. The two rules in the following example prevent spoofed packets for an internal network 192.168.12.0.
Example:
!recv /src /192.168.12.0
# block receiving packets from outside which claim to
# be from 192.168.12.0-192.168.12.255
!send /dst /192.168.12.0
# block sending packets to outside which claim to be # going to 192.168.12.0-192.168.12.255
Some qualifiers (i.e., keywords) may only be used in combination with other
qualifiers. For example, `syn, `fin, `rst', `ack' and `estab' are options or fields in TCP packet headers and may only be used when the qualifier `tcp' is directly stated in the rule or implied by a TCP protocol service. If the definition of a service allows it to use TCP and UDP packets the `tcp' qualifier must be explicitly added to the service name in the rule.
Example:
!tcp/syn /recv # block inbound TCP connection requests
smtp/syn # permit SMTP (25/tcp) connection requests
domain/tcp/syn # permit DNS (port 53) TCP connection requests
A rule which qualifies a session with `recv or `send prevents the session from being started or logged unless it is initiated in the indicated direction. The initiator sends a SYN packet to the recipient to open a TCP data stream. This permits the filter to distinguish between outbound and inbound uses of TCP applications such as telnet or FTP. The special keyword `syn allows you to filter or log these connection starters. Unlike most other qualifiers, `syn' is actually a compound qualifier that tests for just the initial packet, which has a SYN bit set but not the ACK bit.
-
The special keyword `estab' identifies any TCP packet that does not have the SYN bit set. `estab is to `existing' as `syn is to `beginning.
-
The special keyword `ack' allows you to filter or log the packets that have the ACK bit set.
-
The special keyword `rst' allows you to filter or log the packets that reset TCP connections.
-
The special keyword `fin allows you to filter or log the packets that close TCP connections.
The `ip-opt=' keyword can be used to select packets based on whether they bear various IP options, including those described in the table below:
OPTION
|
DESCRIPTION
|
rr
|
Record Route is used to trace the route an Internet datagram takes
|
ts
|
Time Stamp
|
security
|
Security is used to carry Security, Compartmentation, User Group (TCC), and Handling - Restriction Codes compatible with DOD requirements
|
lsrr
|
Loose Source Routing is used to route the Internet datagram based on information supplied by the source
|
satid
|
SATNET Stream Identifier (obsolete)
|
ssrr
|
Strict Source Routing is used to route the Internet datagram based on information supplied by the source
|
srcrt
|
Either Loose Source Routing or Strict Source Routing
|
any
|
Any IP option including the `No Operation' option.
|
Example:
!ip-opt=srcrt # block source routed packets
The `frag' keyword permits filtering of IP fragments. When IP packets are larger than the media permit, the datagram can be fragmented into smaller segments, transmitted, and reassembled at the destination. IP datagrams can be up to 65,535 bytes long, but most physical networks do not support datagrams that large. Ethernet supports datagrams 1500 bytes long. SLIP's default is 1024 bytes.
The special keyword `all' matches any packet. It typically appears at the end of a filter to either permit or block all unspecified packets. The software automatically implicitly adds `!all' at the end of a stanza list if the last stanza is not negated, and `all' at the end of a stanza list if the last stanza is negated. While not strictly necessary, it is a good a idea to explicitly state your preference.
You may add time-based restrictions to your packet filter, limiting the types of traffic passing through the packet filter during the workday, or enabling additional access after business hours or on weekends.
Two keywords define time-based rules. They are the `weekday' and `daytime' keywords.
The syntax for using the keyword `weekday' in a qualifier is weekday=when', where `when' is a string indicating the days the rule should be applied. The `when' portion may be a list containing any of `Su', `Mo', `Tu', `We', `Th', `Fr' or `Sa'.
Example:
!ftp /syn /send /weekday=MoTuWeThFr
#prevents any weekday outbound ftp connection requests
The syntax for the keyword `daytime' qualifier is `weekday=time', where `time' is a string that indicates the hours of a day the rule should be applied. You may indicate hours in a range (for example, `daytime=0800-1800').
Example:
!ftp /syn /send /weekday=MoTuWeThFr/daytime=0800-1800
#prevents weekday outbound ftp connection requests
# between 8am and 6pm.
In addition to permitting the packet to be passed or blocked, keywords also allow you to specify additional actions to take with any packet that matches the template. For example, you can silently drop the packet and/or send an ICMP message to notify the sender of the action.
The `unreach =' keyword causes an ICMP Destination Unreachable message to be sent to the packet's source address, bearing the indicated code field. The ICMP Code may be specified numerically or mnemonically.
Example:
!ip-opt=srcrt/unreach=srcfail # block source routed packets and notify #sender of failure
!tcp/113/unreach=1 #block RFC1413 Identification Protocol packets and #send a Destination unreachable host message.
The currently available pnemonic codes are:
#
|
NAME
|
DESCRIPTION
|
0
|
net
|
The destination network is unreachable.
|
1
|
host
|
The destination host is unreachable.
|
2
|
prot or protocol
|
The designated transport protocol is not supported.
|
3
|
port
|
The designated transport protocol (e.g., UDP) is unable to demultiplex the datagram but has no protocol mechanism to inform the sender.
|
4
|
needfrag
|
Fragmentation is needed and the Don't Fragment flag is set.
|
5
|
srcfail
|
Source route failed.
|
6
|
net-unknown
|
The destination network is unknown. This code normally should not be generated. It implies that the destination network does not exist. Code 0 (Network Unreachable
) should be used in place of Code 6.
|
7
|
host-unknown
|
The destination host is unknown.
|
8
|
|
The source host is isolated. Routers should not generate Code 8; whichever of Codes 0 (Network Unreachable) and 1 (Host Unreachable) is appropriate should be used instead.
|
9
|
|
Communication with the destination network is administratively prohibited. This code was intended for use by end-to-end encryption devices used by U.S military agencies. Routers should use the newly defined Code 13 (Communication Administratively Prohibited) if they administratively filter packets.
|
10
|
|
Communication with the destination host is administratively prohibited. Same reasoning as message 9 above.
|
11
|
net-tos
|
Destination network unreachable for the designated type of service.
|
12
|
host-tos
|
Destination host unreachable for the designated type of service.
|
13
|
prohibited
|
Communication Administratively Prohibited.
|
14
|
precedence
|
Host Precedence Violation.
|
15
|
precedence-cutoff
|
Precedence cutoff in effect.
|
|
rst
|
This is a special keyword which will not send
an ICMP Destination Unreachable message, but instead a TCP RST packet.
|
Use the keywords `log' and `trace' to log actions taken by the packet filter or dump the contents of the matching packet (in hex) to the system log.
Example 1:
!frag/trace # block and dump the contents of any IP fragment
# received
Example 2:
tcp/syn /send /log # pass and log all outbound TCP connection
# requests
There are two ways to invoke the `log keyword. The log filter allows you to define, in one location, all the packets you wish to log. Or you can add the log keyword to the individual rules in the `pass filter as shown in the above examples. Generally, it is easier to add a rule in the log filter requiring all rejected packets be logged rather than adding a `log' qualifier to all rules that block packets.
The syntax of a stanza is very flexible. In general, the order of the values and keywords in the stanza are not fixed, although certain combinations of keywords are not allowed. The rules that do exist are:
-
Each value and keyword in a stanza must be separated by a single `/'
-
In a negation, the `!' must be the first character of the stanza
-
When a network mask accompanies a network address, the mask must follow the address
-
Since white space created with a space, tab, or newline entry separates stanzas, no white space is permitted within a stanza
-
Only one protocol (e.g. tcp/udp/icmp) may be specified per stanza
-
syn, fin, ack, rst, or estab may not appear in the same stanza
Example:
The following rules describe the same packet filtering, and would cause the same template to be invoked.
Example 1:
!telnet /syn /recv /192.0.2.0/255.255.255.0
Example 2:
!192.0.2.0/recv /syn /255.255.255.0/telnet
The following section describes the writing of a rather complex packet filter involving the Domain Name System (DNS). It provides a good example of why you need to understand the applications in use when writing packet filters. It also shows the difficulty of writing static packet filters for UDP packets without permitting inbound network access in order to permit outbound service.
A brief explanation follows each rule. The explanation attempts to illustrate the security considerations which prompted the creation of the rule.
Your security policy should allow access for packets that need to cross the link to fulfill your needs, while still keeping out as many unrelated packets as possible. Look at the following example of a rule concerning domain name queries. It is one of easiest rules you could add to permit domain name queries, but it is also the most insecure.
1. domain/udp
Think of the stanza as though it were translated into this simple pseudo-code:
if
protocol is UDP AND
source or destination port is domain (53)
then
permit the packet to pass
This means that a user on an outside host sending a UDP packet from port 53 could reach ANY UDP destination port on ANY host on your local network, including privileged ports used by other services. This would not be "safe".
In the simplest case for domain queries, hosts on your network will send all `domain requests to your domain name server. Your server will check to see if it has the information cached. If not, it will query other domain name servers on the Internet to obtain the information.
The packet exchange will look similar to those shown below, where the entries mean the following:
-
`dns' is the IP address of the domain name server
-
`domain' is UDP port 53
-
`any' is any IP address on the inside or outside network (as appropriate)
-
the arrow represents the direction of travel:
dns.domain any.domain # the outbound domain request
dns.domain any.domain # the inbound response to the request
In appearance, this is similar to an actual log file entry. The diagram explains fields in a normal log entry.
udp 192.168.199.11/domain -> 10.0.5.1/domain 124
^ ^ ^ ^ ^ ^ ^
| | | | | | |
| | | | | | + packet size (bytes)
| | | | | + foreign port
| | | | + foreign address
| | | + direction
| | + local port
| + local address
+ protocol
An Exercise in Simplifying Rules
This section illustrates a process you might go through to develop domain name rules. Throughout the steps, the illustration includes two paths you might take. The first shows how individual rules might be developed. The second shows how the first rules can be condensed with the same results. After each group of rules, we will evaluate the progress, considering loopholes which might be created by the way the rules have been written. Throughout the examples, we will use 192.168.199.11 to represent the IP address of the domain name server.
The first example attempts to map each packet description into a separate rule to permit these packets through the pass filter. This results in two rules similar to the following:
a)
udp/srcaddr=192.168.199.11/srcport=domain/send /dstport=domain
udp/dstaddr=192.168.199.11/dstport=domain/recv /srcport=domain
Alternatively, group (a) can be combined and simplified into a single rule similar to:
2)
udp/192.168.199.11/dstport=domain/srcport=domain
Both the outbound request and the inbound response match this template and no packets to UDP ports other than domain (53) are permitted by the rule.
In general, domain name servers on the Internet will also want to query your domain name server to obtain information. The packet exchange will be very similar to the outbound request but reversed in order:
dns.domain any.domain # the inbound domain request
dns.domain any.domain # the outbound response to the request
This means that both the individual rules in example (a) and the combined rule in example (2), which were created to handle requests from outside hosts, are still functionally correct.
There is a limitation associated with rules (a) and (2) concerning domain name queries. It arises because not all queries from the Internet will come from a domain name server. Some will come from applications, such as `nslookup or `host' that use an unprivileged port (i.e., a port in the range of 1024-65535).
The packet exchange for such an inbound domain query resembles the following, where `unpriv is any port from 1024-65535.
dns.domain any.unpriv # the inbound domain request
dns.domain any.unpriv # the outbound response to the request
Because the query comes from an unprivileged port, you will need to add two additional rules to example (a) to cope with the new packets. You will now need four stanzas to deal with domain queries.
(b)
udp/dstaddr=192.168.199.11/dstport=domain/recv /srcport=1024-65535
udp/srcaddr=192.168.199.11/srcport=domain/send /dstport=1024-65535
In this situation, if you combined the original rules as in example (2), it can be modified to permit the inbound request by removing the restriction on `srcport'. However, the revised rule (2) will still block the outbound response, causing the query to fail. To permit the outbound packet, you must add another rule following rule (2). Call it rule (3).
(2) udp/192.168.199.11/dstport=domain
(3) udp/srcaddr=192.168.199.11/srcport=domain/send /dstport=1024-65535
Comparing the examples (a) and (b) to examples (2) and (3), you have reduced the number of rules needed from 4 to 2.
When trying to simplify, it is important you double-check your assumptions. You should not use "udp/192.168.199.11/srcport=domain", although it would permit the query to succeed, because it will also match packets that should not be permitted. That rule is similar in function to this pseudo-code that follows it.
(2) udp/192.168.199.11/srcport=domain
if
protocol is UDP AND
source or destination IP address is 192.168.199.11 AND
source port is domain (53)
then
permit the packet to pass
This means an outside host sending a UDP packet from port 53 to 192.168.199.11 can access ANY destination port, including privileged ports used by other services. This would not be "safe".
Similarly, if an internal user on the domain name server uses an application such as `nslookup' to send a query directly to another domain name server, rather than sending the query to the local domain name server, the packet traces and rules needed to deal with them will change.
dns.unpriv any.domain # the outbound domain request
dns.unpriv any.domain # the inbound response to the request
If you want your templates to match the packets as closely as possible, you must add two further rules (c) to (a) and (b). You now have 6 rules if you have not attempted to condense the rules.
(c) udp/srcaddr=192.168.199.11/srcport=1024-65535/send /dstport=domain
udp/dstaddr=192.168.199.11/dstport=1024-65535/recv /srcport=domain
If you have simplified rules (a) and (b) and have used rules (2) and (3), the additional packets also cause rule (3) to block some of the necessary traffic. This is because the inbound packet, while originating from the domain port, does not have a source address of the domain name server. After making the change to accommodate the differences, by removing the restriction on direction (`send) and relaxing the restriction on address, you have replaced rule (3) with the edited rule resembling (4).
(2) udp/192.168.199.11/dstport=domain
(4) udp/192.168.199.11/srcport=domain/dstport=1024-65535
Up to this point, the rules have always been based on the trust of data under local control. With static filtering, the second rule now permits data that is under external control through the packet filter.
if
protocol is UDP AND
source or destination IP address is 192.168.199.11 AND
source port is domain (53) AND
destination port is in the range 1024-65535
then
permit the packet to pass
This means that an external host can send UDP packets from port 53 to any unprivileged port on the domain name server without requiring an internal initiator. Unfortunately, there are a number of assigned ports, such as the normal default NFS port (2049/udp), which are allocated out of the unprivileged port range and can present security problems. You can minimize the risk by reducing services on your domain name server and by adding additional rules to block access to those services before the second rule. If you explicitly block access to the port first, the packet will not reach the rule that gives it permission to pass because the filter will stop as soon as a match is found.
Finally, an internal user on a local host other than the domain name server may use the `server' command of `nslookup' to change the default server. In this case, the packet will not be sent to the local domain name server but directly to the external domain name server.
any.unpriv any.domain # the outbound domain request
any.unpriv any.domain # the inbound response to the request
Once again, permitting the traffic to pass requires adding two additional rules, labeled (d) in the example, to group (a) (b) and (c). Now there are a total of 8 rules.
(d) udp/srcaddr=192.168.199.0/srcport=1024-65535/send /dstport=domain
udp/dstaddr=192.168.199.0/dstport=1024-65535/recv /srcport=domain
The condensed version of the rules also requires that rule (4) be modified to permit proper operation. The modification is required because the outbound packet has a destination port domain, but it is not to or from the IP address of the domain name server (192.168.199.11). After removing the IP address restriction, the final set of simplified rules is:
(2) udp/dstport=domain
(5) udp/srcport=domain/dstport=1024-65535
Domain name service offers a strong example of the tradeoff between functionality and security. It also illustrates the complexity of maintaining security. The level of service you decide to offer should strongly affect the rules you use. Your security policy should dictate the level of service you offer. You should not, in general, let the desired functionality dictate your security policy.
To open a TCP data stream, the initiator sends a packet to the intended recipient. The SYN bit (with no ACK bit) is set in the TCP header to show a TCP connection request. The special keyword `syn will match packets which have the SYN bit set, but no ACK bit set. This allows you to filter or log packets which start connections.
The TCP protocol requires more than a single SYN packet for a TCP connection to work. This means you cannot enable TCP connections with a single `syn' rule.
There are two approaches to filtering TCP connections. The first approach is to block `syn' packets you do not want to establish a service, while permitting all other packets for the service.
Example:
!telnet /syn /recv # block inbound telnet connection requests
telnet # permit all other telnet packets
The second approach is to permit the `syn packets you do want to establish a connection, followed by permitting any other non-SYN packets. The opposite of using the `syn' keyword is the `estab' keyword. `estab' describes any TCP packet that does not have the SYN bit set or that has both the SYN and ACK bits set in the TCP header.
Example:
telnet /syn /send # permit outbound telnet connection requests
telnet /estab # permit packets to established connections
The first line of a ruleset must contain a hostname, IP address, or `default that identifies the interface you wish to use. For pppd, use the peer, or remote, IP address. This hostname or IP address must not be indented because the name/address will be assumed to be part of a rule and may or may not cause a syntax error.
We recommend that you use an IP address, but, if you use a hostname, it is important that the system can resolve the hostname locally. If the link must be up to resolve the name, the hostname matching will fail and the interface will be forced to use the default ruleset. This changes the meaning of your filter file and causes long delays because the connection will timeout while waiting for name resolution.
Each additional line of a ruleset (continuation lines) must be indented, using one or more white space characters (space or tab). If a line is not indented, the first word on the line is assumed to be a hostname for a new ruleset.
Any information which follows a `#' character on a line is assumed to be a comment and is ignored.
When a ruleset has been selected, each stanza is applied in order, top to bottom, and left to right. The filter returns when it finds a matching stanza. It is therefore important that you order stanzas in the Filter file in most specific to least specific (most general) order. If the order is reversed, the most general rule will match first and the filter will never reach the more specific rules.
Example: (CORRECT)
domain/192.0.2.1 # permit DNS to/from 192.0.2.1
!domain # prevent all (other) DNS
Example: (WRONG)
!domain # prevent all DNS
domain/192.0.2.1 # this rule is never reached
When pppd finds an error in the Filter file, the line number that caused the failure is reported. When a packet is rejected due to a filter and thelog rejected' keyword is used, the line number that caused the rejection can be recorded in the log file. Therefore, when tracking down problems, you can quickly isolate the correct stanza if only one stanza is used per line.
The hardwired default ruleset is:
default bringup all pass all keepup all log !all
This is probably an unacceptable default if you are trying to filter packets. Your default should be the same as your most restrictive ruleset because it will keep your site secure if connection specific filtering fails due to a misconfigured IP address or hostname.
The following sections deal with two approaches to writing default rulesets. The difference between the two approaches is apparent from their names, the "closed policy" and the "open policy".
If you are willing to accept most packets from a site from which you have not previously accepted traffic, a reasonable default filter might be:
default
bringup all
pass !exec !tftp all
keepup all
log rejected !all
Notice the use of `all' rather than `!all' at the end of each filter. This default ruleset will only block `tftp packets and `rexec' packets, two protocols that normally should never cross organizational boundaries.
In the previous example, and in the following Closed Policy examples, we use the `log rejected filter. This is a good default log filter to use. When testing, it permits you to see that your filter is working as expected and keeps track of outside attempts to connect through to blocked services.
The closed policy default rulesets in the examples that follow illustrate the way services can be safely and incrementally allowed for a remote site. This approach begins from the premise that no packets should be allowed to pass.
If your security policy changes and you must block packets from a formerly acceptable site, you might change the default filter to the following:
default bringup !all pass !all keepup !all log rejected !all
However, most sites are not this "paranoid" and are willing to permit electronic mail through the workstation or system. For this, and the following examples, it is important that you have the smtp service defined in your services file. To help prevent any problems due to this assumption, you could use the explicit port number, protocol, and IP address to test. Then, you might write the default this way:
default bringup !all pass 25/tcp !all keepup !all log rejected !all
The filter file is easier to read and comprehend if you use the service name. Still, specifying the explicit port number and protocol can also prevent someone from changing the meaning of your rulesets by subverting NIS. The benefit may be negligible, though, if the information is only checked against the local services file. Intruders able to modify the services file could also modify the filter file.
If you wish to limit electronic mail access to a gateway machine, you need to add the qualification to the smtp stanza. The next two examples use the fictitious name/address bignfast/192.0.2.1:
default bringup !all pass smtp/bignfast !all keepup !all log rejected !all
In the last example, we used the hostnamebignfast'. But consider the inherent problem of using a hostname instead of the IP address. If the host address cannot be resolved, you may reach a state of "deadlock" because the name must be resolved for the service to begin, but the service must begin for the name to be resolved. The example below may be more reliable.
default bringup !all pass smtp/192.0.2.1 !all keepup !all log rejected !all
However, nothing is perfectly reliable. Being explicit can cause other problems if you change the address of the server. The reliability of using an IP address instead of a hostname, or vice versa, may only be decided on a site-by-site basis. Still, we strongly favor using IP addresses over using hostnames. One benefit is that specifying the explicit IP address prevents people from changing the meaning of your rulesets by DNS spoofing.
Build up the list of what you would let an unknown site do a little at a time as you discover services you wish to allow. The important thing is to remember to place `!all' at the end of each filter. You and any future manager can quickly see you are blocking all but specific packets and you reduce the chance that someone will accidentally change the meaning of the implicit ending stanza to `all'.
Using the IP Source Routing options, it is possible for people to send packets to you that look like they are coming from a host on your network. Prevent this sort of attack by blocking packets that have the Loose Source Routing or Strict Source Routing IP options set. If you want to be restrictive, add the line below to all your rulesets, including your default ruleset in the default pass filter:
!ip-opt=srcrt
Here's an example static filter configuration, appropriate for a system using pppd to create a PPP/SLIP link between the system 192.168.199.1 and a peer, 10.0.0.1, that is acting as the gateway to the Internet. The complete filter, minus the comments, follows this section.
The filter design reflects a fail-safe, or closed, policy.
default
pass !all # block all other packets
log rejected # packets rejected by packet filter
First, we define a default ruleset that is very restrictive. This is a fail-safe ruleset that will not pass any packets through the filter, but will notify you of all traffic you are missing.
10.0.0.1
This ruleset will be applied to any packet crossing the link connecting this host to the peer (10.0.0.1).
bringup
!3/icmp # ICMP unreachable messages
!5/icmp # ICMP redirect messages
!11/icmp # ICMP time exceeded messages
!who # WHO service (513/udp)
!route # routed
/gated
RIP
service (520/udp)
!ntp # Network Time service (123/udp)
all # all other packets
If the link is configured for `dial on demand connections, the `bringup filter describes those packets that will cause a call to be placed and a connection to be initiated. The `bringup filter should be used to prevent the connection from being brought up inappropriately. It is a good idea to block packets that are responses to "bad" inbound packets, such as ICMP Destination unreachable messages, because they aren't "interesting" enough to dial the modem. You should also block services, such as the WHO service, that send packets at a regular intervals and would therefore never permit the link to stay down long. Any other sort of traffic will initiate a dial connection.
pass
!recv /ip-opt=srcrt/unreach=srcfail # Block SRCRT attacks
Don't allow any incoming packets with the Source Route option set in the IP header. Respond with an ICMP Destination Unreachable message with the Source Route Failed code value.
!192.168.199.0/recv /src /unreach =net # Block IP spoofing attacks
!192.168.199.0/send /dst /unreach =net # Block IP spoofing attacks
Block any incoming packets that claim to be from your net, and block any outgoing packets that claim to be destined for your net. Respond with an ICMP Destination Unreachable message with the Bad Net code value.
!127.0.0.0;8 # Block IP spoofing attacks
Silently block all packets that claim to be either to or from the loopback
network.
dstport=nntp/dstaddr=192.168.199.10/srcaddr=10.0.5.6
dstport=nntp/srcaddr=192.168.199.10/dstaddr=10.0.5.6
dstport=nntp/dstaddr=192.168.199.10/srcaddr=172.31.12.13
dstport=nntp/srcaddr=192.168.199.10/dstaddr=172.31.12.13
!nntp/unreach=rst
Allow Network News (Usenet) exchanges with only your known news neighbors (10.0.5.6 and 172.31.12.13) and your news server 192.168.199.10). Block any other NNTP traffic, and respond with a TCP RST message.
domain/tcp/192.168.199.11/dst /syn /recv # (53/tcp)
!domain/tcp/syn /recv #
domain/tcp/192.168.199.11 #
Allow outside hosts to obtain Domain Name Service zone transfers only if your end of the stream is really being handled by your domain name server. In this example, you first permit inbound requests to the domain name server, then block all other inbound requests, and finally allow any TCP packets to pass over the link if they are to or from the host 192.168.199.11 and to or from the domain port to pass over the link. The sender will not be notified that the packets are being dropped.
dstport=domain/udp/192.168.199.11 #permit domain queries
#(53/udp)
!domain # block domain (53/tcp, 53/udp)
Allow Domain Name Service (DNS) queries to and from the DNS server. Block all other domain requests. This second rule is not strictly necessary, since the final rule is `!all, however adding this rule makes it fail-safe.
smtp/192.168.199.14/dst /syn /recv # (25/tcp)
!smtp/syn /recv #
smtp #
Allow incoming electronic mail connection requests to reach your SMTP server, allow no other incoming SMTP connection requests, and allow yourself unlimited outbound SMTP access.
www/syn /recv /192.168.199.13/dst # (80/tcp)
!www/syn /recv /unreach =host #
www #
Allow incoming World Wide Web connection requests to reach your WWW server. Allow no other incoming WWW connection requests. And allow yourself unlimited outbound WWW access.
!dstport=ident/recv /unreach=rst # block IDENT service (113/tcp)
You don't use the RFC 1413 identification services, so you might as well bounce the queries at the gateway instead of having inetd refuse the connection. Respond with a TCP RST message. This does not improve the security of your packet filter, since the packets would be blocked by the final `!all', but it does reduce the delay in services that make use of `ident'.
!telnet /syn /recv /unreach=prohibited # block inbound TELNET requests
telnet # permit TELNET messages
Allow outbound telnet connections from your network to anywhere else.
!finger /syn /recv /unreach =prohibited # block inbound FINGER requests
finger # permit FINGER messages
Block incoming finger requests until you install a safe finger daemon.
ftp /syn /recv /dst /192.168.199.12 # permit inbound FTP for anon FTP
!ftp /syn /recv /unreach =host # block inbound FTP
# requests
Allow incoming FTP (file transfer) traffic that uses your Anonymous FTP server system, but block any other incoming FTP requests. Respond with an ICMP Destination Unreachable message with the Bad Host code value.
ftp
# permit FTP messages
srcport=ftp -data/dstport=1024-65536/syn
!ftp -data/syn # block other FTP-DATA connections
ftp -data # permit FTP-DATA messages
After blocking the traffic specified above, allow both FTP command streams and FTP data streams to cross the link, both inbound and outbound.
dstport=33410-33515/udp/send # permit outbound traceroute operation
The traceroute tool probes high-numbered UDP ports and is so useful that you should let it through.
!5/icmp # block ICMP_REDIRECT
8/icmp/192.168.199.1 # permit ping of gateway
8/icmp/192.168.199.10 # permit ping of NNTP server
8/icmp/192.168.199.11 # permit ping of DNS server
8/icmp/192.168.199.12 # permit ping of FTP server
8/icmp/192.168.199.13 # permit ping of WWW server
8/icmp/192.168.199.14 # permit ping of SMTP server
!8/icmp/recv # block inbound ping address
# scanning
icmp # permit ICMP messages
Block ICMP redirect messages since the routing on an internal node should not be changed by an external site. Permit ICMP echo request packets, sent by `ping, to reach all hosts providing external services. Block all other inbound ping packets to prevent IP address probes. Finally, allow other ICMP messages to pass freely.
!all # block all other packets
Silently block all traffic not explicitly permitted to pass. Pass through the firewall only those packets explicitly permitted to pass.
keepup
!send # outbound traffic
!3/icmp # ICMP unreachable messages
!5/icmp # ICMP redirect messages
!11/icmp # ICMP time exceeded messages
!who # WHO protocol
!route # routed /gated RIP protocol
!ntp # Network Time Protocol
all # permit all other packets
The link will be considered active (non-idle) if any packet passes that's not specified in the keepup filter as being blocked. Since there are certain link failure modes that will allow your system to continue sending even though the peer is unresponsive, no outbound packets are permitted to reset the idle timer.
log
!8/icmp # ICMP ECHO packets
rejected # packets rejected by packet
# filter
tcp/syn # all TCP connection requests
!all # block all other packets
Log any packet blocked by the `pass filter above, except ICMP Echo messages. Also log all TCP connection requests.
This example of a filter is the product of an open policy. It was developed for the same system configuration as was used in the previous example demonstrating a filter developed for a closed policy. The system uses pppd to create a PPP/SLIP link between the system 192.168.201.1and a peer, 10.0.0.1, that is acting as the gateway to the Internet.
default
Since this ruleset is declared as the default ruleset and no ruleset has been defined for 10.0.0.1, it will be applied to any packet crossing the link connecting this host to any peer, including the Internet gateway (10.0.0.1).
bringup
!3/icmp # ICMP unreachable messages
!5/icmp # ICMP redirect messages
!11/icmp # ICMP time exceeded messages
!who # WHO service (513/udp)
!route # routed /gated RIP service
# (520/udp)
!ntp # Network Time service (123/udp)
all # all other packets
If the link is configured for `dial on demand connections, the `bringup filter describes those packets that will cause a call to be placed and a connection to be initiated. The `bringup filter should be used to prevent the connection from being brought up inappropriately. It is a good idea to block packets that are responses to "bad" inbound packets, such as ICMP Destination unreachable messages, that aren't "interesting" enough to dial the modem. You should also block services, such as the WHO service, that send packets at a regular intervals and would therefore never permit the link to stay down long. Any other sort of traffic will initiate a dial connection.
pass
!recv /ip-opt=srcrt/unreach =srcfail # Block SRCRT attacks
Don't allow any incoming packets with the Source Route option set in the IP header. Respond with an ICMP Destination Unreachable message that has the Source Route Failed code value.
!192.168.199.0/recv /src /unreach =net # Block IP spoofing
# attacks
!192.168.199.0/send /dst /unreach =net # Block IP spoofing
# attacks
Block any incoming packets that claim to be from your net, and block any outgoing packets that claim to be destined for your net. Respond with an ICMP Destination Unreachable message that has the Bad Net code value.
!127.0.0.0;8 # Block IP spoofing attacks
Silently block all packets that claim to be either to or from the loopback network.
!dstport=ident/recv /unreach=rst # block IDENT service (113/tcp)
You don't use the RFC 1413 identification services, so you might as well bounce the queries at the gateway instead of having inetd refuse the connection. Respond with a TCP RST message. This does not improve the security of your packet filter, since the packets would be blocked by the final!all', but it does reduce the delay in services that make use of `ident'.
!chargen/unreach=prohibited # block chargen service
# (19/tcp,19/udp)
!discard/unreach=prohibited # block discard service
# (9/tcp,9/udp)
!echo/unreach=prohibited # block echo service
# (7/tcp,7/udp)
Block access to your `` character generator'' port, and two others, because they are only meant as testing facilities and could be used by someone outside to swamp your network's bandwidth with unwanted, but otherwise harmless, traffic.
!5/icmp # block ICMP_REDIRECT
Block ICMP redirect messages since the routing on an internal node should not be changed by an external site.
!sunrpc # block portmap (sunrpc 111/tcp,111/udp)
!exec # block rexecd (512/tcp)
!login # block rlogind (513/tcp)
!shell # block rshd (514/tcp)
!syslog # block syslogd (514/udp)
!printer # block lpd (515/tcp)
!2049/udp # block nfsd (2049/udp)
Block access to a number of services that depend upon IP addresses for authentication, or that have no authentication built-in.
!tftp # block tftp (69/udp)
Block access to the tftp port because it is sometimes buggy and thus permit access to files that should not be distributed, such as password files. It is normally only used locally and should not be receiving requests from outside the local area network.
all # permit all other packets
Permit all traffic except that which you've explicitly specified as blocked, through the firewall.
keepup
!send # outbound traffic
!3/icmp # ICMP unreachable messages
!5/icmp # ICMP redirect messages
!11/icmp # ICMP time exceeded messages
!who # WHO protocol
!route # routed /gated RIP protocol
!ntp # Network Time Protocol
all # all other packets
The link will be considered active (non-idle) if any packet passes that's not specified as blocked in the keepup filter. Since there are certain link failure modes that will allow your system to continue sending even though the peer is unresponsive, no outbound traffic counts against the idle timer.
log
rejected # packets rejected by packet filter
!all # block all other packets
Log any packet blocked by the `pass filter above.
A number of errors are common enough to be specifically pointed out.
Earlier documentation for MST PPP used "Internet-gateway" to define the ruleset. This is the example hostname that was chosen to illustrate what the hostname might be. Many people have become confused and thought it was a special keyword. It is not! You must supply a real hostname or IP address or the keyword `default.
Another common mistake is to accidentally indent the ruleset identifier (e.g. hostname, IP address, or `default). This causes the software to assume that it is a part of the previous ruleset rather than defining the start of a new ruleset.
Yet another common mistake is not indenting all the parts of a ruleset after the initial ruleset identifier. This will cause the software to assume that the stanza is the start of a new ruleset. This will cause both failures and/or delays as the software tries to resolve the stanza into an IP address.
A different error is to fail to specify `tcp' or `udp' when a service can use either service but the keywords are applicable to only one. An example of this is the domain name service (DNS), which uses UDP for normal queries, but TCP for zone transfers. If you try to block inbound requests for a zone transfer you must remember to add the `tcp' qualifier to the service name `domain' to prevent a syntax error.
You can easily, but mistakenly, use a hostname that needs to be resolved because it is not defined or requires DNS, over a network link that is down. This causes failures and/or delays. Therefore, we would strongly recommend the use of only IP address in filter files.
Less commonly, some people who do not fully understand the protocol only permit `ftp packets to pass through their filter. The FTP protocol actually uses two channels; the first channel is used for commands and the second port is for used for data. The second channel uses a separate port, commonly `ftp-data', but that is actually determined during the FTP negotiations. The second channel is normally a reverse channel used to transfer data back to the client.
Finally, carefully make sure you permit passage of all packets required for your network access. Some Internet Service Providers (ISPs) require the use of a routing protocol and will mark the link inactive if they do not receive routing packets. This may require a rule in the pass clause of your ruleset to permit the route packets to traverse the link (e.g., `route').
Example of Static Packet Filter Developed for Closed Policy
default
pass !all # block all other packets
log rejected # packets rejected by packet filter
10.0.0.1
bringup
!3/icmp # ICMP unreachable messages
!5/icmp # ICMP redirect messages
!11/icmp # ICMP time exceeded messages
!who # WHO service (513/udp)
!route # routed
/gated
RIP
service (520/udp)
!ntp # Network Time service (123/udp)
all # all other packets
pass
!recv /ip-opt=srcrt/unreach =srcfail # Block SRCRT attacks
!192.168.199.0/recv /src /unreach =net # Block IP spoofing attacks
!192.168.199.0/send /dst /unreach =net # Block IP spoofing attacks
!127.0.0.0;8 # Block IP spoofing attacks
dstport=nntp/dstaddr=192.168.199.10/srcaddr=10.0.5.6
dstport=nntp/srcaddr=192.168.199.10/dstaddr=10.0.5.6
dstport=nntp/dstaddr=192.168.199.10/srcaddr=172.31.12.13
dstport=nntp/srcaddr=192.168.199.10/dstaddr=172.31.12.13
!nntp/unreach=rst
domain/tcp/192.168.199.11/dst /syn /recv # (53/tcp)
!domain/tcp/syn /recv #
domain/tcp/192.168.199.11 #
dstport=domain/udp/192.168.199.11 # permit domain queries (53/udp)
!domain # block domain (53/tcp, 53/udp)
smtp/192.168.199.14/dst /syn /recv # (25/tcp)
!smtp/syn /recv #
smtp #
www/syn /recv /192.168.199.13/dst # (80/tcp)
!www/syn /recv /unreach=host #
www #
!dstport=ident/recv /unreach =rst # block IDENT service (113/tcp)
!telnet /syn /recv /unreach =prohibited # block inbound TELNET requests
telnet # permit TELNET messages
!finger /syn /recv /unreach=prohibited # block inbound FINGER requests
finger # permit FINGER messages
ftp /syn /recv /dst /192.168.199.12 # permit inbound FTP for anon FTP
!ftp /syn /recv /unreach =host # block inbound FTP requests
ftp # permit FTP messages
srcport=ftp -data/dstport=1024-65536/syn
!ftp -data/syn # block other FTP-DATA connections
ftp -data # permit FTP-DATA messages
dstport=33410-33515/udp/send # permit outbound traceroute
!5/icmp # block ICMP_REDIRECT
8/icmp/192.168.199.1 # permit ping of gateway
8/icmp/192.168.199.10 # permit ping of NNTP server
8/icmp/192.168.199.11 # permit ping of DNS server
8/icmp/192.168.199.12 # permit ping of FTP server
8/icmp/192.168.199.13 # permit ping of WWW server
8/icmp/192.168.199.14 # permit ping of SMTP server
!8/icmp/recv # block inbound ping address scanning
icmp # permit ICMP messages
!all # block all other packets
keepup
!send # outbound traffic
!3/icmp # ICMP unreachable messages
!5/icmp # ICMP redirect messages
!11/icmp # ICMP time exceeded messages
!who # WHO protocol
!route # routed /gated RIP protocol
!ntp # Network Time Protocol
all # permit all other packets
log
!8/icmp # ICMP ECHO packets
rejected # packets rejected by packet filter
tcp/syn # all TCP connection requests
!all # block all other packets
Example of Static Packet Filter Developed for Open Policy
default
bringup
!3/icmp # ICMP unreachable messages
!5/icmp # ICMP redirect messages
!11/icmp # ICMP time exceeded messages
!who # WHO service (513/udp)
!route # routed /gated
RIP
service (520/udp)
!ntp # Network Time service (123/udp)
all # all other packets
pass
!recv /ip-opt=srcrt/unreach=srcfail # Block SRCRT attacks
!192.168.199.0/recv /src /unreach=net # Block IP spoofing attacks
!192.168.199.0/send /dst /unreach=net # Block IP spoofing attacks
!127.0.0.0;8 # Block IP spoofing attacks
!dstport=ident/recv /unreach=rst # block IDENT service (113/tcp)
!chargen/unreach =prohibited # block chargen service
!discard/unreach=prohibited # block discard service
!echo/unreach=prohibited # block echo service (7/tcp,7/udp)
!5/icmp # block ICMP_REDIRECT
!sunrpc # block portmap (sunrpc 111/tcp,111/udp)
!exec # block rexecd (512/tcp)
!login # block rlogind (513/tcp)
!shell # block rshd (514/tcp)
!syslog # block syslogd (514/udp)
!printer # block lpd (515/tcp)
!2049/udp # block nfsd (2049/udp )
!tftp # block tftp (69/udp)
all # permit all other packets
keepup
!send # outbound traffic
!3/icmp # ICMP unreachable messages
!5/icmp # ICMP redirect messages
!11/icmp # ICMP time exceeded messages
!who # WHO protocol
!route # routed /gated RIP protocol
!ntp # Network Time Protocol
all # all other packets
log
rejected # packets rejected by packet filter
!all # block all other packets
The second field on each line in the /usr/lib/mstppp/Systems file specifies the times pppd is allowed to attempt to establish connections. Two benefits of time restrictions are:
-
assurance that there will always be personnel on each end of the link to monitor connection attempts
-
assurance that connections will take place when the most favorable telephone calling rates apply
The Systems field is very flexible. It can be configured by day and by hour, with many different combinations allowed for the same connection. For example, the following entry allows connections on any day between 1 AM and 6AM or any time on Saturday and Sunday:
lark Any0100-0600|Sa|Su ACU 38400 5551212 in:--in: Probin word: mypasswd
MST PPP supports the ability to maintain a connection when calling a modem which has a dial-back security feature. The /usr/lib/mstppp/Systems file chat script option \ M allows this by disabling delivery of SIGHUP to pppd . This signal usually results from loss of Carrier Detect and tells pppd to abruptly disconnect from the active session.
Typically, an answering modem with dial-back capability responds to a call by taking the following steps:
The modem
-
challenges incoming callers with a prompt string
-
accepts the input identifying the caller
-
hangs up the call
-
calls a number associated with the caller's identification
-
re-establishes a carrier
The calling modem might then demand the same type of identification before allowing remote data to flow through its serial interface to the local system.
The calling system's pppd must be prepared for the temporary lack of a Carrier Detect signal from its modem during the dial-back from the remote modem. To avoid receiving a SIGHUP, pppd instructs the UNIX system's serial drivers not to deliver the signal. In other words it says, "Temporarily treat the serial interface as if it were connected to a local device like a terminal or printer, instead of a modem." pppd does this by specifying \M in the `send phase of a /usr/lib/mstppp/Systems chat script.
After the disconnection period, through the `send phase option, \m, pppd tells the system's serial drivers to reverse the first instruction and respect the modem's full variety of control. For example, to dial into a system protected by a dial-back modem, the /usr/lib/mstppp/Systems chat script might be written like this:
#
# This connects to a system protected by a Telebit T3000 callback
# modem
# with S46=2.
#
server Any ACU 38400 19071234567 TIMEOUT 60 \
ENTER\sPASSWORD: my_modem_password \ M \
ENTER\SPASSWORD: my_modem_password \ m \
login: my_login_name ssword: my_login_password
Morning Star PPP implements both the Password Authentication Protocol (PAP) and the Challenge Handshake Authentication Protocol (CHAP). If pppd is invoked with either of the requireauth or requirechap options, it will demand that the peer (either calling or called) authenticate itself. The Auth file contains pairs of either names and secrets for CHAP negotiation, or usernames and passwords for PAP negotiation. If a peer provides a name or username, its secret or password must match that found in Auth or the authentication phase fails and the connection is terminated. Each name / secret pair in Auth may be followed by address patterns restricting the peer's negotiated IP address. If an address restriction is specified for a particular name and the peers negotiated IP address does not match the restriction address patterns, pppd will terminate the connection. The
rechap interval
option instructs pppd to periodically (every interval seconds) challenge the peer to authenticate itself. If the peer fails the new challenge, the link is terminated.
Sometimes an incoming call must penetrate the answering machine's SecureID system before its offered a login prompt. SecureID is a credit card sized device which provides the caller a code that matches one held by the answering system. The code changes frequently, but the card and the SecureID system are synchronized so that each has the same code at any given time.
MST PPP allows standard output from the xprompt program to populate a field in the /usr/lib/mstppp/Systems file. If you have xprompt and the C compiler, you can develop the means to input the current SecureID code into your Systems chat script. Ultimately, the chat script passes the callers code to the SecureID system during the login process.
Suppose the SecureID system answers incoming calls with the string `Identify Yourself!, expecting the incoming user to type the secret string that appears on the user's SecureID card. The Systems file entry for the calling system looks like this with an executable shell script called SecureCode in back quotes:
peer Any ACU 38400 5551212 self! `SecureCode` in: Pfoo word: bar
SecureCode is installed in the pppds search path set by the /usr/lib/mstppp/Autostart script that loads pppd. SecureCode would look something like this:
#!/bin/sh
DISPLAY=:0.0
export DISPLAY
prompt="`tr -d "\015" | tail -1`"
/usr/local/bin/X11R4/xprompt -rlen 20 -p $prompt
The integrated process described below provides a means for dialog between the user and the remote SecureID system. When pppd brings up the link on demand, the Systems chat script progresses until it sees ``self!". These steps follow:
-
The script invokes the SecureCode script
-
SecureCode, in turn, invokes xprompt
-
An xprompt window appears on the workstations screen
-
The user types the secret string into the xprompt window and hits a carriage return
-
xprompt exits, putting that secret string on its standard output (stdout)
-
SecureCode exits, putting that secret string on its stdout
When SecureCode, the command between the backquotes, exits, pppd sends its stdout across the modem to the SecureID barrier, just as if it had been typed directly by the user. If the string sent to the answering system matches the expected string, the user is identified and the expect/send couplets of the chat script continue.
Intro - Introduction to the Morning Star Technologies PPP manual pages.
This section contains the following manual pages:
This introduction
ppp.Auth
PPP authentication file format
ppp.devices
PPP physical device description format
ppp.dialers
PPP dialer description file format
ppp.Filter
PPP packet filter specification file format
ppp.Keys
PPP encryption keys file format
ppp.Systems
PPP neighboring systems file format
pppd
PPP daemon
tun
IP network tunnel driver
tun - IP
network tunnel driver
pseudo-device tun[
n
]
#include <sys/tun.h>
open("/dev/tun_n", mode);
When IP
packets are written to
/dev/tun
n
or
/dev/tun
n+M,
they are received by the kernel
's IP
layer on the network interface du
n
When the kernel's IP layer sends packets to the IP interface du
n
, they are available for reading on
/dev/tun
n
or
/dev/tun
n+M.
Instead of having hardware and an associated kernel interface that support network functions, the tun driver allows a network interface to be implemented as a user-space process. While talking to the same set of tunnel drivers on the same system, different network interface processes can implement different IP encapsulation methods, such as RFC 877 for use over CCITT X.25-based public data networks, or RFC 1055 SLIP or RFC 1661/1332 PPP for use over dedicated line s and dialup modems.
The tun driver provides support for a pair of devices collectively known as an IP tunnel The two devices comprising a tunnel are known as the inbound and outbound sides, similar to the pairing between /dev/tty n (the inbound terminal) and /dev/cu n (the outbound `auto -call unit available on many systems). The outbound side's minor device number is that of the inbound side plus M , which is 128, though they together appear to IP as one interface. If both the inbound and outbound sides of a tunnel device are open, packets received from IP are delivered to only the inbound side.
If a TCP packet received from IP is part of a telnet, rlogin, or FTP command stream, it will be put in a fast queue . All packets in the fast queue are delivered to the user before any packets in the normal queue.
A few special ioctls are provided for use on the /dev/tun* devices to supply the functionality needed by applications programs to emulate real hardware interfaces. The complete list of supported ioctls is:
- TUIOSPTPT
-
Set or clear the IFF_POINTOPOINT in the associated network interface.
- TUIOSADRMD
-
Set or clear `address mode', in which packets read are prefaced with four octets containing the destination IP address in network byte order. The third argument is a pointer to an integer containing either a zero or a one, indicating whether `address mode' should be cleared or set, respectively. If both `address mode' and `packed buffer mode' are set, each packet's length will come first, followed by the packet's destination address, followed by the packet itself
- TUIOGADRMD
-
Get the current status of `address mode'.
-
TUIOSPKBMD
-
Set or clear `packed buffer mode' where multiple packets are encoded in single read/write buffers. The third argument is a pointer to an integer containing either a zero or a one, indicating whether `packed buffer mode' should be cleared or set, respectively. If set (1), each packet is preceded by four octets representing the next packet's length in octets. The following packet will then be aligned to the next multiple of four octets. If cleared (0), packets will be delivered one per read(3) from the tunnel device. If both `address mode' and `packed buffer mode' are set, each packet's length will come first, followed by the packet's address, followed by the packet itself.
-
TUIOGPKBMD
-
Get the current status of `packed buffer mode'.
-
TUIOSPKMAX
- Set the max number of IP frames to send back in a packet buffer read.
-
TUIOGPKMAX
-
Get the PKMAX value.
-
TUIOSPKPAD
-
Set the number of long word zeroes to put on the front of each packet read in packed buffer mode.
-
TUIOGPKPAD
-
Get the number of pad words.
-
TUIOSNAME
-
Set the interface name (may only be invoked by the superuser).
-
TUIOGNAME
-
Get the interface name.
-
FIONBIO
-
Set or clear non-blocking mode for I/O operations
#include <sys/tun.h>
int tun_fd = -1, len;
char *packet;
tun_fd = open("/dev/tun0", O_RDWR);
ioctl(tun_fd, TUIOSNAME, "du");
len = read(tun_fd, packet, size);
write(tun_fd, packet, len);
If a packet is delivered to the interface for an address family other than AF_INET, EAFNOSUPPORT will be returned.
/dev/tun0
through /dev/tun M-1 `inbound tunnel devices
/dev/tun M through /dev/tun 2*M-1 ` outbound tunnel devices
ppp.Auth
(MST_PPP), ppp.Devices
(MST_PPP), ppp.Dialers
(MST_PPP), ppp.Filter
(MST_PPP), ppp.Keys
(MST_PPP), ppp.Systems
(MST_PPP), pppd
(MST_PPP), RFC
1661
, RFC 1332, RFC 1144
, RFC 1055
, RFC 877
Copyright 1991, 1992, 1993, 1994, 1995, 1996 Morning Star Technologies Inc.; all rights reserved.
ppp.Auth - PPP
authentication file format
The file /usr/lib/mstppp/Auth on SCO systems contains values used by MST PPPs implementation of the link-level authentication protocols, CHAP (Challenge Handshake Authentication Protocol) and PAP (Password Authentication Protocol). This implementation of both CHAP and PAP conforms to RFC 1334, PPP Authentication Protocols.
CHAP is a stronger authentication mechanism. Use CHAP whenever possible instead of PAP. Earlier versions of MST PPP provided interoperability with draft versions of CHAP pppd s oldchap or olderchap command line options. However, these options are long out of date and have been eliminated from this version of the software.
The file /usr/lib/mstppp / Auth should be mode 600 or 400, and owned by root.
-
Each authentication specification is on its own single line of up to 1023 characters.
-
Comments begin with a#' and extend to the end of the line. Blank lines, or lines beginning with a `#', are ignored. Fields are separated by horizontal white space through the use of blanks or tabs.
-
If pppd is using CHAP authentication, the first word on the line must match the peer's Name as received in a CHAP Challenge or Response packet and the second word is used for the Secret .
-
If pppd is using PAP authentication, the first word on the line must match the Peer-ID in a transmitted or received PAP Authenticate-Request packet and the second word is used for the Password.
-
The default value used for the Name in transmitted CHAP packets or for the Peer-ID in transmitted PAP packets is the hostname (1) of the machine pppd is running on.
In the midst of the Name/Peer-ID and Secret/Password strings, ^x is translated into the appropriate control character before matching, and \xxx represents the character corresponding to the octal number xxx . Other special sequences are:
- \s
-
Matches a space character (ASCII 0x20)
- \t
-
Matches a horizontal tab character (ASCII 0x09)
- \n
-
Matches a line feed character (ASCII 0x0a)
- \r
-
Matches a carriage return character (ASCII 0x0d)
The fields have the following meaning:
- name
-
The Name field of a sent or received CHAP Challenge or Response message, or the Peer-ID field of a sent or received PAP Authenticate-Request message. For transmitted packets, this is the hostname unless overridden by the pppd name option.
- secret
-
The secret word that the peer also knows.
- optional address restrictions
-
A set of zero or more patterns restricting the addresses that are allowed to be used with the named peer. Patterns are separated by spaces or tabs and are parsed from left to right.
Each pattern may begin with an exclamation mark to indicate that the following pattern should not be allowed.
The rest of the pattern consists of digits and periods, and optionally a leading or trailing asterisk, which will match anything. If none of the patterns match, then the address will be allowed if the last pattern began with an exclamation point, and will be disallowed otherwise.
If the optional address restriction field consists of only a single address, it replaces the destination address configured on the command line.
The following
Auth
provides
pppd
with a secret for use when a peer claims to be other-host, robin, orJack's machine'.
#
# Auth - PPP authentication name/secret file
# Format:
#name secret optional address restrictions
other-host secret-key !137.175.9.2 37.175.9.*/0xffffff00
robin dK3ig8G8hs 137.175.11.4
Jack's\smachine I\sam\sa\sjelly\sdonut.
tun(MST_PPP), ppp.Devices
(MST_PPP), ppp.Dialers
(MST_PPP), ppp.Filter
(MST_PPP), ppp.Keys
(MST_PPP), ppp.Systems
(MST_PPP), pppd
(MST_PPP), RFC
792, RFC 1661
, RFC 1332, RFC 1334
.
Brian Lloyd and William A. Simpson, "The PPP
Authentication Protocols," Internet
Draft, May 1992.
Copyright 1991, 1992, 1993, 1994, 1995, 1996 Morning Star Technologies Inc.; all rights reserved.
ppp.Devices - PPP
physical device description file format
The file /usr/lib/mstppp/Devices on SCO systems associates dialer types with physical devices and speeds. Pppd examines it when placing a call to a neighboring machine. If no suitable speed is found, or if all dev ices associated with that speed are busy, pppd will try again later.
-
Entries are one to a line
-
Blank lines are ignored
-
Comments begin with a `#' and extend to the end of the line
-
Upper/lower case distinctions are significant
-
Fields on a line are separated by horizontal white space created by blanks or tabs
-
Each entry must contain three or more fields, in this order:
- dialer
-
Contains either the string `Direct, the name of the modem dialing chat script in Dialers to use with this device, or the name of an external dialer program.
- Device
-
The name of the device in the /dev directory ( tty1a, tty1A , etc.). Device names for SnapLink connections are followed by a slash and the port number in use ( rfd0, rfd1 , etc.).
- speed
-
The baud rate of the synchronous connection, or a string to be matched against the speed field of entries in Systems when the Systems device field is set to ACU (Any Call Unit).
There is also a fourth field for describing options:
- optional parameters
-
Any special handling for this device. Currently supported values are shown in the table below.
- rtscts
-
Specifies that the line be conditioned for out-of-band EIA RS-232-D `hardware (RTS/CTS) flow control. The default is to use no flow control. For an outbound connection, this may be specified either in Devices or on the pppd command line.
- Crtscts
-
A synonym for rtscts
- xonxoff
-
Specifies that the line be conditioned for in-band (`software) flow control, using the characters DC3 (^S, XOFF, ASCII 0x13) to stop the flow and DC1 (^Q, XON, ASCII 0x11) to resume. The default is to use no flow control. For an outbound connection, this may be specified either in Devices or on the pppd command line.
- internal-clocking
-
The SnapLink will provide the synchronous clock signal. By default, it expects the modem, CSU/DSU or modem eliminator to provide the clock signal. Internal-clocking cannot be used with RS-232 cables on the SnapLink.
- 32-bit-fcs
-
A SnapLink will calculate 32-bit FCS values for transmitted frames, and check received frames with 32-bit FCS calculations. This is not negotiable at connection establishment time. 32-bit FCS is only available when running synchronous PPP on the SnapLink.
- min-flags=min flags
-
The number of additional HDLC flag characters a SnapLink should insert between data frames. The default and minimum is 2; the maximum is 16.
-
ignore-cd
-
Ignore the state of the CD (Carrier Detect, also called DCD, Data Carrier Detect) signal. This is useful for systems that don't support CD but want to run PPP over a dedicated line.
The external dialer program is run with the following arguments:
-
device name
-
The contents of the Device field from the Devices entry
-
speed
-
The contents of the Speed field of the Systems and Devices entries.
-
telephone number
-
The contents of the Phone Number field of the Systems entry.
This program also allows for optional parameters:
-
optional parameters
-
Copied from the Optional Parameters section of the Devices entry. If the external dialer program exits with status 0, then the dial attempt is considered to have succeeded. Any other exit status indicates a failure.
#
# Devices - PPP devices file
#
#Dialer device speed Optional parameters
T2500-PEP cua 19200-PEP rtscts
T1600 cub 38400 rtscts
Direct
rsd0a/0
1536000 internal-clocking
Oddball rsd0a/1 64000 cua 9600 5551212
In the last line of this example, the 64Kb synchronous modem on the SnapLinks port 1 has an asynchronous dialer interface attached to the workstations port `a' The Systems line would look like
host Oddball rsd0a/1 64000 0
There must be a program (or an executable shell script) called /usr/lib/mstppp/Oddball that dials the modem when invoked as
Oddball rsd0a/1 64000 0 cua 9600 5551212
A warning message will be printed for each unrecognized optional parameter if the debug level is 2 or more.
The external dialer is invoked as root , so you should take appropriate security precautions with its content and file protection.
tun(MST_PPP), ppp.Auth
(MST_PPP), ppp.Dialers
(MST_PPP), ppp.Filter
(MST_PPP), ppp.Keys
(MST_PPP), ppp.Systems
(MST_PPP), pppd
(MST_PPP), RFC
1661
, RFC 1332, RFC 1144
, RFC 1055
.
Copyright 1991, 1992, 1993, 1994, 1995, 1996 Morning Star Technologies Inc.; all rights reserved.
ppp.Dialers - PPP
dialer description file format
The file
/usr/lib/mstppp/Dialers
on SCO systems describes how to dial each type of modem attached to the UNIX system that is to be made available for outbound
PPP calls. After looking for modem dialers in
Dialers.local
,
Pppd
examines
/usr/lib/mstppp/Dialers
when placing a call to a neighboring machine. Entries in Dialers.local take precedence over those in
/usr/lib/mstppp/Dialers.
When
pppd
selects a line from
Systems
, it uses thespeed
' field to select an entry in
Devices
, from which it uses thedialer
' field to select an entry in
Dialers
.
Pppd
then interprets thechat script
' field from that dialer description. The `dialer
' field may also be the name of a binary dialer program.
-
Entries are one to a line; blank lines are ignored.
-
Comments begin with a `#' and extend to the end of the line.
-
Upper/lower case distinctions in the dialer
field
are significant for matching purposes, as are strings in the chat script.
-
Fields on a line are separated by horizontal white space created by blanks or tabs).
-
If a chat script
ends with a backslash (`
\'), the next line is considered a continuation of the chat script. Continuations may only occur in the midst of a chat script.
-
Each entry must contain these fields, in this order:
-
dialer
-
The name of this dialer
, to be matched against the dialer field
in
Devices
chat-script
A description of the conversation that
pppd
holds with the modem.
A chat script
takes the form of a space-separated list of expect-send
pairs. At minimum, each pair consists of a field to expect the "remote" end to send, followed by a field to send in response. Unless asend' string ends with
\
c
,
pppd
will follow it by sending a carriage return character (ASCII 0x0d).
Chat scripts areexpect send
expect send...', orexpect-send-expect send...', where thesend' following the hyphen is executed if the preceding expect fails to match received text.
Certain special words may be used in the chat script
to control the behavior of
pppd
as it attempts to dial. Both ABORT
and TIMEOUT
must be in theexpect' phase of the chat script.
-
ABORT
abort-string
-
If
pppd
sees
abort-string
while executing the remainder of the chat script
, abort the dialing attempt and note the failure in the log
file.
-
TIMEOUT
timeout-time
-
While executing the current chat script
, wait timeout-time seconds for a response before considering the dialing attempt to have timed out. Writes have a fixed 60-second timeout.
The expect-send
couplet of
"" P_WORD
sets the line parity
accordingly:
-
P_AUTO
-
Set transmission parity
based on the parity observed in characters received inexpect' strings. This is the default.
-
P_ZERO
-
Transmit characters with the parity
bit set to 0
(8 bits, no parity
).
-
P_ONE
-
Transmit characters with the parity
bit set to 1
-
P_EVEN
-
Transmit characters with even parity.
-
P_ODD
-
Transmit characters with odd parity.
In the midst of either anexpect' string or a `send
' string,
^x
gets translated into the appropriate control character, and
\x
gets translated into
x
. Other special sequences are:
- \s
-
Send or receive a space character (ASCII 0x20)
-
\t
-
Send or receive a horizontal tab character (ASCII 0x09)
-
\n
-
Send or receive a line feed character (ASCII 0x0a)
-
\r
-
Send or receive a carriage return character (ASCII 0x0d)
-
\\
-
Send or receive a backslash character (ASCII 0x5c)
-
\^
-
Send or receive a carat character (ASCII 0x5e)
-
^>character>
-
Send or receive the single character Ctrl-<character> (ASCII 0x00 through 0x1f)
-
\
ddd
-
Send or receive a character, specified in octal
d
igits
-
\p
-
Pause for.25 second before proceeding (send
only)
-
\d
-
Delay for 2 seconds before proceeding (send
only)
-
\K
-
Send a break (.25 second of zero bits)
-
\M
-
Disable hangups (sets CLOCAL or LNOHANG)
-
\m
-
Enable hangups (unsets CLOCAL or LNOHANG) (the default
)
-
\c
-
Don't append a carriage return character after sending the preceding string (send
only)
-
\q
-
Don't print succeeding send
strings (e.g. a password
) in any debugging
or logging output. Subsequent
\
q
sequences togglequiet' mode.
-
\T
-
Insert the telephone number found in the fifth field of
Systems
here
#
# Dialers - PPP dialers file
#
# Dialer Chat script
T1600 ABORT
NO
\sCARRIER ABORT NO\sDIALTONE ABORT BUSY \
ABORT
RRING
\r\n\r\nRRING\r\n\r\nRRING \
ABORT
ERROR TIMEOUT
5 "" AT OK-AT-OK \
ATS111=0DT\T TIMEOUT
30 CONNECT
#
T2500-PEP \
ABORT
NO
\sCARRIER ABORT NO\sDIALTONE ABORT BUSY \
ABORT
RRING
\r\n\r\nRRING\r\n\r\nRRING \
ABORT
ERROR TIMEOUT
5 "" AT OK-AT-OK \
ATS111=0DT\T TIMEOUT
30 CONNECT
\sFAST
#
USRv32bis \
ABORT
ERROR ABORT NO
\sANSWER ABORT NO\sCARRIER \
ABORT
BUSY ABORT RRING
\r\n\r\nRRING\r\n\r\nRRING \
ABORT
NO
\sDIAL\sTONE TIMEOUT
5 "" AT&F \
OK-ATQ0-OK ATB0E0X7&B1&H1&I0&K3&R2&S1 OK-AT-OK \
ATS01=1S02=255S19=0 OK-AT-OK ATDT\T TIMEOUT
30 \
CONNECT
tun(MST_PPP), ppp.Auth
(MST_PPP), ppp.Devices
(MST_PPP), ppp.Filter
(MST_PPP), ppp.Keys
(MST_PPP), ppp.Systems
(MST_PPP), pppd
(MST_PPP), RFC
1661, RFC 1332, RFC 1144
, RFC 1055
.
Copyright 1991, 1992, 1993, 1994, 1995, 1996 Morning Star Technologies Inc.; all rights reserved.
ppp.Filter
- PPP
packet filter specification file format
The file
/usr/lib/mstppp/Filter
describes how on-demand PPP
links are managed. By default
, any type of packet may:
-
cause the link, if down, to be brought up
-
traverse the link
-
reset the idle timer
, preventing the timer from expiring which, in turn, cause the link to shut down
These actions are not always appropriate and packet traffic should be controlled. The filter file allows individual control based on many of the packet's attributes and components, including type, source, destination, direction, and service. These selection criteria may be specified for any of the situations listed at the beginning of the paragraph.
The file
/usr/lib/mstppp/Filter
only filters packets on a PPP link. To filter packets on any kind of network (such as Ethernet or Token Ring), use the SCO Internet Security Package.
The details of the filtering which are recorded by a fourth activity, packet logging, may also be selected using packet information.
-
Comments begin with a `#' and extend to the end of the line
-
Blank lines, or lines beginning with a `#', are ignored
-
Upper/lower case distinctions are ignored in hostname
specifications, but are significant elsewhere
-
Fields are separated by horizontal or vertical white space created by blanks, tabs or newlines. If a newline is followed by white space, that line is a continuation of the filtering specification already in progress.
Lines beginning with a hostname
or IP
address
or the special word `default
', are considered the beginning of a new set of filtering specifications. The filtering specifications are applied to any packet crossing the point-to-point link connecting the host to the peer
named by that initial hostname or IP address.
-
The hostname
or IP
address
in the first column of the filter file refers to the peer
at the remote end of the point-to-point link, which may be a system or router
or terminal server
.
-
The hostname
or IP
address
associated with the link peer
is unrelated to the source or destination IP address of any packet crossing the link.
-
If the link peer
's address doesn't match any name or address specified in the first column of filter file, the filter specification following the special word `default
' will be used.
There are four keywords to describe the actions taken by
pppd
in response to a particular packet:
-
bringup
-
Describes those packets that will cause a call to be placed and a connection initiated. Packets of this sort also must qualify to `pass
' across the link, either by being explicitly mentioned or by inclusion in a larger class in the `pass
' section.
-
pass
-
Describes those packets that will be allowed to traverse the link on an already-established connection. Only packets which would be passed can cause the link to be brought up. Any packet that is not passed is optionally logged, then discarded.
-
keepup
-
Describes packets that will reset the idle timer
, thereby keeping the line connected.
-
log
-
Describes packets whose headers or contents are to be noted in the log
file.
After each action keyword comes stanzas, separated by white space, describing packets that fit the criteria for that action. Each stanza is processed in the order shown in the file, and contains restrictions or permissions on the packets encountered. As soon as a pattern or a condition is found that matches the packet in question,
pppd
takes the indicated action and ignores the rest of the listed stanzas (i.e. inclusive
or
with shortcut evaluation).
Stanzas may contain:
-
IP
protocol numbers which are optionally hyphen-separated ranges of TCP
or UDP port numbers defined by the `/tcp
' or `/udp' qualifier
-
Numbers representing ICMP
message types or codes along with the `/icmp
' qualifier. (ICMP numbers are listed in
<netinet/ip_icmp.h>.
)
-
Service
names corresponding to entries in
/etc/services
-
Names or IP
address
es of hosts or networks
-
The special keywords `all', or `!all'. The former, `all', is the default
for all actions except `log', where the default is `!all
'
Usually, it is unnecessary to use `all' because
pppd
automatically adds a `!all
' at the end of a stanza list if the last stanza
is not
negated or `all' at the end of a stanza list if the last stanza
is
negated.
For example, in the typical case of `log
' this sensibly results in
only
those packets matching the stanzas shown being logged, and no others. In the typical case of `pass
', this results in certain listed packets being restricted, and all others being passed.
If a network is specified, either by name or by address, the corresponding network mask must also be specified if it is of a different size than the default
for that class of network. The network mask and additional `and
' conditions within a stanza are separated by slashes (/), and may be specified either as a series of decimal numbers separated by periods, or as a single 32-bit hexadecimal number. The sense of a stanza may be negated by prefixing it with an exclamation mark (!).
In the `log
' filter specification, the special keyword `trace
' causes the
contents
(as well as the headers) of the indicated type of packet to be written to the log file
. Also in the `log
' filter specification, the special flag `rejected' signifies that the packet is to be logged only if it was rejected
by the `pass
' filter.
Pppd can distinguish between outbound
and inbound
packets, i.e. those which originate at the host versus those that originate at the other end of the link. TCP
data streams are opened when the initiator sends a SYN packet to the intended recipient when using of TCP applications such as telnet
or FTP. The special keyword `syn
' allows filtering or logging these connection-starting packets. Qualifying it with `recv
' or `send
' allows a session to be started or logged only if it is in the indicated direction. The special keyword `fin
' allows filtering or logging the packets that close TCP connections.
The `src
' and `dst
' keywords refer to source and destination and are used to distinguish a packet
's ports
, addresses or hostnames.. If both are applied to the same stanza, e.g.
/src/dst
, both the source and destination address
and/or port must match.
The `unreach
=
' keyword causes an ICMP
Destination Unreachable message to be sent to the packet's source address
, bearing the indicated code field, which may be chosen from the table shown below. The `unreach
' messages are described in RFCs 792, 1122 and 1812.
The currently available pnemonic ICMP
Unreachable codes are:
-
# NAME
-
DESCRIPTION
-
0 net
-
The destination network is unreachable
-
1 host
-
The destination host is unreachable
-
2 prot or protocol
-
The designated transport protocol is not supported
-
3 port
-
The designated transport protocol (e.g., UDP) is unable to demultiplex the datagram but has no protocol mechanism to inform the sender.
-
4 needfrag
-
Fragmentation is needed and the Don't Fragment flag is set
-
5 srcfail
-
Source route failed
-
6 net-unknown
-
The destination network is unknown. This code normally should not be generated. It implies that the destination network does not exist. Code 0 (Network Unreachable) should be used in place of Code 6.
-
7 host-unknown
-
The destination host is unknown.
-
8 *
-
The
source host is isolated. Routers should not generate Code 8; whichever of Codes 0 (Network Unreachable
) and 1 (Host Unreachable) is appropriate should be used instead.
-
9 *
-
Communication
with the destination network is administratively prohibited. This code was intended for use by end-to-end encryption
devices used by U.S military agencies. Routers should use the newly defined Code 13 (Communication Administratively Prohibited) if they administratively filter packets.
-
10 *
- Communication
with the destination host is administratively prohibited. Same reasoning as message 9 above.
-
11 net-tos
-
Destination network unreachable for the designated type of service
-
12 host-tos
-
Destination host unreachable for the designated type of service
-
13 prohibited
-
Communication Administratively Prohibited
-
14 precedence
-
Host Precedence Violation
-
15 precedence-cutoff
-
Precedence cutoff in effect
-
rst
-
This is a special keyword which will not send
an ICMP
Destination Unreachable message but instead a TCP
RST packet.
The `ip-opt=' keyword can be used to select packets based on whether they bear various IP
options
(RFC
1122 section 3.2.1.8 and RFC 791 section 3.1 (pps 16ff)), selected from
-
rr
-
Record Route is used to trace
the route an internet datagram takes
-
ts
-
Time Stamp
-
security
-
Security
is used to carry Security, Compartmentation, User Group (TCC), and Handling Restriction Codes compatible with DOD requirements.
-
lsrr
-
Loose Source Routing is used to route the internet datagram based on information supplied by the source.
-
satid
-
SATNET Stream Identifier (obsolete)
-
ssrr
-
Strict Source Routing is used to route the internet datagram based on information supplied by the source.
-
sscrt
-
Either Loose Source Routing or Strict Source Routing
-
any
-
Any IP
option, could even match the No Operation option.
The following
Filter
file describes the default
behavior of
pppd
, either in the absence of a filter specification file or in the case of an empty file:
# Filter
- PPP
configuration file,
# binding packet types to actions.
# Describes the default
behavior of the daemon
:
default
bringup
all pass
all keepup
all log
!all
The default
behavior is no restriction of packets, and no logging.
A `pass
' line like this might be appropriate as a security firewall between an organizational network and the larger Internet
:
internet-gateway
bringup
!ntp !3/icmp !5/icmp !11/icmp !who !route !nntp !89
pass
nntp/137.39.1.2 !nntp
telnet
/syn
/recv
/137.175.0.0
!telnet
/syn
/recv
!ftp
/syn/recv
!login
/syn
/recv
!shell/syn/recv !who
!sunrpc !chargen !tftp !supdup
/syn
/recv
!exec
!syslog !route !6000/tcp/syn
/send
keepup
!send
!ntp !3/icmp !5/icmp !11/icmp
!who !route !89
log
rejected
The `pass specification:
-
Allows NNTP (Usenet news) transactions with one peer and no others.
ex.
pass
nntp/137.39.1.2 !nntp
-
Allows incoming Telnet sessions from hosts on only one network
ex.
pass
telnet
/syn
/recv
/137.175.0.0
-
Disallows all other
incoming
Telnet, SUPDUP, and FTP sessions
-
Allows all
outgoing
Telnet SUPDUP, and FTP sessions.
-
Allows X Window System clients running elsewhere to display on local window servers
-
Disallows local X clients to use displays located elsewhere.
-
Disallows all SUN RPC traffic, thereby guarding the local YP/NIS
and NFS
servers from outside probes and filesystem mounts.
Alas, the `pass
' specification also disallows local machines from mounting filesystems resident on NFS
servers elsewhere, but this can't be helped because NFS uses RPC which is a UDP service. UDP does not use the SYN and FIN packets that can be used to characterize the direction in which a TCP
stream is being initiated.
-
Blocks several other sorts of traffic that could be used for nefarious purposes
-
Allows passage of any traffic not explicitly blocked because the filter does not end with `!all'
The `bringup
' and `keepup
' lines are appropriate for an intermittent dialup connection, so that various error conditions won
't cause the link to be established, nor keep the call open beyond its usefulness.
-
OSPF (Open Shortest Path First) routing
packets, identified by the IP
protocol number 89, will cross the link, but won
't cause it to be brought up, nor keep it up if it's otherwise idle.
-
Usenet
news traffic won't bring up the link, but once started, the link won't be shut off in the middle of a news batch.
The `log
rejected
' line keeps a record of every packet that is blocked by the `pass
' line, so that unsuccessful penetration attempts will be noted.
The following
Filter
file provides these instructions for the PPP
daemon
:
-
Allow any packet except those generated by NTP, ICMP
Destination Unreachable, and
rwhod
. to bring up a connection to any neighbor except the host `backbone'
If those are the only types of packets flowing across the link, it will not be kept up, but all packets are allowed to cross the link while it is up.
-
Disallow outbound
packets to reset the idle timer
-
Allow packets received from the peer
to reset the idle timer
-
Hang up the connection and retry if the
idle
command-line argument has been specified when the peer
goes down and modem problems cause the phone not to be hung up
-
Allow Domain Name System queries to bring up the link and keep it up if otherwise idle
-
In the special case of the host `backbone', such as a network connectivity vendor server, only bring up the link or keep it up if otherwise idle, for the following:
Þ telnet
and FTP sessions
Þ SMTP
electronic mail
Þ NNTP
network news
-
Once the link is up, allow all the above plus NTP clock chimes and ICMP
messages to flow across the link.
-
Block all packets to or from a particular host,
-
Block any packets except Domain Name System queries and responses for any host on subnet 42 of the class B network 137.175 and don't allow them to bringup
the link. would they cause the link to be initiated
-
Allow telnet
and FTP sessions only if they are initiated in the outbound
direction.
-
Log one-line descriptions of various ICMP
problem messages including Unreachable and Time Exceeded
-
Log the complete contents of ICMP
messages reporting IP
header problems. Log all telnet
and FTP sessions, including inbound
attempts (though they will fail because they are excluded in the `pass
' specification above
-
Log the header of the first packet of any electronic mail message flowing over this link on its way to or from a specific host.
#
# Filter
- PPP
configuration file binding packet
# types to actions.
#
# For packets that would pass
, these services
# will bring up the link:
#
backbone bringup
smtp nntp domain telnet
ftp
#
# Once brought up, these will pass
(or not):
#
pass
!131.119.250.104
domain/137.175.42.0/255.255.255.0
!137.175.42.0/0xffffff00
# (alternative ways of
# expressing subnet mask)
!telnet
/syn
/recv
!ftp
/syn/recv
domain smtp nntp ntp icmp telnet
ftp
#
# Packets received for the services shown will
# reset the idle timer
.
#
keepup
!send
smtp nntp domain telnet
ftp
#
# Only these messages will have headers or contents
# logged, unless higher-level debugging
is set:
#
log
3/icmp 11/icmp 12/icmp/trace
telnet
/syn
ftp
/syn
smtp/syn
/terminus.netsys.com
#
default
bringup
!ntp !3/icmp !who
keepup
!send
!ntp !3/icmp !who
Simpler filter specifications allow
pppd
to start up quicker and run faster, with less processing overhead for each packet, but that overhead is likely to present a problem only at very high line speeds (like T1). The `backbone
' example shown above is severe overkill for the sake of illustration, evolved over a period of several weeks, and took the authors several tries to get right. Start with a simple filter specification and add each special case only as the need arises, usually as the result of watching packet logs. Then test carefully to ensure that your change had only the desired effect.
Be very careful with header logging and even more careful with packet content tracing. Make the selection criteria very narrow, or the log
file
will grow extremely large in a short period of time. Also, if the daemon
is running on a diskless workstation or if the log file is on a NFS
-mounted file system, excessive amounts of logging information will drastically impede the daemon's ability to process at high packet rates. Remember, NFS writes are synchronous
.
If you specify host names
, be sure that their addresses are available locally, even with the connection down. If you find that you must bring up a connection to resolve a domain name, consider using that host's IP
address
(decimal numbers separated by periods) in both
Filter
and
Systems
instead.
If you want to specify all Domain Name System traffic, use `domain' which will be expanded to entries for both 53/tcp and 53/udp. (Some DNS
traffic uses each transport.) To allow queries but disable domain transfers, use `!domain/tcp
'. Similarly, some systems' older /etc/services files, as distributed by the manufacturer, list NTP as a TCP
service. When the current UDP NTP implementation was installed on your system, the administrator may have left the old 123/tcp entry along with the correct 123/udp. The correct solution is to remove the 123/tcp entry from
/etc/services
. A workaround would be to specify 123/udp in
Filter
.
If your /
etc/services
file is missing some application-level protocols that you consider useful, you can populate it with entries from the Assigned Numbers
RFC, number 1700. For example, you may find it useful to add lines like:
-
gopher
-
70/tcp
-
gopher
-
70/udp
-
kerberos
-
88/tcp
-
kerberos
-
88/udp
-
snmp
-
161/tcp
-
snmp
-
161/udp
-
nextstep
-
178/tcp
-
nextstep
-
178/udp
-
prospero
-
191/tcp
-
prospero
-
191/udp
-
x11
-
6000/tcp
If you augment
/etc/services
this way you can using Filter
file entries like,
pass
!x11/syn
/send
which is much more readable than the alternative:
pass
!6000/tcp/syn
/send
A list of TCP
and UDP service numbers and names, culled from the Assigned Numbers RFC
, is available in
Services.ex.
tun(MST_PPP), ppp.Auth
(MST_PPP), ppp.Devices
(MST_PPP), ppp.Dialers
(MST_PPP), ppp.Keys
(MST_PPP), ppp.Systems
(MST_PPP), pppd
(MST_PPP), RFC
791, RFC 792, RFC 1055
, RFC 1661
, RFC 1332, RFC 1122, RFC 1144, RFC 1700 RFC 1812.
Copyright 1991, 1992, 1993, 1994, 1995, 1996 Morning Star Technologies Inc.; all rights reserved.
ppp.Keys
- PPP
encryption
keys
file format
Encryption is not available in software exported from the USA, and therefore not available for international licenses.
The keys
file named in the
gw-crypt
option on the
pppd
command line contains key values used by MST PPP
's implementation of link-level encryption
. Before transmission, packets with source and destination address
es matching the endpoints on a keys file line are encrypted using DES with the key specified on that keys file line. Upon reception, packets with source and destination addresses matching those on a keys file line are decrypted using DES with the key specified on that keys file line.
Each key specification is on its own single line of up to 1023 characters. Comments in the keys
file begin with a#' and extend to the end of the line; blank lines, or lines beginning with a `#
', are ignored. Fields are separated by horizontal white space (blanks or tabs).
The first two words on a key line are compared with the source and destination addresses of each packet to be transmitted and each received packet. The endpoint address specifications may contain either host or network names, or host or network addresses. If a network is specified, either by name or by address, then the corresponding network mask must also be specified if it is of a different size than the default
for that class of network. The mask is separated from the network name or address by a slash (/),and may be specified either as a series of decimal numbers separated by periods, or as a single 32-bit hexadecimal number, optionally with a C-style `0x
' prefix.
The remainder of the key line is a 56 bit (14 digit) hexadecimal number (without the C-style `0x' prefix), used as the DES key between the specified pair of hosts or networks. The digits may be separated by horizontal white space for readability. If the key contains fewer or more than 14 hexadecimal digits, the line is ignored. If the key is weak or semi-weak, a warning message will be printed in the log
file
and the specified key will be used for encryption
anyway.
The following keys
file provides
pppd
with keys for use when encrypting or decrypting traffic between the indicated pairs of hosts or networks:
#
# Keys - PPP
encryption
keys
file
#
# Format:
#endpoint endpoint key
frobozz.foo.com glitznorf.baz.edu feed face 00d aa
147.225.0.0 38.145.211.0/0xffffffc0 b1ff a c001 d00d 1
128.49.16.0/0xffffff00 198.137.240.100 0123456789abcd
193.124.250.136 143.231.1.0/0xffffff00 e1c3870e1c3870
Avoid using weak or semi-weak keys
. These are weak DES keys:
00000000000000
FFFFFFFFFFFFFF
1E3C78F1E3C78F
E1C3870E1C3870
These are semi-weak DES keys
:
01FC07F01FC07F
FE03F80FE03F80
1FC07F00FE03F8
E03F80FF01FC07
01C007001E0078
E003800F003C00
1FFC7FF0FFC3FF
FE3FF8FFE1FF87
003C00F001C007
1E007800E00380
E1FF87FF1FFC7F
FFC3FF0FFE3FF8
The keys
file should be mode 600 or 400, and owned by root
.
Packets' IP
headers are not encrypted, though their TCP
, UDP, or ICMP
headers are encrypted along with the user data portion. This allows encrypted packets to traverse normal internetworks, but permits snoopers to analyze traffic by its endpoints.
Since the TCP
, UDP, or ICMP
header is encrypted, protocol-based filters along the packet
's path will be unable to discern whether it is SMTP
, Telnet, or any other network service. This means that encrypted traffic will only permeate packet-filtering firewalls if the firewall allows all traffic between the endpoints, regardless of traffic type. MST PPP
/SLIP
software for UNIX systems, when deployed as the endpoint gateways of the encrypted traffic, decrypt incoming encrypted traffic before applying their configured packet filtering rules.
tun(MST_PPP), ppp.Auth
(MST_PPP), ppp.Devices
(MST_PPP), ppp.Dialers
(MST_PPP), ppp.Filter
(MST_PPP), ppp.Systems
(MST_PPP), pppd
(MST_PPP), RFC
792, RFC 1661
, RFC 1332, RFC 1334
.
Copyright 1993, 1994, 1995, 1996 Morning Star Technologies Inc.; all rights reserved.
ppp.Systems
- PPP
neighboring systems description file format
The file
/usr/lib/mstppp/Systems
on SCO systems describes how to connect with neighboring systems via PPP
.
-
Entries are one to a line; blank lines are ignored.
-
Comments begin with a `#' and extend to the end of the line.
-
Upper/lower case distinctions are ignored in hostname
specifications, but are significant elsewhere.
-
Fields on a line are separated by horizontal white space created by blanks or tabs.
-
If a chat script
ends with a backslash (
\), the next line is considered a continuation of the chat script. Continuations may only occur in the midst of a chat script.
-
Each entry must contain six fields, in the following order:
-
name
The hostname
or IP
address
of the destination machine, which should be resolvable locally.
-
when
-
Hours in a range are written as those from a 24 hour clock, 0800-1230 for example. If you do not specify a time, calls will be allowed at any time. A time range that spans 0000 is permitted. For example, 0800-0600 means that all times are allowed except times between 6 AM and 8 AM.
Examples:
MoTuTh0800-1740.
Wk0800-1230, (same as MoTuWeThFr)
Any0900-1700, (same as SuMoTuWeThFrSa).
Multiple date specifications are separated by a vertical bar (|). This example means that means that the system can be called any day between 1 AM and 6 AM or any time on Saturday and Sunday.
Example:
Any0100-0600|Sa|Su
The entire sequence of days and times may be followed by a semicolon and up to three decimal numbers separated by hyphens as described in the table below:
-
one
- If only one number follows the semi-colon, it is used as the redial delay, which is the initial time (in seconds)before a failed call will be retried.
For example, Any;60 means call any time, but wait at least 60 seconds after a failure has occurred before trying to call again.
If a call retry fails, pppd
doubles the delay before trying again. If no initial retry delay is specified, 10 seconds is assumed.
-
two
-
If two numbers follow the semicolon, the second number is the maximum redial delay, or the maximum time (in seconds) to delay before retrying a call. The retry time doubles with each unsuccessful call until it reaches this value, after which the call will be retried every time the maximum number of seconds passes.
If no maximum retry delay is specified, 3600 seconds is assumed.
-
three
-
If three numbers follow the semicolon, the third is the maximum redial delay. The callback delay is the time (in seconds) to wait before attempting to re-establish a previously active
connection that ended because of an abrupt line disconnection (a Hangup or SIGHUP
event in the log
file
).
The default
is not to delay before calling back.
-
device
-
If set to `ACU
', any device in Devices
with a matching speed
may be used. The device's dialer
chat script
will be executed first, followed by the Systems
chat script.
If set to the name of a device in the /dev directory (tty00, cua, etc.), there may be an optional corresponding Direct
entry in Devices
, Dialers
will not be consulted, and only the Systems
chat script
will be executed.
If set to `tcp', it must be followed by a slash, then the hostname
or IP
address
of the system that will serve as the destination of the PPP
link, then another slash, then the socket number on which to contact the remote PP daemon.
-
speed
-
The speed
of the connection. If the device field
is ACU
, the speed field
will be string matched against entries in Devices
. Speeds must either be valid speed numbers or must begin with them (2400, 38400, 19200-PEP, etc.). If the device field is `tcp...' or `telnet
...', the speed field is ignored, but must be present as a place-holder.
-
phone number
-
The value to replace the \T escape sequence in the dialer
script. If the device field
names an entry in /dev, the phone number field is optional. If the device field is `tcp...' or `telnet
...', the phone number field is ignored if present, but must be present as a place-holder.
-
chat script
-
A description of the conversation that pppd
holds with the remote machine.
During the delay following an unsuccessful call, any level 6 debugging messages written to pppd.log will have the message `dial failed' appended.
A chat script
takes the form of a space-separated list of expect-send
pairs. At minimum, each pair consists of a field to expect the "remote" end to send, followed by a field to send in response. Unless asend' string ends with
\
c
,
pppd
will follow it by sending a carriage return character (ASCII 0x0d).
Chat scripts areexpect send
expect send...', orexpect-send-expect send...', where thesend' following the hyphen is executed if the preceding expect fails to match received text.
Certain special words may be used in the chat script
to control the behavior of
pppd
as it attempts to dial. Both ABORT
and TIMEOUT
must be in the "expect" phase of the chat script.
-
ABORT
abort-string
-
If
pppd
sees
abort-string
while executing the remainder of the chat script
, abort the dialing attempt and note the failure in the log
file.
-
TIMEOUT
timeout-time
-
While executing the current chat script,
wait timeout-time seconds for a response before considering the dialing attempt to have timed out. Writes have a fixed 60-second timeout.
The expect-send
couplet of
"" P_WORD
sets the line parity
accordingly:
-
P_AUTO
-
Set transmission parity
based on the parity observed in characters received inexpect' strings. This is the default.
-
P_ZERO
-
Transmit characters with the parity
bit set to 0
(8 bits, no parity).
-
P_ONE
-
Transmit characters with the parity
bit set to 1
-
P_EVEN
-
Transmit characters with even parity.
-
P_ODD
-
Transmit characters with odd parity.
The backquote character (`) surrounds the name of a program that is to be run before proceeding. If the program is run in the `send
` phase of a chat script
couplet, its standard output will be sent to the peer
when the program exits. Chat script processing continues when the program exits.
In the midst of either anexpect' string or a `send
' string,
^x
gets translated into the appropriate control character, and
\x
gets translated into
x
. Other special sequences are:
-
\s
-
Send or receive a space character (ASCII 0x20)
-
\t
-
Send or receive a horizontal tab character (ASCII 0x09)
-
\n
-
Send or receive a line feed character (ASCII 0x0a)
-
\r
-
Send or receive a carriage return character (ASCII 0x0d)
-
\\
-
Send or receive a backslash character (ASCII 0x5c)
-
\^
-
Send or receive a carat character (ASCII 0x5e)
-
^<character>
-
Send or receive the single character Ctrl-<character> (ASCII 0x00 through 0x1f)
-
\
ddd
Send or receive a character, specified in octal
d
igits
-
\p
-
Pause for.25 second before proceeding (send
only)
-
\d
-
Delay for 2 seconds before proceeding (send only)
-
\K
-
Send a break (.25 second of zero bits)
-
\M
-
Disable hangups (sets CLOCAL or LNOHANG)
-
\m
-
Enable hangups (unsets CLOCAL or LNOHANG) (the default)
-
\c
-
Don't append a carriage return character after sending the preceding string (send
only)
-
\q
-
Don't print succeeding send
strings (e.g. a password
) in any debugging
or logging output. Subsequent
\
q
sequences togglequiet' mode.
-
\A
-
Parse the incoming string as an IP
address, written as four
decimal numbers separated by periods, and use it for the local end of the point-to-point connection (receive only)
In the example below:
-
You call host`everyone', using a Telebit PEP modem with its DTE
interface set at 19200 b
-
You call host`nobody', using a V.32
/V.42/V.42bis
modem capable of driving a 38400 DTE
-
You are connected to host `someone' via a direct cable attached to
/dev/ttya
, running asynchronous
PPP
.
-
You talk
to `anyone' via a T1 CSU/DSU
attached to port 0 on a SnapLink.
-
You connect with pseudo-one via a PPP
connection tunneled across a TCP
stream to port 77 on realone.somewhere.com.
If you are unsuccessful at connecting with `someone' you will try again in two seconds. If that attempt fails, you will wait four seconds before the next attempt; then eight, then sixteen, then thirty two, then forty seconds. You will continue attempting to contact `someone' every forty seconds.
Your retry intervals and maximum backoff values for `everyone' and `nobody' are the default
`10-3600'.
The notation "" "" means to expect nothing, then send
nothing, followed by a carriage return. The implicit carriage return is often useful for eliciting a response from a remote system.
#
# Systems
- PPP
systems file
#
everyone Any ACU
19200-PEP 5551212 in:--in: Pwe word: \
qfoObar
nobody Any ACU
38400 5551213 in:--in: Pthey word: \
qbaZz1ng
someone Any;2-40 cua 38400 0 in:--in: Pthem word: \qmeumBle
anyone Any rsd0a/0 1536000
pseudo-one Any;2-2 tcp/realone.somewhere.com/57
The default
retry time and backoff (i.e. Any;10-3600) are appropriate for use with dialup connections where the PPP
connection must be reestablished as quickly as possible after an interruption but where it is not desirable to continuously redial a host that may be down.
A much shorter maximum would be appropriate for a dedicated
line
between two systems, or where call attempts cost nothing.
Moderate call retry times, such as 60 seconds, work well on systems that can establish connections in either direction using dialup modems, to avoid deadlocks waiting for telephone busy signals from each calling the other at the same time. Because of the difference between the behaviors of originating and answering modems, the 60-second clocks will usually start ticking at different times, allowing one side to call the other without interference. Alternatively, different call retry times may be specified at either end of a link to help keep the two systems from calling each other simultaneously.
If you specify host names
, be sure that their addresses are available locally, even with the connection down. If you find that you must bring up a connection to resolve a domain name, consider using that host's IP
address
in dotted quad format in
Filter
and
Systems
instead.
Automatic failover
recovery can be arranged between systems that each have multiple modems, or multiple connection methods. If two systems are connected via a dedicated
line
(sync or async), that entry should be first in
Systems
, followed by another entry describing an on-demand dialup connection. See the MST PPP
User Guide for more details.
The file
/usr/lib/mstppp/Systems
should be mode 600.
tun(MST_PPP), ppp.Auth
(MST_PPP), ppp.Services(MST_PPP), ppp.Dialers
(MST_PPP), ppp.Filter
(MST_PPP), ppp.Keys
(MST_PPP), pppd
(MST_PPP), RFC
1661
, RFC 1332, RFC 1144
, RFC 1055
.
Copyright 1991, 1992, 1993, 1994, 1995, 1996 Morning Star Technologies Inc.; all rights reserved.
pppd
- PPP
daemon
pppd
[options...]
Pppd
is a daemon
process used in UNIX systems to manage connections to other hosts using PPP
, the Point to Point Protocol, or SLIP
, the Serial Line Internet
Protocol. It uses the UNIX host's native serial ports
or the Morning Star SnapLink SCSI-attached high speed
serial interface. It communicates with the UNIX kernel
's own TCP
/IP
implementation via the Morning Star IP tunnel driver
. (see
tun
(MST_PPP))
-
FIELD
-
DESCRIPTION
-
auto
-
Requires the remote address. Start inautocall' mode and detach from the controlling terminal to run as a daemon
. Initiate connection in response to a packet specified in the filter-file`bringup' category.
-
up
-
When used with
auto
, bring the link up immediately rather than waiting for traffic. If the link goes down, attempt to restart it after the call retry delay timer
expires. Don't wait for an outbound
packet.
-
dedicated
-
Implies
up
. Treat the connection as dedicated
line
rather than a demand-dial connection.
This option tells
pppd
to never give up on the connection. If the peer
tries to shut down the link,
pppd
does, but will immediately try to reestablish the connection. Similarly, when first trying to connect,
pppd
will not give up after sending a fixed number of Configure-Request messages. As with dialup connections, hangup
events (LQM
failures, loss of Carrier Detect) will cause the device to be closed, and the
Systems
file is then checked for alternate entries. If none are available, the connection will be re-established after the call retry delay timer
expires. Use a short call retry delay timer on dedicated
circuits. Something like
Any;5-30
should work well..
-
nodetach
-
Don't detach from the controlling terminal inautocall' mode. When used with log
, this is useful for watching the progress of the PPP
session.
-
log log-file
-
Append logging messages to log
-file (default:
/usr/adm/pppd
.log
).
-
acct acct-file
-
Append session accounting messages to acct-file. If acct-file is
the same as log-file, the session accounting messages is interleaved with other logging information.
-
filter filter-file
-
Look in filter-file for packet filtering and link management information
(default:
/usr/lib/mstppp/Filter
on SCO systems).
-
debug debug-level
-
Set the log file verbosity to debug-level, chosen from the following table:
-
0
-
Daemon start messages
-
1
-
Link status messages, calling attempts (the default)
-
2
-
Chat script processing, input framing errors
-
3
-
LCP, IPCP, PAP and CHAP negotiation
-
4
-
LQM status summaries
-
5
-
IP interface changes
-
6
-
IP message summaries
-
7
-
Full LQM reports
-
8
-
All PPP messages (without framing)
-
9
-
Characters read or written
-
10
-
Procedure call messages
-
11
-
Internal timers the lower-numbered levels
-
exec exec-cmd
-
Runexec-cmd
up
addr args' when the link comes up, andexec-cmd
down
addr args' when it goes down. Addr is the IP
address
of the peer, and args is the list of arguments
given to
pppd
.
-
nonice
-
Run at a normal user process priority, rather than using the nice() library routine to elevate
pppd's scheduling priority to 10.
-
asyncmap async-map
-
Set the desired Async Control Character Map to
async-map,
expressed in C-style hexadecimal notation (default0xA0000).
-
noasyncmap
-
Disable LCP
Async Control Character Map negotiation.
-
escape odd-character
-
In addition to characters specified in the PPP
Async Control Character Map, which can include only 0x00 through 0x1F, apply the escaping algorithm when transmitting odd-character. The value of odd-character must be between 0x00 and 0xFF, and cannot be 0x5E, 0x7D or 0x7E.
Odd-character can be specified as a decimal number, in C-style hexadecimal notation, or as an ASCII character with optional^' control-character notation. For example, the XON character could be specified as 17, 0x11, or ^Q.
A warning will be printed in the log file
and the character specified on the command line will not be escaped if a character specified with the
escape
argument is the same as a character contained in the peer's
negotiated Async Control Character Map when the character is transformed into its escaped form,
Pppd
will print an error message and exit if a character specified with the
escape
argument is the same as a character specified in another
escape
argument on the daemon's command line when transformed into its escaped form.
-
device
-
Communicate over the named device (default
/dev/tty
).
-
comm-speed
-
Set communications rate to comm-speed
bits per second.
-
poll poll-rate
-
Set SnapLink polling frequency, in polls per second. Recommend values are 20, 50, or 100 (default 50).
-
internal-clocking
-
A SnapLink will provide the synchronous
clock signal (TXCLK and RXCLK). By default, it expects the modem, CSU/DSU
or modem eliminator to provide the clock signal. Internal-clocking cannot be used with RS-232 cables on the SnapLink.
-
ignore-cd
-
Ignore the state of the CD
(Carrier Detect, also called DCD, Data CarrierDetect) signal. This is useful for systems that don't support
CD but want to run PPP
over a dedicated
line.
-
gw-crypt keys-file
-
Encrypt traffic between the pairs of hosts or networks specified in the designated keys
file (see
ppp.Keys
(5)).
-
rtscts
-
Set the line to use out-of-band EIA RS-232-Dhardware' (RTS/CTS) flow
control. (The default
is to use no flow control.) For an outbound
connection, this may be specified either in
Devices
or on the
pppd
command line. On SCO systems,
rtscts
cannot be used with either
rtscts-rtsflow
or
rtscts-crtsfl
.
-
crtscts
-
A synonym for
rtscts.
-
rtscts-rtsflow
-
As above in
rtscts
, but sets both CTSFLOW and RTSFLOW. Cannot be used with either
rtscts
or
rtscts-crtsfl.
-
crtscts-rtsflow
-
A synonym for
rtscts-rtsflow
.
-
rtscts-crtsfl
-
As above in
rtscts
, but sets CRTSFL and clears CTSFLOW and RTSFLOW. Cannot be used with either
rtscts
or
rtsctsrtsflow.
-
crtscts-crtsfl
-
A synonym for
rtscts-crtsfl
.
-
xonxoff
-
Set the line to use in-band ('software') flow control, using the characters DC3 (^S, XOFF, ASCII 0x13) to stop the flow and DC1 (^Q, XON, ASCII 0x11) to resume. For an outbound
connection, this may be specified either in
Devices
or on the
pppd
command line.
-
telnet
-
When used on an answering
pppd
command line, negotiate the telnet
binary option and understand telnet escape processing. Not for use with
device
or
auto
.
-
nooptions
-
Disable all LCP
and IPCP options.
-
noaccomp
-
Disable HDLC
Address and Control Field compression.
-
noprotcomp
-
Disable LCP
Protocol Field Compression.
-
compress
-
Offer all supported link compression
types when negotiating. The default
is to propose and accept no link compression type.
-
compress-pred1
-
Accept any supported compression
type, but prefer Predictor type 1 compression.
-
compress-stac
-
Accept any supported compression
type, but prefer Stac LZS compression.
-
nopred1
-
Never use Predictor-1 compression.
-
nostac
-
Never use Stac LZS compression.
-
slip
-
Use RFC 1055
LIP packet framing
rather than PPP
packet framing. Disables all option negotiation, and implies
noasyncmap, noipaddress, vjslots
16, novjcid, nomagic, nomru
, and
mru 1006
if peer
sends a header-compressed
TCP
packet.
-
extra-slip-end
-
When running in SLIP
mode, prepend a SLIP packet framing
character (0xC0) to each frame before transmission, even if this frame immediately follows the previous frame. By default,
pppd
transmits only one framing character between adjacent SLIP frames.
-
nomagic
-
Disable LCP
Magic Number negotiation.
-
mru mru-size
-
Set LCP
Maximum Receive Unit value to
mru-size
for negotiation. The default
is 1500 for PPP
and 1006 for SLIP. The value must be greater than 128.
-
nomru
-
Disable LCP
Maximum Receive Unit negotiation, and use 1500 for your interface.
-
active
-
Begin LCP
parameter negotiation immediately. Active is the default
-
passive
-
Do not send
our first LCP
packet until we receive an LCP packet from the peer.
-
timeout restart-time
-
Set the LCP, IPCP, CCP, PAP, and CHAP option negotiation restart timers to
restart-time
. The default
is 3 seconds.
-
lqrinterval time
-
Send Link-Quality-Reports or Echo-Requests every
time
seconds (default
10 seconds). If the peer
responds with a Protocol-Reject, send
LCP
Echo-Requests every time seconds instead, and use the received LCP Echo-Replies for link status policy decisions.
-
lqthreshold min/per
-
Set a minimum standard for link quality by considering the connection to have failed if fewer than
min
out of the last
per
LQRs we sent have been responded to by the peer
(default
1/5). The
per
number can be no greater than 256 and cannot be 0.
-
echolqm
-
Use LCP
Echo-Requests rather than standard Link-Quality-Report messages for link quality assessment and policy decisions. The peer
can override this if it actively tries to configure Link Quality Monitoring
unless the
nolqm
parameter is also specified.
-
nolqm
-
Don't send
or recognize Link-Quality-Report messages. If
echolqm
is also specified, Echo-Request messages will be used to detect link failures.
-
idle idle-time
-
Shut down the link when idle-time seconds pass
without receiving or transmitting a packet specified in the
`keepup' category in the filter file. The default
is to never shut down.
-
max-configure tries
-
Set the PPP
Max-Configure counter to the value of
tries
. This is the maximum number of Configure-Requests sent without a response.
-
max-terminate tries
-
Set the PPP
Max-Terminate counter to the value of
tries
. This is the maximum number of Terminate-Requests to be sent without a response.
-
max-failure tries
-
Set the PPP
Max-Failure counter to the value of
tries
. This is the maximum number of Configure-Naks to be sent without a positive response. Default is 5, in accordance with RFC
1661
-
local:remote
-
The address of this machine, followed by the expected address for the remote machine. Can be specified either as symbolic names or as literal IP
address
es, if their addresses cannot be discovered locally without using the PPP
link.
Both addresses are optional, but a colon by itself is not valid, and the remote address is required when running as a daemon
inautocall' mode. If onlylocal:' is specified when receiving an incoming call, the remote address will be discovered during IPCP IP
-Address negotiations.
If either address is followed by a tilde character ('~'), or if the tilde appears alone,
pppd
accepts the IP
address
given by the peer
during IPCP negotiations, whether for the local end or the peer's end of the link. (not available in SLIP
mode)
Because SLIP
cannot perform option negotiations, including IPCP, both addresses should normally be specified, and the tilde option is unavailable. To obtain a similar "feature", the peer
must provide the IP
address
textually during the login
process, and a new value must be obtained using the
Systems
file `\A' chat script
feature (see
ppp.Systems
(MST_PPP)).
-
netmask subnet-mask
-
Set the subnet mask of the interface to subnet-mask, expressed either in C-style hexadecimal (e.g. 0xffffff00) or in decimal dotted-quad notation (e.g. 255.255.255.0). The default
subnet mask will be appropriate for the network (class A, B, or C), assuming no subnetting.
-
noipaddress
-
Disable IPCP IP-Address negotiation.
-
need-ip-address
-
Force IPCP to ask the peer
to assign us an IP
address
even if
pppd
was invoked with a local address on the command line.
-
vjcomp
-
Enable RFC
1144
`VJ' Van Jacobson
TCP
header compression
negotiation with 16 slots and slot ID compression (this is the default
with PPP
framing).VJ' compression is enabled by default for async connections, and disabled by default for sync connections.
-
novjcomp
-
Disable RFC
1144
`VJ' Van Jacobson
TCP
header compression
(this is the default
with SLIP
framing, until the peer
sends a header-compressed
-
vjslots vj-slots
-
Set the number of VJ compression
slots (min 3, max 256, default
16).
-
novjcid
-
Disable VJ compression
slot ID compression (enabled by default).
-
rfc1172-vj
-
Backwards compatibility with older PPP
implementations (4-byte VJ configuration option), but with the correct option negotiation value of 0x002d.
-
rfc1172-typo-vj
-
Backwards compatibility with older PPP
implementations (4-byte VJ configuration option) that conform to the typographical error in RFC
1172 section 5.2 (Compression-Type value 0x0037).
-
rfc1172-addresses
-
Backwards compatibility with older PPP
implementations that conform to RFC
1172 section 5.1 (IP-Addresses, IPCP configuration option 1) and not with the newer RFC 1332 (IP-Address, IPCP configuration option 3), but that respond with something besides a Configure-Reject when they receive an IPCP Configure-Request containing an option 3.
-
rechap interval
-
Demand that the peer
re-authenticate itself (using CHAP) every
interval
seconds. If the peer fails the new challenge, the link is terminated.
-
requireauth
-
Require either PAP or CHAP authentication
. Equivalent to individually specifying
requirechap
,
requirepap
and
requiremschap
.
-
requirechap
-
Require CHAP authentication
as described in RFC
1334.
-
requiremschap
-
Require Microsoft MS CHAP authentication
-
name identifier
-
Provide the
identifier
used during PAP or CHAP negotiation. This option is necessary if the PPP
peer
requires authentication
. The default
value is the value returned by the
gethostname
(2) system call or the
hostname
(1) command.
Encryption software is not available outside the United States, and therefore is not
available in international licenses.
-
gw-crypt keys-file
-
Encrypt traffic between the pairs of hosts or networks specified in the designated keys
file (see
ppp.Keys
(5)).
-
ms-dns
-
Set the MS DNS
address to provide to the peer
. First occurrence of this option on the command line sets the primary address. Second occurrence sets the secondary address.
-
ms-nbns address
-
Set the MS NBNS address to provide to the peer
. First occurrence of this option on the command line sets the primary address. Second occurrence sets the secondary address.
Status information is recorded in the log
file
by each copy of
pppd
running on a single machine. The default
file for logging is
/usr/adm/pppd.log
. Each line in the file consists of a message preceded by the date, the time, and the process ID number of the daemon
writing the message. The quantity and verbosity
of messages are controlled with the
debug
option and with the
log
filter (see
ppp.Filter
(5)).
Each packet that:
-
brings up the link at debug
level 1 or more
-
matches the
log
filter at any debug
level,
or
-
any packet at debug
level 7 or higher
-
writes a one-line description of the packet to the log
file
.
The parts of the message are as follows:
1. The protocol (
tcp, udp, icmp
, or a numeric protocol value ). For ICMP
packets, the keyword
icmp
is followed by the ICMP message type and sub code, separated by slashes.
2. An IP
address
and, optionally, a TCP
or UDP port number, followed by an arrow indicating whether the packet was sent ( ) or received ( )
3. Another address and port number. For transmitted packets, this is the source address
. For received packets, this is the destination address
. Well known TCP
and UDP port numbers are replaced by the name returned by the
getservbyport
() library function.
4. The length of the packet in bytes before VJ TCP
header compression
.
5. Zero or more keywords. The keywords and their meanings are:
-
frag
-
the packet is a middle or later part of a fragmented IP
frame
-
syn
-
the packet has the TCP
SYN bit set
-
fin
-
the packet has the TCP
FIN bit set
-
bringup
-
the transmitted packet matches the
bringup
filter and is bringing up the link
-
!keepup
-
the packet has been rejected
by the
keepup
filter
-
!pass
-
the packet has been rejected
by the
pass
filter
-
dial failed
-
the packet was dropped because
pppd
is waiting for the call retry timer to expire
-
(c)
-
the received packet is VJ TCP
header compressed
-
(u)
-
the received packet is VJ TCP header uncompressed
For example, the following log
file
line indicates that at 2:06:26 PM on September 6, process ID 83 sent a 44-byte TCP
packet with the SYN bit set from port 1050 on 63.1.6.3 to the SMTP
port on 8.1.1.9.
9/6-14:06:26-83 tcp 63.1.6.3/1050 -> 8.1.1.9/smtp 44 syn
When the following signals are received by
pppd
it closes and reopens the log
file
, re-reads the filter and key files, then takes the indicated actions:
-
SIGKILL
-
Don't use this. Never, never use this
. Since
pppd
won't be able to shut down gracefully, it will leave your serial interfaces (whether
/dev/tty
or a SnapLink) and your IP
tunnel driver
in some unknown state. Use SIGTERM
instead, so
pppd
will shut down cleanly, and leave the system in a well-defined state.
-
SIGINT
-
Disconnect gracefully from an active
session. If inautocall' mode, reset all retry backoff interval. If
up
was specified, attempt to re-establish the link. Exit if not inautocall' mode.
-
SIGHUP
-
Disconnect abruptly from an active
session. If
up
was specified, attempt to re-establish the link. Exit if not inautocall' mode.
-
SIGTERM
-
Disconnect gracefully from an active
session, clean up the state of any serial and IP
interfaces that are open, then exit.
-
SIGUSR1
-
Increment the verbosity
level for logged debugging
information.
-
SIGUSR2
-
Reset the debugging
verbosity
level
to the base value (1, unless
debug
0
was supplied on the command line).
-
SIGALRM
-
Take no action except to re-read the filter and key files.
The file
/etc/rc2.d/S89mstppp
, shown here, starts up PPP upon booting the
system, and shuts it down during system shutdown:
#!/bin/sh
# Sysinit script for Morning Star Technologies PPP for SCO UNIX
#
# This file should be linked to appropriate places in
# /etc/rc0.d, /etc/rc2.d and /etc/init.d
PPPHOME=/usr/lib/mstppp
PATH=/bin:usr/bin:/usr/lib/mstppp:/etc
export PPPHOME PATH
LOGDIR=/usr/adm
case "$1" in
start')
if [ -f ${PPPHOME}/pppd ]; then
if [ -f ${LOGDIR}/pppd.log ]; then
mv ${LOGDIR}/pppd.log ${LOGDIR}/OLDpppd.log
fi
if [ -x ${PPPHOME}/Autostart ]; then
echo "Starting PPP..."
${PPPHOME}/Autostart
fi
fi ;;
stop')
while pid=`/bin/ps -e 2>/dev/null | /bin/grep pppd | /bin/grep -v grep`
do
[ -z "${pid}" ] && continue
set -- ${pid}
pid=$1
if [ "${pid}" != "" ]
then
/bin/kill -15 ${pid}
(echo "Stopping pppd(pid $pid)") > /dev/console
fi
done
;;
echo "Usage: $0 {start | stop}"
exit 1
;;
esac
The
S89mstppp
file executes
/usr/lib/mstppp/Autostart
, which executes another
script,
/usr/lib/mstppp/exec.dialout
for dialing out:
/usr/lib/mstppp/dialout 132.147.65.2~:132.147.65.254~ auto up \
exec /usr/lib/mstppp/exec.dialout netmask 255.255.255.0 idle 120
This file uses the script
/usr/lib/mstppp.dialout
to call the system with an IP number of 132.147.65.254. The dialout file
is the script that actually executes
pppd.
The local side of the connection (as defined in
Autostart
) will have the IP
number 132.147.65.2. The remote side of the connection will have the IP
number 132.147.65.254.
The system will dialout immediately (up) and sets the idle timer to two
minutes (idle 120), causing the link to disconnect in two minutes if there
is no activity. The netmask is set to 255.255.255.0, and the script
called
/usr/lib/mstppp/exec.dialout
is executed when the link is established
or brought down. The ~'s at the end of the IP numbers indicate that the remote
side can reset the IP numbers when the link is established. To determine
what phone number and login sequence (chat Script) to use, the PPP daemon
consults the
/usr/lib/mstppp/Systems
file:
132.147.65.254 Any;5 ACU 38400 5551212 "" \r\d in:--in: \dpppuser word: passwd
Note that the IP number listed here is the initial IP number of the remote
system, matched in the
Autostart
file.
The PPP daemon uses the
/usr/lib/mstppp/Devices
file to determine the modem,
baud rate, and tty to use:
atdialSPORT tty1A 38400
The modem is a binary dialer in
/usr/lib/uucp
or an entry in the
/usr/lib/mstppp/Dialers
file.
For incoming connections, a user needs to be created with the login shell
/usr/lib/mstppp/Login
, with the home directory
/usr/lib/mstppp
. When a user
with this shell logs into the system, an attempt to create a PPP connection
is made.
-
/etc/passwd entry for "pppuser" --
pppuser:x:200:100:PPP account:/usr/lib/mstppp:/usr/lib/mstppp/Login
-
end /etc/paswd entry for "pppuser" --
The login shell
/
usr/lib/mstppp/Login
is actually a script that reads
the file
/usr/lib/mstppp/Accounts
. When the user "pppuser" logs in,
/usr/lib/mstppp/Login
tries to match the user name "pppuser" against the
first field in the
Accounts
file:
pppuser 132.147.65.229:132.147.65.2 exec /usr/lib/mstppp/exec.dialin \
netmask 255.255.255.0 idle 300 rtscts
ppp2 132.147.65.229:132.147.65.4 exec /usr/lib/mstppp/exec.dialin \
netmask 255.255.255.0 idle 300 rtscts
In this case, the first line line matches the user "pppuser", and the PPP
daemon is executed using the arguments shown in the rest of the line in
this file:
132.147.65.229:132.147.65.2 exec /usr/lib/mstppp/exec.dialin \
netmask 255.255.255.0 idle 300 rtscts
In this example, the local IP number is assigned as 132.147.65.229, the
system dialing into this one is assigned IP number 132.147.65.2, with
netmask 255.255.255.0. The sysetm will bring down the link in 5 minutes if
there is no activity, (idle 300), and it uses hardware flow control.
(rtscts) The script
/usr/lib/mstppp/exec.dialin
is run when the link
is brought up or down.
The environment variable
PPPHOME
, if present, specifies the directory in which
pppd
looks for its configuration files (
Filter
and
Auth
for all connections, along with
Systems
,
Devices
, and
Dialers
if the connection isoutbound
'). You can specify
PPPHOME
either in the Startup script or in an incoming connection's Login script. If
PPPHOME
is not present,
pppd
will expect to find its configuration files in
/usr/lib/mstppp/*.
Pppd
should be mode 4750, owned by root, and executable only by the members of the
group containing all the incoming PPP login users'.
MST PPP implements the IETF Standard Point-to-Point Protocol and many of its
options and extensions, conforming with RFCs 1661, 1549, 1332, 1333, 1334, and
1144. It can be configured to conform with earlier specifications of the PPP
protocol, as described in RFCs 1134, 1171, and 1172. MST PPP also implements
the nonstandard SLIP protocol as described in RFCs 1055 and 1144.
tun(MST_PPP), ppp.Auth
(MST_PPP), ppp.Devices
(MST_PPP), ppp.Dialers
(MST_PPP), ppp.Filter
(MST_PPP), ppp.Keys
(MST_PPP), ppp.Systems
(MST_PPP), RFC
1661
, RFC 1549, RFC 1332, RFC 1333
, RFC 1334
, RFC 1172, RFC 1144
, RFC 1055
, ds.internic.net:/internet-drafts/draft-ietf-pppext-compression
-04.txt.