Public ip address

Sarah Reichelt sarahr at genesearch.com.au
Sun Jul 25 23:40:37 EDT 2004


> We have to maintain a radio stations network running our automation 
> software,MacBroadcast*, via Timbuktu. To take the control of a distant 
> computer, PC or Macintosh, we have to know the public IP address to 
> connect to that computer and do our job. Since the IP address provided 
> by the ISP is not permanent, I want to write a simple code which once 
> an hour, is able to send us the actual IP public address of every 
> radio station. (Some of them have a fixed IP Address which never 
> change but the cost of this solution is about 20 $ per month.)
> Using solutions like DynDNS which is supposed to translate the IP 
> address to a fixed one is not a secure solution.
> I want to do what www.whatismyip.com is able to do.
> The solutions suggested by this list are just able to return the lan 
> ip address.
>
> Thanks to all of you for your replies
>
> Roger;
>
Are you connecting through a router with a web interface? If so you can 
connect to the router and read the allocated IP address directly from 
it. Here is the script that works for my Netgear RP114 router, with 
tRouter being the address for the router, tName being the login name 
and tPass being my password. You would have to experiment to see the 
page address and exact text format.

   put "http://" & tName & ":" & tPass & "@" & tRouter & 
"/mtenSysStatus.html" into theURL
   put URL theURL into theData
   get lineOffset("IP Address :", theData)
   put line it to it+1 of theData into theData
   put word 1 of line 2 of theData into ipAddr

Cheers,
Sarah



More information about the use-livecode mailing list