Windows netsh command

Netsh is a command-line scripting utility that allows you to display or modify the network configuration of a computer that is currently running.

Port proxies

List port proxies

Show currently configured port proxies.

netsh interface portproxy show v4tov4

Adding a port forward port proxy

The below example will start a listerner on the localhost and forward all traffic to the connectaddress and port.

netsh interface portproxy add v4tov4 listenport=443 listenaddress=0.0.0.0 connectport=443 connectaddress=192.168.99.16

Deleting a port proxy

netsh interface portproxy delete v4tov4 listenport=5985 listenaddress=192.168.250.10

Cleaning up and reverting changes

netsh interface portproxy reset

Adding firewall rule

netsh advfirewall firewall add rule name=fwd_80 dir=in action=allow protocol=TCP localport=80

References

Last updated