Department of Computing Imperial College
Setting up PPP on Linux

The DoC dial-in service uses PPP with CHAP authentication. These notes are for a RedHat 5.0 installation but should work with later versions of RedHat and other Unixes. Newer distributions may have simpler tools for dialin. When you register to use the service you will be allocated a username ppp-username e.g. ppp-md, and a special session-password which is only used to authenticate your dial-in PPP session.

Step 1

Make sure that pppd is installed on your system. At the time of writing, the version I have is: ppp-2.3.3-2.i386.rpm.

Also, check that /usr/sbin/pppd is installed setuid root (this is needed for the script in Step 3).

[root@myhost ppp]# ls -l /usr/sbin/pppd
-rwsr-xr-x   1 root     root       104460 Jan 12 18:55 /usr/sbin/pppd
    
If it doesn't look like this, make it so with the commands (run from root of course):
chown root.root /usr/sbin/pppd
chmod 04755 /usr/sbin/pppd
    

Step 2

Edit the chap-secrets file in the directory /etc/ppp this should be owned by root and have mode 0600. You need something like:
# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
ppp-username    *       session-password
    
(Don't forget to change the third line!)

Step 3

Create a script to start the PPP session. I use the following which I put somewhere on my path (in ~/bin). If you have other people sharing your computer you will need separate ppp-usernames/session-passwords and each user would have slightly different script. Here is the sample script pppic:
#!/bin/sh 
PPPD=/usr/sbin/pppd
CHAT=/usr/sbin/chat
USER=ppp-username
TELE=02075948460
INIT='&F&C1&D2&K3'
DEBUG=

PPPDARGS="user $USER $DEBUG netmask 255.255.255.0 \
        defaultroute crtscts /dev/cua1 115200"

$PPPD connect "$CHAT \
ABORT BUSY ABORT 'NO CARRIER' ABORT 'NO DIALTONE' \
'' AT$INIT 'OK' ATX1DT$TELE CONNECT" $PPPDARGS
    
Don't forget to change the USER= line. If you have problems connecting check that the initialisation string INIT is appropriate for your modem. Make sure that this script is executable:
chmod +x pppic
    

Step 4

Edit or create the file /etc/resolv.conf and put the following in it:
domain doc.ic.ac.uk
nameserver 146.169.1.24

Step 5

Making the connection, just run:

pppic

Closing the connection, run:

killall pppd

Get connected!

© CSG / 2000