| 1 |
Configuring a PPP link. |
| 2 |
|
| 3 |
After you have compiled and installed this package, there are some |
| 4 |
configuration files which will generally need to be set up. The |
| 5 |
pppd(8) man page is the best reference for the full details; this file |
| 6 |
outlines the configuration process for the most common case, where |
| 7 |
this package is being used to enable a machine to dial an ISP and |
| 8 |
connect to the internet. The FAQ and README.linux files also provide |
| 9 |
useful information about setting up PPP. |
| 10 |
|
| 11 |
Dialling an ISP. |
| 12 |
**************** |
| 13 |
|
| 14 |
Usually, an ISP will assign an IP address to your machine, and will |
| 15 |
refuse to authenticate itself to you. Some ISPs require a username |
| 16 |
and password to be entered before PPP service commences, while others |
| 17 |
use PPP authentication (using either the PAP or CHAP protocols). |
| 18 |
|
| 19 |
The recommended way to set up to dial an ISP is for the system |
| 20 |
administrator to create a file under /etc/ppp/peers, named for the ISP |
| 21 |
that you will be dialling. For example, suppose the file is called |
| 22 |
/etc/ppp/peers/isp. This file would contain something like this: |
| 23 |
|
| 24 |
ttyS0 # modem is connected to /dev/ttyS0 |
| 25 |
38400 # run the serial port at 38400 baud |
| 26 |
crtscts # use hardware flow control |
| 27 |
noauth # don't require the ISP to authenticate itself |
| 28 |
defaultroute # use the ISP as our default route |
| 29 |
connect '/usr/sbin/chat -v -f /etc/ppp/chat-isp' |
| 30 |
|
| 31 |
If there are any other pppd options that should apply when calling |
| 32 |
this ISP, they can also be placed in this file. |
| 33 |
|
| 34 |
The /etc/ppp/chat-isp file named in the last line contains the script |
| 35 |
for chat(8) to use to dial the ISP and go through any username/ |
| 36 |
password authentication required before PPP service starts. Here is |
| 37 |
an example (for dialling an Annex terminal server): |
| 38 |
|
| 39 |
ABORT "NO CARRIER" |
| 40 |
ABORT "NO DIALTONE" |
| 41 |
ABORT "ERROR" |
| 42 |
ABORT "NO ANSWER" |
| 43 |
ABORT "BUSY" |
| 44 |
ABORT "Username/Password Incorrect" |
| 45 |
"" "at" |
| 46 |
OK "at&d2&c1" |
| 47 |
OK "atdt2479381" |
| 48 |
"name:" "^Uusername" |
| 49 |
"word:" "\qpassword" |
| 50 |
"annex" "ppp" |
| 51 |
"Switching to PPP-ppp-Switching to PPP" |
| 52 |
|
| 53 |
See the chat(8) man page for details of the script. If you are not |
| 54 |
sure how the initial dialog with your ISP will go, you could use |
| 55 |
a terminal emulator such as kermit or minicom to go through the |
| 56 |
process manually. |
| 57 |
|
| 58 |
If your ISP requires PAP or CHAP authentication, you will have to |
| 59 |
create a line in /etc/ppp/pap-secrets or /etc/ppp/chap-secrets like |
| 60 |
this: |
| 61 |
|
| 62 |
myhostname * "password" |
| 63 |
|
| 64 |
(Replace myhostname with the hostname of your machine.) |
| 65 |
|
| 66 |
At this point, you can initiate the link with the command: |
| 67 |
|
| 68 |
/usr/sbin/pppd call isp |
| 69 |
|
| 70 |
(N.B.: pppd might be installed in a different directory on some |
| 71 |
systems). |
| 72 |
|
| 73 |
This will return to the shell prompt immediately, as pppd will detach |
| 74 |
itself from its controlling terminal. (If you don't want it to do |
| 75 |
this, use the "nodetach" option.) |
| 76 |
|
| 77 |
Pppd will log messages describing the progress of the connection and |
| 78 |
any errors using the syslog facility (see the syslogd(8) and |
| 79 |
syslog.conf(5) man pages). Pppd issues messages using syslog facility |
| 80 |
daemon (or local2 if it has been compiled with debugging enabled); |
| 81 |
chat uses facility local2. It is often useful to see messages of |
| 82 |
priority notice or higher on the console. To see these, find the line |
| 83 |
in /etc/syslog.conf which has /dev/console on the right-hand side, and |
| 84 |
add `daemon.notice' on the left. This line should end up something |
| 85 |
like this: |
| 86 |
|
| 87 |
*.err;kern.debug;daemon,local2,auth.notice;mail.crit /dev/console |
| 88 |
|
| 89 |
If you want to see more messages from pppd, request messages of |
| 90 |
priority info or higher for facility daemon, like this: |
| 91 |
|
| 92 |
*.err;kern.debug;daemon.info;local2,auth.notice;mail.crit /dev/console |
| 93 |
|
| 94 |
It is also useful to add a line like this: |
| 95 |
|
| 96 |
daemon,local2.debug /etc/ppp/ppp-log |
| 97 |
|
| 98 |
If you do this, you will need to create an empty /etc/ppp/ppp-log |
| 99 |
file. |
| 100 |
|
| 101 |
After modifying syslog.conf, you will then need to send a HUP signal |
| 102 |
to syslogd (or reboot). |
| 103 |
|
| 104 |
When you wish terminate the PPP link, you should send a TERM or INTR |
| 105 |
signal to pppd. Pppd writes its process ID to a file called |
| 106 |
ppp<n>.pid in /var/run (or /etc/ppp on older systems such as SunOS or |
| 107 |
Ultrix). Here <n> is the PPP interface unit number, which will be 0 |
| 108 |
unless you have more than one PPP link running simultaneously. Thus |
| 109 |
you can terminate the link with a command like |
| 110 |
|
| 111 |
kill `cat /var/run/ppp0.pid` |