title: How to prevent the ip address of hyper-v virtual switch from being changed?
body: <p>I have a laptop with Windows 10 2004 installed. I configureded Hyper-V and created two VMs: On one VM runs windows 10 to enclose serveral malware IM softwares which I have to use for working contacts. On the other VM runs ubuntu server 20.04 for development.</p>
  <p>I configured Hyper-V with a virtual switch of type internal network and Hyper-V automatically specified the virtual switch with a static IP. I want to connect to ubuntu with machine name. So I specified ubuntu VM with a static IP and added an item in the hosts file of the host windows 10. Then I can use the remote over SSH feature of VS Code to develop node.js app in windows 10 host. Everything went ok till I had restarted my laptop.</p>
  <p>After I have restarted the laptop, the IP address of the hyper-v virtual switch was changed. I couldn't reconnect to VM ubuntu any more because the VM ubuntu was configured with a static IP and default gateway based on the old IP of the virtual switch.</p>
  <p>I checked the IPv4 properties of the virtual switch via UI, It's configured as &quot;using the following IP&quot;, so I thought of the IP shouldn't change. But I was wrong. Each time after my laptop being restarted, the &quot;static IP&quot; of virtual switch always changes. This change breaks the connection to VM ubuntu.</p>
  <p>So, is there any way to prevent the IP address of the virtual switch from being changed? Or some way to add name resolving mechanism to Hyper-V virtual switch (then I can configure using dynamic IP address in VMs)?</p>