Retrieving WAN IP address directly from a Linksys WRT64G Broadband Router

I was browsing groups earlier this week and noticed lots of folks wanting to retrieve their broadband router's WAN IP address without relying on an internet site.

Here's a VBScript that will do it from within Windows. It can be easily tweaked for other broadband routers.


Dr. C. ____________________________________________________________________ SCRIPT: '============================================================ ' *Retrieve WAN IP* (c)2006 F.M. Covington, Lancanyon Labs '============================================================ 'This script retrieves the WAN IP address directly from a Linksys WRT64G broadband router. 'Replace default internal router IP address and password as necessary. '============================================================ Set xml = CreateObject("Microsoft.XMLHTTP") xml.Open "GET", "", True, "UserName","admin" xml.Send wscript.sleep 1500 x=15 IP = mid(xml.responsetext,instr(xml.responsetext,"var wan_ip = ")+14,x) do while instr(IP,"""") x=x-1 IP=mid(IP,1,x) loop wscript.echo "Current IP Address: "&vbcrlf& IP '=============================================================

Reply to
Loading thread data ...

"Mike" hath wroth:

I think you mean WRT54G in the Subject: line. Very nice VBS "scraper". Mind if I "borrow" it?

Here's how to do roughly the same thing with SNMP and WRT54G with DD-WRT v23 SP2.

In the WRT54G, enable SNMP under Administration -> Services -> SNMP Save settings.

Fill in the fields. These are mine: SNMP [x] Enable Disable Location Fort Fungus Contact Name My home router RO Community public RW Community private

Reply to
Jeff Liebermann

Jeff Liebermann hath wroth:

Reply to
Jeff Liebermann Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.