... and now also to the list (forgetting to hit reply to all is
frustrating...)
hello ray!
your assumptions were correct, here are the details:
a cable modem on eth0;
my provider gives out a dynamic ip address (which rarely changes);
dhcp is handled by pump;
lease is renewed once per hour;
if i get a new address, a short script updates dns;
problems are actually really rare (or rather those problems that do not
resolve on their own):
pump died once (after about 60 days uptime) - but there is not much to be
done here, apart from restarting;
two times service was interupted at about 4:00 am;
in such a case the host ends up with a eth0 up, but without an ip address
for eth0. default route is also not available. restarting the network solves
connectivity issues; very, very rarely i have to reset the modem itself
(maybe less then 1 time within last year) to get back online.
i have no clue as to why this might happen.
a search on the internet gave me this hint: if a dhcp server goes down, pump
will bring the interface down even if the router works - maybe my isp is
doing some maintenance on his dhcp server;
maybe my cable modem gets reset due to some kind of maintenance;
maybe sometimes the network just needs to go down, just to make sure there
is still someone to bring it up...
... really, no idea...
my last version of the script for pinging hosts follows. if there is a more
elegant and reliable way to react in such rare situations, i will be glad to
hear it.
regards,
kiril
#!bin/bash
PING_REMOTE_HOSTS="host1.com host2.com host3.com"
for HOST in $PING_REMOTE_HOSTS
do
UP=0
while [ $UP -eq 0 ]
do
sleep 120
ping $HOST -qc 1 >/dev/null 2>&1
UP=$?
done
echo "$HOST is down, trying next host..."
done
echo "network is down. restarting..."
/etc/init.d/network reload
sleep 60
-----Urspr�ngliche Nachricht-----
Von: Ray Olszewski <[EMAIL PROTECTED]>
An: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Datum: Montag, 27. Mai 2002 23:25
Betreff: Re: [leaf-user] Detecting Disconnected Network
>At 10:16 PM 5/27/02 +0200, Kiril wrote:
>>My ISP sometimes has short network outages (2-3 minutes). After such an
>>outage, I have to manually restart networking to get my router back
online.
>>
>>Is there a simple and reliable way to test the status of a connection? a
>>script that can runs constantly, supervised by daemontools, and restarts
>>networking after some waiting period is what i am looking for
>
>Assuming we are talking about a connection handled by an external device
>(e.g., a cable or DSL "modem" that connects to the LEAF router via an eth*
>interface, and NOT a ppp connection over a dialup modem), the only real way
>to see if the remote network is working is to try to make it do something.
>A ping is the lightest weight "something" there is. A one-per-minute ping
>to the ISP's default gateway really isn't much of a burden on it ... and
>since they are the ones causing the periodic interruptions, surely they
>can't with any sincerity claim your behavior to be "unfriendly". And its' a
>good host to pick for another reason too -- if it does go offline, that act
>cuts off your access to the Internet, so you won't be detecting a false
>failure.
>
>
>>ping somehow does not work best. the host that i am trying to ping could
go
>>offline, dns could fail and constantly pinging some other host seems not
>>particularly friendly to me.
>>
>>i tried also ip addr show | grep eth0 | grep inet, but this also did not
>>really work out, because routing could fail.
>
>
>In any case, a failure at the ISP end won't cause your routing table to be
>rewritten, unless you are using a system that gets a new DHCP lease every
>few minutes.
>
>>one could always test all conditions, but before i do this, i would like
to
>>ask the list if there is a more elegant way.
>
>Really, it depends on what the local symptoms of these brief connectivity
>failures are. I've been making some assumptions about that in my response,
>but a better approach is for you to characterize the failures a bit more
>exactly.
>
>
>--
>-----------------------------------------------"Never tell me the
>odds!"--------------
>Ray Olszewski -- Han Solo
>Palo Alto, California, USA [EMAIL PROTECTED]
>---------------------------------------------------------------------------
----------------
>
>
>_______________________________________________________________
>
>Don't miss the 2002 Sprint PCS Application Developer's Conference
>August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
>
>------------------------------------------------------------------------
>leaf-user mailing list: [EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/leaf-user
>SR FAQ: http://leaf-project.org/pub/doc/docmanager/docid_1891.html
>
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
------------------------------------------------------------------------
leaf-user mailing list: [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-user
SR FAQ: http://leaf-project.org/pub/doc/docmanager/docid_1891.html