ip address behind router ?

cpghost at cordula.ws cpghost at cordula.ws
Sun Jan 9 09:02:26 PST 2005


On Sun, Jan 09, 2005 at 02:38:56PM +0100, FreeBsdBeni 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 ?

That's not as easy as it sounds, esp. if you're using NAT on the router.
The config is basically this:


+-----------+ 192.168.1.101       +--------+ A.B.C.D 
| Your_Host |---------------------| Router |--------//-+
+-----------+         192.168.1.1 +--------+           |
                                                       |
                                                       | E.F.G.H
                                                 +------------+
                                                 | ISP Router | 
                                                 +------------+ 


So basically, Your_Host has no way (and no need) to know A.B.C.D
or E.F.G.H

Now you could try a combination of traceroute(8) and ping(8) to
get that address. For example, try the -R Record Route option to
ping(8):

% ping -R www.freebsd.org

If your Router is configured to honor RR requests, it will list
its A.B.C.D address in the reply, and ping will show it as
the first RR-Record in the list of max. 9 route records that
you can get out of the ICMP protocol spec.

Another way to do this, is to enable a routing daemon on
the router, and use some utility on Your_Host to listen
to the routing updates, or even query those updates with SNMP.
But not every router supports this option. Sometimes, you
can also query the ISP Router directly, but that's also
unreliable, since most ISPs block SNMP requests on the last
mile for security reasons.

You may as well try to get the info from the HTTP config managemnt
interface of your router http://192.168.1.1:80/ or so.

> I'm using 5.3-rel-p4.
> -- 
> Beni.

Cheers,
-cpghost.

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


More information about the freebsd-questions mailing list