Network adapter in Hyper-V keeps being reset to DockerNAT
I've installed Docker for Windows on my Windows 10 machine, which uses Hyper-V. Its default network adapter (virtual switch) is DockerNAT, an internal network.
If I shut down the VM (the default MobyLinuxVM) and change the network adapter to one using the external network, after restarting the VM, it has switched back to DockerNAT. If I change DockerNAT itself to use the external network, it gets changed back to internal.
Why is that? And what is the preferred way of getting some connectivity for Docker?
Microsoft describes here how to add NAT to the DockerNAT switch in order to allow external access.
It boils down to:
New-NetNat -Name DockerNAT -InternalIPInterfaceAddressPrefix 10.0.0.0/17
Using the IP range configured in Docker 4 Windows.