虚拟机安装Centos7网卡无法启动
一、错误背景
1、使用VMware安装的centos7.2虚拟机,开机突然不能上网了,报错如下:
错误提示:
执行:#systemctlrestart network.service
Restarting network (via systemctl): Job fornetwork.service failed because the control process exited with error code. See"systemctl status network.service" and "journalctl -xe" for details.
2、执行#journalctl –xe报一堆错。
3、查看日志:进一步确认错误
#cat /var/log/message |grep network
二、解决方法:
方法1、通过百度查找答案,大多是mac地址不对,修改mac地址
链接:https://www.cnblogs.com/wudonghang/p/c0cd315470b06ef0f455855fe36c222c.html
截图:
方法二:(本次解决问题的方法也属于网上搜索仅供参考)
(1)禁止NetworkManager服务启动,问题解决
#systemctl stop NetworkManager
#systemctl disable NetworkManager
Removed symlink/etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed symlink/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.
Removed symlink/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
(2)重新启动网络服务
#systemctl start network.service
正常启动。