"Mike" <(E-Mail Removed)> hath wroth:
>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.
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
(E-Mail Removed)
Name My home router
RO Community public
RW Community private <- change this !!!
The community names are actually passwords and should be kept secret.
Save settings.
Download and uncompress the Microsoft NETUTIL.EXE binary. This is an
all in one SNMP query program that originally came with Windoze NT
Resource kit. See:
http://www.wtcs.org/snmp4tpc/testing.htm
Copy NETUTIL.EXE to the c:\windows\system32\ directory.
Run:
snmputil walk 192.168.1.1 public .1.3.6.1.2.1.3.1.1.3.1.1
Variable = at.atTable.atEntry.atNetAddress.1.1.63.249.85.1
Value = IpAddress 63.249.85.1 <---- my router IP
Variable = at.atTable.atEntry.atNetAddress.1.1.192.168.1.11
Value = IpAddress 192.168.1.11 <---- my desktop IP
Variable = at.atTable.atEntry.atNetAddress.1.1.192.168.1.105
Value = IpAddress 192.168.1.105 <---- the neighbors via wi-fi
Variable = at.atTable.atEntry.atNetAddress.1.1.192.168.1.111
Value = IpAddress 192.168.1.111 <---- My PDA phone
(etc...)
End of MIB subtree.
This will show the router IP address and all the connected IP
addresses, on all ports.
For entertainment value, run:
snmputil walk 192.168.1.1 public .1.3
and you'll get all the various SNMP OID's (variables) that are
available. It's quite a long list.
SNMP v2 is somewhat of a security risk. The community names (i.e.
passwords) are sent unencrypted. The router is set by default to NOT
accept SNMP queries from the internet port, so this is only a problem
if you plan to run SNMP queries over the internet.
--
Jeff Liebermann
(E-Mail Removed)
150 Felker St #D
http://www.LearnByDestroying.com
Santa Cruz CA 95060
http://802.11junk.com
Skype: JeffLiebermann AE6KS 831-336-2558