Here is a mini faq I wrote that might help...

                Using PPP on Linux Systems
                        30 May 1998

INTRODUCTION:

        This paper talks to getting your Linux set up as a client
that uses a modem to connect to an Internet Service Provider (ISP).
The version of Linux I use is Slackware 3.4 and I think what follows
is correct for all Linux, but Red Hat often changes locations of
files and file names.

        You can use Linux as a ISP. Many do and then your concerned
about a host of other setup needs. This paper only covers use of PPP
by a single user using Linux to get the Internet from an ISP with a
telephone modem. The ppp-HOWTO is excellent and covers both client
and server use of ppp. I suggest you have this HOWTO available as you
may need to copy some files from it.

PPP FILES:

        You must have several files in the proper place for ppp to
work. Here in no detail is what you MUST have:

        1. The pppd file must be in /usr/sbin.
        2. The ppp-on file must be in /usr/sbin.
        3. The options file must be in /etc/ppp.
        4. The ppp-on-dialer file must be in /etc/ppp.
        5. The pap-secrets file must be in /etc/ppp.

        If 1. or 2. are missing then you need to install ppp from
your cd-rom or floppy disks.

        If you have no /etc/ppp directory then make one. At the end
of this paper are copies of files 3. and 4. and 5. from my system.
They work fine here.

KERNEL NEEDS:

        For ppp to function you must have turned it on when you
configured your kernel. To determine if your kernel has ppp turned
on, as a root login type demsg | more. This will show you what
happened the last time you booted Linux on. You should see some lines
that look like:

PPP: version 2.2.0 (dynamic channel allocation)
TCP compression code copyright 1989 Regents of the University of
California
PPP Dynamic channel allocation code copyright 1995 Caldera, Inc.
PPP line discipline registered.

If you have no lines like this and all the files listed in /usr/sbin
are there, then your kernel must be configured and compiled again. To
do this cd to /usr/src/linux and read the file README with care.

        If you have lines like this shown then your ready for the
next steps. 

MODEMS:

        You must have a modem to talk to the ISP over a telephone
line. The modem is attached to your computer directly if you have an
internal modem, or by a cable if it is external. If you used the
modem on this computer with DOS then it will work with Linux. If you
used it before determine which serial port is used by it. Under DOS
they are called com1 or com2. Linux calls them /dev/ttyS0 and
/dev/ttyS1. 

        Before we use the telephone modem for ppp we will use it to
just see what our ISP sends us. Your ISP must have given you a login
name and a password. Write both of these down on paper for use later.
Now let's check to see if you have the application "minicom" loaded.
As root login type minicom. It should come up and it uses the
com-port you designated for your modem.
   
        Now in minicom type atdt telephone-number where the number is
that for your ISP. It should connect and you will get something
printed back on your screen that looks like:

login:

Type your login name and see what happens. Some systems that use
"pap" will just hang up after you give a login name, saying "host not
available". Some will now ask for a password. Give it your password.
If you are logged into a system and have a prompt given to you, type
ppp <enter>. Now you should begin to get garbage characters sent to
you. Many ISP will start sending garbage as soon as your logged in
and that will be demonstrated when you log in with minicom.

        Today a modern ISP uses "pap" which is built into win-95 so
those users can be switched to the first example above and must do
nothing to keep working. Call your ISP and ask him if he is using
pap. If the answer is "what is pap", ask to speak to the technical
expert. If your ISP uses PAP then follow instructions for PAP below,
and IGNORE the section on CHAP. If your ISP does not use PAP, follow
only the instructions for CHAP, and IGNORE the part dealing with PAP.


USING PAP:

        To make PAP work you must do these things:
1. Make a file in the /etc/ppp directory with the name pap-secrets.
This file looks like:

  # Secrets for authentication using PAP
  # client        server  secret          acceptable local IP addresses
    Login name       *    password

Login name and password are those you got from your ISP.

2. You have a file ppp-on-dialer that is a bash file and you need to
modify it so it looks like this:

#!/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

Notice that the last 2 lines are not used because a # precedes them.
Those lines are used if CHAP only is used.

3. There is the file options you will need to modify to your needs.
Here is mine:

  # /etc/ppp/options -*- sh -*- general options for pppd
  # created 13-Jul-1995 jmk
  # autodate: 01-Aug-1995
  # autotime: 19:45

  # async character map -- 32-bit hex; each bit is a character
  # that needs to be escaped for pppd to receive it.  0x00000001
  # represents '\x01', and 0x80000000 represents '\x1f'.
  asyncmap 0

  # Use hardware flow control (i.e. RTS/CTS) to control the flow of data
  # on the serial port.
  crtscts

  # Add a default route to the system routing tables, using the peer as
  # the gateway, when IPCP negotiation is successfully completed.  This
  # entry is removed when the PPP connection is broken.
  defaultroute

  # Specifies that pppd should use a UUCP-style lock on the serial device
  # to ensure exclusive access to the device.
  lock

  # Use the modem control lines.  On Ultrix, this option implies hardware
  # flow control, as for the crtscts option.  (This option is not fully
  # implemented.)
  modem

  # Set the MRU [Maximum Receive Unit] value to <n> for negotiation.  pppd
  # will ask the peer to send packets of no more than <n> bytes. The
  # minimum MRU value is 128.  The default MRU value is 1500.  A value of
  # 296 is recommended for slow links (40 bytes for TCP/IP header + 256
  # bytes of data).
  mru 1500

  # Set the interface netmask to <n>, a 32 bit netmask in "decimal dot"
  # notation (e.g. 255.255.255.0).
  netmask 255.255.255.0

  # Enables the "passive" option in the LCP.  With this option, pppd will
  # attempt to initiate a connection; if no reply is received from the
  # peer, pppd will then just wait passively for a valid LCP packet from
  # the peer (instead of exiting, as it does without this option).
  passive

  # Set the MTU [Maximum Transmit Unit] value to <n>. Unless the peer
  # requests a smaller value via MRU negotiation, pppd will request that
  # the kernel networking code send data packets of no more than n bytes
  # through the PPP network interface.
  mtu 1500

  # Set the user name to use for authenticating this machine with the peer
  # using PAP to <u>.
  # Do NOT use this if you are using 'name' above!
  user k5di

  # Set the PAP restart interval (retransmission timeout) to <n> seconds
  # (default 3).
  pap-restart 3

Change user k5di to user Your Login name because k5di is my login
name.

        With all this done properly all that remains is the files in
the /usr/sbin directory, ppp-on and ppp-off. These are the same
whether using CHAP or CHAP-PAP so they will be discussed only once.

USING PPP-ON:

        Here is my current in use ppp-on file with my password
removed:

#!/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=19155871200
#TELEPHONE=523-0039     # The telephone number (totaccess)
TELEPHONE=523-4710
# ACCOUNT=user
ACCOUNT=k5di            # The account name for logon (as in 'George Burns')
# PASSWORD=aokokok
PASSWORD=xxxxxxx        # The password for totalaccess
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 /dev/ttyS0 38400 \
          $LOCAL_IP:$REMOTE_IP \
          connect $DIALER_SCRIPT



 The third from the bottom line starts exec /usr.... make sure you
use the proper /dev/ttySX com port. If the modem is on com1 it's
ttyS0 and com2 is ttyS1 ect.

        Put the proper telephone number for your ISP and your login
name and your password (PAP will not use this data since it gets it's
data from /etc/ppp/pap-secrets).

        Now the PAP user is done. As root type ppp-on and your system
will call your ISP and login and work. If it doesn't double check
each file and make sure there are no typo errors.

USING ppp-off:

        As a root login after you have ppp working type ppp-off. This
will drop your connection to the ISP. If your using X windows put
ppp-on and ppp-off into the list of applications you can run. 

USING CHAP:

        If your ISP is not using PAP you will need to set up your
files to do CHAP but not PAP. This is simple and as said earlier you
fill out /usr/sbin/ppp-on just as shown above. 

        In the /etc/ppp directory make sure there are nothing except
the ppp-on-dialer file and make sure the last 2 lines do not have a #
in front of them. 

        Now with an editor make a file with the title options and
nothing in it. Now you will have 2 files and that is all it should
take for CHAP to work. As root type ppp-on and watch the dialing
and make sure it works and you get logged in. 

        It may be that you want some control over your ppp system. If
this is the case copy the sample file options in the USING PAP
section to your /etc/ppp directory and configure what you need. If it
doesn't work for some reason keep trying and if all else fails go back
to a blank file.

CONCLUSIONS:

        Once you have ppp working it should continue to work until
your ISP changes his system. You have 3 or 4 files to keep safe on
your ppp system and hundreds more. I suggest you back up the entire
Linux 4 times a year and every week do a incremental backup. This
will protect ALL the files you have made.





On Thu, 11 Jun 1998, Dmi wrote:

> Hi, friends!
> Thanks everybody for the help about my Internet problem. I'll try to
> give all the related infos a deeper look.
> 
>    bye
> 
> 
>  Luca
> 
> 

Best wishes 

   - Karl F. Larsen, 3310 East Street, Las Cruces,NM (505) 524-3303  -

Reply via email to