network.service: control process exited, code=exited status=1

时间:2024-03-28 14:20:04

给电脑加了内存条,然后启动虚拟机,发现xshell连不上虚拟机了

ifconfig一看 只剩下 lo和virbr0

network.service: control process exited, code=exited status=1

如果用ifconfig -a  可以看到ens33

 修改了静态IP

1、配置文件所在目录为 /etc/sysconfig/network-scripts 

cd /etc/sysconfig/network-scripts

2、打开配置文件进行修改,建议在修改之前先备份

cp ifcfg-ens33 ifcfg-ens33.bak
vim ifcfg-ens33

3、参数配置如下

network.service: control process exited, code=exited status=1

重启网络: 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 Fri 2017-08-04 08:20:31 CST; 1min 44s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 62726 ExecStop=/etc/rc.d/init.d/network stop (code=exited, status=0/SUCCESS)
  Process: 63183 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

Aug 04 08:20:31 CT71 network[63183]: RTNETLINK answers: File exists
Aug 04 08:20:31 CT71 network[63183]: RTNETLINK answers: File exists
Aug 04 08:20:31 CT71 network[63183]: RTNETLINK answers: File exists
Aug 04 08:20:31 CT71 network[63183]: RTNETLINK answers: File exists
Aug 04 08:20:31 CT71 network[63183]: RTNETLINK answers: File exists
Aug 04 08:20:31 CT71 network[63183]: RTNETLINK answers: File exists
Aug 04 08:20:31 CT71 systemd[1]: network.service: control process exited, code=exited status=1
Aug 04 08:20:31 CT71 systemd[1]: Failed to start LSB: Bring up/down networking.
Aug 04 08:20:31 CT71 systemd[1]: Unit network.service entered failed state.
Aug 04 08:20:31 CT71 systemd[1]: network.service failed.

解决方法:

1. systemctl stop NetworkManager

2. systemctl disable NetworkManager

3.systemctl start network.service

如下图

network.service: control process exited, code=exited status=1

再次ifconfig如上图 一切OK

查看网络是否连接成功:

network.service: control process exited, code=exited status=1

网络连接成功, 问题解决!!!