There is a built-in ability in Microsoft Windows to set up network ports forwarding. Due to it, any incoming TCP connection (IPv4 or IPv6) to local port can be redirected to another local port or even to port on the remote computer. And it is not necessary for system to have a service that listens to this port.

Port forwarding in Windows can be configured using Portproxy mode of the command Netsh. The syntax of this command is as follows:

netsh interface portproxy add v4tov4 listenaddress=localaddress listenport=localport connectaddress=destaddress connectport=destport


  • listenaddress – is a local IP address waiting for a connection.
  • listenport – local listening TCP port (the connection is waited on it).
  • connectaddress – is a local or remote IP address (or DNS name) to which the incoming connection will be redirected.
  • connectport – is a TCP port to which the connection from listenport is forwarded to.

Let’s imagine that our task is to make the RDP service to respond on a non-standard port, for example 3340 (the port can be changed in the settings of the service, but we will use RDP to make it easier to demonstrate forwarding). To do this, you need to redirect incoming traffic from TCP port 3340 to another local port – 3389 (standard rdp port).

Start the command prompt as an administrator and perform the following command:

netsh int portproxy add v4tov4 listenport=3340 listenaddress= connectport=3389 connectaddress=

Below example enables your PC to forward all packets from any clients on 15000 to

netsh int portproxy add v4tov4 listenport=15000 listenaddress= connectport=15000 connectaddress=

Once you run "netsh", server will permanently remember the configuration as long as you do not delete it.

Show all list of portproxy in NetSh

netsh int portproxy show all

You will be able to see the list like below

Reset all the settings in portproxy in NetSh

netsh int portproxy reset all

Other reference associated with NetSh