最近在学习Linux,在centos7配置好网关后,ping百度是OK。
但是reboot后再ping百度就报错 ping: www.baidu.com: 未知的名称或服务,
查看ifconfig ,发现ip地址变成了127.0.0.1。
感觉是ip地址没配置好,但是重新检查没发现问题。
运行systemctl restart network 出现报错:
Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.
顺着这条线索发现了问题:
最后在networkmanager上进行配置:
输入 vim /etc/sysconfig/grub,在GRUB_CMDLINE_LINUX=。。。。的
哪行最后面按i编辑,添加net.ifnames=0 biosdevname=0
,才能ping通百度。
参考文档: