在VMware WorkStation中创建了一个新的Linux CentOS7虚拟机后,发现无法连接网络,ping不通,ping www.baidu.com显示“ping name or service not known”。
经高人指点后,才知道只需要两步便可以解决这个问题
1,编辑/etc/sysconfig/network-scripts/ifcfg-ens33文件,将文件中的ONBOOT=no改为ONBOOT=yes
vi /etc/sysconfig/network-scripts/ifcfg-ens33
2,重启网络
service network restart
3,再次尝试ping
ping www.baidu.com
即可ping成功