You need the following information about the ``far end'' of your connection (ie from your Internet Service Provider - ISP) :
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 - making 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.2... (for a Linux 1.2.13 kernel, Red Hat 3) ppp-2.2.... (for a Linux 1.3.x kernel, Red Hat 4)
If you do NOT have the PPP daemon installed, do this now/!
If your system tells you that you have ppp-2.1.2 installed, you should immediately upgrade to PPP-2.2. (See the previous section).
Make sure you are logged in as root.
/etc/ppp/scripts/ppp-on-dialer are scripts for you to edit.
When you have finished editing them, running
/etc/ppp/scripts/ppp-on (as root) will connecct your machine to
As the sample scripts are not included in the standard Red Hat distribution, they are included here.
#!/bin/sh # # Script to initiate a ppp connection. This is the first part of the # pair of scripts. This is not a secure pair of scripts as the codes # are visible with the 'ps' command. However, it is simple. # # These are the parameters. Change as needed. TELEPHONE=555-1212 # The telephone number for the connection ACCOUNT=george # The account name for logon (as in 'George Burns') PASSWORD=gracie # The password for this account (and 'Gracie Allen') LOCAL_IP=0.0.0.0 # Local IP address if known. Dynamic = 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 # # Export them so that they will be available at 'ppp-on-dialer' time. export TELEPHONE ACCOUNT PASSWORD # # 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.) # DIALER_SCRIPT=/etc/ppp/ppp-on-dialer # # Initiate the connection # # I put most of the common options on this command. Please, don't # forget the 'lock' option or some programs such as mgetty will not # work. The asyncmap and escape will permit the PPP link to work with # a telnet or rlogin connection. You are welcome to make any changes # as desired. Don't use the 'defaultroute' option if you currently # have a default route to an ethernet gateway. # exec /usr/sbin/pppd debug lock modem crtscts /dev/ttyS0 38400 \ asyncmap 20A0000 escape FF kdebug 0 $LOCAL_IP:$REMOTE_IP \ noipdefault netmask $NETMASK defaultroute connect $DIALER_SCRIPT
#!/bin/sh # # This is part 2 of the ppp-on script. It will perform the connection # protocol for the desired connection. # exec 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 \ CONNECT '' \ ogin:--ogin: $ACCOUNT \ assword: $PASSWORD
You probably only need to edit
second script is passed parameters from the first to dial the
connection. You WILL need to edit
/etc/ppp/scripts/ppp-on-dialer if you need to issue a specific
command to your ISPs machine to start PPP at that end once you have
Undertaking the connection in this fashion ensures that your ISP username and password are NOT displayed in the process table (as occurred with the scripts used for PPP-2.1.2).
cp /etc/scripts/ppp-on /usr/sbin/ppp-on-<your ISP name>where <your ISP name> is something you remember and easy to type!
/usr/sbin/ppp-on-<your ISP name>
TELEPHONE=555-1212 # The telephone number for the connection ACCOUNT=george # The account name for logon (as in 'George Burns') PASSWORD=gracie # The password for this account (and 'Gracie Allen') LOCAL_IP=0.0.0.0 # Local IP address if known. Dynamic = 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 neededand change them so that they are the phone number, user (account) name, password, IP numbers and Netmask 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
DIALER_SCRIPT=/etc/ppp/ppp-on-dialerand change it to reflect the name of the dialer script you will be using (if you are not using the supplied dialer script).
The actual PPP command includes options to pppd:-
exec /usr/sbin/pppd debug lock modem crtscts /dev/ttyS0 38400 \ asyncmap 20A0000 escape FF kdebug 0 $LOCAL_IP:$REMOTE_IP \ noipdefault netmask $NETMASK defaultroute connect $DIALER_SCRIPT
/var/log/messages. Once your link is running cleanly every time, you can remove this.
/var/lockand look like:-
The file contains the process ID of the running pppd process using the port.
-rw-r--r-- 1 root root 11 Nov 3 05:11 LCK..ttyS0
/dev/ttySo: this is the serial port which pppd uses for the connection.
The 'standard' options should work except as noted above. For more
information on the various options to pppd, see
man pppd and the
Look at the
/etc/ppp-on-dialer script. It makes certain
assumptions about the prompts issues by your ISPs PPP server.
Note: the '\' at the end of lines is a dummy end of line -
requires that everything is on one line but allows the line to be broken
if the break is preceded by a '\'.
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.
ogin:--ogin: $ACCOUNT \ assword: $PASSWORDand edit these so that they reflect (enough of) the login and password prompts issued by your ISPs PPP server.
/etc/resolv.confand add the IP number(s) of your IPS's name servers. Your
/etc/resolv.confshould look like
Where <your ISP's domain name> is something like
domain <your ISP's domain name> nameserver XX.XX.XX.XX
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
Next Chapter, Previous Chapter
Table of contents of this chapter, General table of contents
Top of the document, Beginning of this Chapter