On Sat, 04 Aug 2007, in the Usenet newsgroup comp.os.linux.networking, in
article <fo8do4-(E-Mail Removed)>, Hactar wrote:
>buck <(E-Mail Removed)> wrote:
>> (E-Mail Removed) (Hactar) wrote:
>>> Hi, I have a variant of Debian installed. Is there a pointy-clicky
>>> way of enabling dial on demand for a regular analog (not ADSL) modem?
>>> (This computer's for a very computer-illiterate person. While I have
>>> no problem editing text files and writing scripts, she feels
>>> differently.)
Why does it have to be a pointy-clicky? This is a one-time shot, and
needs only to add a line to the boot scripts.
>> What's wrong with the demand option to pppd?
>It doesn't bring the link up when I ping an outside site.
How exactly are you trying to do this? All that is needed is a dumb
script that is runnable by root - something like
[compton ~]$ cat /usr/local/bin/dialin
#!/bin/bash
exec /usr/sbin/pppd connect "/usr/sbin/chat -f /etc/ppp/dialscript" lock \
defaultroute noipdefault /dev/modem 115200 crtscts user ibuprofin \
nodetach
[compton ~]$
There must not be anything after the \ in those two lines.
[compton ~]$ cat /etc/ppp/dialscript
ABORT BUSY ABORT 'NO CARRIER' "" AT&F1 OK ATDT2662902 CONNECT \d\c
[compton ~]$
There is also the file /etc/ppp/pap-secrets (or possibly chap-secrets)
that has the username/password in the form
ibuprofin * p42Sw0rD~
and the right nameserver data in /etc/resolv.conf, and that's basically
it. Get this running from the command line in a separate terminal. When
you have done so, change the last line of the /usr/local/bin/dialin
script so that it now reads:"
[compton ~]$ cat /usr/local/bin/dialin
#!/bin/bash
exec /usr/sbin/pppd connect "/usr/sbin/chat -f /etc/ppp/dialscript" lock \
defaultroute noipdefault /dev/modem 115200 crtscts user ibuprofin \
demand idle 300 holdoff 15
[compton ~]$
and then add two lines to the local boot script (usually rc.local) that
read
echo -n 1 > /proc/sys/net/ipv4/ip_dynaddr
/usr/local/bin/dialin
The first line is used to tell a 2.2.x or later kernel that the system will
have dynamic IP addresses, while the second line runs the dialin script. As
this file (rc.local) is run by root, the daemon will be running as root.
Now, pppd will start, but stay in the background and respond to requests for
IP services after that. The idle 300 will cause the system to disconnect
when the ppp link has been idle for 5 minutes (300 seconds). The holdoff 15
means the system will not try to redial for 15 seconds after an idle
timeout, to allow everything to recover.
Other things to consider: You may want to be running a firewall (hint -
hint) to protect you from the outside world. If masquerading for windoze
boxes, be sure to block ports 137, 138, and 139 with a firewall, and disable
sharing on them, so that the idle timer has a chance to work. Windoze boxes
are extremely chatty, and would otherwise prevent timeouts. You may need to
monitor the ppp0 interface with tcpdump to detect such problems. You may
also want to (at least temporarily) monitor the ppp0 interface with a
simple packet sniffer, and see that you aren't being constantly probed by
other windoze boxes on the net (connection attempts to ports 135, 139, 445
among others) looking to share. The problem with that crap is that the
outside generated packets are resetting the "idle" timer, and this may
prevent pppd from deciding that the link is not in use. The solution
to that problem is "active-filter" option to pppd.
Old guy