Last active
May 30, 2022 22:08
-
-
Save axelitus/6e2a056ae61a82162639d187b6b931ec to your computer and use it in GitHub Desktop.
Port exclusions to allow port redirection to WSL2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run commands in an elevated prompt | |
# Stop WinNAT | |
net stop winnat | |
# Docker | |
netsh int ipv4 add excludedportrange protocol=tcp startport=50000 numberofports=50 # Docker - extend range as needed | |
# Laravel Sail services | |
netsh int ipv4 add excludedportrange protocol=tcp startport=80 numberofports=1 # Web server | |
netsh int ipv4 add excludedportrange protocol=tcp startport=3000 numberofports=10 # BrowserSync | |
netsh int ipv4 add excludedportrange protocol=tcp startport=3306 numberofports=1 # MySql | |
netsh int ipv4 add excludedportrange protocol=tcp startport=6379 numberofports=1 # Redis | |
netsh int ipv4 add excludedportrange protocol=tcp startport=1025 numberofports=1 # Mailhog | |
netsh int ipv4 add excludedportrange protocol=tcp startport=8025 numberofports=1 # Mailhog Dashboard | |
netsh int ipv4 add excludedportrange protocol=tcp startport=8080 numberofports=1 # HotReloading (HMR) | |
# Spatie's Ray | |
netsh int ipv4 add excludedportrange protocol=tcp startport=23517 numberofports=1 # Ray - change as needed | |
# PhpStorm/xDebug | |
netsh int ipv4 add excludedportrange protocol=tcp startport=9000 numberofports=1 # xDebug 2 | |
netsh int ipv4 add excludedportrange protocol=tcp startport=9003 numberofports=1 # xDebug 3 | |
# Additional useful ports | |
netsh int ipv4 add excludedportrange protocol=tcp startport=6000 numberofports=1 # X11 | |
# Other ports | |
netsh int ipv4 add excludedportrange protocol=tcp startport=6379 numberofports=1 # | |
netsh int ipv4 add excludedportrange protocol=tcp startport=6991 numberofports=1 # | |
# Start WinNAT | |
net start winnat | |
# Show excluded ports | |
netsh int ipv4 show excludedportrange tcp | |
# Best to do: restart Windows |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment