looking up ip global IP address from inside LAN

Stoffel, Andrew andrew.stoffel at jenzabar.net
Tue Jul 29 15:55:33 UTC 2003


> From: Justin Holzer [mailto:justin at ptctraining.com]

> Say for example, I have cable modem service, and have several machines
> sharing this connection via a store-bought broadband router. 
> Now say I'm running squeak on one of the networked machines, ie.
192.168.1.1.
> 
> Is it possible for me to get the global IP address of my 
> cable modem, ie 216.109.125.71, without having to send a 
> packet outside of my local network?

Hmmm... it should be possible, if we assume the meaning of local
is physical. Not sure if you can do this in Squeak though...

Since each network interface has its' own IP address, devices on your
 'local' network (LAN) will each have an address (hopefully in the
same subnet :-)). A router on your LAN will have a local IP
address and the other side of it (often called the WAN interface)
attached to your cable modem will have a different IP address 
that it gets from your ISP.

What you want is most likely the WAN address from your router.
Several other methods have been mentioned so here's a third
possibility:

OSProcess + traceroute (or tracert in Windows) (Unless someone has 
written a traceroute utility you can use within Squeak ?)

In theory you should be able to get the address from traceroute
because it SHOULD be the next address following your router's LAN 
address when you use traceroute... [I'm at work so I can't try/verify 
it myself right now...] (And assuming your router isn't blocking ICMP
(the protocol used by traceroute))

The real "trick" is going to be keeping packets within your
network... with traceroute you have to be "aiming" at something
to get it to work. If you can control "hops" in whatever traceroute
utility you are using it might be possible. I don't recall how
'hop counts' are measured - between routers or between network 
interfaces...

HTH

-Andy-	 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030729/5c8b357c/attachment.htm


More information about the Squeak-dev mailing list