offbynull / portmapper

Java library that maps ports on NAT-enabled routers (supported protocols: UPnP-IGD/NAT-PMP/PCP).
Apache License 2.0
88 stars 17 forks source link

Test on Android #5

Closed offbynull closed 8 years ago

offbynull commented 9 years ago

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

offbynull commented 9 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.

offbynull commented 8 years ago

ping -6 for windows IPv6

offbynull commented 8 years ago

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.

offbynull commented 8 years ago

Switched VM's network interface from NAT to Bridged and my phone was able to ping miniupnpd on the VM. All mappers detected.