Forward a port to another machine or WSL (netsh portproxy) — via Microsoft Learn
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 allUndo
netsh interface portproxy delete v4tov4 listenport=8080 listenaddress=0.0.0.0TCP only.listenaddress=0.0.0.0accepts 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 withwsl hostname -I; it can change after WSL restarts.netsh interface portproxy resetclears all rules.
Sources
- netsh interface — portproxy — by Microsoft Learn
- Accessing network applications with WSL — by Microsoft Learn
- 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.