Windows OS

How to Do Port Forwarding in Windows

Some applications and video games require particular ports on your network to function correctly. The router has specific ports open by default, but most are closed and may only be utilized if they are explicitly opened. If your file server, online video games, or any other networking applications are not working, use your router and open the ports that the application requires.

What is Port Forwarding in Windows

The technique of capturing data going for one IP address and redirecting it to another IP address is known as port forwarding. The program executing on your Windows operating or changing your computer’s settings can cause this redirection. A mid-way component, such as a firewall or router, helps in the port forwarding process.

Usually, a router observes and stores the header of an IP packet, sends it to the suitable interface that has already been linked, and sends the necessary contents to the header information. Port forwarding also permits the intercepting device or application to read the packet header and then rewrite the header information and send it to another computer after storing the details about the destination.

Port forwarding allows services on a hidden internal network accessed by an external network. It accomplishes this by renaming or remapping the internal host’s destination IP address and port number. It is an excellent approach to keep public IP addresses safe. Port forwarding also hides clients and servers, preventing unauthorized access. It also prevents any unwanted traffic from entering the network. The network administrator utilizes one IP address for all internet communications, while multiple servers with specific IP addresses and ports handle the task internally.

Working of Port Forwarding in Windows

Port forwarding is similar to connecting a pipe from the router to the device that requires the port. There should be a direct connection on both sides, allowing data to flow. For instance, for incoming connections, FTP listens on Port 21. Suppose you want to set up an FTP server and restrict its network access outside your network, open port 21 on your router and forward it to the server machine. This newly created pipe will use the router to transport files from the server to the network to the FTP client.

In other cases, such as video games that require an internet connection to play with other participants, torrent clients that need specific ports to be available for uploading data, and instant messaging software that only send and receive messages through a specific port, are all the same. Each networking application requires a port to perform its operation. If an application or program is not working despite all of the other settings being fine, open the port on your router and send requests to the destination device. It can be another computer, game console, or printer.

Is Port Forwarding Safe?

Before we check out the process of opening ports on your Windows, we will answer how safe port forwarding is. Port forwarding is safe in most cases, but there are few things related to port forwarding which you should keep in mind. Port forwarding is the procedure through which you can forward all ongoing traffic to one of the thousands of digital ports of your operating system to a specified server or device listening to that port on the other side of the connection.

The security of port forwarding depends on the machine or server security. For instance, if you set up port forwarding to hosting an online game, it is important to check if the game or software has any security risks. Like, if you want to set up an online Minecraft server, you will ensure that it is updated and utilizing firewalls.

Now, let’s check how to do port forwarding in Windows:

Port forwarding in Windows using Command Prompt

Most Windows operating systems have a command-line interpreter tool called Command Prompt. It is utilized to execute the commands that have been entered. Most of those commands use batch and script files for performing advanced administrative functions, automate activities and troubleshoot any particular Windows issues.

We need some basic information related to our network to port forwarding, such as IPv4 address, subnet mask, default gateway, etc. The command prompt will help you get this information, So, open it up manually by typing “Command prompt” in the search box and open this application:

Use the below-given command for retrieving the information related to all of your system network interfaces:

> ipconfig /all

The output will show you the information of your network interface. Note your IPv4 Address, Subnet Mask, Default Gateway, and DNS servers because these attributes will be used in port forwarding.

Open up the “Run” dialog box, and then type “ncpa.cpl” to open “Network Connections”:

Select the network on which you want to do port forwarding and open its “Properties”:

The opened dialog box will show you a list of items, choose “Internet Protocol Version 4 (TCP/IPv4)” and open its “Properties”:

Your default settings for TCP/IPv4 will look like this:

Add your IPv4 address, Default Gateway, and Subnet Mask in the highlighted section and click “OK”.

Window Defender Firewall Configuration for Port Forwarding

In this step, you have assigned a static IP Address to your system. Now, move forward to complete open port settings. For that, open up “Window Defender Firewall” by searching it manually:

Click on the “Advanced settings” option, present at the left side of the panel.

Right-click “Inbound rules” and move to the option “New Rule”:

Select “Port” as the type of the rule you want to create and click “Next”:

We will apply this newly created rule to “TCP”. Next, specify the port numbers for forwarding purposes and allow the connection:

Enter the name of your newly created inbound rule and click “Finish”:

This newly created “MTE” rule will appear in the list of “Inbound Rules”:

Note: If you are getting an error, then try enabling port forwarding from router settings. To do so, follow this method:

Step 1: First of all, access your router as an administrator by browsing its IP address. Enter the required credentials such as Username, passwords.

Step 2: Look for the port forwarding options in the settings categories. On router port forwarding settings can be referred as Port range forwarding, Port triggering, Port forwarding, etc. These options are found in the Wireless, Network or Advanced settings.

Step 3: After finding the required section, specify port range or a single port which you want to open for forwarding.

Step 4: Choose TCP as your protocol. You can also select TCP and UDP at the same time, then enter your static IP Address.

Step 5: Save these settings. Now, your router should be configured for the port forwarding at the specified ports!

That was all about the port forwarding procedure on Windows and router. You can test the configured port using various online tools such as Port Forwarding Tester, PortChecker, Open Port Check Tool,

Network Port Checker and Scanner Tool, Port Check tool.


Port forwarding in Windows is required to utilize various applications and games fully. Incoming and outgoing data traffic between your remote servers and home network can be routed via port forwarding. This permits data to be sent over particular port. This article has discussed port forwarding, how safe it is, and how you can do port forwarding in Windows. We have also provided you some online tools to test your ports whether they are open or not.

About the author

Talha Saif Malik

Talha is a contributor at Linux Hint with a vision to bring value and do useful things for the world. He loves to read, write and speak about Linux, Data, Computers and Technology.