How to set WSL2 subnet to a specific address space?
Running WSL2 on Windows 11, without Hyper-V, changes the subnet associated with vEthernet (WSL) adapter on every reboot of the host computer.
The subnet is a /20 block randomly selected from the address space of 172.12.0.0/12. This conflicts sometimes with other subnets in my LAN creating "no route to host" conflict when trying to connect from WSL guest to one of those other subnets.
I need to be able to set more specific /20 block for WSL2 so that the conflict never occurs any longer. The only workaround I found was to reboot the host computer, so that WSL network is randomly re-assigned from a different block that does not conflict with my other subnets.
I was not able to find any way to modify the settings of vEthernet (WSL) adapter. While this adapter is enumerated by ipconfig, it does not show up in Control Panel / Settings. Is there a way to set the vEthernet (WSL) subnet to a specific block range?
Such feature would be similar to VMware Virtual Network Editor that permits the configuration of virtual subnets.
Thanks