You are here

Dialing The World From Linux

World Logo

A Public Information Utility



Linux Set-Up Guide For Dialing Into

                      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 to the
    corresponding IP address (  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"):


    The file /etc/host.conf should have the following contents:

        order hosts,bind
        multi on

    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:


    ("" 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
    World account. 

       # Secrets for authentication using PAP
       # client                      server    secret           IP addresses    *         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
    PPP session. 

    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: P-t-P:

    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:

        # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface   *      UH    0      0        1 ppp0       *            U     0      0       10 lo
default         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:

        # ppp-on 

    To disconnect, type:

        # ppp-off

    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.

# 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=        # Dynamic IP Address =
REMOTE_IP=       # Remote IP address if desired. Normally
NETMASK=   # 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
--------------------end cut----------------

    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'                 \
        ''              \rAT                            \
        'OK-+++\c-OK'   ATH0                            \
        TIMEOUT         30                              \
        OK              ATDT$TELEPHONE                  \
        CONNECT         ''

    Finally, the following script, ppp-off will assist you in terminating
    your PPP session: 


# Determine the device to be terminated.
if [ "$1" = "" ]; then

if [ -r /var/run/$ ]; then
        kill -INT `cat /var/run/$`

# to delete the lock file at the same time.
                rm -f /var/run/$
                echo "ERROR: Removed stale pid file"
                exit 1

# Success. Let pppd clean up its own junk.
        echo "PPP link to $DEVICE terminated."
        exit 0

# The ppp process is not running for ppp0
exit 1