Showing posts with label UPnP. Show all posts
Showing posts with label UPnP. Show all posts

Saturday, September 26, 2015

How to port forward in asus router RT N14UHP

We will do something fun today. But you will need a router which has the feature universal plug and play  . In this article, I will use Asus router RT N14UHP for this demo.

Login to your router and locate the UPnP setting. Go to WAN then on the basic config, click yes for Enable UPnP. See screenshot below.

Next, get this script from github. See command line below which I have experience myself.

 user@localhost:~$ wget  
 --2015-09-04 02:53:28--  
 Resolving (  
 Connecting to (||:443... connected.  
 HTTP request sent, awaiting response... 200 OK  
 Length: 9115 (8.9K) [text/plain]  
 Saving to: ‘’                 100%[=======================================================================================================>]  8.90K --.-KB/s  in 0s     
 2015-09-04 02:53:29 (46.3 MB/s) - ‘’ saved [9115/9115]  
 user@localhost:~$ chmod 755   
 user@localhost:~$ ./   
 Found 1 UPnP routers:  
 No external port specified.  
 user@localhost:~$ ./ -e 1337 -v -r -l 9999 -d 'forward 1337 to 9999'   
 Discovering routers...  
 Found 1 UPnP routers:  
 port forward on successful, 1337->  
 user@localhost:~$ nc -l 9999  

As you can read above, the script is downloaded and then permission is set accordingly. Noticed that UPnP is found on my router on port 42917. Then you can instruct the router to port forward, in this example port 1337 to an internal of this machine. In this example, my local ip is and the application is running on port 9999. Now, to simulate this work, you can use command nc to listen on port 9999.

To test if this work, just get your public ip and telnet to your router on port 1337, your router should forward this traffic to internal machine port 9999. As you can also see above, when telnet is done, nc port listen is also closed. That's it. Have fun port forwarding!