title: WSL-2: Which ports are automatically forwarded?
body: <p>I've been tinkering around with WSL-2 for a while now and don't exactly understand how traffic is routed between the host and WSL-2 dist.</p>
  <p>In some sources it seems like all ports used by WSL-2 automatically become available to the host machine. Such as in <a href="https://docs.microsoft.com/en-us/windows/python/web-frameworks#hello-world-tutorial-for-flask" rel="noreferrer">this tutorial by Microsoft</a>.
  Similarly I managed to host a Jupyter instance which is available directly on my host machine through <code>localhost:8888</code>.</p>
  <p>However, when trying other services, such as ssh (also tried on a non-standard port) the port does not automatically become available through localhost and I have to use the IP address assigned to my WSL distro (the one from <code>wsl hostname -I</code>)</p>
  <p>To make the services available through localhost I found <a href="https://github.com/microsoft/WSL/issues/4150#issuecomment-504209723" rel="noreferrer">this portforwarding script</a>, which worked. But I would like to understand why it was needed.</p>
  <p>Why is port forwarding needed for some services, but not all?</p>