Skip to content

Instantly share code, notes, and snippets.

@wildlarva
wildlarva / udp-port-forwarding.ps1
Last active May 29, 2025 09:16
WSL Port Forwarding Example for UDP
#--------------------------------------------------------
# Background: WSL UDP port forwarding
#--------------------------------------------------------
# Microsoft recommends "netsh interface portproxy" for port forwarding, but it does not support UDP for now.
# See https://learn.microsoft.com/en-us/windows/wsl/networking#accessing-a-wsl-2-distribution-from-your-local-area-network-lan.
# For UDP port forwarding, you can use Windows NAT mechanism.
# See https://gist.github.com/the-moog/e7a1b5150ce9017309afbcf91848e622.