Question

I need some code, preferably Java, to locate the IP address of a router on a SOHO-type network. As a bonus, I'd also like to get the make/model of the router along with the firmware version.

I see that HNAP will do the job, UPnP can sort of do it, and that they both depend on SSDP. The problem is that these things seem to be unreliable since they're able to be turned off and/or I'm not sure that all routers will even support this.

How can I definitively get the address? Does the answer lie in DHCP?

If I do get the address, is there any good way to likely get info on the router? HNAP seems like the right choice, but there seems to be very little info and no code out there about HNAP.

Does anyone have any code to do these things?

No correct solution

OTHER TIPS

If your router supports SNMP, then that may be an approach. The system MIB will return basic info on the make/model etc. and there's likely an enterprise MIB that would give you a lot more. How do you find the router initially ? Possibly by interrogating your local routing via SNMP.

SNMP4J is a commonly used SNMP library for Java.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top