Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jan 2005 00:52:04 +0100
From:      cpghost@cordula.ws
To:        Brian Davis <brian_davis@cox.net>
Cc:        FreeBsdBeni <freebsdbeni@spymac.com>
Subject:   Re: ip address behind router ?
Message-ID:  <20050110235204.GC601@bsdbox.farid-hajji.net>
In-Reply-To: <20050110155202.06ffb1ed.brian_davis@cox.net>
References:  <200501091438.59814.freebsdbeni@spymac.com> <20050110155202.06ffb1ed.brian_davis@cox.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jan 10, 2005 at 03:52:02PM -0600, Brian Davis wrote:
> On Sun, 9 Jan 2005 14:38:56 +0100
> FreeBsdBeni <freebsdbeni@spymac.com> wrote:
> 
> > Hi,
> > 
> > How do I find what ip address I'm really having ? 
> > My adsl modem/firewall gives me a dynamic private address :
> > 192.168.1.101,  which is what I see with an ifconfig. But how do I find
> > the real (dynamic)  address given to my modem by my provider ?
> > I'm using 5.3-rel-p4.
> > -- 
> > Beni.
> > 
> 
> Try the traceroute command. The first IP address will be the
> address of your modem. If I traceroute my ISP this is the output.
> The 1st line contains  the IP address of my cable modem.

That doesn't work well if you use NAT, because traceroute works
only in one direction (forward). With NAT you will see something
like 

1. internal address of your nat box/router (say: 192.168.1.1)
2. address of your NAT box' peer (the ISP router at the other
   end of the ADSL link, not your external address)
3. other addresses.

The problem is that between 1 and 2, you won't see the external
address of your NAT box (the one it got e.g. via DHCP).

If you want to see that address, you'll have to perform the
traceroute 'backwards'. That's what RR-Records in the ICMP
protocol are for.

% ping -R www.freebsd.org
PING www.freebsd.org (216.136.204.117): 56 data bytes
64 bytes from 216.136.204.117: icmp_seq=0 ttl=53 time=235.246 ms
RR:     natbox.yourdomain.tld (a.b.c.d)
        upstream.yourprovider.tld (e.f.g.h)
        ... more addresses here ...

Your external address would be a.b.c.d in the example above.
e.f.g.h would be the 'other side' of your peer (isp) router
(looking to ITS upstream router and away from you). Essentially,
RR records are being seen from the destination (here: www.freebsd.org)
rather than from the source. That's the only way to see the
external address (a.b.c.d) of your NAT box.

Cheers,
-cpghost.

-- 
Cordula's Web. http://www.cordula.ws/



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