19

Is there a utility to forward ports on a simple home networking wireless router from commandline using upnp?

2 Answers2

16

Check out MiniUPNP Project.

Wesley
  • 4,495
3

You can use the miniupnpc library test client.
Use $ upnpc -r PORT PROTOCOL to automatically forward port to your current machine.

Example:

$ upnpc -r 13 TCP

…forwards port 13 to local port 13 when TCP is used.

On correct execution it will print a message like:

external 203.0.113.0:13 TCP is redirected to internal 192.168.1.5:13 (duration=604800)

…where 192.168.1.5 is your LAN IP and 203.0.113.0 you WAN (public Internet) IP.