I installed centos7 in vmware,it went well at first. But when I ran it, I found it cannot ping any domain, I reallized the network of it has some problems.
So this is my method to resolve it.
first, open the edit of network
second, choice the VMnet8
then, click NAT setting, Note that the last digit of the gateway here cannot be 1
after clicking the confirm, return to home and click 网络适配器, change to 自定义mode and change it to Vmnet8, then click confirm
Settings in CentOS 7
vi /etc/sysconfig/network-scripts/ifcfg-ens33
then change BOOTPROTO=dhcp to BOOTPROTO=static
change ONBOOT=NO to ONBOOT=yes
Finally, add the following code at the end
IPADDR=192.168.111.10
NETMASK=255.255.255.0
GATEWAY=192.168.111.2 //此处应和虚拟网络中的网关一致(上面`不是1`那张图)
DNS1=8.8.8.8
DNS2=114.114.114.114
systemctl restart network
打赏