Skip to content

💩 Development in Windows (11, WSL)

Pier Dolique edited this page Aug 16, 2024 · 3 revisions

Troubles

Connection to port 3000 doesn't work

It looks like winnat automatically excludes 100 new ports at every new WSL start. When port 3000 is in this range, it becomes unavailable from WSL.

Show excluded ports

netsh interface ipv4 show excludedportrange protocol=tcp

Show dynamic ports range

netsh int ipv4 show dynamicportrange proto=tcp

Delete excluded port range

netsh int ip delete excludedportrange proto=tcp startport=2961 numberofports=100

This command requires winnat service to be stopped. And just winnat service restart can help without manual port range removal.

net stop winnat

Change dynamic port range

It can potentially prevent blocking port 3000 (haven't tested):

netsh int ipv4 set dynamicportrange proto=tcp startport=10000 numberofports=3000

Context