Linux Step By Steps

  DIALD: Demand Dialling

From: mikea@norfolk.nf

with help from Jeffrey Hawkins RTSWGURU@msn.com

Revised for Kernel 2.4.x with diald 1.0.1

SEE PPP->DEMAND DIALLING FOR AN EASIER METHOD

If you are a windoze refugee, you may have been looking for the equivalent of 'dial up networking'. You have found it.

Demand dialling causes your modem to connect to your  ISP automatically when you begin to browse the internet or run your mailer program.

Like most steps, it is assumed you are a  root user, and you have knowledge how to  edit a file via the console, or from a gui. It also assumes you know how extract and compile a tarball, or, install and rpm. THESE items are not covered here.see here for basic coverage of these items.

Brief synopsis.

Diald is actually two packages in one:

Diald, as supplied, from tarball or rpm does not contain the setup scripts you need to tailor it to your system. These scripts are detailed in this SxS.




INSTALLING DIALD (versus installing DCTRL)

Step ZERO:

diald uses the pppd daemon directly. It does NOT use any pppd dialling scripts you may already have created. It does NOT use kppp, or Xisp.

However, save yourself pain and grief by FIRST doing PPP->CLIENT. DO NOT CONTINUE WITH THIS SxS UNTIL YOU"VE DONE SO. YOU ARE WASTING YOUR TIME.

The options you enter into diald directly, will be the same or similar to ppp-client. Not only, must you first establish a working dialup conection, you will use most of the data from that SxS, AND, it is one lot easier to debug Do it now, come back here later.

These steps make assumptions that you do in fact have a working ppp->client.

Step ONE:

Download and install diald version 1.0.1, or better from sourceforge.

if this link is broken, go to www.rpmfind.net and obtain a similar rpm

Steps for installing this file, or it's tarball, are NOT included here, since by now, you will be very familiar with such a process.

TWO:

diald uses a fifo to communicate. 

if this 'file' is not present type the following as su

cd /etc
mkdir diald
chmod 777 diald
mknod /etc/diald/diald.ctl p
chmod 664 /etc/diald/diald.ctl
chown root.users /etc/diald/diald.ctl

THREE:

Create the following script file as  /etc/ppp/connect

FOR PAP CONNECTIONS (you MUST install PPP->CLIENT)

#!/bin/sh
/usr/sbin/chat  "" ATDT12345 CONNECT ""

FOR SCRIPT CONNECTIONS

#!/bin/sh
#/usr/sbin/chat "" ATDT12345 CONNECT "" ogin: YOURNAME word: YOUR_PASSWORD

FOUR: change permissions

chown root.root /etc/ppp/connect
chmod 700        /etc/ppp/connect

FIVE: make a config file

cp /usr/lib/diald/diald.conf.example /etc/diald.conf
chown root.root /etc/diald.conf
chmod 600 /etc/daild.conf

SIX: edit the skeleton config

The following is the recommend contents of the file, man diald for more info

(content order is not important)

# /etc/diald.conf 

# items only you can know

connect /etc/ppp/connect
disconnect /bin/true
device /dev/ttyS1
speed 57600

#modem specifics, normally just right

dynamic
mode ppp
modem 
crtscts
defaultroute
lock
mtu 576

#
local 192.168.0.1
remote 192.168.0.2
netmask 255.255.255.0

fifo        /etc/diald/diald.ctl
accounting-log  /var/log/diald
path-route      /sbin/route
path-ifconfig   /sbin/ifconfig
path-pppd       /usr/sbin/pppd
path-bootpc     /sbin/bootpc
 

#------ 

#include         /usr/lib/diald/standard.filter
accept any 600 any
 

Local and remote are dummy entries. They are re-configured by 'dynamic' during ppp
negotiation with your ISP. IF your ISP does NOT supply dynamic IP's remove dynamic and
enter the correct fixed values, (only you  and your ISP can know these details.)


Note that on dynamic connections where the 'local' ip number is set AFTER the connection, the very first packet from diald will FAIL.
The only way around this is to set the 'dummy' address to the 'real' address before dialing.A difficult task.

accept any 600 any, allows any connection for any off computer traffic 

SEVEN:

Next assign tap devices

here is the script required, or, you can do this by hand

----------------
!/bin/bash

# create fifo
[ -f /etc/diald/diald.ctl ] || mknod /etc/diald/diald.ctl p

# make 16 (ether)tap entries in /dev and add to modules.cof

echo "">>/etc/modules.conf

for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
[ -c /dev/tap$i ] ||  mknod /dev/tap$i c 36 $(($i+16))
  echo "alias tap$i ethertap" >>/etc/modules.conf
  echo "options tap$i -o tap$i unit=$i" >>/etc/modules.conf
done

depmod -a

tail /var/log/messages

--------

by hand

Tap lines

Add the following to /etc/modules.conf 

# tap device configuration
alias tap0 ethertap
    options tap0 -o tap0 unit=0
alias tap1 ethertap
    options tap1 -o tap1 unit=1
alias tap2 ethertap
    options tap2 -o tap2 unit=2
alias tap3 ethertap
    options tap3 -o tap3 unit=3
alias tap4 ethertap
    options tap4 -o tap4 unit=4
alias tap5 ethertap
    options tap5 -o tap5 unit=5
alias tap6 ethertap
    options tap6 -o tap6 unit=6
alias tap7 ethertap
    options tap7 -o tap7 unit=7
alias tap8 ethertap
    options tap8 -o tap8 unit=8
alias tap9 ethertap
    options tap9 -o tap9 unit=9
alias tap10 ethertap
    options tap10 -o tap10 unit=10
alias tap11 ethertap
    options tap11 -o tap11 unit=11
alias tap12 ethertap
    options tap12 -o tap12 unit=12
alias tap13 ethertap
    options tap13 -o tap13 unit=13
alias tap14 ethertap
    options tap14 -o tap14 unit=14
alias tap15 ethertap
    options tap15 -o tap15 unit=15 

And create the tap devices with the corresponding "mknod /dev/tap* c 36
NN" command (NN starts at 16 for tap0 and goes incremented by 1 until
31 for tap15). You don't need to create all tap devices but it is
recommended
at least one more than those you know that you'll need just to stay on
the safe side. 

Note, you must have Ethernet Tap Support enabled in the Kernel.

EIGHT:


You can now type diald at the command prompt.

pinging an external ip, should bring the modem up. /var/log/messages is your friend. Almost ALL connection issues would be due to and covered by ppp->client. If you have not done THAT step, why are you here?


Diald can be entered in /etc/rc.local to come up at boot time, OR, you can create a suitable /etc/rc.d/init.d/diald
script by using any of the existing (simple) scripts in that folder and editing accordingly.


ADDENDA #1 Killing diald. 

Diald uses a fifo mechanisim to communicate to you. The commands you need to know are 

echo "COMMAND" >/etc/diald/diald.ctl 

The COMMANDs are 

up force the ppp to dial
down force the line to drop
reset force diald to re-initialise itself (and re-read diald.conf)
quit kill diald 

ADDENDA #2 Dial control and monitoring. 

dctrl from the command line initiates a gui display

type in

dctrl title = diald fifo=/etc/diald/diald.ctl

this is an excellent little gui that can sit there monitoring the traffic levels, and other items respective to diald. You can control most
aspects of diald, via this gui.