Port Forwarding
You may have seen the term “port forwarding” quite a bit if you have ever tried to set up remote connection or any other web service on your computer. Port forwarding is an essential piece of the remote connection puzzle and it needs to be set up correctly in your environment in order for you to be able to connect from outside your local network.
Understanding Ports
Ports, in a nutshell, are how computers determine which service will respond to certain requests. This is best explained with an example rather than technical talk, so consider this:
A web server often does more than respond to web browsers, they typically handle sending and receiving email as well. But how does the server know if the request it receives is for a web page or an email? It knows by the port which the traffic is requesting a connection to. Take a look at this chart of a few common ports:
| Port Number | Service |
|---|---|
| 80 | HTTP (web server) |
| 20 & 21 | FTP |
| 25 | SMTP (email server) |
| 110 | POP server |
So when you type http://www.pcmech.com into your browser, you are sending a request to the PC Mech server on port 80, thus handled by the web server. Conversely if you were to send an email to the same server, the request would be on port 25 and handled by the SMTP server.
The point of this explanation is so you understand that when you are connecting to your computer remotely, your computer is acting as a server. Additionally, the remote connection client you are using is sending a request to your computer on a specific port. The process works exactly the same as our web and email server example above. This said, here are the default port numbers for the methods explained in this article:
| Port Number | Service |
|---|---|
| 3389 | Windows Terminal Services (TS) |
| 5900 | Virtual Network Computing (VNC) |
Now, let’s put this information to use for setting up remote connection.
Configuring Port Forwarding
You probably have a router on your home computer network, either in the form of a device you bought (Linksys, Netgear and D-Link are common brands) or a DSL/Cable Modem. Most of these devices act as a firewall to filter and protect you from “garbage” traffic. So when we try to remote connect to our computer through VNC (port 5900), this request hits our router and, by default, is perceived as garbage and discarded because we do not have our router configured to accept this request. In order to remedy this, we have to “open” the port and then forward it to the computer we want to handle the request. This process is called port forwarding.
Before we set up our router, we need to get the local IP of the machine you want to remote connect to. We need this so we can tell your router which local computer will handle the remote connection request. The way we find this information depends on your operating system:
Finally, we need to configure the router to forward a port request. This is done on our router’s configuration page. In my article I will be using a Linksys router, so understand your screens may look different. Check your router documentation or the manufacturer’s website for more information.
Once you have completed the above, your local environment should be properly configured and you are now all set for remote connection!
The PCMech.com weekly newsletter has been running strong for over 8 years. Sign up to get tech news, updates and exclusive content - right in your inbox. Also get (several) free gifts.



Great artical only one thing wrong can’t see any of the images.
Great job. Keep up the good work.
It this also included in your book on “build your own network”?
Thanx
Another remote access tool to take a look at is I’m InTouch – http://www.imintouch.net – that costs about half the price of GoToMyPC. It also has a neat feature of letting you access your outlook email and transfer files from almost any mobile phone.
how to make a remote desktop connection in linux?