Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Jun 2012 15:46:11 +0200
From:      Matthias Apitz <guru@unixarea.de>
To:        freebsd-questions@freebsd.org
Subject:   Re: IP -> e-mail
Message-ID:  <20120606134611.GA2185@tiny>
In-Reply-To: <20431.22651.888125.876852@jerusalem.litteratus.org>
References:  <1338973608.78319.YahooMailNeo@web162906.mail.bf1.yahoo.com> <20120606125125.GA2043@tiny> <20431.22651.888125.876852@jerusalem.litteratus.org>

next in thread | previous in thread | raw e-mail | index | archive | help
El día Wednesday, June 06, 2012 a las 09:17:47AM -0400, Robert Huff escribió:

> >  Run this in a cronjob:
> >  
> >  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; 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 :-))

Trust me, the above lynx is the nearly only robust version.

	matthias
-- 
Matthias Apitz
e <guru@unixarea.de> - w http://www.unixarea.de/
UNIX since V7 on PDP-11, UNIX on mainframe since ESER 1055 (IBM /370)
UNIX on x86 since SVR4.2 UnixWare 2.1.2, FreeBSD since 2.2.5



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120606134611.GA2185>