Next

Dialing into OzEmail using PPP under Linux

Chris Blake
v1.01   June 1999

These pages may be redistributed under the terms of the GPL (GNU Public License).


Contents

  1. Overview (this page)
  2. Configuration Files
  3. Some Refinements
  4. Debugging a Linux PPP Connection
  5. Troubleshooting a Linux PPP Connection
  6. A Working pppd Connection
  7. Dialing into OzEmail using Minicom
  8. Dialing into OzEmail using netcfg
  9. Dialing into OzEmail using dip
  10. Dialing into OzEmail using X-ISP
  11. A Chat Script that gets you onto the wrong subnet


Introduction

These instructions are for users from the Australian National University wishing to dial in to OzEmail in Canberra. People in other locations and using other internet service providers may find these notes useful but will of course need to make some changes to the scripts. The methods described were tested on a system running Red Hat 5.2 and pppd 2.3.5. If you find any mistakes or can suggest improvements, please email me.

ANU users dialing in via OzEmail are assigned to a different subnet which uses a link to CARNO. To be assigned to this subnet you must set up PAP (Password Authentication Protocol) correctly on your computer. PAP is an authentication scheme that runs under PPP. You can reach the ANU using PPP without PAP, but you will be on the slower subnet.

If you are on the slower subnet, your computer will be given a name similar to
  slcan2p13.ozemail.com.au
(This is on the 203.108.192 subnet).

If you are on the CARNO subnet, your computer will be given a name similar to
  h194.anu.uniras.aust.com
(This is on the 203.108.55 subnet).

You can check the IP address you were assigned using the ifconfig ppp0 command. You can also check your computer's name by telneting to a Unix host at the ANU and using
last | less
to display where you are logged in from.


Before You Start

It is assumed that your modem is already set up. If it is not, read these brief instructions before continuing.

For PPP to work on your computer you must have two things installed

  1. the PPP daemon (pppd)
  2. kernel support for PPP
1.   Check the version of pppd installed on your computer.
To display just the pppd version, type pppd --version
Red Hat Linux users can also try
  rpm -q ppp
  ppp-2.3.5-1
The method described here uses the call option which was added in pppd version 2.3. If you are using an older version, try the "pppd connect" method of invoking pppd, or try netcfg or dip. If these methods fail, update!

2.   Check that your kernel supports ppp.
Support for PPP can either be compiled directly into your kernel or as a loadable module. If ppp is compiled into the kernel the output from the dmesg command should contain lines similar to...
  PPP: version 2.3.3 (demand dialling)
  PPP line discipline registered.

If ppp is compiled as a module, you won't see it in the output from dmesg unless the module has been loaded. Check for the ppp module by typing
modprobe -l | grep ppp
The output should contain something similar to this:
  /lib/modules/2.2.5-22/net/ppp.o

If the kernel doesn't support ppp you will need to recompile it. (See instructions in LDP documentation).


Quick Setup

You need to set up 4 files in the /etc/ppp directory. If you want to keep your originals, either rename them or rename the entire /etc/ppp directory and create a new one. You may need to create the peers directory if /etc/ppp/peers does not already exist on your system.

  options

  peers/ozemail

  pap-secrets

  ozemail-chat

You also need to create

  /etc/resolv.conf

This is the minimum setup for ppp. After creating these files you should be able to type
  pppd call ozemail
and establish a ppp connection.
(Most of these instructions were written under the assumption that you have become root before dialling in. However it is possible to set things up so that you can dial in as any user. See here).

Try ping, telnet or rlogin and see if you get a response from a computer running Unix at the ANU. Also see if your browser can connect to your favourite web site. If you have problems, see the troubleshooting section. When you have established a ppp connection, set your browser's automatic proxy configuration to http://www.uniras.aust.com/university/proxy.pac

When you want to shut down the ppp connection, type
  killall pppd

Note: If there is a problem with your setup, it is possible that a PPP session will not be established, but the connection to OzEmail remains open. If this happens killall pppd will not cause the modem to hang up. In this case try typing
echo ATH > /dev/modem
and if that doesn't work, turn your modem off or pull out the phone plug. You need to make sure you are not being charged for an open connection to OzEmail that you are not using!

If your version of pppd does not support the call option, you could try invoking pppd as follows Substituting your own user name for "amcbeal"):

pppd connect 'chat -v -f /etc/ppp/ozemail-chat' /dev/cua1 38400 debug \
 crtscts modem defaultroute noauth user amcbeal
If this all seems like too much to type, put the pppd command you use into a script.

 

There a few refinements you can make to this basic setup. These are described in the refinements page.


How it Works

The man page for pppd states that:
Pppd reads options from the files /etc/ppp/options, ~/.ppprc and /etc/ppp/options.tty-name (in that order)...

The pppd call ozemail command causes options to be read from /etc/ppp/peers/ozemail after the above files are processed. This allows the system administrator to set default options in /etc/ppp/options and to add to or reverse these options for particular ISPs in files /etc/ppp/peers/ozemail, /etc/ppp/peers/bigpond etc.

The auth line in the options file might seem unnecessary. What is does is demand that the remote computer (the peer) authenticate itself before your computer will allow a ppp connection. However an ISP will not authenticate itself to you! This option is overridden in the /etc/ppp/peers/ozemail file, using the noauth option. This relaxes security for ozemail but retains it for other systems trying to establish a ppp connection with you. See the SECURITY section of the pppd man page.

This line from peers/ozemail

chat -v -f /etc/ppp/ozemail-chat
calls the chat program and tells it to use the /etc/ppp/ozemail-chat. script.
Chat is a program for automating the process of logging into a remote computer. The -v option sets verbose mode, which records the execution of the chat script in the log file (see the debugging section).

Most of the lines in a chat script are expect - send pairs of strings, separated by spaces. In other words, the program expects to receive one of the strings on the left (from your modem or ISP), and when it does, it sends the corresponding string on the right. The script used here has each expect - send pair on a separate line. This is only to improve readability and is not compulsory. Since spaces are used to separate strings, those strings containing spaces must be quoted. Chat accepts either single or double quotes and doesn't mind if you quote single words, so for example the strings

name: amcbeal
'name:' 'amcbeal'
"name:" "amcbeal"
are equivalent. The case of an empty string is handled by a pair of single or double quotes with nothing between them.
The actual script is quite short. Note that it does not attempt to supply a username and password. Doing so will get you onto the wrong subnet.


Other Sources of Information


Next