Port Forwarding in Windows

Tags: March 18, 2014 6:04 PM

I'm pretty shocked Windows comes with built-in quiet powerful command line tools for port forwarding. The name is netsh. Let say we want to redirect all incoming traffic to IP port 80 to IP port 8080.

prompt> netsh interface portproxy add v4tov4 listenport=80 listenaddress= connectport=8080 connectaddress=
Check the current status of port-forwarding
prompt> netsh interface portproxy show all

Listen on IPv4:             Connect to IPv4:

Address         Port        Address         Port
--------------- ----------  --------------- ----------         80         8080
For <= Windows Server 2003 the TCP/IPv6 must be enabled on the interface to make the port-forwarding works even we did not use IPv6. It weird.


Share on Facebook Twitter


Post a Comment