Skip to content

Instantly share code, notes, and snippets.

@mpcen
Created September 4, 2021 01:33
Show Gist options
  • Save mpcen/688a3db9f0bf2947e7f5c408e591bb00 to your computer and use it in GitHub Desktop.
Save mpcen/688a3db9f0bf2947e7f5c408e591bb00 to your computer and use it in GitHub Desktop.
Forward a local port of an application running in WSL 2
Open an admin powershell:
`netsh interface portproxy add v4tov4 listenport=PORT listenaddress=0.0.0.0 connectport=PORT connectaddress=IP_WSL2_MACHINE`
More info: https://www.williamjbowman.com/blog/2020/04/25/running-a-public-server-from-wsl-2/
and: https://www.youtube.com/watch?v=yCK3easuYm4
@mpcen
Copy link
Author

mpcen commented Feb 11, 2022

example:
netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=172.20.58.179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment