How to hook up PPP

in Linux

in Brief

W.G. Unruh

There is a text version at ./ppp-linux-brief.txt

This is a brief version of the file ./ppp-linux.html--How to Hook up PPP in Linux . This file includes no explanations and is terse. If anythig confuses you read the original longer file. It is the longer file which is more definitive.
Note that all of the steps are necessary. There are quite few of them, but skipping steps will probably lead you to grief.

Initial Setup

As root: Get your modem port-- /dev/ttyS# (#=0,1,...)

In /etc/syslog.conf
local2.*         /var/log/ppp
daemon.*         /var/log/ppp
killall -1 syslogd

In /etc/resolv.conf
nameserver <DNS-IPaddress>
In /etc/host.conf
order hosts,bind
chmod a+r /etc/host.conf /etc/resolv.conf

route -n
If default route ( as first item), then run
    route del default
    and Remove reason for this default route being there.
    or put that command into /etc/rc.local or /etc/rc.d/rc.local

ps aux|grep kerneld|grep -v grep
If no output (kerneld not running) run
    and make sure that kerneld is started up at boot time.

If long line of garbage which repeats itself about 10 times
    Go to next paragraph!
if permission denied
    You are not running as root!
if error- ppp may not be in kernel
    Probably kerneld is not running-- fix

Edit /etc/ppp/options and insert the lines

Figuring out how your ISP wants to log you on

In a separate window (xterm)
tail -f /var/log/ppp

Run (all one line)
/usr/sbin/pppd /dev/ttyS1 57600 connect " /usr/sbin/chat -v '' AT OK ATD5555555 CONNECT '\d\c'"
5555555=your ISP's phone number.
/dev/ttyS1=your modem serial port (ttyS0=COM1,...ttyS3=COM4)
Also note difference between a single double quote ", and two successive apostrophes ''.

Look at /var/log/ppp (in tail -f window or by
less /var/log/ppp

If  pppd starts to run and gives Problem: all had bit 7 set to 0
    Go to Login Authorisation?
If one of lines had <auth pap> or <auth chap #>
    Go to PAP/CHAP

Login Authorization?

/usr/sbin/pppd /dev/ttyS1 57600 connect "/usr/sbin/chat -v '' ATD5555555 CONNECT '' ogin <yourusername> assword  <yourpassword>"

In /var/log/ppp
If Login:, Password: accepted
    If pppd started negotiation
        if Connection made and addresses returned
            Success--Go to Test
        if <auth pap> or <auth chap #>  occur
            Go To PAP/CHAP
            Trouble. Ask in Linux or PPP newsgroups
        Go to Start PPP
Else Login: or password not accepted
    If Login: and Password: occur and your name and password are sent
        Check your login name or password with your ISP
    Else If Login: or Password: not asked for
        Check what is asked for and insert into above command instead of  ogin and assword

Start ppp

/usr/sbin/pppd /dev/ttyS1 57600 connect "/usr/sbin/chat -v '' ATD5555555 CONNECT '' ogin <yourusername> assword <yourpassword> ppp y"
Check /var/log/ppp.
If Successful LCP exchange
    Go up to previous lines.
     If other text ( eg run pppd  or PPP? type y) received from remote machine
        Alter    ppp  y to reflect what is actually wanted and try again.
    Else Ask in newsgroups or your ISP.


If <auth pap> in /var/log/ppp
    edit /etc/ppp/pap-secrets
     <username>   *   <password>    *
    Try Again whichever chat line got you here.
      If  Success
          Go to Test
            if peer authorisation failure
                Check username/password with ISP.
            else other
                Ask in Newsgroup

If <auth chap #> where # is a number
    If #= 05 or md5--you're OK
     Else if #=80 or 81
         Microsoft Chap. If 80 and pppd rejected it (ConfRej), recompile pppd with MSCHAP
        if 81, complain to ISP about non-standard chap
    edit /etc/ppp/chap-secrets
      <username>   *   <password>    *
     Try again whichever chat script got you here.
       If Success
            Go to Test
            if peer authorisation failure
                Check username and password with ISP
            else other error
                Ask in Newsgroup


route -n
If  Two lines ending in ppp0. One has remote ISP IP number as first, your IP number as second
      Other line has as first.
     Are you sure previous things were all done?

ping <remoteIP>
If succession of responses-- Success connection working
Else May still be OK, but worry.

ping <DNS-IPaddress>
if succession of responses -- Success Connection working
Else if Network not found-- problems-- check number with ISP

If succession of responses -- Sucess Name resolver working
Else Name Resolver problems-- check with ISP
          Or, has problems-- try other internet names.

User use and Automation

chmod a+rx /usr/sbin/pppd
chmod +s /usr/sbin/pppd

edit /usr/bin/pppon
if [ "$1" = "" ]; then
    echo Useage: pppon username
    exit 1
pppd /dev/ttyS# 57600  user $1 connect "chat -f $HOME/chatscript"

chmod a+rx /usr/sbin/pppon

edit $HOME/chatscript
              ABORT   "NO CARRIER"
              ABORT   "NO DIALTONE"
              ABORT   "ERROR"
              ABORT   "NO ANSWER"
              ABORT   "BUSY"
              ""    AT
              OK-\d\d+++\d\d\c-OK   ATH0
              OK    'AT&F'
# and whatever other modem initialisation is needed (some need AT&F0 instead.
             OK     ATD8765432
              CONNECT      '\c\d'
#At this point  (after CONNECT) the various chat scipts diverge.
#You must enter the expect send pairs which were successful for you
#This example is an example of login authorisation.
              ogin:--ogin:    wunruh
               assword:    Dontyouwish

To stop the connection
killall pppd

The End