14

Is there any client that can request mapping and unmapping ports via UPnP port mapping behind a NAT gateway? I had problem with PortMap. I want this mostly for testing purposes.

Atilla Filiz
  • 1,226

3 Answers3

14

Use upnpc from MiniUPnP.

For gateways supporting the NAT-PMP protocol, natpmpc is available from the same site.

grawity
  • 501,077
11

Complementing @user1686 answer. This is how you can do it on Ubuntu, Mint and all Debian based distros:

# Install upnpc command line
sudo apt install -y miniupnpc

Get network ip address (typically started with 192)

export IP=$(hostname -I | tr " " "\n" | grep 192)

External port 2222 forwarded to internal port 22

upnpc -e "upnpc test" -a $IP 22 2222 TCP

Delete

upnpc -d 2222 TCP

Eduardo
  • 423
4

I found upnp-router-control that make it possible to do it with a beautiful GUI interface.

eloyesp
  • 563