Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for some no-brainer commandline tool or script that can be used to forward a given port from the LAN's router (which supports UPNP) to the local machine.


upnpforward 9000

would forward port 9000 to from the router to the local host.

share|improve this question
what exactly are you attempting to do? UPNP is something that should be on an internal network, so there shouldn't be any reason for port forwarding since there is no firewall. What device will the mac connect to with upnp and what is your LAN setup like? – MaQleod Sep 24 '10 at 0:42
@MaQleod, UPnP can be used for setting up a lot of different network devices. A popular category of UPnP-capable devices are home gateway routers, which the UPnP spec calls "Internet Gateway Devices" (IGDs). UPnP's IGD protocols can be used to registering NAT port mappings. – Spiff Sep 24 '10 at 4:31
up vote 3 down vote accepted

Try the MiniUPNP client

Its usage is:

upnpc-static [options] -a ip port external_port protocol
        Add port redirection
upnpc-static [options] -d external_port protocol [port2 protocol2] [...]
        Delete port redirection
upnpc-static [options] -s
        Get Connection status
upnpc-static [options] -l
        List redirections
upnpc-static [options] -r port1 protocol1 [port2 protocol2] [...]
        Add all redirections to the current host
share|improve this answer
This client does not appear to have a Mac port directly available at the link provided. They only suggest going to MacPorts and trying to find one. – James Mar 15 '13 at 6:29
Note that you can now install miniupnpc for UPNP or libnatpmp for NAT-PMP via Homebrew, depending on which your router supports. They give you the upnpc and natpmpc commands, respectively. – tvon Mar 23 '14 at 17:02

If a GUI tool is fine, or you don't mind creating that command line application yourself, have a look at Port Map / TCMPortMapper

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .