Last active
June 24, 2021 07:03
-
-
Save AtomicMaya/7a5d34c114bcecb27eef4a8486843388 to your computer and use it in GitHub Desktop.
This file contains 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
@echo off | |
REM DOCKER / WSL2 / HYPER-V Systems with sometimes blocked ports you don't understand why are blocked. | |
REM TL;DR It's WinNAT that's reserving them, here's how you still let WinNAT do it's job but get a usable chunk of your ports back. | |
REM THIS COMMAND LISTS ALL RESERVED PORTRANGES FOR TCP (can be changed to ipv6 and/or udp) | |
netsh interface ipv4 show excludedportrange protocol=tcp | |
REM THIS COMMAND SETS IT TO BE DYNAMIC AND THE FUCK OUT OF ANY DEVELOPER'S WAY | |
REM (Run in Admin powershell) | |
netsh int ipv4 set dynamic tcp start=49152 num=16384 | |
REM Fucking hell microsoft... | |
REM Here for original fix https://github.com/docker/for-win/issues/3171#issuecomment-554587817 | |
REM Restart the WinNAT service (Run in Admin powershell) | |
net stop winnat | |
net start winnat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment