If a visitor asks for door 22 on Daisy Lane, the gatekeeper (representing NAT on the router) won’t know which house to send them to. To continue the house analogy, imagine that the outside world could only send visitors to Daisy Lane, not specific houses within the neighborhood. The trouble with NAT is that it provides different addresses internally and externally. If port 22, used for the SSH remote access protocol, is listening, imagine that door 22 on 1234 Daisy Lane is unlocked. You can think of ports like doors to a house: your computer is at 1234 Daisy Lane and it has about 65,000 doors. So, let’s use a little allegory to explain how port forwarding works. To fully understand it, you should also know that, thanks to NAT (Network access translation), all the internal devices share the same external IP address. The others can be assigned to the devices or applications of your choice, and this process is called port forwarding. In total, there are more than 65,000 different ports, but only about 1,000 are used regularly. Each service has its own port - for example, email servers usually use port 587 while websites use port 80. Using ports lets a device run a myriad of different processes and services. Ports are how computers distinguish between multiple services listening on one computer.
If you fail to secure a remote desktop connection, for example, someone could log into your computer from afar. Port forwarding solves all kinds of problems, but it can also be dangerous. This allows you (or someone else) to access something on your computer from the internet. Whether you’re making a Minecraft game accessible to your friends or hosting a small website, port forwarding is a useful way to access software running on your computer remotely.Įssentially, port forwarding maps an external “port” on your internet-facing IP address to a particular computer on your local private network. Without port forwarding, only devices that are part of the internal network can access each other, and with port forwarding, anyone can. Port forwarding, or port mapping, allows remote servers and devices on the internet to access the devices that are within your private local-area network (LAN) and vice versa.