Q: looking up ip global IP address from inside LAN

Stephen Pair stephen at pairhome.net
Tue Jul 29 14:57:52 UTC 2003


Randal L. Schwartz wrote:

>>>>>>"Justin" == Justin Holzer <justin at ptctraining.com> writes:
>>>>>>            
>>>>>>
>
>Justin> Say for example, I have cable modem service, and have several
>Justin> machines sharing this connection via a store-bought broadband
>Justin> router. Now say I'm running squeak on one of the networked
>Justin> machines, ie. 192.168.1.1.
>
>Justin> Is it possible for me to get the global IP address of my cable
>Justin> modem, ie 216.109.125.71, without having to send a packet
>Justin> outside of my local network?
>
>Well, without that final restriction, there are hosts out there
>(something like my-ip-is.com, but I can't remember the name) that will
>give you back a web page that contains your "public" IP in a fairly
>extractable fashion.
>

Your router will have that information...most routers support a 
mechanism for retrieving your external IP address.  It would be nice to 
extend NetNameResolver to support a method like 
#getExternalIpAddress...you could support multiple 
ExternalIpAddresResolver's that use different mechanisms to fetch the ip 
address (i.e. hitting a web page, talking to a router, etc).  Something 
on a public webserver (perhaps operated by someone in the Squeak 
community) could be the last ditch place to get the external IP 
address.  Sounds like a fun little project.

- Stephen



More information about the Squeak-dev mailing list