Closed offbynull closed 8 years ago
You can run the executable ping/ping6 from Java to do a traceroute-like request.
On linux/android, ping -c 1 -t
On windows, ping -n 1 -i
For two domains (e.g. microsoft.com and google.com), starting from ttl value 1, increment ttl value until the result of ping commands comes back with different IPs as respondents.
These IPs are the ones that may take in requests for UPnP/NATPMP/PCP.
ping -6 for windows IPv6
Test on Android work -- mostly. Still need to test with a UPnP-IGD device, but NAT-PMP and PCP servers on Apple router were detected.
Switched VM's network interface from NAT to Bridged and my phone was able to ping miniupnpd on the VM. All mappers detected.
Cannot do commandline query for internet gateway device on android. Find another way.
http://developer.android.com/reference/android/net/DhcpInfo.html#gateway <-- does not support IPv6