Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Detecting a connection on ppp0

My /etc/resolv.conf is static i.e. does not change whether link
is really connected or not, always names ISP as DNS host.
Typically it is a DNS lookup request that triggers the link to connect
via dial-on-demand, so the DNS entry for the ISP must already be in
resolv.conf before the connection is triggered.

BTW fetchmail "-M ppp0" option does a form of monitoring of the link,
by watching the byte counters, so that it will keep collecting mail
as long as the link is remaining up due to other traffic, but will not
itself cause the link to remain up by repeated polling alone.
This monitors if the link has any traffic, but does not monitor
if the link is connected as such.

At 11:02 AM 6/09/2001 +1000, you wrote:
>Another trick to detect would be to rely on the default route: pppd does
>intall this route when the link does comes effectively down and should
>delete it when it is not. same for /etc/resolv.conf which is changed when
>the config goes up and down. But this sounds like tricks and is probably
>not the best solution ..
>On Thu, 6 Sep 2001, Brian Martin wrote:
>> I'm also interested in how to detect if the link is "really" up,
>> since ifconfig shows it always "logically" up, and pppd is usually
>> running, up or not, but maybe this helps a bit ...
>> in RH6.0 with dial-on-demand ppp configured,
>> the scripts /etc/ppp/ip-up.local, /etc/ppp/ip-down.local
>> are run whenever the ppp link actually connects or disconnects from ISP.
>> File names may vary in other dist.
>> These can be used to reconfig firewall rules in ipchains to suit
>> the dynamically allocated IP address on connection,
>> and to remove firewall rules on disconnection.
>> Its a bit tricky but I find that
>> (a) tight firewalling needs to reconfig to the new addr on connection, &
>> (b) relax rules on disconnect to allow local LAN machines to trigger
>> the dialup next time, otherwise they are refused.
>> These scripts are also handy to start & stop mail collection.
>> These scripts could set a flag for up/down, but would not be totally
>> as sometimes the ip-down.local does not always seem to complete when
>> the link drops.
>> Next I want them to log dialup stats like number & duration of phone calls,
>> total MB upload/download etc.
>> Hope that is some help, but still keen to see a direct test on whether
>> link is really connected.
>> Brian
>> ------------------------------------------------------------------
>> Brian Martin, brian@xxxxxxxxxxxxxxxxxxxxx, martinbj@xxxxxxxxxxxxxx
>> Future Software Pty Ltd, Sydney, Australia.
>> --
>> SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
>> More Info: http://lists.slug.org.au/listinfo/slug
Brian Martin, brian@xxxxxxxxxxxxxxxxxxxxx, martinbj@xxxxxxxxxxxxxx
Future Software Pty Ltd, Sydney, Australia.