Ian's PPP Primer for Linux 2.0

Introduction

This is a completely revised version of my original PPP Primer, designed to work for Linux kernels in the 2.0.x series (including the newest releases of Slackware and Redhat). It should contain everything you need to get PPP working on your system.

Disclaimer: This document is intended only as a guide, and it falls firmly in the class of "It works for me; your mileage may vary." Nevertheless, comments, bug reports, and suggestions are welcome; my address is listed below.

What you will need

In order to use this primer, you will need:

Setting up your configuration files

You will need to edit certain files in your /etc directory (as root, obviously) to reflect your PPP connection. Each file you will need to change will be listed, along with the ownership and permissions it should have (the output of ls -l).

-rw-r--r--  1 root   root      22 Jul 29 12:57 /etc/HOSTNAME

This file should contain a single line consisting of the hostname for your machine. At Berkeley, this is your PPP account name, followed by .hip.berkeley.edu. For example, my /etc/HOSTNAME file contains the line cypherpunk.hip.berkeley.edu.

-rw-r--r--  1 root   root     144 Jun 20 21:49 /etc/hosts

This file associates host names to IP addresses. Any hosts you list in this file can be looked up more quickly than ones you don't, because you won't have to send a message over your modem. Here is a sample /etc/hosts file. Make sure to change the second line to match your IP address and hostname.

127.0.0.1    localhost
YOUR.IP.ADD.RESS YOURNAME.hip.berkeley.edu YOURNAME
128.32.136.9  ns1.berkeley.edu
128.32.136.12  ns2.berkeley.edu
128.32.37.33  kerberos1.cs.berkeley.edu
128.32.240.249 kerberos2.eecs.berkeley.edu
-rw-rw-r--  1 root   root     124 Jun 20 13:35 /etc/resolv.conf

This file lists the computers to use as nameservers, and how to look up computers, given the first part of their names. You should have been given one or two IP address of machines to use as nameserver when you got your PPP account. Use them in the nameserver lines, below. Here is a sample /etc/resolv.conf file, suitable for EECS and CS students at Berkeley:

domain hip.berkeley.edu
search cs.berkeley.edu eecs.berkeley.edu berkeley.edu
nameserver 128.32.136.12
nameserver 128.32.136.9
The first line of this file lists your computer's domain; usually, this is anything after the first dot in the /etc/HOSTNAME file. The second line lists domains to search when looking up partial hostnames. For example, if you had the the file above, and you tried to telnet to quux, your computer would try to connect to quux.cs.berkeley.edu, quux.eecs.berkeley.edu, and quux.berkeley.edu, in that order. The remaining lines list nameservers to use. Fill in the ones you were given, as described above.
drwxrwxr-x  2 root   root     1024 Jun 20 13:02 /etc/ppp
-rw-rw-r--  1 root   root      0 Feb 25 1996 /etc/ppp/options

Make sure you have a directory called /etc/ppp and in it, an empty file called options. We will be putting other files in this directory later.

Dialing in

Now you must set up the programs that will allow you to dial the modem, log in, and start a PPP connection. You may already have programs with the following names. If so, back them up and replace them with these. Clicking on their names will download them.

-rwxr-xr-x  1 root   root     641 Feb 25 1996 /usr/sbin/ppp-on
-rwxr-xr-x  1 root   root     981 Feb 25 1996 /usr/sbin/ppp-off
-rwxr-xr-x  1 root   root     142 Sep 24 19:57 /etc/ppp/ip-up
-rwxr-xr-x  1 root   root     222 Sep 24 19:52 /etc/ppp/ppp-on-chat

Finally, you have to set up one or more chatscripts. These are files that tell the computer how to log in to your PPP account. You need at least one of these called /etc/ppp/chatscript:

-rw-------  1 root   root     192 Sep 8 19:49 /etc/ppp/chatscript

You will need to substitute your own values for some of the entries in the file above:

***PHONENUMBER***
Change this to the phone number you use to dial in. Leave no space between it and the atdt before it.
***USERNAME***
Change this to the username you use to log in to your PPP account. At Berkeley, this is your Home-IP account name.
***PASSWORD***
Change this to your PPP account password. Leave no space between it and the \q before it. If your password contains any characters that are not letters or numbers, you may have to put ticks (') around the password.

You can have more than one chatscript if, for example, there is more than one phone number you can use. Just copy the above chatscript and make the appropriate changes to the new copy. Call your new copy /etc/ppp/chatscript-word, where word is any sequence of letters or numbers. For example, you might have the file /etc/ppp/chatscript-15min that contains the phone number to dial up the 15 minute service.

How to use it

Once you have done everything described above, you can try it out. As root, do:

  # ppp-on

If all goes well, your modem should dial, and you should get a PPP connection. Check your /var/log/messages file if it doesn't work. If you want to use one of your other chatscripts, give the suffix for the chatscript as an argument. For example,

  # ppp-on 15min

would access the chatscript /etc/ppp/chatscript-15min instead of the default one.

As you would expect, to turn off PPP, do

  # ppp-off

Additional Coolness

You can use the kerneld feature of the 2.0 kernels to eliminate the need to run ppp-on al all! If set up properly, your computer can just dial your modem automatically, whenever it needs to send something over the net. To get this to work, you need to have kernerld support compiled into your kernel, and you need to have the line

  /sbin/kerneld

in your /etc/rc.d/rc.S file (for Slackware; for Redhat, this may be different). Now you just need to add one more program:

-rwxr-xr-x  1 root   bin     357 Sep 24 19:53 /sbin/request-route

If you just installed all of this now, reboot. Now try running netscape, or telnetting to or pinging some machine. If all went well, your modem should automatically dial, your computer should automatically start PPP, and the connection will work.

You will still need to shut down PPP manually with ppp-off, or you can just rely on the fact the the line will drop after 30 minutes of not being used (at Berkeley, anyway).

If you want request-route to use a different chatscript, simply edit the appropriate line in the program. If you want it to try different ones, you're on your own (unless someone writes such a thing and sends it to me!).

Comments

Please direct any questions, comments, or radical doubts to me at the address below, or post to ucb.os.linux.


Last updated September 26, 1996
Ian Goldberg <iang@cs.berkeley.edu>