some earlier Windows update made the reserved ports ranged from 1259 to 65536, and the exact ports change each reboot. That's why sometimes ssh-ing from Windows to WSL via port 2222 works and sometimes it fails with error 10061. The command netsh interface ipv4 show excludedportrange protocol=tcp