[EMAIL PROTECTED] wrote:
> 
> For some reason my ISP is having modem problems, When My net server dials up
> and stays online for a while after about 5-6 hours the modem at the isp will
> stop sending packets back to me. Is there any way I can log the problem or do
> a diagnostics on it?
<snip>
Well, you answer yourself:

> Even better is there a program I can run that will ping the isp every hour,
> and if it doesnt get a reply then do a "ifdown ppp1" then a "ifup ppp1" ?
> thanks
> Marcus
> 
<snip>

You can use crontab(1) to instruct cron(8) to run the following every
hour:

Q> ping -c1 $REMOTE_IP || /sbin/ifdown $IF && /sbin/ifup $IF

(
a crontab line would look like the following:
Q> 0 * * * * ping -c1 $REMOTE_IP || /sbin/ifdown $IF && /sbin/ifup $IF
)

where $REMOTE_IP is the IP address of the dial-in host at your ISP and
$IF the network interface (ppp1 in your mail).
There is, of course, room for improvenemts, e.g. using multiple pings to
see if the link is really dead or a big ftp transfer causes ping packets
to get lost.
But you should get the idea...

Marc

-- 
Marc Mutz <[EMAIL PROTECTED]>        http://marc.mutz.com/Encryption-HOWTO/
University of Bielefeld, Dep. of Mathematics / Dep. of Physics

PGP-keyID's:   0xd46ce9ab (RSA), 0x7ae55b9e (DSS/DH)


-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to