UPnP port mapping client for Linux

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.


Use upnpc from MiniUPnP.

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


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


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