CentOS 7 ping baidu.com 报错name or service not know

在用 VirtualBox 安装了CentOS 7 的虚拟机之后,尝试测试用ping baidu.com来测试网络的连接性,提示name or service not know这个错误,解决办法如下:

  1. 首先在/etc/sysonfit/network-scripts的路径下找到网卡的配置文件
  2. 用vi编辑配置文件,例如vi ifcfg-eth0,把其中的ONBOOT=NO改成ONBOOT=yes
  3. 重启网卡systemctl restart network
You need to set client_id and slot_id to show this AD unit. Please set it in _config.yml.
Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now