CentOS 7 ping baidu.com 报错name or service not know
在用 VirtualBox 安装了CentOS 7 的虚拟机之后,尝试测试用ping baidu.com来测试网络的连接性,提示name or service not know这个错误,解决办法如下:
- 首先在
/etc/sysonfit/network-scripts的路径下找到网卡的配置文件 - 用vi编辑配置文件,例如
vi ifcfg-eth0,把其中的ONBOOT=NO改成ONBOOT=yes - 重启网卡
systemctl restart network