Macos – Automatically allowing SSH into a Mac behind a UPNP router

macosport-forwardingsshupnp

I have a MacBook connecting to the Internet from behind various routers from time to time. All of the routers support UPNP.

I need to allow a co-worker to SSH into the machine, without configuring each router each time to forward port 22 to the MacBook.

Is there any way to get the MacBook to use UPNP (or some other method) to automatically configure any supporting router that it is behind to forward port 22 to itself? That would allow the co-worker to SSH into the MacBook but just knowing its external IP, which is easy using dyndns.

Best Answer

Check out MiniUPnP. It is a simple command-line UPnP client. It supports all of the major platforms and has a pretty simple interface. It should be pretty simple for you to just execute a quick command anytime you need to open up a port using this tool.

Related Question