Skip to content

Instantly share code, notes, and snippets.

@nmiglio
Last active October 30, 2020 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmiglio/d2fd2d6b51c98fdcd321fd5836723129 to your computer and use it in GitHub Desktop.
Save nmiglio/d2fd2d6b51c98fdcd321fd5836723129 to your computer and use it in GitHub Desktop.
Set up port forwarding (TCP) on win10
To port forward 127.0.0.1:3340 to 192.168.0.10:80 in Windows 10:
Launch an Administrator Command Prompt.
netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=3340 connectaddress=192.168.0.10 connectport=80
Check that the port is not already used:
netstat -na|find "3340"
To display a list of all active TCP port forwarding rules on Windows, run the command:
netsh interface portproxy show all
To remove a specific port forwarding rule:
netsh interface portproxy delete v4tov4 listenport=3340 listenaddress=10.1.1.110
This forwarding scheme works only for TCP ports. You won’t be able to forward UDP ports this way.
Also you can’t use the loopback interface 127.0.0.1 as the connectaddress.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment