FindMyRouter.net was a free web-based tool to help users find their router’s administration web page. Created in 2009, web browsers phased out support for the Java applet technology it relied on between 2013 and 2017.
There are two IP addresses of interest to people setting up their Wi-Fi, the WAN IP address and the LAN IP address.
WAN IP Address
The easy one to find out is your IP address on the Internet (WAN). It’s very easy to create a web page that will provide users with this information, so this feature was not unique to FindMyRouter.net. For example, you can use the Javascript code to create a Cloudflare Worker that will return the user’s IP address as a string:
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
});
/**
* Respond to the request
* @param {Request} request
*/
async function handleRequest(request) {
return res = new Response(request.headers.get('CF-Connecting-IP'),
{
status: 200,
headers: {
'cache-control': 'no-cache, max-age=0',
'Content-Type': 'text/html'
}
});
}
LAN IP Address
Users may want to find their router’s administration web page in order to set up wireless (802.11/Wi-Fi) access, configure forwarding rules, upgrade firmware, or set security features. Depending on the configuration and router model, the router could have been using one of many possible Internet (IP) addresses and port numbers.
Most online help expected users to use the Windows command line and run ipconfig. To make this easier, FindMyRouter.net used a Java applet to find the IP address of the router and to determine the port number.
It’s hard to believe in hindsight, but Java applets running inside a web browser were once able to run command line programs on the host computer, though they at least had to be signed and to prompt the user for permission. FindMyRouter.net relied on running netstat to determine the LAN IP address:
Runtime.getRuntime().exec("netstat -rn");
The applet simply looked for the line of the program output that indicated the default gateway:
if ( line.startsWith("default") || line.startsWith("0.0.0.0"))
and extracted the IP address of the gateway from that line.
Once the applet determined the IP address, it had to determine the port number. To do that, it simply scanned likely port numbers,
int[] ports = { 80, 8080, 88 };
attempting to connect to each one in turn using HTTP:
sock.connect(new InetSocketAddress(InetAddress.getByName(gateway), ports[port]), 1250);
Fortunately, many router manufacturers have since simplified this process, for example by supporting the special hostnames router, routerlogin.net, myrouter.local or mydlinkrouter.local.