Steps to configure Dial-on-Demand (demand dialing) on RedHat7.1
---------------------------------------------------------------

1.0 Introduction
----------------
This steps are not tested on other system/Linux Distro. It works fine with
RedHat 7.1 and I supposed with it newer version. Since the PPP daemon in new 
Linux kernel already supports demand dialing, old configuration of 
dial-on-demand can't be used. Another thing that change is the dialer script.
In RedHat 7.1 we are going to use wvdial for ppp dialer program that is a bit 
different on the configuration.

2.0 Steps
---------
Check this first:
1) Make sure you are running RedHat 7.1 (perhaps newer version will also do)
2) Make sure you install pppd and rp3 (redhat ppp)
3) Make sure your modem is connected
4) Add these lines into /etc/rc.d/rc.local

   echo "1" > /proc/sys/net/ipv4/ip_forward
   echo "1" > /proc/sys/net/ipv4/ip_dynaddr
   /usr/sbin/pppd


Setting Up:
1) It's a lot easier if you can start your XWindows (startx)
2) Select Dial-Up configuration menu (or just run "rp3" at terminal)

   ----------- sample of /etc/wvdial.conf ------------
       [Modem0]
       Modem = /dev/ttyS0
       Baud = 115200
       Init1 = ATZ
       Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
       SetVolume = 0
       Dial Command = ATDT

       [Dialer Defaults]
       Modem = /dev/ttyS0
       Baud = 115200
       Init1 = ATZ
       Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
       SetVolume = 0
       Dial Command = ATDT

       [Dialer tmnet]
       Username = tmnet-user-account
       Password = tmnet-password
       Phone = 1515
       Inherits = Dialer Defaults
       Stupid mode = 0
           

    -------- end --------------------------------

3) Follow the instruction to setup your ISP account
4) Open /etc/sysconfig/network-scripts/ifcfg-ppp0 (using vi/pico)
5) Change the parameter (if not set) of the file to the following:
   
   -------------- sample of /etc/sysconfig/network-scripts/ifcfg-ppp0 -----
          DEVICE=ppp0
          NAME=tmnet
          WVDIALSECT=tmnet
          MODEMPORT=/dev/ttyS0
          LINESPEED=115200
          PAPNAME=tmnet-user-account
          USERCTL=true
          REMIP=1.1.1.1
          IPADDR=1.1.1.2
          ONBOOT=no
          PERSIST=yes
    
   ------- end -------------

6) Open /etc/ppp/pap-secrets 
7) make sure you put your account name and password in there, i.e:
   
   ------- sample of /etc/ppp/pap-secrets -----
   #username           device    password
   tmnet-user-account	*	mypassword
   
   --------- end ------------

8) Open /etc/ppp/options and fill-in the following setting:

    ---- sample of /etc/ppp/options -----

    /dev/ttyS0  #com1
    demand
    idle 600    #10 minutes
    ipcp-accept-local
    ipcp-accept-remote
    noauth
    modem 115200
    lock
    crtscts
    defaultroute
    noipdefault

   ---- end ---------------

9) Done, try ping an Internet Address (i.e: ping 202.188.0.133) and see
   whether the modem is dialing or not (you can view the log by typing
   tail -f /var/log/messages)

3.0 Conclusion
--------------
If this guide doesn't work with your system, try to search for other resource
on the Internet, I believe many people already put up simillar guide like this
on the Net today. Use Google! to search for it :-).


Thank you.
Maznan Deraman
1 November 2001
maznan@rumah.net