Matthias Apitz <[email protected]> opined: > El dia Wednesday, June 06, 2012 a las 09:17:47AM -0400, Robert Huff escribio: > > Matthias Apitz <[email protected]> opined: > > > > > > lynx -dump myip.nl | fgrep 'WAN IP' > > > > > > strore the result in a file and when it changes, trigger a mail; > > > > Or, using only tools in the base system: > > > > ifconfig | head | grep "inet " | awk '{print $2}' > > This will not work if your host has some private addr which is NAT'ed by a > router;
FALSE TO FACT. Given the OP's actual request. > the real test is ask some remote side "how I do apear to you?" > ofc you could do this as well by SSH'ing to some side and asking with > netstat(1) there (which may be shows another NAT'ed addr too :-)) Matthias, your lynx-based 'solution' does *NOT* solve the OP's question. He wants to know -when- his DHCP assigned address changes. Consider what happens if both the expired address and the new address are behind the _same_ NAT translation. The internal addrress changes, but the external one does not. To do what the OP _asked_, parsing the 'ifconfig' output *is* the correct approach. _IF_, on the other hand, he wants to know when the 'externally visible' address (a _very_ different question) for that host changes, then your approach is the correct one. _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[email protected]"
