Hyper-V Virtual Switch NAT Setting Static IP
I have mentioned before that you can use NAT+port mapping to access a virtual machine, but I found a problem during use: every time the host machine is restarted, the default Default Switch
IP address will change, causing the virtual machine to be unable to access the gateway and thus unable to connect to the Internet.
In order to ensure that the virtual machine is connected to the Internet, you must manually set the IP address of the adapter corresponding to the Default Switch
every time you restart the machine, which is very inconvenient. The following is a solution given in reference to the Microsoft official document
.