ssh upnp

First, see if your router supports upnp
upnpc -l

You should see something like

upnpc : miniupnpc library test client. (c) 2005-2014 Thomas Bernard
Go to http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
for more information.
List of UPNP devices found on the network :
 desc: http://192.168.0.1:5000/rootDesc.xml
 st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

On the target machine, open an imcomming path 

upnpc -a 192.168.0.10 22 3333 tcp

a new list will show

...
...
 3 TCP  3333->192.168.0.10:22    'libminiupnpc' '' 0

When done, delete the mapping with 

upnpc -d 3333 TCP

Here's a handy one-liner

upnpc -a `ifconfig eno1 | grep "inet addr" | cut -d : -f 2 | cut -d " " -f 1` 22 2222 TCP



Comments