VM restore default settings
If your previous operations are all right, Xshell still can’t connect to our virtual machine, you can try this method
Click Edit in VM –> Virtual Network Editor – Restore Default Settings ** (This method is also very effective) **
Note that after the restoration, we will mainly look at VM8.
This is the NAT setting before restoring
and the DHCP setting before restoring
Here I paste the subnet IP, gateway IP (gateway), start and end IP addresses of VM8 after restoring the default settings.
Change settings after restore
Note:
1. If we only have a simple single virtual machine, we can first click the application on the right of restore default settings, and then click OK next to it. At this time, we will vi /etc/sysconfig/network-scripts/ifcfg-ens33
change the previous IP address to your restored one. Any one of the starting IP and ending IP addresses in DHCP, for example, I changed it to 192.168.58.130, and changed the gateway to the gateway IP in the NAT settings. Restart and restart the network to connect to the virtual machine.
2. When our virtual machine is a cluster composed of many linux, it is more troublesome to use the above method of modifying the configuration file. You can modify the subnet IP and NAT settings of VM8 according to the information in the previous configuration file ifcfg-ens33 , the value in DHCP, note that in DHCP, you only need to modify the data in the third case in its start IP and end IP, and the others remain unchanged from before. After the modification is completed, click Apply and OK.