1

I would like to use mirrored network for my default WSL2 distribution, but for other distribution, I want them remain NAT. Especially for docker desktop, containers should have not had any impact to outer network, but now nginx of a container keeps attempting to bind 0.0.0.0:80, which has been already bound by IIS.

Mokubai
  • 95,412

1 Answers1

1

Unfortunately this is just not possible, at least not at the moment. All WSL2 distributions run in the same WSL2 Hyper-V virtual machine, so there's only one networking stack that is shared amongst all. You'll notice that any change you make to an address/interface/route/etc. are shared across all running distributions. This is the same for either NAT mode or Mirrored.

More information in this answer, and, depending on your use-case, perhaps a potential workaround in this one using additional network namespaces.

NotTheDr01ds
  • 28,025