Would you like to learn how to configure port forwarding using the command line? In this tutorial, we are going to show you how to configure port forwarding on a computer running Windows.

• Windows 2012 R2
• Windows 2016
• Windows 2019
• Windows 2022
• Windows 10
• Windows 11

Equipment list

Here you can find the list of equipment used to create this tutorial.

This link will also show the software list used to create this tutorial.

Windows Related Tutorial:

On this page, we offer quick access to a list of tutorials related to Windows.

Tutorial Windows – Configure port forwarding

As an Administrator, start an elevated command line.

Windows - Elevated command prompt

Redirect the local port 8888 to a remote server on port 80.

Copy to Clipboard

Open a browser and try to access the local port 8888.

Windows - Port forwarding

Redirect any incoming connection on port 9999 to a remote server on port 80.

Copy to Clipboard

Create a firewall rule allowing incoming connections on the TCP port.

Copy to Clipboard

Open a browser and try to access any IP address of the local host on port 9999.

Windows - Port forward TCP port

Verify the TCP port redirections.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Delete a port redirection.

Copy to Clipboard

Reset all port forwarding rules.

Copy to Clipboard

Congratulations! You are able to configure TCP port forwarding on Windows.