Re: Keeping pppd alive--how?
chris_at_nospam.com
Date: 10/30/04
- Previous message: Paul Lutus: "Re: mouse crashing"
- In reply to: Phisherman: "Keeping pppd alive--how?"
- Next in thread: Phisherman: "Re: Keeping pppd alive--how?"
- Reply: Phisherman: "Re: Keeping pppd alive--how?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 30 Oct 2004 09:12:44 GMT
On Fri, 29 Oct 2004 18:54:00 GMT, Phisherman <nobody@noone.com> wrote:
>I have yet to solve this problem and I'm no Linux expert. I use
>Fedora Core One (text only!) running Squid as my proxy server. I
>wrote a script to dial up my ISP, wait 40 seconds, then start up Jay's
>Firewall. It goes offline periodically, so I re-run this script
>manually. (All I do is type ./s on the keyboard without using the
>monitor.) Sometimes a family member will startup this script if I am
>not present. I always have this computer logged in as root--I know
>this not a good idea, but physical security is not a big concern.
>What I have not been successful is writing a script to automate this
>process.
>
>
>Here's my script (called s) that dials up the ISP and starts the
>firewall:
>
>#!/bin/sh
>#
>./ppp-on
>sleep 40s
>./fire
>
>
>Here's a hangup script I use to disconnect (works great!):
>
>#!/bin/sh
>#
>killall pppd
>
>
>What I want Linux to do (automatically) is to run the "s" script if
>the modem loses the connection. What is the best way to do this? A
>cron job? A looping script? Perhaps using the netstat command to do
>the "test?"
>
>Another thought. I need to easily disable running the s script if I
>need to take the modem offline to make a phone call.
>
>I appreciate any detailed suggestions. Thanks!
I'm not sure what your ppp-on script has in it, but you're trying to
make this harder than it has to be.
Run redhat-config-network-gui and edit the connection. Under the
options tab is an option to redial is connection is lost. If you
can't run the gui (even if you send the display to your local
computer) you will need to edit the ifcfg-*** script and set
persist=yes.
That way when the connection comes up, ppp-watch will be spawned which
will redial the connection on it's own if the connection dies. You'll
need to kill ppp-watch instead of pppd to hangup, btw.
Another question is why are you stopping/starting the firewall with
the connection. Just start it and leave it running.
For easier control of the connection, download Putty and run SSH on
the linux box (listen on the inside interface or firewall port on ppp
interface). Then create a shortcut to run the plink command to run
your scripts on the firewall. Something like:
C:\putty\PLINK.EXE -load "firewall" -batch /root/start_ppp.sh &
My custom solution was to write a daemon in perl that runs on the
linux box listening for commands and returning output to the client.
The client is a perltray app with a popup list of commands like
dialing, hangup, show connected speed, etc. It also changes the icon
to reflect the connection state. The tray program needs to be compiled
with the ActiveState perltray tool.
Before you ask, no I don't feel like posting the code. It's got a
bunch of custom stuff that I don't feel like ripping out and
reverifying it'll work. Stuff like altering my firewall depending on
where I'm dialed (only let my computer out if dialed into work) and
different menu options depending on user (ie wife can't dial work).
-Chris
- Previous message: Paul Lutus: "Re: mouse crashing"
- In reply to: Phisherman: "Keeping pppd alive--how?"
- Next in thread: Phisherman: "Re: Keeping pppd alive--how?"
- Reply: Phisherman: "Re: Keeping pppd alive--how?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|