]> git.ozlabs.org Git - ppp.git/blob - README.linux
Use the ipparam value as the PW_CALLING_STATION_ID value
[ppp.git] / README.linux
1                 PPP for Linux
2                 -------------
3
4                 Paul Mackerras
5                 8 March 2001
6
7                 for ppp-2.4.2
8
9 1. Introduction
10 ---------------
11
12 The Linux PPP implementation includes both kernel and user-level
13 parts.  This package contains the user-level part, which consists of
14 the PPP daemon (pppd) and associated utilities.  In the past this
15 package has contained updated kernel drivers.  This is no longer
16 necessary, as the current 2.2 and 2.4 kernel sources contain
17 up-to-date drivers.
18
19 The Linux PPP implementation is capable of being used both for
20 initiating PPP connections (as a `client') or for handling incoming
21 PPP connections (as a `server').  Note that this is an operational
22 distinction, based on how the connection is created, rather than a
23 distinction that is made in the PPP protocols themselves.
24
25 Mostly this package is used for PPP connections over modems connected
26 via asynchronous serial ports, so this guide concentrates on this
27 situation.
28
29 The PPP protocol consists of two parts.  One is a scheme for framing
30 and encoding packets, the other is a series of protocols called LCP,
31 IPCP, PAP and CHAP, for negotiating link options and for
32 authentication.  This package similarly consists of two parts: a
33 kernel module which handles PPP's low-level framing protocol, and a
34 user-level program called pppd which implements PPP's negotiation
35 protocols.
36
37 The kernel module assembles/disassembles PPP frames, handles error
38 detection, and forwards packets between the serial port and either the
39 kernel network code or the user-level program pppd.  IP packets go
40 directly to the kernel network code.  So once pppd has negotiated the
41 link, it in practice lies completely dormant until you want to take
42 the link down, when it negotiates a graceful disconnect.
43
44
45 2. Installation
46 ---------------
47
48 2.1 Kernel driver
49
50 Assuming you are running a recent 2.2 or 2.4 (or later) series kernel,
51 the kernel source code will contain an up-to-date kernel PPP driver.
52 If the PPP driver was included in your kernel configuration when your
53 kernel was built, then you only need to install the user-level
54 programs.  Otherwise you will need to get the source tree for your
55 kernel version, configure it with PPP included, and recompile.  Most
56 Linux distribution vendors ship kernels with PPP included in the
57 configuration.
58
59 The PPP driver can be either compiled into the kernel or compiled as a
60 kernel module.  If it is compiled into the kernel, the PPP driver is
61 included in the kernel image which is loaded at boot time.  If it is
62 compiled as a module, the PPP driver is present in one or more files
63 under /lib/modules and is loaded into the kernel when needed.
64
65 The 2.2 series kernels contain an older version of the kernel PPP
66 driver, one which doesn't support multilink.  If you want multilink,
67 you need to run the latest 2.4 series kernel.  The kernel PPP driver
68 was completely rewritten for the 2.4 series kernels to support
69 multilink and to allow it to operate over diverse kinds of
70 communication medium (the 2.2 driver only operates over serial ports
71 and devices which look like serial ports, such as pseudo-ttys).
72
73 Under the 2.2 kernels, if PPP is compiled as a module, the PPP driver
74 modules should be present in the /lib/modules/`uname -r`/net directory
75 (where `uname -r` represents the kernel version number).  The PPP
76 driver module itself is called ppp.o, and there will usually be
77 compression modules there, ppp_deflate.o and bsd_comp.o, as well as
78 slhc.o, which handles TCP/IP header compression.  If the PPP driver is
79 compiled into the kernel, the compression code will still be compiled
80 as modules, for kernels before 2.2.17pre12.  For 2.2.17pre12 and later,
81 if the PPP driver is compiled in, the compression code will also.
82
83 Under the 2.4 kernels, there are two PPP modules, ppp_generic.o and
84 ppp_async.o, plus the compression modules (ppp_deflate.o, bsd_comp.o
85 and slhc.o).  If the PPP generic driver is compiled into the kernel,
86 the other four can then be present either as modules or compiled into
87 the kernel.  There is a sixth module, ppp_synctty.o, which is used for
88 synchronous tty devices such as high-speed WAN adaptors.
89
90
91 2.2 User-level programs
92
93 If you obtained this package in .rpm or .deb format, you simply follow
94 the usual procedure for installing the package.
95
96 If you are using the .tar.gz form of this package, then cd into the
97 ppp-2.4.1b1 directory you obtained by unpacking the archive and issue
98 the following commands:
99
100 $ ./configure
101 $ make
102 # make install
103
104 The `make install' has to be done as root.  This makes and installs
105 four programs and their man pages: pppd, chat, pppstats and pppdump.
106 If the /etc/ppp configuration directory doesn't exist, the `make
107 install' step will create it and install some default configuration
108 files.
109
110
111 2.3 System setup for 2.4 kernels
112
113 Under the 2.4 series kernels, pppd needs to be able to open /dev/ppp,
114 character device (108,0).  If you are using devfs (the device
115 filesystem), the /dev/ppp node will automagically appear when the
116 ppp_generic module is loaded, or at startup if ppp_generic is compiled
117 in.
118
119 If you have ppp_generic as a module, and you are using devfsd (the
120 devfs daemon), you will need to add a line like this to your
121 /etc/devfsd.conf:
122
123 LOOKUP          ppp             MODLOAD
124
125 Otherwise you will need to create a /dev/ppp device node with the
126 commands:
127
128 # mknod /dev/ppp c 108 0
129 # chmod 600 /dev/ppp
130
131 If you use module autoloading and have PPP as a module, you will need
132 to add the following to your /etc/modules.conf or /etc/conf.modules:
133
134 alias /dev/ppp          ppp_generic
135 alias char-major-108    ppp_generic
136 alias tty-ldisc-3       ppp_async
137 alias tty-ldisc-14      ppp_synctty
138 alias ppp-compress-21   bsd_comp
139 alias ppp-compress-24   ppp_deflate
140 alias ppp-compress-26   ppp_deflate
141
142
143 2.4 System setup under 2.2 series kernels
144
145 Under the 2.2 series kernels, you should add the following to your
146 /etc/modules.conf or /etc/conf.modules:
147
148 alias tty-ldisc-3       ppp
149 alias ppp-compress-21   bsd_comp
150 alias ppp-compress-24   ppp_deflate
151 alias ppp-compress-26   ppp_deflate
152
153
154 3. Getting help with problems
155 -----------------------------
156
157 If you have problems with your PPP setup, or you just want to ask some
158 questions, or better yet if you can help others with their PPP
159 questions, then you should join the linux-ppp mailing list.  Send an
160 email to majordomo@vger.kernel.org with a line in the body saying
161
162 subscribe linux-ppp
163
164 To leave the mailing list, send an email to majordomo@vger.kernel.org
165 with a line in the body saying
166
167 unsubscribe linux-ppp
168
169 To send a message to the list, email it to linux-ppp@vger.kernel.org.
170 You don't have to be subscribed to send messages to the list.
171
172 You can also email me (paulus@samba.org) but I am overloaded with
173 email and I can't respond to most messages I get in a timely fashion.
174
175 There are also several relevant news groups, such as comp.protocols.ppp,
176 comp.os.linux.networking, or comp.os.linux.setup.
177
178
179 4. Configuring your dial-out PPP connections
180 --------------------------------------------
181
182 Some Linux distribution makers include tools in their distributions
183 for setting up PPP connections.  For example, for Red Hat Linux and
184 derivatives, you should probably use linuxconf or netcfg to set up
185 your PPP connections.
186
187 The two main windowing environments for Linux, KDE and Gnome, both
188 come with GUI utilities for configuring and controlling PPP dial-out
189 connections.  They are convenient and relatively easy to configure.
190
191 A third alternative is to use a PPP front-end package such as wvdial
192 or ezppp.  These also will handle most of the details of talking to
193 the modem and setting up the PPP connection for you.
194
195 Assuming that you don't want to use any of these tools, you want to
196 set up the configuration manually yourself, then read on.  This
197 document gives a brief description and example.  More details can be
198 found by reading the pppd and chat man pages and the PPP-HOWTO.
199
200 We assume that you have a modem that uses the Hayes-compatible AT
201 command set connected to an async serial port (e.g. /dev/ttyS0) and
202 that you are dialling out to an ISP.  
203
204 The trickiest and most variable part of setting up a dial-out PPP
205 connection is the part which involves getting the modem to dial and
206 then invoking PPP service at the far end.  Generally, once both ends
207 are talking PPP the rest is relatively straightforward.
208
209 Now in fact pppd doesn't know anything about how to get modems to dial
210 or what you have to say to the system at the far end to get it to talk
211 PPP.  That's handled by an external program such as chat, specified
212 with the connect option to pppd.  Chat takes a series of strings to
213 expect from the modem interleaved with a series of strings to send to
214 the modem.  See the chat man page for more information.  Here is a
215 simple example for connecting to an ISP, assuming that the ISP's
216 system starts talking PPP as soon as it answers the phone:
217
218 pppd connect 'chat -v "" AT OK ATDT5551212 ~' \
219         /dev/ttyS0 57600 crtscts debug defaultroute
220
221 Going through pppd's options in order:
222     connect 'chat ...'  This gives a command to run to contact the
223     PPP server.  Here the supplied 'chat' program is used to dial a
224     remote computer.  The whole command is enclosed in single quotes
225     because pppd expects a one-word argument for the 'connect' option.
226     The options to 'chat' itself are:
227
228          -v            verbose mode; log what we do to syslog
229          ""            don't wait for any prompt, but instead...
230          AT            send the string "AT"
231          OK            expect the response "OK", then
232          ATDT5551212   dial the modem, then
233          ~             wait for a ~ character, indicating the start
234                        of a PPP frame from the server
235
236     /dev/ttyS0         specifies which serial port the modem is connected to
237     57600              specifies the baud rate to use
238     crtscts            use hardware flow control using the RTS & CTS signals
239     debug              log the PPP negotiation with syslog
240     defaultroute       add default network route via the PPP link
241
242 Pppd will write error messages and debugging logs to the syslogd
243 daemon using the facility name "daemon".  These messages may already
244 be logged to the console or to a file like /var/log/messages; consult
245 your /etc/syslog.conf file to see.  If you want to make all pppd
246 messages go to a file such as /var/log/ppp-debug, add the line
247
248 daemon.*                                        /var/log/ppp-debug
249         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
250            This is one or more tabs. Do not use spaces.
251
252 to syslog.conf; make sure to put one or more TAB characters (not
253 spaces!) between the two fields.  Then you need to create an empty
254 /var/log/ppp-debug file with a command such as
255
256         touch /var/log/ppp-debug
257
258 and then restart syslogd, usually by sending it a SIGHUP signal with a
259 command like this:
260
261         killall -HUP syslogd
262
263
264 4.1 Is the link up?
265
266 The main way to tell if your PPP link is up and operational is the
267 ifconfig ("interface configuration") command.  Type
268
269         /sbin/ifconfig
270
271 at a shell prompt.  It should print a list of interfaces including one
272 like this example:
273
274 ppp0      Link encap Point-to-Point Protocol
275           inet addr 192.76.32.3  P-t-P 129.67.1.165  Mask 255.255.255.0
276           UP POINTOPOINT RUNNING  MTU 1500  Metric 1
277           RX packets 33 errors 0 dropped 0 overrun 0
278           TX packets 42 errors 0 dropped 0 overrun 0
279
280 Assuming that ifconfig shows the ppp network interface, you can test
281 the link using the ping command like this:
282
283         /sbin/ping -c 3 129.67.1.165
284
285 where the address you give is the address shown as the P-t-P address
286 in the ifconfig output.  If the link is operating correctly, you
287 should see output like this:
288
289   PING 129.67.1.165 (129.67.1.165): 56 data bytes
290   64 bytes from 129.67.1.165: icmp_seq=0 ttl=255 time=268 ms
291   64 bytes from 129.67.1.165: icmp_seq=1 ttl=255 time=247 ms
292   64 bytes from 129.67.1.165: icmp_seq=2 ttl=255 time=266 ms
293   --- 129.67.1.165 ping statistics ---
294   3 packets transmitted, 3 packets received, 0% packet loss
295   round-trip min/avg/max = 247/260/268 ms
296