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 1.2.3.4 port 80 to IP 1.2.3.4 port 8080.
prompt> netsh interface portproxy add v4tov4 listenport=80 listenaddress=1.2.3.4 connectport=8080 connectaddress=1.2.3.4Check the current status of port-forwarding
prompt> netsh interface portproxy show all Listen on IPv4: Connect to IPv4: Address Port Address Port --------------- ---------- --------------- ---------- 1.2.3.4 80 1.2.3.4 8080Note:
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.
0 comments:
Post a Comment