Understanding Port Forwarding- Beginners Guide (2024)

Understanding Port Forwarding- Beginners Guide (1)What is Port forwarding ? and What Does it do?

Port forwarding is a technique that is used to give external devices access to computers services on private networks.

It does this by mapping an external port on the router to an internal IP address and port.

Most online gaming Applications will require you to configure port forwarding on your home router.

To understand port forwarding you need to understand what a TCP/IP port is and how ports and IP addresses are used together.

You will also need to appreciate the difference between internal and external IP addresses and internal and external ports.

TCP/IP Ports

A TCP/UDP port identifies an application or service on a machine in a TCP/IP network.

On a TCP/IP network every device must have a unique IP address.Understanding Port Forwarding- Beginners Guide (2)

The IP address identifies the device.

However a device can run multiple applications/services.

The port identifies the application/service running on the machine.

The use of ports allow a computer/device to run multiple services/applications.

Standard Port numbers are allocated to server services (0-1023) by the Internet Assigned Numbers Authority (IANA) and are reserved. An an example web servers normally use port 80 and SMTP servers use port 25.

The combination of IP address plus port is known as a socket. See Network Ports Explained

As an example. Imagine sitting on your PC at home, and you have two browser windows open. One looking at the Google website and the other at the Yahoo website.

the connection to Google would be:

Your PC – IP1+port 2020 ——– Google IP2 +port 80 (standard port)

the connection to Yahoo would be:

our PC – IP1+port 2040 ——–Yahoo IP3 +port 80 (standard port)

Notes: IP1 is the IP address of your PC. Client port numbers are dynamically assigned and can be reused once the session is closed.

Returning to Port forwarding..

On home or small office networks the router uses NAT (Network Address Translation) which allows internal devices to share a single external IP4 Address.

The IP addresses on the Internal network are private addresses and are not routable on the Internet.

External computers or devices only see the public IP address that is assigned to the NAT router Interface.Understanding Port Forwarding- Beginners Guide (3)

The NAT router maps an Internal IP address + Internal Port to the external IP address + external port.

External devices send packets to the external IP address and external port.

The NAT router maps those packets and re-transmits those packets on the Internal network to the Internal IP address and internal port.

The ports used by NAT are normally randomly assigned which is OK when the session is initiated from the Internal network.

However if you want, for example, to host a website on your internal network and that website needs to be accessible to external clients then you will need to use a standard port (port 80 for http) as the external client expects this.

To do this you statically map the external IP address + port 80 to the Internal IP address of the web server + port 80. — This is port forwarding.

For home users the most common reason to use port forwarding is gaming.

Enabling Port forwarding and Checking Open Ports

Before you set up port forwarding you ideally will need to configure a static IP address for the Internal device.

This step is important as the forwarding will be set to send packets to a specific internal IP address.

Depending on your Application you may need a list of ports that need to be available from the the external network (i.e. Internet) and forwarded to the internal network.

To configure port forwarding on your router you will need Admin privileges.

This site has a comprehensive guide covering 100s of routers, and also port lists for many of the games/applications.

Regardless of exactly how you configure it, as it varies by device, what you are essentially doing is creating a mapping table that maps an external address and port to an internal address and port.

This video shows how to configure port forwarding on a BT Home Hub.

This video shows you how to set it up on a Linksys router. It also shows you how to set a static IP address for your machine.

Once you have forwarded the ports you may want to check that they are really open using an open port checker.

Connecting to a Forwarded Port

To connect to the forwarded port from the Internet you will need to know the external IP address of the Router and the Port number that has been allocated.

However using an IP address instead of a domain name is not very convenient, in addition the external IP address can change as most ISPs assign these addresses using DHCP.

Therefore when using port forwarding you might also what to consider using Dynamic DNS.

Port Forwarding Example

Below is a screen shot of my home router configuration which shows the ports I’ve forwarded.

Notice my router doesn’t have a field for the external IP address as it isn’t really necessary.

However some do and it is usually then configured to 0.0.0.0 .

Understanding Port Forwarding- Beginners Guide (4)

Checking Open Ports

You can see from the screenshot above that I’ve opened ports 1800 and 1884 and 8884.

I used the online open port check to check those ports and also one that shouldn’t be open and you can see the results below.

Understanding Port Forwarding- Beginners Guide (5)

Note: I’ve hidden my external IP address for security reasons.

Port Triggering

This is a type of dynamic port forwarding were ports are opened by an application, and don’t require prior setup.

The application connects to the designated trigger port on the router which tells the router to open a specific port for inbound traffic.

After the application has finished it closes the ports it opened.

Because the ports aren’t left open it is considered more secure than port forwarding.

UPnP ( Universal Plug and Play)

You may have noticed that your games work OK on the Internet even though you have not configured port forwarding.

This is most probably because the router has UPnP enabled.

Using the UPnP protocol an application can open ports on the router.

The screen shot below is taken from my router and shows a standard port forwarding rule and one setup automatically using UPnP.

Understanding Port Forwarding- Beginners Guide (6)

Using UPnP is considered insecure and to be avoided if possible.

However most routers come with UPnP enabled by default.

Summary

Port forwarding Maps external IP addresses and ports to Internal IP addresses and ports allowing access to internal services from the Internet.

It is configured on home routers and it is necessary because home routers use NAT which isolates the home network from the Internet.

Common Questions and Answers

Q- Is the External IP address mapped to the Internal IP Address?

A- No the external port is mapped, and not the external IP address. the external IP address might change see Dynamic DNS

Q- Should I use a static Internal IP address or can I use addresses assigned by DHCP?

A- You should always use a static one.

Q- Do I need to forward both the TCP and UDP ports?

A- It depends on the application. You need to check which ports the application uses.

Q- How do I know if my device has a static address or a dynamic one?

A- You have to go to the device and examine the settings or look at your DHCP server.

Q- How do I know what port I need to forward?

A- You need to know what port the service you want to use is using.However most home routers will have a list of common games and applications and you just need to select it and it will automatically select the ports.

Understanding Port Forwarding- Beginners Guide (7)

Q- How do I know if I have configured it correctly

A- You can use an online port forwarding checker to check that the ports are open.

Q- What is strict NAT?

A- Microsoft define three levels of NAT- Strict,Moderate and Open. Devices that perform strict or moderate can affect Gamers on Xbox. See this article for help

Q- Does port forwarding affect my home network security?

A- Yes because you are exposing the home network to the Internet meaning that external devices can access internal devices.

Q- I’m using port forwarding should I also use DDNS (dynamic DNS).

A- Almost certainly yes unless if you are using it on a permanent basis.


Related Tutorials:

References:

Please Let me Know if you found it Useful

[Total: 77 Average: 4.5]

Understanding Port Forwarding- Beginners Guide (2024)

FAQs

Understanding Port Forwarding- Beginners Guide? ›

Port forwarding is a map between a router's public IP address and the IP addresses and ports of the services running on a network. It tells your router to relay data that it receives on a specific port to a specific port on a specific private IP address on the network.

How do I learn port forwarding? ›

How to Port Forward
  1. Open a web browser. ...
  2. Then type your router's IP address into the address bar. ...
  3. Next, enter your router's username and password. ...
  4. Then go to the port forwarding settings on your router. ...
  5. Next, create a new port forwarding rule. ...
  6. Then enter a name for the service or application.
Feb 2, 2023

How to port forward for dummies? ›

Working with your Router
  1. Go to System Preferences > Network to find the IP address of your router. ...
  2. Copy the IP address and paste it into a browser window. ...
  3. Navigate to the Port Forwarding section of your router's interface. ...
  4. Some routers will ask you to select the device you want to port forward to.

What is port forwarding explained simply? ›

Port forwarding, also known as port management, allows remote servers and devices on the internet to be able to access devices that are on a private network. If you are not using port forwarding, only devices on that private internal network can have access to each other or your network.

What numbers do I use for port forwarding? ›

Here are a few common ports assigned by the Internet Assigned Numbers Authority standards organization:
  • 20 = File Transfer Protocol (FTP)
  • 21 = File Transfer Protocol (FTP)
  • 22 = Secure Shell (SSH)
  • 25 = Simple Mail Transfer Protocol (SMTP)
  • 53 = Domain Name System (DNS)
  • 80 = Hypertext Transfer Protocol (HTTP)
May 27, 2020

How do I know what ports to forward? ›

You do this by finding the IP address of the computer running your website and setting a rule to forward all traffic on port 80 to that IP address. You can also specify the port you forward the data to. For example, if you run the website on port 8080, you can forward it to that port.

Do I need a static IP address for port forwarding? ›

What generally happens is that the IP address your computer gives you will change, so one day you have an IP of 192.168. 1.100, and the next it might be 192.68. 1.101. Any port forwarding configuration you make on your router needs to be fixed to a certain IP address, so it's important that it doesn't change.

How do I safely set up port forwarding? ›

How to open ports on a router
  1. Access your router's web interface. Navigate to your router's configuration page by typing the router's IP address into your browser.
  2. Log in to your router. ...
  3. Find the port forwarding section. ...
  4. Add a new port forwarding rule. ...
  5. Save the changes.
Jun 19, 2023

What can I do instead of port forwarding? ›

You can either use port forwarding, or you can use a virtual private network, or VPN. While both options will allow you to access the resources you need – servers, network-attached storage devices, or even your router configuration – one is superior to the other.

Do I have to restart the router after port forwarding? ›

If prompted, you'll also need to allow your router to restart in order for the changes to take effect. You may also have to check an "Enabled" or "On" box next to the forwarded port row.

When should you use port forwarding? ›

Port forwarding is useful whenever you need to make a direct connection between a device in your home network and a remote device. For example: Watch a security camera or baby monitor when you're away from home. Connect to your home server remotely.

What is the principle of port forwarding? ›

Port forwarding works on the principles of destination and source IP addresses and port numbers, which essentially identify the receiving and sending ends of data packets, respectively.

What is UPnP in a router? ›

Universal Plug and Play (UPnP) is a network protocol that allows compliant devices to automatically set port forwarding rules for themselves. These devices can be personal computers, printers, security cameras, game consoles or mobile devices that communicate with each other and share data over your network.

What port number am i using? ›

How to find your port number on Windows. Type “Cmd” in the search box. Open “Command Prompt.” Enter the netstat -a command to see your port numbers.

What are the port codes? ›

Port codes are used to identify U.S. Customs and Border Protection (CBP) ports of entry. The entry documents submitted to CBP require these codes. To find a port code, click on the link to the port of entry and then select the state.

How to find the starting port? ›

How to find your port number on Windows
  1. Start your command prompt.
  2. Type ipconfig.
  3. Next type netstat -a for a list of your various port numbers.

How can I learn my port? ›

How to find your port number on Windows
  1. Start your command prompt.
  2. Type ipconfig.
  3. Next type netstat -a for a list of your various port numbers.

How do I setup port forwarding on my computer? ›

Here is a step-by-step guide on how to use the command prompt for port forwarding in Windows:
  1. Step 1: Open the Command Prompt. ...
  2. Step 2: Obtain the IP address of the device. ...
  3. Step 3: Create a port forwarding rule. ...
  4. Step 4: Verify the port forwarding rule. ...
  5. Step 5: Close the Command Prompt.
Jul 31, 2023

How to test port forwarding? ›

We recommend using a reliable port forward tool like www.portchecktool.com. The port forward checker tool is a valuable resource for network troubleshooting. It helps you check whether your ISP (Internet Service Provider) is blocking specific ports, such as the commonly restricted HTTP port 80 and SMTP port 25.

Is port forwarding the same as routing? ›

Routing is sometimes referred to as forwarding, but it's important to note that routing is a different process from forwarding. When routing data, the router takes care of moving the data from one device to another device. When forwarding data, a device collects data from one device and sends it to another.

Top Articles
Latest Posts
Article information

Author: Mr. See Jast

Last Updated:

Views: 6195

Rating: 4.4 / 5 (75 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Mr. See Jast

Birthday: 1999-07-30

Address: 8409 Megan Mountain, New Mathew, MT 44997-8193

Phone: +5023589614038

Job: Chief Executive

Hobby: Leather crafting, Flag Football, Candle making, Flying, Poi, Gunsmithing, Swimming

Introduction: My name is Mr. See Jast, I am a open, jolly, gorgeous, courageous, inexpensive, friendly, homely person who loves writing and wants to share my knowledge and understanding with you.