This document explains how to connect a linux box to WMU campus appartments
- 56K data line, using pppd and script files.
(The procedure was tested for RedHat 7.1, but should work for any Linux
box)
Introduction
We want to set a ppp connection over a "null modem". Normally, a null
modem is used to connect two computers trough the serial/parallel port.
At one end, the connection cable is attached to your serial port (trough
a small device used to amplify the signal), at the other end is the WMU
server port. We want to make ppp talk directly on the port.
Assumptions
- you live in WMU campus appartments, and you have the 56K data line
connection. (Attention! WMU dorms have a different type of connection)
- the connection is actually working, (i.e. the connection works in
Microsoft Windows, if you have it installed)
- you have root access to the linux box,
- you have some basic information about the connection: the serial
port where the modem is located (ttyS0=COM1, ttyS1=COM2) and the WMU -
DNS server address. (the following description assumes COM1)
Debug the process
To see all system messages (including the communication messages):
- open a separate terminal window,
- (as root) issue:
> tail -f /var/log/messages
If the connection works, you are going to see here all the messages
exchanged with the WMU server.
Script Files
As root, execute the following steps:
1). Create connect file "connect.scr"
connect 'chat -v "" ^D ost:"" PPP ogin: user-name@wmich.edu assword:
xxxxxxxx' crtscts defaultroute noipdefault
2). Create connection script file"directUp":
pppd /dev/ttyS0 57600 file connect.scr
3). Create disconnect script file "directDown":
- First, you have to find
where the script "ppp-off" is located (use "locate ppp-off" ).
(on my machine
is at: /usr/share/doc/ppp-2.4.0/scripts/ppp-off)
- Create the "directDown"
file:
/usr/share/doc/ppp-2.4.0/scripts/ppp-off
killall pppd
4). Make "directUp", "directDown" excutable:
> chmod a+x directUp directDown
5). To connect, execute:
> directUp
To disconnect, execute:
> directDown
Set "/etc/resolv.conf"
Now that you are online, make sure that your system knows some servers
that will help to convert names to ip addresses.
In "/etc/resolv.conf" add:
nameserver <WMU DNS server
address>
Example of "/etc/resolv.conf":
search cs.wmich.edu
nameserver 141.218.20.114
nameserver 141.218.1.100
Important!
The modem needs to be properly shutdown. If you kill the process (or
shutdown the machine while connected) you will not be able to reconnect
until you reset the modem.
Normally, to reset the modem, you either have to call WMU help desk
and ask them to do it, or wait 60 min. According to one of the documents
that I referenced bellow, if you don't use the connection for 60 min there
will be an automatic reset !!?? (from the amount of information on this
issue, looks like not many people had this problem)
Personally, I had a lot of trouble finding this. Anyway, here is my
solution.
Reset the modem:
1). Get the reset file: resetData.txt
2). Notice the number at the end of the file: PM005\:Sxx . Change it
(at least "xx") with the unit, and the port that UCS has assigned for your
connection.
3). Send this file to your serial port.
Example, if your connection is on COM1
> cat /root/ppp/resetData.txt > /dev/ttyS0
Extra:
Set a perl + GTK interface for a nice, one click, starting interface.
If you want to start/stop the connection from the modem lights interface,
here is a little tool that may help.
- Download: connectDlg.c
and directUpDialog
- Compile the GTK file "connectDlg.c":
> g++ connectDlg.c -o connDlg `gtk-config --cflags
--libs`
- Set the constants at the beginning of the directUpDialog file (including
the perl path).
Voila, to start the interface, just say:
> directUpDialog
- To stop the connection, I use
- kill-port.pl
(a small perl program that takes as argument either: 0 or 1, end kills
pppd for ttyS0 or ttyS1)
- directDown
(a small shell program that kills the connection)
- To start the connection at boot-time, add the following line to:
/etc/rc.d/rc.local
/<ppp-scripts-path>/directUpDialog > /tmp/ppp-network 2>&1 &
- To prevent the disconnect after one hour of idle time, do a ping
to a known host.
- To find the assigned IP address, use the script: getIP
(also used by the directUpDialog)
Note: use "-h" for help with "directUpDialog" command line parameters.
Download all the above scripts: directppp.tgz
Laurentiu Cucos
15.Nov.2001
Last modified: 29.March.02
Other sites
http://saintjust.tripod.com/kppp/kppp.html
http://unix.cc.wmich.edu/vorpagel/apartments.html