Applications for port forwarding using UPnP

Post Reply
User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

Applications for port forwarding using UPnP

by Calinou » Post

Note that your router needs to have UPnP enabled.

UPnP-PortMapper

UPnP-PortMapper is a Java application which makes port forwarding easy. It works on Windows, OS X, Linux and *BSDs.

Note that your router must support UPnP and it must be enabled. On most routers, it is enabled by default.

Download link: here

Download it then run it with Java (right click > Open With > Java). On Linux, make sure it is executable -- if it is not, then type this after using the "cd" command to go to the folder where you placed the .jar file:

Code: Select all

chmod -v +x PortMapper-1.9.5.jar
upnpc

upnpc is a command-line tool for Linux and Windows. It can be found in distributions' repositories (at least for Debian/Ubuntu, probably other distributions too).

Download link for Windows: here

On Linux, just install it using your package manager.

Instructions:

Add port forwarding:

Code: Select all

upnpc -a <INTERNAL IP> 30000 30000 UDP
(you can see your internal IP with "ifconfig" on Linux, "ipconfig" on Windows)

List active port forwardings:

Code: Select all

upnpc -l
Remove a port forwarding:

Code: Select all

upnpc -d 30000 UDP
Last edited by Calinou on Tue Feb 26, 2013 20:56, edited 1 time in total.

User avatar
xyz
Member
Posts: 450
Joined: Thu Nov 10, 2011 14:25

by xyz » Post

The same can be achieved by entering this command:

Code: Select all

upnpc -a 192.168.1.26 30000 30000 UDP
without java or any other bloated shit.

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

by Calinou » Post

xyz wrote:The same can be achieved by entering this command:

Code: Select all

upnpc -a 192.168.1.26 30000 30000 UDP
without java or any other bloated shit.
Works too, but that's Linux-only (edit: nope, nevermind). Added to the topic, though.
Last edited by Calinou on Sat Jan 26, 2013 21:31, edited 1 time in total.

tux_peng
Member
Posts: 99
Joined: Thu Dec 06, 2012 18:21

by tux_peng » Post

It is better to do port forwarding in your router, and not deal with uPnp; but this is nice...
Servers now up (Economy, no PvP) Forum up already! http://tuxcraft.info

User avatar
InfinityProject
Member
Posts: 1009
Joined: Sat Mar 17, 2012 00:52
Location: World of Infinity, US

by InfinityProject » Post

Using UPnP-PortMapper, I got this error:

Code: Select all

Could not add port mapping: Detailed error code:402, Detailed error description :InvalidArgs
I followed the instructions exactly like you said.
I run windows 7.

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

by Calinou » Post

InfinityProject wrote:Using UPnP-PortMapper, I got this error:

Code: Select all

Could not add port mapping: Detailed error code:402, Detailed error description :InvalidArgs
I followed the instructions exactly like you said.
I run windows 7.
"InvalidArgs"... maybe some argument in your port forwarding preset was empty or invalid (eg. a word instead of a number as port). Or your router doesn't have UPnP enabled.

User avatar
RabbiBob
Member
Posts: 335
Joined: Sat Jan 28, 2012 22:40
Location: /teleport 54,47,28
Contact:

by RabbiBob » Post

tux_peng wrote:It is better to do port forwarding in your router, and not deal with uPnp; but this is nice...
For the security conscious, see show 389 of Security Now. Within the first 3:30 I was aghast at the number of vulnerable routers out there.

http://www.grc.com/securitynow.htm <- mp3 download available
http://twit.tv/show/security-now/389

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

by Calinou » Post

RabbiBob wrote:http://www.grc.com/securitynow.htm <- mp3 download available
>security
>mp3

It's not possible for someone from the Internet to port forward unless you've got some malicious software on your machine. And as always... crackers have better things to do.
Last edited by Calinou on Sat Feb 02, 2013 17:58, edited 1 time in total.

User avatar
RabbiBob
Member
Posts: 335
Joined: Sat Jan 28, 2012 22:40
Location: /teleport 54,47,28
Contact:

by RabbiBob » Post

Calinou wrote:
RabbiBob wrote:http://www.grc.com/securitynow.htm <- mp3 download available
>security
>mp3

It's not possible for someone from the Internet to port forward unless you've got some malicious software on your machine. And as always... crackers have better things to do.
Port forwarding isn't the issue, it's a vulnerability in the uPNP protocol that allows the device to be compromised. H.D. Moore has a paper out on it last Tuesday outlining the issue and how many devices were found to be open to the issue during a five month scan of the Internet:

https://community.rapid7.com/community/ ... -dont-play

We've known for a couple of years how much upnp swiss cheese's a router, but not to this extent until last week.

Post Reply

Who is online

Users browsing this forum: No registered users and 35 guests