Introduction
The purpose of this note is to outline the setup and operation of a dialup network connection named Clemson for Fedora Core 4 (FC4).
Legacy FC4 On-demand and Persistant Connections
Two types of dialup connections are available: on-demand and persistant. The type of connection is controlled by the connection configuration file. Most users will take the default which is the persistent connection.
/etc/sysconfig/network-scripts/ifcfg-Clemson DEMAND=no
We begin with the steps taken to bring up a persistant connection, the default connection type.
Steps to bring up a persistant connection
netdir = /etc/sysconfig/network-scripts
/sbin/ifup
reads netdir/ifcfg-Clemson (DEMAND=no)
calls netdir/ifup-ppp
netdir/ifup-ppp
calls /sbin/ppp-watch
/sbin/ppp-watch
reads netdir/ifcfg-Clemson
creates options list for pppd
calls /usr/sbin/pppd with options list
daemonizes
/usr/sbin/pppd
reads passwords from /etc/ppp/pap-secrets
reads options from /etc/ppp/options
reads options from /etc/ppp/peers/Clemson
calls /usr/bin/wvdial
daemonizes
/usr/bin/wvdial
reads /etc/wvdial.conf
dials the ISP
/usr/sbin/pppd
creates the ppp device
calls /etc/ppp/ip-up
/etc/ppp/ip-up
calls netdir/ifup-post
/sbin/ppp-watch
monitors the connection and pppd
redials if the connection is lost
The command
ifdown Clemson
will kill the ppp-watch and pppd processes.
Next, we begin with the steps taken to bring up an on-demand connection with configuration file setting
/etc/sysconfig/network-scripts/ifcfg-Clemson DEMAND=yes
Steps to bring up an on-demand connection
netdir = /etc/sysconfig/network-scripts
/sbin/ifup
reads netdir/ifcfg-Clemson (DEMAND=yes)
calls netdir/ifup-ppp
netdir/ifup-ppp
reads netdir/ifcfg-Clemson
creates options list for pppd
calls /usr/sbin/pppd with options list
/usr/sbin/pppd
reads passwords from /etc/ppp/pap-secrets
reads options from /etc/ppp/options
reads options from /etc/ppp/peers/Clemson
daemonizes
calls /usr/bin/wvdial when data traffic is present
/usr/bin/wvdial
reads /etc/wvdial.conf
dials the ISP
/usr/sbin/pppd
creates the ppp device
calls /etc/ppp/ip-up
/etc/ppp/ip-up
calls netdir/ifup-post
/usr/sbin/pppd
monitors the connection and redials if the line is dropped
drops the connection after an idle timeout
The command
ifdown Clemson
will kill the pppd process.
Is PPP-WATCH Needed?
The default connection configuration file contains
/etc/sysconfig/network-scripts/ifcfg-Clemson DEMAND=no PERSIST=no
The FC4 ignores the PERSIST value and instead uses ppp-watch to monitor the connection. The Red Hat ppp-watch daemon is a wrapper for pppd. Early versions of pppd would die if the connection to the ISP was dropped. It appears that purpose of ppp-watch was to restart pppd if it died. The pppd in use today has a 'persist' option although FC4 does not use it. With the persist option in force, pppd does not die if the connection to the ISP is dropped. Instead, pppd will redial. The wrapper ppp-watch may no longer be needed. In fact, only a few Linux distributions use it. Here is an outline of the steps for a persistent connection using a modified ifup-ppp script and a modified ifdown-ppp script, neither of which use ppp-watch.
Steps to bring up a persistant connection without ppp-watch
netdir = /etc/sysconfig/network-scripts
/sbin/ifup
reads netdir/ifcfg-Clemson (DEMAND=no, PERSIST=yes)
calls netdir/ifup-ppp
netdir/ifup-ppp (modified)
reads netdir/ifcfg-Clemson, creates options for pppd
calls /usr/sbin/pppd with options
/usr/sbin/pppd
reads passwords from /etc/ppp/pap-secrets
reads options from /etc/ppp/options
reads options from /etc/ppp/peers/Clemson
calls /usr/bin/wvdial
daemonizes
/usr/bin/wvdial
reads /etc/wvdial.conf
dials the ISP
/usr/sbin/pppd
creates the ppp device
calls /etc/ppp/ip-up
/etc/ppp/ip-up
calls netdir/ifup-post
/usr/sbin/pppd
monitors the connection
redials if the line is dropped
The command
ifdown Clemson
will kill the pppd process.
For an on-demand connection, set DEMAND=yes in the configuration file. The PERSIST=yes will set the pppd persist option and PERSIST=no will set the pppd nopersist option.
Informal testing suggests that performance is improved when ppp-watch is not used. A loss of connection is dealt with quicker and the routing table seems to be set up much quicker.
Disconnecting
Here are the steps to bring down the connection.
Steps to bring down a connection
netdir = /etc/sysconfig/network-scripts
/sbin/ifdown
reads netdir/ifcfg-Clemson
calls netdir/ifdown-ppp
netdir/ifdown-ppp
reads netdir/ifcfg-Clemson
sends the kill signal to /sbin/ppp-watch if running
sends the kill signal to /usr/sbin/pppd
/usr/sbin/pppd
removes the ppp device
calls /etc/ppp/ip-down
dies
/etc/ppp/ip-down
calls netdir/ifdown-post
Fedora Core 4 Dialup Connection Configuration
When I installed the Linuxant (www.linuxant.com) HSF modem driver, the configuration utility hsfconfig identified the modem device
hsfconfig: modem device: /dev/ttySHSF0
and provided a udev rule which I renamed.
# cd /etc/udev/rules.d # mv hsf.rules 10-local.rules
This udev rule creates a symlink in /dev.
modem -> ttySHSF0
If you modem doesn't work, make sure the modem device is defined in /dev.
The FC4 system-config-network utility can be used to set up the following configuration files.
/etc/wvdial.conf [Modem0] Modem = /dev/modem Baud = 115200 SetVolume = 2 Dial Command = ATDT Init1 = ATZ Init3 = ATM1L2 FlowControl = CRTSCTS [Dialer Clemson] Username = bmoss Password = ******* Phone = ***-**** Stupid Mode = 1 Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Inherits = Modem0
/etc/sysconfig/network-scripts/ifcfg-Clemson ONBOOT=no USERCTL=yes PEERDNS=yes TYPE=Modem DEVICE=ppp0 BOOTPROTO=dialup AC=off BSDCOMP=off VJCCOMP=off CCP=off PC=off VJ=off LINESPEED=115200 MODEMPORT=/dev/modem PROVIDER=Clemson DEFROUTE=yes PERSIST=yes PAPNAME=bmoss WVDIALSECT=Clemson MODEMNAME=Modem0 DEMAND=no
/etc/ppp/pap-secrets "bmoss" "Clemson" "*******" "bmoss" * "*******"
/etc/ppp/peers/Clemson connect "/usr/bin/wvdial --remotename Clemson --chat 'Clemson'"
Other Linux Distributions
The wvdial and ppp packages are all that are needed to set up an on-demand or persistant dialup connection. See the article
http://www.davidpashley.com/articles/wvdial-pppd-dod.html
After walking through this procedure, I produced the same wvdial.conf and pap-secrets files as above. All the pppd options are stored in the peers file. Here is the one I produced.
/etc/ppp/peers/Clemson noauth name wvdial connect "/usr/bin/wvdial --remotename Clemson --chat 'Clemson'" modem /dev/modem 115200 crtscts user bmoss login asyncmap 00000000 defaultroute usepeerdns ipparam Clemson linkname Clemson demand/persist (use one of these)
The manpage for pppd shows that there are many more options available than those that are configured by the FC4 ifup-ppp script. Generic options can be placed in the options file.
/etc/ppp/options
Connection specific options can be place in a peers file. The FC4 system-config-network utility has an options tab which can be used to add a space separated list of options to a connection configuration file, or the file can be edited directly, for example
/etc/sysconfig/network-scripts/ifcfg-Clemson . . . PPPOPTIONS=option_1 option_2 . . . option_k
Connections can be brought up and down with the pon and poff scripts which can be found in FC4 in
/usr/share/doc/ppp-2.4.2/scripts