Re: Keeping pppd alive--how?

chris_at_nospam.com
Date: 10/30/04

  • Next message: Phisherman: "Re: Keeping pppd alive--how?"
    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


  • Next message: Phisherman: "Re: Keeping pppd alive--how?"

    Relevant Pages

    • Re: Remote MySQL Server
      ... The server with the script is on an outside network, ... $open = mysql_select_db($database, $connection) ... One obvious problem could be the firewall. ...
      (comp.lang.php)
    • Re: [SLE] Still having firewall and dialup problems
      ... >>I have to stop and restart the firewall everytime I connect to my ISP. ... >>Since my dialup dies fairly often and has an 8 hour limit where the ISP ... that calls a chat script to start my connection. ...
      (SuSE)
    • Re: dialup solution (as seconary connection / iptables )
      ... ip-down is launched by pppd only after the PPP link no longer available ... first with MINICOM or is PAP and script not mutualy exclusive? ... do have to "make the connection first with MINICOM." ... If you use the Linux box and route the news IP address to it on each ...
      (comp.os.linux.networking)
    • Re: PPP ip-up and firestarter
      ... >> up and stop it whenever my connection goes down. ... >> script runs it whenever ppp is up. ... > iptables -L does display the firewall rules. ... Anyway, whenever I get connected to my ISP, I get the ...
      (Debian-User)
    • Re: mysqli connections and oop
      ... need to do all processing in a script before I display a page that will ... But it will most probably NOT terminated the execution of the script. ... this means that NO lasting connection is build ... Why does it not carry the mysqli connection? ...
      (comp.lang.php)