1. Open the host network manager
2. Create a NIC
The IP4 address is arbitrarily defined as 192.168.88.1
3. Open NETWORK Settings for the VM to be configured, and set NIC 1 and NIC 2 respectively
Nic 1 Set host-only to the promiscuous network mode. Select the virtual NIC created by the network manager in Step 1. Nic 2 Set network address translation (NAT) mode
4. Log in to the centos system, modify the NIC file, and run the following command
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
Copy the code
1. Change ONBOOT=true BOOTPROTO=static 2. Add IPADDR=192.168.88.91(change the last digit based on the IP address of the NIC created in Step 1) 3. Run the systemctl restart network command to restart the network. 5. The host can connect to the VM using the Xshell tool. The IP address is 192.168.88.91