network-programmingwindows-10windows-subsystem-for-linuxportforwarding

WSL2 cannot access forwarded ports


I want to access 127.128.0.11:11224 from WSL2.

I tried forwarding that address and port to localhost and accessing it that way from WSL2, but it doesn't seem to work. It might be related to the way my corporate laptop is set up, but I cannot tell.

I tried forwarding 127.128.0.11:11224 to 127.0.0.1:11224:

netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=11224 connectaddress=127.128.0.11 connectport=11224

But I cannot access it from WSL2:

Note that if I run python server directly on 127.0.0.1:11224, I can access it from WSL2.


Solution

  • I asked the same question on GitHub and the answer is that this is by design.