Next

Dialing into OzEmail using PPP under Linux

Chris Blake
v1.02   November 2001

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 originally tested on a system running Red Hat 5.2 and pppd 2.3.5. These instructions were updated in November 2001 on a system running Red Hat 7.1 and pppd 2.4.0, however I did not have time to check everything (for example I hardly looked at the alternative dialin methods described in sections 7, 8, 9 and 10) so there may still be some stuff that is only relevant to Red Hat 5.2. If you find any mistakes or can suggest improvements, please email me.

ANU users dialing in via OzEmail were assigned to a different subnet which uses a link to CARNO. To be assigned to this subnet you needed to 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. In 2001 OzEmail opened a new network (OzEcampus) which uses CHAP (Challenge Handshake Authentication Protocol).

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).

If you are on the OzEcampus network, your computer will be given a name similar to
  1cust178.tnt3.cbr1.da.uu.net.

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
With Red Hat 5.2 the output should contain something similar to this:
  /lib/modules/2.2.5-22/net/ppp.o
Under Red Hat 7.1 I you should see:
/lib/modules/2.4.2-2/kernel/drivers/net/ppp_async.o
/lib/modules/2.4.2-2/kernel/drivers/net/ppp_deflate.o
/lib/modules/2.4.2-2/kernel/drivers/net/ppp_generic.o
and probably this as well:
/lib/modules/2.4.2-2/kernel/drivers/net/ppp_synctty.o
/lib/modules/2.4.2-2/kernel/drivers/net/wan/syncppp.o

If the kernel doesn't support ppp you will need to compile the required modules (which also include bsd_comp.o) or recompile the kernel with ppp compiled in. (See instructions in LDP documentation).


Quick Setup

You need to set up 4 or 5 files in the /etc/ppp directory, depending on whether you will be using CHAP. 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

  chap-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.


wvdial.

Starting with Red Hat Linux 6.1 two new tools were included to help configure and setup a PPP connection. The first one is wvdial. This is a small intelligent PPP dialer with a command-line interface. The second one, rp3 is a graphical front end for wvdial. Install rp3 last because it depends on wvdial. You also need to have X and the Gnome desktop installed to run rp3. If you have not used wvdial before, simply type (as root)
wvdialconf /etc/wvdial.conf
This scans your system to find the modem, then creates the configuration file. You then need to edit /etc/wvdial.conf to insert the phone number of your ISP, your username and password. You should then be able to connect by typing wvdial.
Note: I had a quick play with wvdial (without rp3) under Red Hat 6.1 but I don't have it installed on my system at the moment. Furthermore I do not know what you would need to do to get wvdial to establish a pap or chap connection with OzEmail.


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