Skip to content

Forward a port to another machine or WSL (netsh portproxy) — via Microsoft Learn

Commandmedium riskNeeds adminWindows 11Windows 10

Windows has a built-in TCP port forwarder. It's the usual way to expose a server running inside WSL 2 or a VM to the rest of your network, without installing anything.

Takes effect right away

Command

Run in an administrator Command Prompt / Terminal window.

netsh interface portproxy add v4tov4 listenport=8080 listenaddress=0.0.0.0 connectaddress=192.168.1.10 connectport=80
netsh interface portproxy show all

Undo

netsh interface portproxy delete v4tov4 listenport=8080 listenaddress=0.0.0.0
TCP only. listenaddress=0.0.0.0 accepts connections from any address, so you'll usually also need a firewall rule for the listen port — and you should only do that on a trusted network. For WSL, get the Linux address with wsl hostname -I; it can change after WSL restarts. netsh interface portproxy reset clears all rules.

Sources

Source reviewed
2026-11-02
Link checked
2026-11-02
Tested hands-on
Not by Oddbyte.Me

Oddbyte.Me hasn't tried this on every Windows build, so keep the undo handy.

port forwardingportproxywslnetshlan access

More in Networking

Flush the DNS cache — via Marc Abramowitz

Commandlow riskAdmin

If a website moved to a new server, or you changed DNS settings and some sites still won't load, your Mac may be holding on to old address lookups. Flushing the DNS cache makes it look them up fresh. It's a troubleshooting step, not a speed boost.

Run Apple's built-in internet speed test — via SS64

Commandlow risk

macOS has its own speed test in Terminal. Besides download and upload speed, it measures 'responsiveness' (round trips per minute while the line is busy), which explains why video calls stutter on a connection that looks fast.