If you wish to control the duration of Internet
connectivity to your LAN, then a conventional dial-up method initiated by authorized users
using software like XISP is sufficient. You can instead setup Linux to perform
dial-on-demand to initiate a dial-up link each time a client makes a request for Internet
access, and close the link after a preset period of inactivity. This eliminates the need
for having a trusted user start up the Internet connection each time it is needed, or
allowing several users on the LAN to know your password.
Dial-on-Demand is implemented by the Diald software
consisting of three packages: diald-0.16-3glibc.i386.rpm, diald-config-1.2.1-1.noarch.rpm,
and diald-config-unmetered-0.2-2.noarch.rpm. The packages are in the pcqupdt/powertools
directory on the PC Quest May CD. Install each of the packages using the command
rpm -ivh diald*.rpm.
The install process sets up the default configuration
files. You will have to customize them to your requirements. Diald is automatically
started at boot time from the /etc/rc.d/init.d directory. You can manually shut it down at
any time by typing /etc/rc.d/init.d/diald stop.
Diald performs two distinct roles. Firstly, it monitors
your network traffic to intercept any traffic that goes beyond the local network, and
requires Internet connectivity. When it detects such traffic, it initiates a PPP or SLIP
link and maintains it until the network activity ceases.
To monitor the network traffic on your server, it creates a
pair of SLIP interfaces with any given IP address on your network. The two SLIP interfaces
serve as the local and remote ends of a TCP link. For example, if you have a
network address 192.168.1.0, then you can configure diald to use the IP addresses
192.168.1.5 and 192.168.1.6, both being reserved. The LAN gateway machine will be modified
to use 192.168.1.5, (the local address), as its gateway, and 192.68.1.6 as the remote
gateway. All network traffic will then pass through the SLIP interfaces, which are
automatically activated at boot time.
Now you need to edit the configuration files for your
setup. Edit the file /etc/sysconfig/network-script/dialdcfg-ppp0. Substitute the addresses
assigned for the local and remote SLIP interface with ones on your network. You should use
addresses that will not be dynamically assigned by your DHCP server. As the addresses in
the range 1 to 20 are normally reserved, 192.168.1.5 and 192.168.1.6 are not bad choices.
You can also specify diald’s behavior, to either keep
a link up permanently, or perform only connection on demand. There are several values that
can be changed, such as how long to keep the link up after an FTP, HTTP, mail, or news
request. These details are site specific, and up to you to decide.
The next step is to configure a working PPP interface from
within the networking applet of the control panel (read the article Connecting To The
Internet in the May issue). However, do not allow the PPP interface to be set up as
the default route after connection (disable Add default route in the networking tab
of the ppp0 interface properties). Enter your login name, password and connect string
(usually ppp). Diald will automatically pick up these values when it is
establishing a connection.
You can now reboot (to get rid of any stale routes), and
diald will automatically launch itself at boot time. After booting, type ifconfig. You
should see two new interfaces called sl0 and sl1 on IP addresses 192.168.1.5 and
192.168.1.6.
Diald is sensitive to nameserver requests. So in order to
ensure that it does not get activated each time a request is made for a host on the local
network, edit the file /etc/host.conf, and change the order of name lookups to hosts,
bind.
Try to connect to a remote site through your Web browser.
Diald will intercept the request and automatically start the connect script. You may
receive a timeout the first time you attempt to connect to a site, until the connection is
made. After that, you are connected!