SETTING UP LINUX PPP
This document explains how to set up Linux PPP (specifically, Red Hat
5.2) for use with your World account. pppd (PPP daemon) is PPP
software that comes with most Linux distributions. It allows Internet
programs such as Netscape, telnet, FTP, etc. to operate via your modem.
These instructions assume some familiarity with basic UNIX commands
and file permissions.
This document is divided into the following sections:
I - Verifying that you have the Correct Software
II - Setting Up DNS
III - Setting Up pppd Configuration Files
IV - Making a PPP Connection
Appendix - Connection Scripts
Part I - Verifying that you have the Correct Software
To make sure that you have the PPP daemon, login as root and type
# rpm -qa | grep ppp
(where "#" is the Unix prompt for user "root"). You should get a
response which looks like this:
If you don't have pppd, you can get it from
The PPP daemon is installed such that it requires root access to
start up a PPP link.
Part II - Setting Up DNS
There are two configuration files which must be set up so that your
computer can resolve names such as www.slashdot.org to the
corresponding IP address (22.214.171.124). These files are
/etc/resolv.conf and /etc/host.conf.
The file /etc/resolv.conf should have the following contents:
and have the following permissions (check using "# ls -l"):
-rw-r--r-- 1 root root .
The file /etc/host.conf should have the following contents:
and have the same permissions as /etc/resolv.conf.
Part III - Setting Up pppd Configuration Files
There are several configuration files which can be used to control the
behavior of pppd. There are two in particular which we are interested
in, /etc/ppp/options and /etc/ppp/pap-secrets.
The file /etc/ppp/options should have the following contents:
("theworld.com" must in lowercase)
and the following permissions:
-rw-r--r-- 1 root root 17 Jun 8 20:49 options
/etc/ppp/pap-secrets must contain the username and password of your
# Secrets for authentication using PAP
# client server secret IP addresses
firstname.lastname@example.org * your_password
Since pap-secrets contains your password, it is important that the
files are not readable by anyone other than the root user:
-rw------- 1 root root 113 Jun 8 20:42 pap-secrets
Of course, replace "your_username" and "your_password" with your World
username and password.
Part IV - Making a PPP Connection
In the appendix are three Bourne shell scripts (ppp-on, ppp-dialer and
ppp-off) which you can use to establish or terminate a PPP connection
to the World. Copy these scripts to wherever you keep executable
files on your computer (such as /usr/local/bin) and make them
readable, writable and executable by the root user.
# chmod u+rwx
Log in as root and run ppp-on to connect to the World. Your modem
will dial and if all goes well, pppd will automatically establish a
Once connected you can use the command "ifconfig" to look at the PPP
interface. You should see something like this:
ppp0 Link encap:Point-point protocol
inet addr: 126.96.36.199 P-t-P:188.8.131.52
UP POINTTOPOINT RUNNING ....
You can also use the command "route" to examine the IP routing table.
There should be two entries for "ppp0" in this table, as show below:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
world.std.com * 255.255.255.255 UH 0 0 1 ppp0
127.0.0.0 * 255.0.0.0 U 0 0 10 lo
default gw.theworld.com 0.0.0.0 UG 0 0 0 ppp0
To disconnect, run ppp-off. You don't have to directly run
If you have difficulties or are interested in PPP issues not covered
in this document, you may wish to view the following web sites, which
contain detailed information on Linux PPP.
Appendix - Connection Scripts
We provide three scripts for use with pppd: ppp-dialer, which dials
the World; ppp-on, which calls ppp-dialer and which starts the PPP
daemon on your computer; and ppp-off, which hangs up your modem and
kills the PPP daemon.
To connect to the World, type:
To disconnect, type:
The connection scripts are listed below. You may find versions of
these scripts already on your computer in the directory /etc/ppp. You
should make sure that the file permissions on the scripts allow them
to be executed.
Here is the ppp-on script:
# This is a simple script to initiate a PPP connection on the World.
# Change the values of $TELEPHONE, $DEVICE, $SPEED and $DIALER_SCRIPT as
# needed. Comment out the line in which $TELEPHONE is set to be prompted
# for a phone number.
TELEPHONE=6175601100 # The telephone number for the connection.
DEVICE=/dev/ttyS2 # The device of the modem.
SPEED=112500 # The speed of your modem port (38400, 57600,
# 112500, etc).
# DOS's COM1 = /dev/ttyS0 or /dev/cua0
# COM2 = /dev/ttyS1 or /dev/cua1, etc.
# This is the location of the script which dials the phone and logs
# in. Please use the absolute file name as the $PATH variable is not
# used on the connect option. (To do so on a 'root' account would be
# a security hole so don't ask.)
# You should not change the following values (LOCAL_IP, REMOTE_IP and
# NETMASK) if you're not sure what they mean.
LOCAL_IP=0.0.0.0 # Dynamic IP Address = 0.0.0.0
REMOTE_IP=0.0.0.0 # Remote IP address if desired. Normally 0.0.0.0
NETMASK=255.255.255.0 # The proper netmask if needed
# Prompt for the phone number if necessary.
if [ "$TELEPHONE" = "" ] ; then
/bin/echo -n 'phone number: '
# Export the phone number so that it will be available to the dialer script.
# Initiate the connection
exec /usr/sbin/pppd $DEVICE $SPEED crtscts modem defaultroute debug connect $DIALER_SCRIPT
Use the following script for ppp-on-dialer:
# This is part 2 of the ppp-on script. It will perform the connection
# protocol for the desired connection.
exec /usr/sbin/chat -v \
TIMEOUT 3 \
ABORT '\nBUSY\r' \
ABORT '\nNO ANSWER\r' \
ABORT '\nRINGING\r\n\r\nRINGING\r' \
'' \rAT \
'OK-+++\c-OK' ATH0 \
TIMEOUT 30 \
OK ATDT$TELEPHONE \
Finally, the following script, ppp-off will assist you in terminating
your PPP session:
# Determine the device to be terminated.
if [ "$1" = "" ]; then
# If the ppp0 pid file is present then the program is running. Stop it.
if [ -r /var/run/$DEVICE.pid ]; then
kill -INT `cat /var/run/$DEVICE.pid`
# If the kill did not work then there is no process running for this
# pid. It may also mean that the lock file will be left. You may wish
# to delete the lock file at the same time.
if [ ! "$?" = "0" ]; then
rm -f /var/run/$DEVICE.pid
echo "ERROR: Removed stale pid file"
# Success. Let pppd clean up its own junk.
echo "PPP link to $DEVICE terminated."
# The ppp process is not running for ppp0
echo "ERROR: PPP link is not active on $DEVICE"