Turn on the virtual machine
Configure the network card
vi /etc/sysconfig/network-scripts/ifcfg-eth0
Modify the relevant configuration pay attention to modify HWADDR, UUID, IPADDR, GATEWAY
NAME=ens33
UUID=99ae368f-6443-42e7-b978-9f6e0e791c3a
DEVICE=ens33
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.92.12
NETMASK=255.255.255.0
GATEWAY=192.168.92.2
DNS1=233.5.5.5
DNS2=8.8.8.8
Get IPADDR
Restart the network service.
service network restart
To verify whether the network configuration is successful, first ping 192.168.1.1 and
try ping www.baidu.com from the external network