美文网首页Linux
Linux虚拟机没有ip地址解决方法

Linux虚拟机没有ip地址解决方法

作者: 程序员大佬超 | 来源:发表于2020-03-29 13:49 被阅读0次

虚拟机CentOS 7克隆后使用ifconfig命令查看没有ip地址。
然后使用service network restart命令报错如下:

Restarting network (via systemctl):  Job for network.service failed because the control process exited with error code. 
See "systemctl status network.service" and "journalctl -xe" for details.

接着使用systemctl status network.service命令查看结果如下:

● network.service - LSB: Bring up/down networking
   Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2019-12-30 19:25:39 CST; 31s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 4198 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

Dec 30 19:25:39 localhost.localdomain network[4198]: RTNETLINK answers: File ...
Dec 30 19:25:39 localhost.localdomain network[4198]: RTNETLINK answers: File ...
Dec 30 19:25:39 localhost.localdomain network[4198]: RTNETLINK answers: File ...
Dec 30 19:25:39 localhost.localdomain network[4198]: RTNETLINK answers: File ...
Dec 30 19:25:39 localhost.localdomain network[4198]: RTNETLINK answers: File ...
Dec 30 19:25:39 localhost.localdomain network[4198]: RTNETLINK answers: File ...
Dec 30 19:25:39 localhost.localdomain systemd[1]: network.service: control pr...
Dec 30 19:25:39 localhost.localdomain systemd[1]: Failed to start LSB: Bring ...
Dec 30 19:25:39 localhost.localdomain systemd[1]: Unit network.service entere...
Dec 30 19:25:39 localhost.localdomain systemd[1]: network.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

解决方法:

systemctl stop NetworkManager
systemctl disable NetworkManager
然后重启网络:
systemctl start network.service

相关文章

网友评论

    本文标题:Linux虚拟机没有ip地址解决方法

    本文链接:https://www.haomeiwen.com/subject/lrkvoctx.html