Thursday, October 24, 2019

Windows: Port forwarding setup

On Windows, you can configure the forwarding of network ports using the netsh utility and its interface portproxy context. Commands must be run with elevated privileges.

Add port:

netsh interface portproxy add v4tov4 listenaddress=local_address listenport=local_port connectaddress=dest_address connectport=dest_port

where local_address - ip address or name of the local host to listen on;
local_port - port of the local host to listen on;
dest_address - ip address or host name to which packets will be redirected;
dest_port - host port to which packets will be redirected.

Edit port settings:

netsh interface portproxy set v4tov4 listenaddress=local_address listenport=local_port connectaddress=dest_address connectport=dest_port

Delete port:

netsh interface portproxy delete v4tov4 listenaddress=local_address listenport=local_port

Clear all port forwarding rules completely:

netsh interface portproxy reset

Show all current port forwarding rules:

netsh interface portproxy show all


No comments:

Post a Comment