Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 740 Bytes

wsl_forwarding.md

File metadata and controls

9 lines (6 loc) · 740 Bytes

WSL Port Forwarding for exposing servers on LAN

Source: Access WSL localhost from LAN

  1. Get first IP from wsl hostname -I
  2. Call New-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' -Direction Inbound -LocalPort <your-port> -Action Allow -Protocol TCP"; on PowerShell
  3. Forward the port with netsh interface portproxy add v4tov4 listenport=<your-port> listenaddress=0.0.0.0 connectport=<your-port> connectaddress=<your-ip-from-step-one>

Detailed explanation with samples on Managing firewall rules on Windows through PowerShell and Managing port proxies on Windows through netsh