Port Forwarding in Windows and Ways to Set it Up

Learn how to set up port forwarding in Windows for remote access or to host servers. Follow our guide to enable and configure it on your device now.

Updated: 27 Jun, 23 by Susith Nonis 9 Min

List of content you will read in this article:

Port forwarding is one of the fundamental techniques used to enhance the security and functionality of networks. It involves configuring a network router to forward incoming traffic from specific ports to a designated device on the network. Setting up port forwarding in a Windows environment can be challenging, especially for people with limited technical expertise. However, with the right knowledge and tools, anyone can set up port forwarding quickly. In this guide, we will explore the steps involved in setting up port forwarding in Windows, including the tools and techniques you need to get the job done.

Port forwarding is an essential networking technique that allows computers and other devices on a network to communicate with the internet. It is a necessary process for accessing devices, services, or programs that require access to the internet from outside a local network. Port forwarding works by routing network traffic from a specific port on the outside of a network to a specific port on the inside. By default, network routers are designed to block incoming traffic from the internet, which can cause issues with servers, gaming consoles, and other network devices.

When a user initiates a connection to a device on a network, the router receives the request and forwards it to the intended device. However, without port forwarding, the router does not know which device needs to receive the traffic, causing the connection to fail. Therefore, port forwarding is vital in allowing certain services, devices, and applications to function correctly and access the internet outside a local network.

Port forwarding works by redirecting incoming traffic from a specific port outside a network to a specific device or service inside the network. The process involves configuring the router to forward specific ports to particular devices or services on the network. When a connection request is made from an external network, the router receives the request and identifies the specific port number in the request. Then, the router checks its port forwarding rules to determine which device or service is designated to receive the request. If a rule is found, the router forwards the incoming traffic to the designated device or service based on the port forwarding configuration.

Port forwarding can be complicated, but it can be done quickly and easily with the right knowledge and tools. Configuring port forwarding on a router requires knowledge of the router's configuration interface, the specific port numbers required for each service, and the IP addresses of devices on the network that need to be accessed from the internet.

Here is a step-by-step guide on how to use the command prompt for port forwarding in Windows:

Step 1: Open the Command Prompt

Click on the Start menu, type "cmd" in the search field, and press Enter. This will open the Command Prompt window. 

Step 2: Obtain the IP address of the device

Type "ipconfig" in the Command Prompt window and press Enter. Look for the "IPv4 Address" under your network adapter, and note down the IP address. 

Step 3: Create a port forwarding rule 

Type the following command and press Enter: 

"netsh interface portproxy add v4tov4 listenport=8080 listenaddress=192.168.1.10 connectport=8080 connectaddress=192.168.1.10"

Step 4: Verify the port forwarding rule 

Type the following command and press Enter: 

"netsh interface portproxy show all"

This command will display a list of all port forwarding rules currently active on the network. Check if the rule you created is listed. 

Step 5: Close the Command Prompt

Type "exit" and press Enter to close the Command Prompt window. 

That's it! You have successfully used the Command Prompt for port forwarding in Windows.

🎁🎁Experience unmatched performance and reliability with Monovm's Windows VPS, empowering you with the flexibility and control to elevate your business to new heights.🎁🎁

Here is a step-by-step guide on how to configure Windows Firewall for port forwarding:

Step 1: Open Windows Firewall Settings

Click on the Start menu, type "firewall" in the search field, and select "Windows Defender Firewall." 

Step 2: Click on "Advanced Settings"

In the left sidebar, click on "Advanced Settings." 

Step 3: Create an Inbound Rule

In the left sidebar, click "Inbound Rules" and "New Rule" in the right sidebar. 

Step 4: Choose Port Rule

Select "Port" and click "Next." 

Step 5: Configure the Port

Select the type of port you need to configure: TCP or UDP. Enter the port number(s) you want to forward in the "Specific local ports" field. 

Step 6: Choose Action

Select "Allow the connection" and click "Next." 

Step 7: Choose Profiles

Select which profiles the rule should apply to (Domain, Private, Public) and click "Next." 

Step 8: Name and Save the Rule

Give the rule a name and click "Finish." 

Step 9: Verify the Rule

You should be able to see the new rule listed in the Inbound Rules list.

Here is a step-by-step guide on how to port forward with NAT rules on Hyper-V Virtual Switch:

Step 1: Open Hyper-V Manager

Click on the Start menu, type "Hyper-V Manager" in the search field, and select "Hyper-V Manager" from the results.

Step 2: Create a virtual switch

Click "Virtual Switch Manager" in the right sidebar in the Hyper-V Manager window. Click on "New virtual network switch" and choose "Internal" or "Private" as the type of virtual switch.

Step 3: Configure the virtual switch

Name the virtual switch and configure the network adapter settings. Ensure the "Allow management operating system to share this network adapter" option is unchecked.

Step 4: Create a new virtual machine or select an existing one

Right-click on a virtual machine in the Hyper-V Manager window and select "Settings."

Step 5: Add a network adapter

Add a network adapter to the virtual machine by clicking "Add Hardware" and choosing "Network Adapter."

Step 6: Connect to the virtual switch

Select the virtual switch you created in Step 2 in the network adapter settings.

Step 7: Enable the NAT sub-switch

In the Hyper-V Manager window, right-click on the virtual switch you created in Step 2 and select "Properties." Check the "Enable NAT" option and click "OK."

Step 8: Create NAT rules

Open the Command Prompt in the virtual machine by pressing "Windows Key + R" and typing "cmd" in the run dialogue. Enter the following commands to create NAT rules:

"netsh interface portproxy add v4tov4 listenport=80 listenaddress=0.0.0.0 connectport=8080 connectaddress=192.168.1.10"

Replace "80" with the port number to forward and "192.168.1.10" with the device's IP address to forward the port to.

Step 9: Verify the NAT rules

Enter the following command to verify the NAT rules:

"netsh interface portproxy show all"

This will display a list of all the NAT rules that have been created.

Here is a step-by-step guide on managing Netsh port forwarding rules in Windows:

Step 1: Open Command Prompt

Click on the Start menu, type "cmd" in the search field, and select "Command Prompt." 

Step 2: View existing port forwarding rules

Type "netsh interface portproxy show all" and press Enter. This will display a list of all the current port forwarding rules. 

Step 3: Add a port forwarding rule

To add a new port forwarding rule, type:

"netsh interface portproxy add v4tov4 listenport= listenaddress= connectport= connectaddress="

Step 4: Delete a port forwarding rule

To delete an existing port forwarding rule, type:

"netsh interface portproxy delete v4tov4 listenport= listenaddress="

Step 5: Modify an existing port forwarding rule

To modify an existing port forwarding rule, delete the rule and add a new one with the desired changes. 

Step 6: Disable a port forwarding rule

To disable an existing port forwarding rule, type:

"netsh interface portproxy delete v4tov4 listenport= listenaddress=" 

Step 7: Enable a disabled port forwarding rule

To enable a disabled port forwarding rule, add the rule back by typing:

"netsh interface portproxy add v4tov4 listenport= listenaddress= connectport= connectaddress="

  • Port forwarding is a networking technique that enables traffic to pass from a public network to a private network through a firewall or router. This technique can access a home network remotely to host servers.
  • Port forwarding assigns a unique public IP address to every private network device, directing incoming traffic to a specific device rather than being blocked at the firewall.
  • Windows operating systems have built-in tools that enable users to configure port forwarding settings, such as the Windows Firewall and the Internet Connection Sharing (ICS) feature. These tools allow users to create rules that specify which ports should be forwarded and which devices or applications should be allowed to receive inbound traffic.

People also read: 

Susith Nonis

Susith Nonis

I'm fascinated by the IT world and how the 1's and 0's work. While I venture into the world of Technology, I try to share what I know in the simplest way with you. Not a fan of coffee, a travel addict, and a self-accredited 'master chef'.