Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Jun 2012 16:23:33 +0200
From:      Matthias Apitz <guru@unixarea.de>
To:        freebsd-questions@freebsd.org
Subject:   Re: IP -> e-mail
Message-ID:  <20120606142332.GB2264@tiny>
In-Reply-To: <201206061411.q56EB2sf030101@mail.r-bonomi.com>
References:  <20120606134611.GA2185@tiny> <201206061411.q56EB2sf030101@mail.r-bonomi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
El día Wednesday, June 06, 2012 a las 09:11:02AM -0500, Robert Bonomi escribió:

> 
> Matthias Apitz <guru@unixarea.de> opined:
> > El dia Wednesday, June 06, 2012 a las 09:17:47AM -0400, Robert Huff escribio:
> > > Matthias Apitz <guru@unixarea.de> 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 OP request is a bit uncertain and I interpreted it as he wants to
know how to 'phone' home. The OP talks about a cable modem and DHCP and
about the addr for the computer. If your computer is connected to the
'modem' by ethernet or Wifi and the IP is assigned by DHCP to the modem,
you will never see any change in your computer. It just stays for ever,
for example, 192.168.2.1 while the router has 192.168.2.2 and all this
network is NAT behind the router WAN IP. In this szenario your ifconfig
solution will not help.

May be the OP should clarify his situation and what he really wants.

	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?20120606142332.GB2264>