Skip to content

Instantly share code, notes, and snippets.

@willwm
Last active July 19, 2020 04:32
Show Gist options
  • Save willwm/18bbc349387331fb485278d432a71ddd to your computer and use it in GitHub Desktop.
Save willwm/18bbc349387331fb485278d432a71ddd to your computer and use it in GitHub Desktop.
Workaround for Docker/Hyper-V unexpectedly "locking" TCP port ranges
# (Re)start all containers, including those not currently running
docker restart $(docker ps -a -q)
# Stop all containers
docker stop $(docker ps -a -q)
# Remove all containers, including those not currently running
docker rm $(docker ps -a -q)
# Run this as an administrator! #
# Show excludedportrange
netsh interface ipv4 show excludedportrange protocol=tcp
# Add excluded port range (Example: Angular port ranges)
netsh interface ipv4 add excludedportrange protocol=tcp startport=4000 numberofports=500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment