[Ddclient-support] wrong ip address picked up from firewall/router
Brought to you by:
supersandro2000,
wimpunk
From: Mike S. <v....@sc...> - 2013-07-20 07:18:23
|
Hi; I've recently started using ddclient (3.8.1). I'm fetching the WAN ip address from my router, a netgear dg834g. It's been running for a couple of weeks or so, but I noticed a hiccup today: the system log contained: Jul 19 14:42:41 data ddclient[71264]: SUCCESS: updating XXXXXXXXXX.dnsd.info: good: IP address set to 192.168.1.254 Jul 19 14:42:43 data ddclient[71264]: SUCCESS: updating XXXXXXXXXX.no-ip.info: good: IP address set to 192.168.1.254 showing the domain name being pointed at the router's private LAN address. This I'm guessing is down to a timing glitch - it seems the lease on that address expired, and a new address was allocated by the dhcp server. A minute later, ddclient picks up a proper WAN ip address. Both LAN and WAN addresses are normally on the netgear's status page; presumably while the dhcp negotiation is in progress, the layout changes just a bit and fools ddclient. I've put a nasty hack in for the moment into the end of subroutine get_ip that checks for my local LAN addresses and returns undef if so set. At least it stops needless updates to clearly wrong values. It might be better if ddclient recognised this situation and checked more often until a valid address was found, as well as maybe parsing the status page a bit more accurately. # Mike's patch 29 Jul 2013. # LAN address confused with WAN if fw is in middle of update. # Should add full list, but hey....... if( define($ip,'') =~ /^192\.168\./ ) { warning("fw returned local ip address -- ignored %s.", $ip); $ip = undef; } ######### debug("get_ip: using %s, %s reports %s", $use, $arg, define($ip, "<undefined>")); return $ip; } Unfortunately, there's no easy way to test this |