centos7下网络无法重启

问题:

[root@localhost Desktop]# systemctl start network.service
Job for network.service failed. See 'systemctl status network.service' and 'journalctl -xn' for details.

解决方法:

1、HWADDR错误 ,查到正确的HWADDR

输入 ip addr,查找到HWADDR

33cc7e99c6424c6e35a7c36f4419724.png

进入 cd /etc/sysconfig/network-scripts 目录编辑对应的 vim ifcfg-ensXX,将HWADDR设置正确,重启 service network restart

如果到这里还不行,需要重新设置下IP相关。

(推荐教程:centos教程)

2、IP检查及设置

进入主机cmd 命令窗口 ,输入

ipconfig /all

94a4012cc6e91b05a63b8f7c2538773.png

再进入centos7虚拟机 cd /etc/sysconfig/network-scripts 目录编辑对应的 vim ifcfg-ensXX

9cec70f0b04a6580b5a1743693afaab.png

然后关闭网络:

root@localhost Desktop]# service NetworkManager stop
Redirecting to /bin/systemctl stop  NetworkManager.service

再重启:

[root@localhost Desktop]# service network restart
Restarting network (via systemctl):         [  OK  ]