Iowa State University IT

Configuring PPP for Linux at Iowa State

Published by Information Technology Services

Handout LNT 312/ June 2006

Overview

Point-to-Point Protocol (PPP) is used to connect to the Internet via modem (phone line). While on-campus, Ethernet is the preferred connection with off-campus DSL and cable modem service available in many areas. Often PPP is the only Internet option for off-campus users. To connect to the ISU network, you must have a current Iowa State Network-ID. The following sections detail how to register, set up, and log in to the PPP service.

Because of the diversity of Linux distributions, four different approaches are described: the KDE Internet Dialer, the Red Hat PPP Dialer, wvdial, and using chat scripts. All four are available in Red Hat (ISU's supported Linux distribution) and many other distributions as well.

Note: At several points in this document we refer to ISU's traveler PPP access number. Although you will not be billed long-distance charges for calls to this number, IT Services will bill your PPP account 12 cents per minute for use of the number (in addition to the usual PPP usage fee). This number was created primarily for the convenience of traveling staff who did not want to bill long-distance dialup charges to a credit card.

If you simply want to dial in from out of town, you may not want to use the toll-free number; remember, it may be more economical to use your long-distance plan and dial the regular PPP number instead (if your plan costs less than 12 cents per minute). Also, if your long-term residence is not in the Ames local dialing area, using a local Internet service provider may cost less than dialing ISU's PPP service.

1 Register for PPP Service

  1. On a machine that is already connected to the Internet, start up a web browser and go to AccessPlus at https://accessplus.iastate.edu/.
  2. Enter the middle nine-digits of the number on your red ISUCard and your password and click "login".
  3. Click on either the "Student" or "Employee" tab.
  4. Click on "Telephone Services".
  5. Click on "PPP Activation".
  6. Select Date for the start of PPP service, then click "Request Activation".
  7. Click Logout.
  8. Close Window.

Within one business day you'll receive an email notifying you that your PPP service has been started. Keep that email since it includes general information about the PPP service and charges.

2 KDE Internet Dialer

If you have KDE, the KDE Internet Dialer is the best approach for connecting. The KDE Internet Dialer, also known as kppp, is available under the KDE desktop manager. It's a simple interface and looks a lot like the Macintosh Remote Access control panel. We prefer it when available, because unlike some of the other PPP managers, kppp doesn't require you to store your Iowa State Net-ID and password in a file. People who aren't authorized can't use your PPP account without your permission; in addition, several people can use PPP from the same machine and have the time billed appropriately to their accounts.

2.1 Configuring the Internet Dialer (KPPP)

  1. Click K button-> Internet-> Internet Dialer.
  2. Click Setup
  3. Click the Accounts tab, then click new
  4. Click Dialog setup
  5. The New Account window appears. Under Connection Name enter ISU PPP
  6. Under Phone Number click Add and enter one of the following phone numbers:
    Ames local call: 268-4565
    On-campus call: 8-268-4565
    Long-distance: 1-515-268-4565
    Traveler number: 1-866-251-5488
  7. Uncheck Store Password.
  8. Click OK.
  9. Click the Device tab, and under Modem Device, select the device your modem is connected to. If you have used this modem or serial port under DOS or Windows and know the COM port number for the device, use the corresponding Linux device name from the table below.
    Windows Device name Lunux device name
    COM1: /dev/ttyS0
    COM2: /dev/ttyS1
    COM3: /dev/ttyS2
    COM4: /dev/ttyS3
  10. Click OK.

2.2 Making a PPP Connection

  1. Click K button-> Internet-> Internet Dialer.
  2. Under Login ID enter your Iowa State Net-ID.
  3. Under Password, enter your password.
  4. Click Connect

The Internet Dialer will automatically dock to the KDE Panel. If the connection is not successful, an error message should appear, or it will simply fail to connect.

2.3 Disconnecting from PPP

  1. Click ISU PPP in the panel.
  2. Click Disconnect.
  3. Back in the KPPP window, click Quit.

3 Red Hat PPP Dialer (rp3)

The Red Hat PPP Dialer is available with Red Hat 7 under both the Gnome and KDE desktop managers. Its real name is rp3. Unlike the KDE dialer, you must store your ISU Network-ID and password in a file. This makes rp3 more convenient, but less secure. However, it's probably the best approach if the only desktop manager you have is Gnome.

3.1 Creating a New PPP Connection

  1. You must be logged in as root.
  2. Click K button-> Internet-> Dialup Configuration.
  3. The Add New Internet Connection window will appear. Make sure your modem is on and connected and click Next.
  4. The wizard will search for modems. If it locates one, click Next. If not, click Modify this modem manually or add a new modem and enter the information for your modem.
  5. In the Phone number and name window, enter this information:

    Account name: ISU PPP
    Prefix:
    Local call: leave blank
    On-campus: enter 8
    Long-distance: enter 1
    If you have call waiting: add the deactivation code to the items above

    Area/country code:
    If using the Ames number from the Ames local calling area: leave blank
    If using the Ames number from outside the Ames local calling area: enter 515
    If using the traveler number: enter 866

    Phone number:
    If using the Ames area number: enter 268-4565
    If using the traveler number: enter 251-5488
    When this information has been entered, click Next.
  6. In the dialog labeled "User name and password" enter the following:
    Username: yourISUNet-ID
    Password: yourISUpassword
    Click Next
  7. 11.Under Other Options, select Normal ISP and click Next.
  8. Click Finish

3.2 To Make a PPP Connection

  1. Click K button-> Internet-> RH PPP Dialer
  2. Under Choose an interface select "ISU_PPP" and click OK.
  3. When asked "Start interface ISU_PPP?" click yes.
    The ISU_PPP window will appear displaying the connection status. You can minimize this window, but don't close it; you'll need it later.

3.3 To Disconnect the PPP Connection

  1. Select the ISU_PPP window.
  2. Click the button with the green dot to disconnect.
  3. When asked "Stop interface ISU_PPP?" click Yes.
  4. Close the ISU_PPP window.

Wvdial: PPP Dialing from the Shell

If you're running a more primitive window manager or just don't want to use a GUI, you can use wvdial as the PPP front end. The wvdial utility (pronounced "Weave Dial") is included with many Linux distributions, including Red Hat and Debian. It will dial for you and even reconnect automatically if your PPP connection is lost. It does require you to store your Iowa State Net-ID and password in a clear text file on your machine, but the file is only readable by root - yet another reason to be careful who has root access to your computer.

4.1 Creating a New PPP Connection

The Red Hat Dialer (rp3) and wvdial use the same configuration file (/etc/wvdial.conf). If you have configured PPP with rp3, you do not need to configure it with wvdialconf; you can skip to "Making a PPP Connection".

  1. You must be logged in as root
  2. Make sure your modem is connected to a phone line and (if external) turned on.
  3. At a shell prompt, type:
    wvdialconf /etc/wvdial.conf
  4. Wvdialconf will search for a modem. Once it has found one, wvdialconf will run several tests, writing the necessary configuration information for your modem into the /etc/wvdial.conf file.
  5. Using your favorite text editor, edit the /etc/wvdial.conf file.
  6. Replace the last three lines with the following:
    Phone = PPPPhoneNumber
    Username = yourISUNet-ID
    Password = yourNet-IDpassword
    where PPPPhoneNumber is one of the following:

    Local call: 268-4565
    On-campus call: 8-268-4565
    Long-distance: 1-515-268-4777
    Traveler number: 1-866-251-5488
  7. Exit the editor, saving the file.
  8. Edit the /etc/resolv.conf file. For use with Iowa State's PPP, it should include these lines (order is unimportant):

    search iastate.edu
    nameserver 129.186.142.200
    nameserver 129.186.140.200
    nameserver 129.186.1.200
  9. Exit the editor, saving the file.

4.2 Making a PPP Connection

  1. Become the root user. If you're using a GUI, start a shell and use the su command to become root. If you're using command-line only, switch to another virtual console and log in as root.
  2. At the shell prompt, type: wvdial
    After dialing the modem and making the PPP connection, wvdial will seem to hang. This is normal. Do not terminate wvdial, as this will cause pppd to disconnect your Internet connection. (You may background the application if you wish.)
  3. Switch back to your original console and use whatever Internet application you choose.

4.3 Disconnecting the PPP Connection

  1. Select the shell window or switch to the virtual console in which you started wvdial.
  2. Press Ctrl/C to terminate the wvdial application. Wvdial will force pppd to disconnect when it exits.
  3. Log out your root session
  4. If necessary, return to your original console.

There are a number of graphical shells to wvdial, including rp3 (the Red Hat PPP Dialer), that can give wvdial more complex commands. Multiple ISPs can be configured and selected at the command prompt, and multiple modems can even be used. For more information, see http://open.nit.ca/wvdial/.

5 When All Else Fails: chat and pppd

Maybe you're using some other distribution of Linux, and none of the preceding utilities are available. Maybe it's a really old version that you're using because your machine is ancient and won't handle newer versions. That's okay; you can still get PPP to work with pppd and chat.

You can see if you have pppd and chat available with the following commands:

whereis pppd whereis chat

If you get /usr/sbin/pppd and /usr/sbin/chat, you're in business. However, you will have to do some configuration by hand.

5.1 Creating a New Connection

  1. Log in as root
  2. Using your favorite text editor, create the file /etc/chatscripts/provider. It should contain the following lines:

    ABORT BUSY
    ABORT "NO CARRIER"
    ABORT VOICE
    ABORT "NO DIALTONE"
    ABORT "NO ANSWER"
    "" ATZ
    OK ATDT2684565
    CONNECT ''
    Username: dqyourISUNet-ID
    Password: qpassword

    "" dc


    where yourISUNet-ID is your Iowa State Net-ID and password is your password. If you're dialing from on-campus, replace 2684565 with 8,2684565. If you're dialing long distance, replace it with 15152684565; if using the traveler number, replace it with 18662515488.
  3. Set the permissions and ownership on /etc/chatscripts/provider as follows:

    chmod 750 /etc/chatscripts/provider
    chown root:dip /etc/chatscripts/provider
  4. Create the file /etc/ppp/peers/provider containing the following lines:

    noauth #pppconfig_noauth
    connect "/usr/sbin/chat -v -f /etc/chatscripts/provider"
    #pppconfig_connect
    debug #pppconfig_debug
    /dev/ttyS1 #pppconfig_dev
    115200 #pppconfig_speed
    defaultroute #pppconfig_route
    :129.186.97.254 #pppconfig_ipdefault
    user yourISUNet-ID #pppconfig_user

    Some notes on this file:
    • Change yourISUNet-ID to your Iowa State Net-ID.
    • The line beginning /dev/ttyS1 indicates a modem on the second serial port (what DOS/Windows would call COM2). The chat utility is case-sensitive; the "S" must be in uppercase. If your modem is in a different location, change it accordingly. If you don't know the Linux device name but do know the Windows device name, see the table in section 2.1 of this document.
    • The line beginning 115200 is the modem speed. Some older machines and/or modems cannot communicate this fast. You may have to try 57600, or even 33600 or 28800 to make a successful connection on an older modem or machine.
  5. Set the permissions on /etc/ppp/peers/provider as follows:
    chmod 750 /etc/ppp/peers/provider
    chown root:dip /etc/ppp/peers/provider
  6. Check to make sure the files /usr/bin/pon and /usr/bin/poff exist. They are normally present in any distribution that includes pppd. If so, skip to step 7. If they do not exist, create them with your favorite text editor as follows:

    Creating /usr/bin/pon:
    #!/bin/sh
    /usr/sbin/pppd call ${1:-provider}


    Creating /usr/bin/poff:
    #!/bin/sh

    # $Id: poff,v 1.4 1998/05/26 14:46:08 phil Exp $
    # Written by Phil Hands
    phil@hands.com, distributed under the GNU GPL

    SIG=TERM DONE=stopped;

    getopts rdch FLAG
    case $FLAG in
    "r") SIG=HUP DONE=signalled; shift ;;
    "d") SIG=USR1 DONE=signalled; shift ;;
    "c") SIG=USR2 DONE=signalled; shift ;;
    "h") cat <<!EOF!
    usage: $0 [options] [provider]

    options:
    -r cause pppd to drop the line and redial
    -d toggles the state of pppd's debug option
    -c cause pppd to renegotiate compression
    -h this help summary
    !EOF!
    exit 1
    ;;
    esac

    PROVIDER=$1


    # Lets see how many pppds are running....
    set -- `cat /var/run/ppp*.pid 2>/dev/null`

    case $# in
    0) # pppd only creates a pid file once ppp is up, so let's try
    killing pppd
    # on the assumption that we've not got that far yet.
    kill -${SIG} `ps axw | egrep "pppd call [[:alnum:]]+" | grep -v
    grep | awk '{print $1}'
    exit 0
    ;;

    1) # If only one was running then it can be killed using the pid
    kill -${SIG} $1
    exit 0
    ;;

    *) # More than one! Aieehh.. We have to use ps to figure it out.
    # If no arguments were specified, then assume the 'provider'
    default.
    PID=`ps axw | egrep "pppd call
    ${PROVIDER:-provider}[[:space:]]*$" | grep -v grep | awk
    '{print
    $1}'
    if [ $PID ]; then
    kill -${SIG} ${PID}
    exit 0
    else
    echo "I could not find a pppd process or provider
    '${PROVIDER:-provider}'. None ${DONE}"
    exit 1
    fi
    ;;

    esac

    Set the permissions and ownership of the files with these commands:

    chmod 755 /usr/bin/pon
    chown root:root /usr/bin/pon
    chmod 755 /usr/bin/poff
    chown root:root /usr/bin/poff
  7. Edit the /etc/resolv.conf file. For use with ISU's PPP, it should include these lines (order is unimportant):
    search iastate.edu
    nameserver 129.186.142.200
    nameserver 129.186.140.200
    nameserver 129.186.1.200
  8. As configured, you must be root to make a PPP connection. If you want other users to be able to connect, edit the /etc/group file, and add the user IDs (separated by commas) to the end of the line beginning with rip.
    Your PPP service should now be configured and ready to use.

5.2 Making a PPP Connection

  1. If you have not added your user ID to the rip group, become the root user. If you're using a GUI, start a shell and use the su command to become root. If you're using command-line only, switch to another virtual console and log in as root.
  2. At the shell prompt, type: pon
  3. Switch back to your original console and use whatever Internet application you choose.

5.3 Disconnecting the PPP Connection

  1. If you have not added your user ID to the rip group, become the root user. If you're using a GUI, start a shell and use the su command to become root. If you're using command-line only, switch to another virtual console and log in as root.
  2. At the shell prompt, type: poff
  3. If necessary, return to your original console.

5.4 Deactivating the PPP

  1. Connect to the Internet, start a web browser, and go to AccessPlus at http://accessplus.iastate.edu.
  2. Enter the middle nine-digits of the number on your red ISUCard and your password and click "login".
  3. Click on either the "Student" or the "Employee" tab.
  4. Click on "Telephone Services".
  5. Click on "PPP Deactivation".
  6. Select Date for the end of PPP service, then click "Request Deactivation".
  7. Click "Logout".
  8. Close Window.

Configuring PPP for Linux was written by Gene Collins and Jeff Balvanz.

For more assistance, contact the Solution Center, 195 Durham Center, 515-294-4000, or by email at solution@iastate.edu