Post

Windows

Windows
  1. Get rid of app which occupies given port
    1. Check app PID
      • netstat -ano | findstr ":<port>"
      • netstat -ano | findstr ":8080"
    2. Find what’s the app
      • tasklist /fi "pid eq <pid>"
      • tasklist /fi "pid eq 22216"
    3. Kill process
      • taskkill /PID <pid> /F
      • taskkill /PID 22216 /F
  2. Other port commands
    1. To see current state of ports run:
      • netsh int ip show excludedportrange protocol=tcp
    2. To add port 4200 to exclusions, run:
      • netsh int ipv4 add excludedportrange protocol=tcp startport=3306 numberofports=1
1
restart-service nhs

Run CMD/Powershell as Admin and run:

1
2
net stop winnat
net start winnat

However, this may make WSL2 unable to connect to the Web.


Solution from Web, not verified yet:

1
2
3
4
netsh winsock reset
netsh int ip reset all
netsh winhttp reset proxy
ipconfig /flushdns

Source: https://github.com/microsoft/WSL/issues/3438#issuecomment-410518578