Skip to content

ManolescuSebastian/Port_Forward_Android

Repository files navigation

Port_Forward_Android

Port Forward From Android Device on any Internet Gateway Device (Router) that has the UPNP option enabled. First step in opening a port on a IGD si to enable the UPNP option, for this you need to access the router settings and select this option

Application screenshot:

Main Application Activity

   

Main Application Get External IP and IGD Friendly Name

   

Add Port Activity

For own implementation use upnplib-mobile.jar library.

First the IGD (Internet Gateway Device Router) using the following line of code. InternetGatewayDevice[] internetGatewayDevices = InternetGatewayDevice.getDevices(5000);

If the internetGatewayDevices array is > 1 get the first element and use the following methods.

firstIGDEmelent.addPortMapping(description, externalRouterIP, internalPort, externalRouterPort, internalIP, 0, "TCP");
firstIGDElement.addPortMapping(description, externalRouterIP, internalPort, externalRouterPort, internalIP, 0, "UDP");

Both protocols (TPC & UDP) are required.

This library also has the remove implementation with the following methods.

firstIGDEmelent.deletePortMapping(externalIP, port, "TCP");
firstIGDEmelent.deletePortMapping(externalIP, port, "UDP");

Application developement in progress.

About

Port Forward From Android Device on any Internet Gateway Device (Router) that has the UPNP option enabled.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published