PPP Setup Tips

Robert Hart, hartr@hedunx.hedland.edu.au V1.1, March 26, 1996

1 Preface

“Red Hat Tips” are documentation meant to help Red Hat users with specific tasks. Some of these documents are for new users, some are for advanced users. Hopefully each document will also be of help for both new and advanced users. If you have contributions to make, please send them to tech-sup@redhat.com. If you have changes that need to be made to individual Tips, send them to the author of that document.

2 Introduction

This document is intended for use in setting up your Red Hat machine to connect to the Internet using PPP.

3 Connecting your RedHat Linux System to the World using PPP

You need the following information about the “far end” of your connection (ie from your Internet Service Provider - ISP) :

• The telephone number to dial to reach their modems.

• Your user name on your ISP’s system.

• Your password on your ISP’s system.

• The IP number for your system (most likely this is NOT needed as your ISP’s system will dynamically give you an IP number each time you dial in).

• The IP number(s) of your ISP’s Domain Name Servers.

• How your ISP starts PPP on his system when you dial in - specifically, does PPP start automatically when you connect or are you required to type in a command to start it.

You also need to know how your ISP’s system prompts you for your username and password. The simplest way to find this out is to dial in using Minicom, capture the entire log in process to a file and print this out.

(This is also useful as it checks the modem configuration and serial port set up - make sure that your modem’s “stored” configuration works fine for connecting to your ISP).

Make sure you have installed the PPP daemon (all RedHat precompiled kernels support PPP). To check this, login as root and type

   rpm -qa | grep ppp

Your RedHat system should respond with something like

   ppp-2.1.2d-2  (for a Linux 1.2.13 kernel)
   ppp-2.2....   (for a Linux 1.3.x kernel)

If you do NOT have the PPP daemon installed, do this now. Make sure you are logged in as root. The file /usr/sbin/ppp-on is a script for you to edit. When you have finished editing it, running this script will connecct your machine to your ISP.

• Copy this file (so you still have the original version if you mess up your editing).

    cp /usr/sbin/ppp-on /usr/sbin/ppp-<your ISP name>

where <your ISP name> is something you remember and easy to type!

• Using your favourite editor, edit /usr/sbin/ppp-<your ISP name>

– Find the line that says

                LOCKDIR=/var/spool/lock

and change it to

                LOCKDIR=/var/lock

– Find the line that says

                DEVICE=com1

and change it to read cua0 (DOS com1:), cua1 (DOS com2:) etc - the serial port on which you have your modem. If your modem is on DOS com2:, the line should read.

                DEVICE=cua1

– Find the lines that read

                PHONE=4511234
                USER=Pkarl
                PASSWORD=password
                OUR_IP_ADDR=137.175.6.3

and change them so that they are the phone number, user name, password and IP number you must use to dial and log into your ISP. Remember - most ISP’s are using Unix based machines (such as Linux), so you MUST get the upper/lower case RIGHT! If your ISP is giving you a ”temporary” (dynamic) IP number each time you dial in, use the ”dummy” IP number of 0.0.0.0 – Find the line

                stty 19200 -tostop

and change it to

                stty 38400 -tostop

– Now we edit the ”chat” script. Find the line that reads

                if chat -l LCK..$DEVICE ABORT "NO CARRIER" ABORT BUSY "" \
                  ATZ OK ATs50=255s111=0DT$PHONE CONNECT "" \
                  ogin: $USER ssword: \\q$PASSWORD

(NB This is ALL ONE LINE - but broken here with ’f́or readability. It MUST be all one line in your script - and the spaces before the ’áre important!) Change this line to read

                if chat -l LCK..$DEVICE ABORT "NO CARRIER" ABORT BUSY "" \
                  ATZ OK ATDT$PHONE CONNECT "" \
                  ogin: $USER ssword: \\q$PASSWORD

Now - if your ISP’s system uses prompts other than “...ogin:” to ask for your user name and “...assword:” to ask for your password, you must change these two elements to reflect the prompts your system sees.

– Find the line

                pppd asyncmap 0 -detach modem crtscts mru 1500 $OUR_IP_ADDR: \
                  /dev/$DEVICE

(Again, this must all be on one line - but for readability it is broken at ’´). Change this by adding

the defaultroute option.
                pppd asyncmap 0 -detach modem crtscts defaultroute mru 1500 \
                  $OUR_IP_ADDR: /dev/$DEVICE

• If your ISP requires you to type in something else to start PPP on his system when you dial in, or if he is using PAP/CHAP, consult the PPP Client HOWTO and/or the man pages on chat and pppd.

• Save this file.

• Again as root, edit the file /etc/resolv.conf and add the IP number(s) of your IPS’s name servers. Your /etc/resolv.conf should look like

        domain <your ISP's domain name>
        nameserver XX.XX.XX.XX

Where <your ISP’s domain name> is something like

        redhat.com

and the XX.XX.XX.XX is the IP number for the domain name server you obtained from your ISP. (If your ISP gave you more than one IP number, that’s fine, out them all in, each one on a separate line, preceded by the key word nameserver).

• Save this file.

• Now dial in and enjoy!

4 Getting Additional help

Most PPP connections work just fine, but if the above method does NOT give you a connection, you can get more detailed information from:

• The PPP Client Howto

• The chat and pppd man pages

• The documents in /usr/doc/ppp-XX.XX... on your system

• The relevant FAQs in /usr/doc/FAQ - in particular – serial-FAQ

– NET-2-FAQ

• The relevant HOWTO’s in /usr/doc/HOWTO – PPP-HOWTO.gz – Serial-HOWTO.gz

• The Linux Network Administrator Guide Help is also available on the RedHat Mailing list, regularly monitored by a number of “knowledgeable” PPP users (including the author of the PPP-Client-Howto) and the Linux newsgroups, particularly comp.os.linux.networking.

5 Copyright Notice

This document is Copyright (C) 1996 by Robert Hart. Redistribution of this document is permitted as long as the content remains completely intact and unchanged. In other words, you may reformat and reprint or redistribute only.