Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Get WSL2 IP
- $wslIp = wsl.exe -e "ip addr show eth0 | grep 'inet ' | awk '{print $2}' | cut -d '/' -f 1"
- # Remove existing rule
- netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=9443
- # Add new rule with updated IP
- netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=9443 connectaddress=$wslIp connectport=9443
- Write-Host "Port 9443 forwarded to WSL2 IP: $wslIp"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement