Setting up ppp on RedHat using netcfg (known to work for 5.1, 5.2, 6.0, 6.1, 6.2)
---------------------------------------------------------------------------------

Based on Jerome Johnson's first writeup - 1998
More accurate transcriptions and added material - July 8, 1999 (Peter Teuben)
Tailored for astronomy :-) - November 23, 1999 (Peter Teuben)
Fixed new Astronomy setup - June 27, 2000 (Peter Teuben)

0)
The following files are read/modified/used... by "netcfg"
/etc/sysconfig/network
/etc/sysconfig/network-scripts/*
/etc/resolv.conf
/etc/hosts

Make sure you haven't screwed them up.  If you have, you may have
to reinstall the relevant rpm packages or know what you do.

Here is my /etc/sysconfig/network

NETWORKING=yes
FORWARD_IPV4=no
HOSTNAME=localhost
GATEWAYDEV=
GATEWAY=

Make sure /dev/modem is a symbolic link to your modem. E.g.:
lrwxrwxrwx   1 root     root            4 Aug  1 12:09 /dev/modem -> ttyS3

(if you use PCMCIA card, this link is not setup until you have 
inserted the card).

If you want to setup networking for a modem, make sure you don't have an
ethernet running that is already using a default gateway (for laptops
this often is the case if you have one of those dual ether/modem PCMCIA
card). Check with the command "ifconfig" if you only have the "lo"
interface, and not the "eth0" interface.

1)
Run netcfg as root.  Click on the "Names" button.

Hostname:  localhost
Domain:	   localdomain

Search for hostnames in additional domains:
astro.umd.edu

Nameservers:	129.2.14.2       	(our astronomy name server)
		128.8.5.2		(campus name server)
		128.8.74.2		(campus name server)
		128.8.76.2		(campus name server)

(you really only need to enter 1, but can't hurt)

This will take care of /etc/resolv.conf

2)
Click on the "Interfaces" button.
There should be a line something like:
lo	  127.0.0.1	 none	   yes	active

This is your local loopback interface.  It allows you to telnet,
finger, ftp, xhost... your own machine when it's not otherwise
connected to a network.  Don't mess with it.
You may also see lines with ethN or pppN (where N is some number
like 0, 1, 2...), just ignore them for the moment.

3)
Click "Add"
Select "PPP"
Click "OK"

Phone Number:		3012090700
Don't use PAP. Dont fill in PPP login name or password yet. And btw,
you do need a WAM account to have access to the annex modem banks.


3)
Click "Customize"
Click "Hardware"
Select		"Use HW flow control..."
Unselect	"Esc control chars..."
Select		"Abort connect on error..."

Line speed:	115200
Port:		/dev/modem
PPP Options:	(leave blank)

4)
Click "Communication"
Modem Init String:	ATZ
Modem Dial Command:	ATDT
Phone Number:		3012090700

Remove all the Expect/Send entries and append the following lines below.
This sets up your chat script. The left column is for "Expect", the
right column for "Send"

username:		DarthVader		(fill in your WAM username)
password:		the_darkside		(fill in your WAM password)
annex:			ppp
TIMEOUT			5

Note: you may want to protect the directory /etc/sysconfig since it will
contain passwords:

chmod 700 /etc/sysconfig

5)
Click "Networking"
Unselect	"Activate interface at boot..."
Select		"Set default route ..."
Unselect	"Restart PPP..."

6)
Click "PAP"
This should be blank.

7)
Click "Done"
Click "Save"

8)
You should now have a line like this in your netcfg "Interfaces" menu:
ppp0				no   no

(you may also see ppp1 or ppp2 etc. if you already had other previous 
entries)

9)
Before we activate the modem, you may want to look at the system logs. 
Type the following command in another xterm:

tail -f /var/log/messages

10)
Select that pppN line you just added, it should be highlighted
now, and click "Activate", and watch the output in the system logfile
you just opened.

11)
Listen to your modem dial and connect.  Wait about 30 seconds.   The
logfile should contain some entries like the following:


Jul  8 23:42:10 roald pppd[1782]: pppd 2.3.7 started by root, uid 0
Jul  8 23:42:10 roald ifup-ppp: pppd started for ppp4 on /dev/modem at 115200
Jul  8 23:42:35 roald pppd[1782]: Serial connection established.
Jul  8 23:42:35 roald pppd[1782]: Using interface ppp0
Jul  8 23:42:35 roald pppd[1782]: Connect: ppp0 <--> /dev/modem
Jul  8 23:42:36 roald pppd[1782]: local  IP address 128.8.24.156
Jul  8 23:42:36 roald pppd[1782]: remote IP address 128.8.10.124

Once you see the local and remote IP address, you can run ifconfig.
It should look something like:

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Bcast:127.255.255.255  Mask:255.0.0.0
          UP BROADCAST LOOPBACK RUNNING  MTU:3584  Metric:1
          RX packets:86 errors:0 dropped:0 overruns:0
          TX packets:86 errors:0 dropped:0 overruns:0

ppp0      Link encap:Point-to-Point Protocol  
          inet addr:128.8.22.217  P-t-P:128.8.10.115  Mask:255.255.0.0
          UP POINTOPOINT RUNNING  MTU:1500  Metric:1
          RX packets:44 errors:0 dropped:0 overruns:0
          TX packets:45 errors:0 dropped:0 overruns:0

and to fully check if your routing works, type the command "route":

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
128.8.10.124    *               255.255.255.255 UH    0      0        0 ppp0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         128.8.10.124    0.0.0.0         UG    0      0        0 ppp0


Congratulations, you are now online! 

12)
To close the connection, highlight your ppp0 (or whichever) interface
again, and click on "Deactivate". Watch the following lines in your 
system log:

Jul  9 00:00:27 roald pppd[1782]: Terminating on signal 15.
Jul  9 00:00:28 roald pppd[1782]: Connection terminated.
Jul  9 00:00:28 roald pppd[1782]: Connect time 17.9 minutes.
Jul  9 00:00:28 roald pppd[1782]: Sent 24346 bytes, received 27436 bytes.
Jul  9 00:00:29 roald pppd[1782]: Exit.


13)
The command line equivalents of this procedure are the following:

	ifup ppp0
	ifdown ppp0

You can also re-configure the scripts such that they can be executed by
any user, but be aware of the previously mentioned passwords in the 
networking scripts, and the permissions on the directories.

14)
You can add more interfaces, e.g. for the annex-express the entries
are almost identical. Just change the phone number to 301-864-2087.
Phone numbers can change, check the relevent UMD/OIT web pages if you 
keep failing for unknown reasons (i know, that's a catch-22).
If you have problems with new modems or ISPs, first try and walk your 
way through manually using "minicom" or a similar terminal program. 
Then enter the correct Expect/Send pairs in the chat script as in 4) 
Also, the Nameservers sometimes change, you may want to check the
UMD/OIT web pages for the latest updates on those.

15) 
For configuring your mail and news servers you probably need the
following names. It will depend a bit if you use WAM, GLUE, or some
other system on or off campus which ones are ok:

   news-servers:       news.wam.umd.edu  news.glue.umd.edu   news.umd.edu

   mail out-servers:   smtp.wam.umd.edu  smtp.glue.umd.edu 

   imap in-servers:    imap.wam.umd.edu  imap.glue.umd.edu 
   pop in-servers:     pop.wam.umd.edu   pop.glue.umd.edu 


15) 
For off-campus non-UMD ISP users you may need to install certificates
from http://ca.umd.edu/
