source: archive/ppp.xml

trunk
Last change on this file was 45ab6c7, checked in by Xi Ruoyao <xry111@…>, 4 months ago

more SVN prop clean up

Remove "$LastChanged$" everywhere, and also some unused $Date$

  • Property mode set to 100644
File size: 20.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY ppp-download-http "http://samba.org/ftp/ppp/ppp-&ppp-version;.tar.gz">
8 <!ENTITY ppp-download-ftp "&gentoo-ftp-repo;/ppp-&ppp-version;.tar.gz">
9 <!ENTITY ppp-md5sum "4621bc56167b6953ec4071043fe0ec57">
10 <!ENTITY ppp-size "920 KB">
11 <!ENTITY ppp-buildsize "6.4 MB">
12 <!ENTITY ppp-time "0.1 SBU">
13]>
14
15<sect1 id="ppp" xreflabel="PPP-&ppp-version;">
16 <?dbhtml filename="ppp.html"?>
17
18 <sect1info>
19 <date>$Date$</date>
20 </sect1info>
21
22 <title>PPP-&ppp-version;</title>
23
24 <indexterm zone="ppp">
25 <primary sortas="a-PPP">PPP</primary>
26 </indexterm>
27
28 <sect2 role="package">
29 <title>Introduction to PPP</title>
30
31 <para>The <application>PPP</application> package contains the
32 <command>pppd</command> daemon and the <command>chat</command>
33 program. This is used for connecting to other machines; often for connecting to
34 the Internet via a dial-up or PPPoE connection to an ISP.</para>
35
36 &lfs70_checked;
37
38 <bridgehead renderas="sect3">Package Information</bridgehead>
39 <itemizedlist spacing="compact">
40 <listitem>
41 <para>Download (HTTP): <ulink url="&ppp-download-http;"/></para>
42 </listitem>
43 <listitem>
44 <para>Download (FTP): <ulink url="&ppp-download-ftp;"/></para>
45 </listitem>
46 <listitem>
47 <para>Download MD5 sum: &ppp-md5sum;</para>
48 </listitem>
49 <listitem>
50 <para>Download size: &ppp-size;</para>
51 </listitem>
52 <listitem>
53 <para>Estimated disk space required: &ppp-buildsize;</para>
54 </listitem>
55 <listitem>
56 <para>Estimated build time: &ppp-time;</para>
57 </listitem>
58 </itemizedlist>
59
60 <bridgehead renderas="sect3">PPP Dependencies</bridgehead>
61
62 <bridgehead renderas="sect4">Optional</bridgehead>
63 <para role="optional"><xref linkend="libpcap"/> (needed to do PPP filtering)
64 and <xref linkend="linux-pam"/> (to authenticate incoming calls using PAM -
65 only needed by ISPs).
66 </para>
67
68 <para condition="html" role="usernotes">User Notes:
69 <ulink url="&blfs-wiki;/PPP"/></para>
70
71 </sect2>
72
73 <sect2 role="installation">
74 <title>Installation of PPP</title>
75
76 <note id="ppp-kernel">
77 <para><application>PPP</application> support (CONFIG_PPP),
78 the asynchronous line discipline (CONFIG_PPP_ASYNC), the
79 driver for your serial port device and/or the PPP over Ethernet
80 (PPPoE) protocol driver (CONGIG_PPPOE) must be compiled into the
81 kernel or loaded as kernel modules.
82 Udev doesn't load the ppp_generic and pppoe modules automatically. If you
83 compiled them as modules they can be loaded by the modules bootscript if
84 they are mentioned in <filename>/etc/sysconfig/modules</filename>
85 file.</para>
86 </note>
87
88 <indexterm zone="ppp ppp-kernel">
89 <primary sortas="d-PPP-support">PPP support</primary>
90 </indexterm>
91
92 <para>Create (as <systemitem class="username">root</systemitem>)
93 the group for users who may run <application>PPP</application>:</para>
94
95<screen role="root"><userinput>groupadd -g 52 pppusers</userinput></screen>
96
97 <para>Compile <application>PPP</application> by running the
98 following commands:</para>
99
100<screen><userinput>rm include/linux/if_pppol2tp.h &amp;&amp;
101./configure --prefix=/usr &amp;&amp;
102make</userinput></screen>
103
104 <para>This package does not come with a test suite.</para>
105
106 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
107
108<screen role='root'><userinput>make install &amp;&amp;
109install -d /etc/ppp/peers</userinput></screen>
110
111 </sect2>
112
113 <sect2 role="commands">
114 <title>Command Explanations</title>
115
116 <para><command>rm include/linux/if_pppol2tp.h</command>:
117 <application>PPP-&ppp-version;</application> contains an out of date copy
118 of the kernel header <filename>linux/if_pppol2tp.h</filename>. This needs to
119 be removed to <emphasis>force</emphasis> it to use the one installed in
120 <filename class="directory">/usr</filename>. If you don't remove this file
121 the build will still succeed (thanks to a poorly written
122 <filename>Makefile</filename>) but it will fail to compile the
123 <filename class="libraryfile">openl2tp.so</filename>,
124 <filename class="libraryfile">pppol2tp.so</filename>,
125 and <filename class="libraryfile">rp-pppoe.so</filename> plugins:</para>
126
127 <para><command>install -d /etc/ppp/peers</command>: This command creates
128 a directory for PPP peer configuration files.</para>
129
130<!-- FIXME: the three options below are taken from pppd/Makefile.linux file.
131 They have not been tested. There are other options, such as USE_SRP=y,
132 that cannot work (in this case, because libsrp is not available from
133 anywhere) - Alexander E. Patrakov -->
134
135 <para><parameter>USE_PAM=y</parameter>: Add this argument to the
136 <command>make</command> command to compile in support for PAM, usually
137 needed for authenticating inbound calls against a central database.</para>
138
139 <para><parameter>HAVE_INET6=y</parameter>: Add this argument to the
140 <command>make</command> command to compile in support for IPv6.</para>
141
142 <para><parameter>CBCP=y</parameter>: Add this argument to the
143 <command>make</command> command to compile in support for the
144 Microsoft proprietary Callback Control Protocol.</para>
145
146 </sect2>
147
148 <sect2 role="configuration">
149 <title>Configuring PPP</title>
150
151 <sect3 id="ppp-config">
152 <title>Config Files</title>
153
154 <para><filename>/etc/ppp/*</filename></para>
155
156 <indexterm zone="ppp ppp-config">
157 <primary sortas="e-etc-ppp-star">/etc/ppp/*</primary>
158 </indexterm>
159
160 </sect3>
161
162 <sect3>
163 <title>Configuration Information</title>
164
165 <para>Add the users who may run <application>PPP</application> to the
166 <systemitem class="groupname">pppusers</systemitem> group:</para>
167
168<screen role="root"><userinput>usermod -a -G pppusers <replaceable>&lt;username&gt;</replaceable></userinput></screen>
169
170 <para>Most internet service providers that use ppp give you a username
171 and password for you to use to authenticate yourself when you connect to
172 their servers. These secrets are kept in the files
173 <filename>/etc/ppp/pap-secrets</filename> or
174 <filename>/etc/ppp/chap-secrets</filename>. If you don't know whether
175 your ISP uses CHAP or PAP then create both files and put the same content
176 in both files.</para>
177
178 <para>If you have more than one ISP account the second column
179 (remotename) is used to identify between the different
180 usernames/passwords needed for the different ISPs. If you only have one
181 ISP account an asterisk will work fine in the second column.</para>
182
183 <para>In this example the username given by the ISP is
184 <quote>jdoe</quote>, the password is <quote>guessit</quote>, the ISP uses
185 PAP and the user wants to give this account the remotename
186 <quote>dialup</quote> in order to distinguish it from other PPP
187 accounts:</para>
188
189<screen role="root"><userinput>cat &gt;&gt;/etc/ppp/pap-secrets &lt;&lt;"EOF"</userinput>
190<literal># username remotename password
191jdoe dialup guessit</literal>
192<userinput>EOF
193chmod 600 /etc/ppp/pap-secrets</userinput></screen>
194
195 <sect4>
196 <title>DNS Server Configuration</title>
197
198 <para>If you don't run your own caching DNS server (like
199 <xref linkend="bind"/>) <command>pppd</command> can ask your ISP for its
200 domain name servers and put them in <filename>/etc/ppp/resolv.conf</filename>.
201 If you want to use their domain name servers:</para>
202
203<screen role="root"><userinput>mv /etc/resolv.conf{,.orig}
204ln -s ppp/resolv.conf /etc</userinput></screen>
205
206 </sect4>
207
208 <sect4>
209 <title>PPPoE connections</title>
210
211 <para>In order to configure a PPPoE connection, create a peer file that
212 contains the connection details:</para>
213<screen role="root"><userinput>cat &gt;/etc/ppp/peers/<replaceable>peername</replaceable> &lt;&lt;"EOF"</userinput>
214<literal>plugin rp-pppoe.so <replaceable>eth0</replaceable>
215
216# Your username at the ISP. This is the same as the first
217# column in /etc/ppp/*-secrets:
218user "<replaceable>jdoe</replaceable>"
219
220# remotename is not needed if you only have one ISP account and
221# hence an asterisk in the second column in pap or chap-secrets:
222# remotename "<replaceable>adsl</replaceable>"
223
224# If it's not working and you want pppd to be
225# more verbose in /var/log/sys.log, add debug:
226# debug
227
228# If you have a static IP address (eg, 12.34.56.78) you
229# can specify it by following it with a colon:
230# 12.34.56.78:
231
232# Otherwise accept whatever IP address the ISP gives you:
233noipdefault
234
235# The settings below usually don't need to be changed
236noauth
237hide-password
238updetach
239defaultroute
240# create /etc/ppp/resolv.conf:
241usepeerdns
242
243### For more details (and more options)
244### read man pppd</literal>
245<userinput>EOF
246chmod 600 /etc/ppp/peers/<replaceable>peername</replaceable></userinput></screen>
247 </sect4>
248
249 <sect4>
250 <title>PPPoATM connections</title>
251
252 <para>PPPoA connections are very similar to PPPoE, the main differences
253 are that you use the pppoatm.so plugin instead of rp-pppoe.so, you don't
254 specify the ethernet interface (it uses ppp0) and you need to VP/VC
255 numbers that are used by your ISP (there is a list of VP/VC numbers
256 <ulink url="http://www.linux-usb.org/SpeedTouch/faq/index.html#q12">here
257 </ulink>)</para>
258
259<screen role="root"><userinput>cat &gt;/etc/ppp/peers/<replaceable>peername</replaceable> &lt;&lt;"EOF"</userinput>
260<literal>plugin pppoatm.so
261
262# Your VP/VC numbers. eg, in Britain it is 0.38, in
263# France they use 8.35. Google is your friend :)
2640.38
265
266# Your username at the ISP. This is the same as the
267# first column in /etc/ppp/*-secrets:
268user "<replaceable>jdoe</replaceable>"
269
270# remotename is not needed if you only have one ISP account and
271# hence an asterisk in the second column in pap or chap-secrets:
272# remotename "<replaceable>adsl</replaceable>"
273
274# If it's not working and you want pppd to be
275# more verbose in /var/log/sys.log, add debug:
276# debug
277
278# If you have a static IP address (eg, 12.34.56.78) you
279# can specify it by following it with a colon:
280# 12.34.56.78:
281
282# Otherwise accept whatever IP address the ISP gives you:
283noipdefault
284
285# The settings below usually don't need to be changed
286noauth
287hide-password
288updetach
289defaultroute
290# create /etc/ppp/resolv.conf:
291usepeerdns
292
293### For more details (and more options)
294### read man pppd</literal>
295<userinput>EOF
296chmod 600 /etc/ppp/peers/<replaceable>peername</replaceable></userinput></screen>
297
298 </sect4>
299
300 <sect4>
301 <title>Dialup Modem Connection</title>
302
303<!-- This section has been tested with various ISPs in Yekaterinburg,
304 Russia using Lucent WinModem. I cannot test it anymore, because
305 there is no free PCI slot for the modem in my new computer. However,
306 it is similar enough to GPRS for me to be sure that it still works,
307 and nobody complained about non-working dialup on the LFS LiveCD.
308 - Alexander E. Patrakov -->
309
310 <para>Dialup connections are established with the help of a modem
311 connected to a computer and the telephone line. The modem dials a
312 telephone number of the ISP's modem, and they exchange data using
313 the signal frequencies 300-4000 Hz. Typical data transfer
314 rate is 40-50 kilobits per second, and the gateway ping time
315 (latency) is up to 300-400 ms. In order to configure the
316 dialup connection, it is required to know the telephone number of
317 the ISP's modem pool, the username and the password.</para>
318
319 <para>In order to configure a dialup connection, two files have to
320 be created: a chat script that automates the connection procedure
321 (common for all dialup accounts), and a peer file that provides
322 configuration information about a specific connection to
323 <command>pppd</command>:</para>
324<screen role="root"><userinput>cat &gt;/etc/ppp/dialup.chat &lt;&lt;"EOF"</userinput>
325<literal>ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE'
326ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED
327ABORT ERROR ABORT BLACKLISTED
328
329TIMEOUT 5
330'' AT
331# \T is the phone number, passed from /etc/ppp/peers/<replaceable>dialup</replaceable>
332OK-+++\dATH0-OK ATD\T
333TIMEOUT 75
334CONNECT \d\c</literal>
335<userinput>EOF
336
337cat &gt;/etc/ppp/peers/<replaceable>dialup</replaceable> &lt;&lt;"EOF"</userinput>
338<literal># Your username at the ISP
339user "<replaceable>jdoe</replaceable>"
340# What should be in the second column in /etc/ppp/*-secrets
341remotename "<replaceable>dialup</replaceable>"
342# Replace <replaceable>TTTTTTT</replaceable> with the ISP phone number
343connect "/usr/sbin/chat -T <replaceable>TTTTTTT</replaceable> -f /etc/ppp/dialup.chat"
344
345# Specify your modem serial port and speed below
346<replaceable>/dev/ttyS0</replaceable>
347<replaceable>115200</replaceable>
348
349# The settings below usually don't need to be changed
350updetach
351noauth
352hide-password
353debug
354lock
355defaultroute
356noipdefault
357usepeerdns</literal>
358<userinput>EOF</userinput></screen>
359
360 <para>The first three lines of the
361 <filename>/etc/ppp/dialup.chat</filename> file abort the script when
362 it receives an indication of an error from the modem. Then the timeout
363 is set to 5 seconds and the script checks that the modem responds to
364 the dummy AT command. If not, measures are taken to dewedge it
365 (by interrupting the data transfer and going on hook). Then the
366 telephone number is dialed, and the script waits for the answer for
367 75 seconds. The serial connection is considered established when the
368 modem sends the string CONNECT.</para>
369
370 </sect4>
371
372 <sect4>
373 <title>GPRS and EDGE Connections</title>
374
375<!-- This section has been tested with GPRS service from MOTIV in
376 Yekaterinburg, Russia. According to forum messages, the procedure
377 also works with EDGE, but my cellular phone (Motorola C350) does not
378 support EDGE. - Alexander E. Patrakov -->
379
380 <para>GPRS and EDGE connections are established with the help of a
381 cellular phone connected to a computer via serial, USB, or Bluetooth.
382 The phone exchanges data packets with the nearest base station,
383 which can be up to 35 kilometers away.
384
385 <!-- FIXME: watch for new standards! SkyLink is already offering
386 3.1 megabits per second with CDMA mobile phones, and
387 the configuration below doesn't work. It is reported that
388 a regular dialup setup with the telephone number "#777",
389 username "mobile" and password "internet" works with SkyLink. -->
390
391 The maximum possible data transfer rate is 170 kilobits per second
392 for GPRS and 474 kilobits per second for EDGE, but many cellular
393 operators impose lower limits, such as 64 kilobits per second. The
394 gateway ping time is 900 ms for GPRS, which makes playing many online
395 games impossible and causes connection to ICQ to be unreliable.
396 In order to configure a GPRS or EDGE connection,
397 it is required to know the access point name (APN) and, rarely, the
398 username and the password.
399 In most cases, billing is based on the telephone number, and the
400 username/password pair is not needed, as assumed in the example
401 below.</para>
402
403 <para>In order to configure a GPRS connection, two files have to
404 be created: a chat script that automates the connection procedure
405 (common for all GPRS accounts), and a peer file that provides
406 configuration information about a specific connection to
407 <command>pppd</command>:</para>
408<screen role="root"><userinput>cat &gt;/etc/ppp/gprs.chat &lt;&lt;"EOF"</userinput>
409<literal>ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE'
410ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED
411ABORT ERROR ABORT BLACKLISTED
412
413TIMEOUT 5
414'' AT
415OK-+++\dATH0-OK ATZ
416# \T is the APN, passed from /etc/ppp/peers/<replaceable>gprs</replaceable>
417# This example stores the APN as profile #1 in the phone.
418# The "telephone number", *99***&lt;profile_number&gt;#, is always the same.
419# If you want to store this as profile #2, change 1 to 2 in the
420# following two lines.
421OK AT+CGDCONT=<replaceable>1</replaceable>,"IP","\T"
422OK "ATD*99***<replaceable>1</replaceable>#"
423CONNECT \d\c</literal>
424<userinput>EOF
425
426cat &gt;/etc/ppp/peers/<replaceable>gprs</replaceable> &lt;&lt;"EOF"</userinput>
427<literal># Replace <replaceable>inet.example.com</replaceable> with the proper APN for your provider
428connect "/usr/sbin/chat -T <replaceable>inet.example.com</replaceable> -f /etc/ppp/gprs.chat"
429
430# Specify your cellphone serial port and speed below
431# Note: you must manually send some vendor-specific AT commands
432# to certain old cellular phones (such as Sony-Ericsson T200)
433# in order to achieve connection speed more than 9600 bits per second.
434<replaceable>/dev/ttyS1</replaceable>
435<replaceable>115200</replaceable>
436
437# The settings below usually don't need to be changed
438noccp
439noauth
440updetach
441debug
442lock
443defaultroute
444noipdefault
445usepeerdns</literal>
446<userinput>EOF</userinput></screen>
447 </sect4>
448
449 <sect4>
450 <title>Establishing the connection manually</title>
451
452 <para>In order to establish a PPP connection described by the
453 <filename>/etc/ppp/peers/<replaceable>peername</replaceable></filename>
454 file run (as <systemitem class="username">root</systemitem> or as a member
455 of the <systemitem class="groupname">pppusers</systemitem> group):</para>
456<screen><userinput>pppd call <replaceable>peername</replaceable></userinput></screen>
457
458 <para>In order to stop the connection, run:</para>
459<screen><userinput>killall pppd</userinput></screen>
460
461 <!-- There are an infinite number of ways that computers can be
462 connected together. Trying to write a bootscript that can cope with every
463 possible network configuration is the road to madness. Andrew Benton -->
464
465 <para>Writing a bootscript that brings up the connection during the boot
466 process is left as an exercise for the reader ;)</para>
467
468 </sect4>
469
470 </sect3>
471
472 </sect2>
473 <sect2 role="content">
474 <title>Contents</title>
475
476 <segmentedlist>
477 <segtitle>Installed Programs</segtitle>
478 <segtitle>Installed Libraries</segtitle>
479 <segtitle>Installed Directories</segtitle>
480
481 <seglistitem>
482 <seg>chat, pppd, pppdump, pppoe-discovery and pppstats</seg>
483 <seg>Several plugin modules installed in
484 <filename class='directory'>/usr/lib/pppd/&ppp-version;</filename></seg>
485 <seg>/etc/ppp, /usr/include/pppd and /usr/lib/pppd</seg>
486 </seglistitem>
487 </segmentedlist>
488
489 <variablelist>
490 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
491 <?dbfo list-presentation="list"?>
492 <?dbhtml list-presentation="table"?>
493
494 <varlistentry id="chat">
495 <term><command>chat</command></term>
496 <listitem>
497 <para>defines a conversational exchange between the computer and the
498 modem. Its primary purpose is to establish the connection between the
499 Point-to-Point Protocol Daemon (PPPD) and the remote
500 <command>pppd</command> process.</para>
501 <indexterm zone="ppp chat">
502 <primary sortas="b-chat">chat</primary>
503 </indexterm>
504 </listitem>
505 </varlistentry>
506
507 <varlistentry id="pppd">
508 <term><command>pppd</command></term>
509 <listitem>
510 <para>is the Point to Point Protocol daemon.</para>
511 <indexterm zone="ppp pppd">
512 <primary sortas="b-pppd">pppd</primary>
513 </indexterm>
514 </listitem>
515 </varlistentry>
516
517 <varlistentry id="pppdump">
518 <term><command>pppdump</command></term>
519 <listitem>
520 <para>is used to convert
521 <application>PPP</application> record files to a readable
522 format.</para>
523 <indexterm zone="ppp pppdump">
524 <primary sortas="b-pppdump">pppdump</primary>
525 </indexterm>
526 </listitem>
527 </varlistentry>
528
529 <varlistentry id="pppoe-discovery">
530 <term><command>pppoe-discovery</command></term>
531 <listitem>
532 <para>performs the same discovery process as the pppoe plugin, but
533 does not initiate a <application>PPP</application> session.</para>
534 <indexterm zone="ppp pppoe-discovery">
535 <primary sortas="b-pppoe-discovery">pppoe-discovery</primary>
536 </indexterm>
537 </listitem>
538 </varlistentry>
539
540 <varlistentry id="pppstats">
541 <term><command>pppstats</command></term>
542 <listitem>
543 <para>is used to print
544 <application>PPP</application> statistics.</para>
545 <indexterm zone="ppp pppstats">
546 <primary sortas="b-pppstats">pppstats</primary>
547 </indexterm>
548 </listitem>
549 </varlistentry>
550
551 </variablelist>
552
553 </sect2>
554
555</sect1>
Note: See TracBrowser for help on using the repository browser.