Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: on demand dialing in pppd



On Tue, 4 May 1999, Tetsuji Rai wrote:

> Does anyone know whether real on-demand dialing (with dinamic address 
> assignment) will be supported or not.   I found a substitute for pppd called 

I use kerneld to start pppd (with dinamic address assignment) on demand.
It works fine.  Here's the relevant section from the Kerneld mini-howto:

Dial-on-demand networking

kerneld also gets a request when the kernel needs to send data to a network
connection for which there is no known route. This is typically the case
when your network access is through a SLIP- or PPP-connection that is only
active part of the time.

The request that kerneld gets are of the form "request-route a.b.c.d", where
a.b.c.d is the IP address that the kernel has data for. kerneld will handle
this request by running a shell script, /sbin/request-route, with the IP
address as parameter. The most likely IP address requested the first time is
that of your nameserver (see /etc/resolv.conf) so that will be the address
passed to the request-route script. Unless you have more than one possible
network connection (dial-up or ethernet), you can safely ignore the IP
address; all of your network access has to go the same way, so there is no
need to differentiate between requests for one IP address or another.

To implement on-demand dialing, you just need to change the
/sbin/request-route script so that it sets up your SLIP or PPP connection.
For SLIP, this typically involves running 'dip' or some other program to
call the SLIP server and setup the connection; for PPP, you will probably
run chat+pppd. The script does not need to worry about loading the ppp- or
slip-modules; this will happen automatically through kerneld.

Calling up your ISP and setting up the SLIP/PPP connection can take a while,
and may not always be succesful. The request-route script therefore has a
built-in timer - by default set for 60 seconds - which is how long it will
keep the kernel waiting for the kerneld request to complete. But often the
network setup does not take 60 seconds, so for the quickest possible
response you should arrange for the request-route timer to be killed as soon
as the network setup is complete. SLIP users can do this with recent version
of dip, by including the command

  shell kill `cat /tmp/request-route`

just before the "mode SLIP" command in your DIP script.

PPP users should have

  kill `cat /tmp/request-route`

in their /etc/ppp/ip-up script.

If your network takes longer than 60 seconds to setup, then you will need to
change the duration of the timer in the /sbin/request-route script. In that
case, you will probably also need to change the kerneld delay for
autocleaning unused modules, by adding a "delay=xxx" option to the line in
/etc/rc.d/rc.S that starts up kerneld. The 'xxx' value is the delay before
modules are removed, in seconds (default is 60). This is especially
necessary if you used ppp: The ppp modules are loaded as soon as pppd
starts, but if you use a command like "/usr/sbin/pppd connect `chat -f
/etc/chat.script` ..." then pppd is idle while the chat-script runs, and the
ppp-modules may have been unloaded by the time the chat-script completes!

kerneld does not yet monitor the network activity to shutdown the network
connection; however, PPP users can take advantage of the 'idle-disconnect'
option for pppd introduced in ppp-2.2.0. If you pass the option
'idle-disconnect 600' to pppd, then the PPP connection will be terminated
after 600 seconds (10 minutes) of inactivity. SLIP users will have to
shutdown the connection manually.


--
David Beutel        "Remember, no matter where you go, there you are."
jdb@example.com  
11011011       

-------------------------------------------------------------------
Next Nomikai: TBD                    Tengu TokyoEkiMae 03-3275-3691
Next Technical Meeting: June 12 (Sat), 12  :30   place: Temple Univ.
-------------------------------------------------------------------
more info: http://www.tlug.gr.jp        Sponsor: Global Online Japan


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links