in reply to Detecting when my ISP changes my IP

I had a similar requirement when my cable ISP switched to DHCP. Once, when the lease on my IP address expired, the system (RH Linux) requested a renewal from the DHCP server. When it was unable to access the server (ISP problems), it completely shut down eth1. Also, when the IP address changes, ntpd stops functioning and has to be restarted. So I wrote the following cron script (keepalive.pl) to stay connected and keep ntpd alive:
#!/usr/bin/perl use strict; my $lastip; if (open IP, '</home/phil/usr/cron/lastip.dat') { $lastip = <IP>; chomp $lastip; close IP } else { print "**keepalive.pl** File 'lastip.dat' cannot be opened to read +: $!" } if (`netstat -i` =~ /eth1.*?inet addr:(\d+\.\d+\.\d+\.\d+)/s) { if ($1 ne $lastip) { print "**keepalive.pl**\n\n".`/etc/init.d/ntpd restart`; if (open IP, '>/home/phil/usr/cron/lastip.dat') { print IP "$1\n"; close IP } else { print "**keepalive.pl** File 'lastip.dat' cannot be opened + to write: $!" } } } else { print "**keepalive.pl**\n\n".`/etc/init.d/network restart` }
The script runs every five minutes. In the event that eth1 has been dropped, it restarts network, then on the next go 'round restarts nptd if the IP has changed. Maybe there will be something of value in there for you.

There's also a companion cron script (ddclient, a free perl script I downloaded) that keeps separate tabs on my IP address and keeps my dyndns entry up-to-date. ddclient uses a remote IP echoing server to obtain the address -- but, of course, fails when eth1 is killed.