Forum Home
Press F1
 
Thread ID: 37633 2003-09-13 22:26:00 Modem control/timer for Linux Mandrake 9.1 mikep (1856) Press F1
Post ID Timestamp Content User
175028 2003-09-13 22:26:00 I am looking for some way or a piece of software to control my winmodem in Linux so that it disconnects after a period of inactivity, or can be set to connect for no longer than a given amount of time.
I have a situation where a business line is used to connect to the internet and we pay 4c per minute for all "open" lines and as the PC is used by many different people, we can not "police" thier habit of not disconnecting and I really don't like paying Telecom for nothing.

I am using the KDE 3.1 desktop and kppp as my dialler and the PC is a standalone unit, though I am thinking of adding a second unit and networking then.

Can anyone help without suggesting broadband which is out of my price range and with NZ's rip off data caps, it out of the question.
(I have been told some US ISP's charge $35 for full rate internet with no data cap)
mikep (1856)
175029 2003-09-14 03:09:00 Two ideas:

can you get an idle timeout set on your account by your ISP? They used to put that on everyone's accounts, so they should have the technology. :D

you could make a script which will run the at command which will take "appropriate steps" at +5 killall kppp (minutes) or something like that. It's certainly possible ... but would take a bit of playing around to make it work.
Graham L (2)
175030 2003-09-14 08:16:00 PPPD has options to do that. But I can't say I've tried them.

Run "man pppd" (or enter "man:/pppd" in the konqueror address bar) to get a description of the options. The "idle" option looks like what you want. The "debug" one is handy too.

You can get kppp to use them by selection "customise pppd arguments" in the account settings. After you dial, have a look in /var/log/messages to check the setting is working.
bmason (508)
175031 2003-09-14 09:58:00 I have used this method on a Redhat 7.0 gateway for a school that incorporates dial on demand and a timeout.

See www.davidpashley.com The summary of this is:

1. copy your /etc/ppp/peers/wvdial file to a new file called dod.
2. Modify the file to look like:

noauth
name wvdial
connect "/usr/bin/wvdial --chat YourISP"
/dev/ttyS0
115200
modem
crtscts
defaultroute
usehostname
user YourUserName@YourISP.co.nz
noipdefault
idle 180
persist
demand
logfd 6


the idle 180 means that the link will persist for 3 minutes after the last packet of traffic.

3. Add pppd call dod to the /etc/rc.d/rc.local file to make the demand dialling active. So end of the /etc/rc.d/rc.local file now looks like:

pppd call dod
JohnD (509)
175032 2003-09-15 02:59:00 Thanks guys, your suggestions should be al that I need to make the changes . I did try setting the idle time to 2 minutes but I found that even when idle, small 1kb packets are sent out continually and 2-3kb returned approx every minute, though they're not at constant intervals and not particularly in that order . Sometimes as little as 20 seconds, other times up to 80 seconds, so the connection doesn't seem to have a true idle where no packets are sent/recieved .

How can I find out what's been sent/recieved or could it be a the likes of port scans etc that are keeping the connection flowing? How could I tell as I do not have experience with Linux firewalls and I am bedazzled with the lingo used for rules and which ports do what and what to block etc .

Mike
mikep (1856)
175033 2003-09-15 04:47:00 Aha. Those will be "keepawake" packets. Those were an early trick to stop ISP's idle settings from working. Obviously they work bioth ways. :D That will be a ppp setting too. Graham L (2)
1