For so many of us, networking hardware is a necessary evil. It's great when it works, but once it does, we just want to leave it alone. But if you've ever run into an app or service that requires "port forwarding" and have thrown up your hands in frustration, don't worry. I'm here to show you it's not so scary after all.
The instructions are specifically for AirPort base stations; check out PortForward.com for instructions for a variety of other routers, or consult your router's manual.
This is Macworld senior editor Dan Moren. If you’ve ever set up a network service on your Mac, you may have encountered the arcane term “port forwarding.” Port forwarding lets people outside your local network access a service on one of your home machines by forwarding specific traffic to that machine. Think of it like creating a rule in your Mail client to forward only email from specific senders to a different address.
Technologies do exist to automate port forwarding, but they aren’t always compatible, so it helps to know exactly how to configure the process manually. For this video, I’m going to show you how to forward a port to your Mac using an AirPort base station. (Different types of routers have different interfaces, but the principle remain the same. Portforward.com is a good resource for instructions.)
First things first: Find the port number that you need to forward to. For this example, I’m using an open-source app called MapTool, which lets me play online games with my friends. I know from its server configuration screen that it expects incoming traffic on port 51234.
Launching AirPort Utility, I select my router and click “Edit.” The port forwarding section is listed under the Network tab and labeled Port Settings. To create a new forwarding rule, click the Plus (+) button. The following sheet might look daunting, but it’s fairly straightforward.
For description, enter the name of the service—in this case, MapTool. The public ports are the ports that my friends will enter when they want to access my server. To make things simple, I’m going to use the same port number for the public and private connections, but you could use a different public-facing number if you need to. UDP and TCP are two different types of networking protocol; if in doubt, enter the same information for both.
By default, AirPort Utility fills in the IP address of the machine you’re using as the address of the computer to which you want to forward traffic, but you can enter the IP of any machine on your network. The private port number is the port we looked up at the beginning: 51234.
Once all the data is filled in, hit Update and you’re good to go. Now my friends can access my server at my external IP address and the port number I specified. (To find your external IP address, it’s often quickest to visit a site like whatismyip.com.) To make things even easier, I could use a dynamic DNS setup to replace the external IP address with a more human-friendly domain name—but that’s a tip for another time.