Forward a TCP port with netsh interface portproxy on Windows
Windows ships a hidden TCP port forwarder — bridge a local port to any remote host:port without installing anything.
01Command
$ netsh interface portproxy add v4tov4 listenport=8080 listenaddress=127.0.0.1 connectport=80 connectaddress=10.0.0.502What it does
portproxy makes Windows listen on listenaddress:listenport and relay every connection to connectaddress:connectport — handy for reaching WSL2, a VM, or a legacy service bound to a specific port. The rules persist across reboots and live in the registry, which is also why forgotten ones cause mysterious 'port already in use' errors. If you listen on a non-loopback address, make sure Windows Defender Firewall allows the incoming port, and don't expose internal services accidentally.
03Risk
04Undo
$ netsh interface portproxy delete v4tov4 listenport=8080 listenaddress=127.0.0.105Sources
- Netsh - Windows CMDEvidence: SS64 covers the netsh command contexts, including the interface portproxy context for TCP port forwarding.
- netsh interface portproxy | Microsoft LearnEvidence: Microsoft documents the portproxy add/delete/set/show commands with v4tov4 parameters listenaddress, listenport, connectaddress, connectport.
Last verified: 2026-09-17 · Category: Network
06Related solutions
Purge cached DNS lookups so Windows re-resolves hostnames from scratch — the fix for 'the new server is live but my browser still hits the old one'.
The nuclear option for broken connectivity: rebuild Winsock and the TCP/IP stack to defaults when adapters show 'no internet' despite everything else working.
Enumerate every wireless network Windows remembers, inspect a profile's settings, and export profiles for backup or transfer to another PC.