centOS 7一个解决“network.service: control process exited, code=exited status=1”方法

时间:2023-03-10 04:45:55
centOS 7一个解决“network.service: control process exited, code=exited status=1”方法

  今天早上2017-08-04,我打开虚拟机,使用远程工具xshell对虚拟机进行连接,我发现连接不上去,然后我ifconfig,发现找不到ens33了,就剩一个本地回环,看来是我的网络出现了问题,然后我查看我的网络状态,发现了如下情况:

[root@CT71 ~]# 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 -- :: CST; 1min 44s ago
Docs: man:systemd-sysv-generator()
Process: ExecStop=/etc/rc.d/init.d/network stop (code=exited, status=/SUCCESS)
Process: ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE) Aug :: CT71 network[]: RTNETLINK answers: File exists
Aug :: CT71 network[]: RTNETLINK answers: File exists
Aug :: CT71 network[]: RTNETLINK answers: File exists
Aug :: CT71 network[]: RTNETLINK answers: File exists
Aug :: CT71 network[]: RTNETLINK answers: File exists
Aug :: CT71 network[]: RTNETLINK answers: File exists
Aug :: CT71 systemd[]: network.service: control process exited, code=exited status=
Aug :: CT71 systemd[]: Failed to start LSB: Bring up/down networking.
Aug :: CT71 systemd[]: Unit network.service entered failed state.
Aug :: CT71 systemd[]: network.service failed.

我在某度上找了好几个答案,都没有找到我能解决问题的答案,然后我进行Google,在一个博客上找到了我需要的答案,不知道是不是会针对于大家都可以,方法是关闭网络管理,如下:

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.

然后重启网络:

systemctl start network.service

可以使用了:

[root@CT71 bin]# ifconfig
ens33: flags=<UP,BROADCAST,RUNNING,MULTICAST> mtu
inet 172.17.251.180 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::20c:29ff:fe84:b4 prefixlen scopeid 0x20<link>
ether :0c::::b4 txqueuelen (Ethernet)
RX packets bytes (300.9 MiB)
RX errors dropped overruns frame
TX packets bytes (288.9 KiB)
TX errors dropped overruns carrier collisions ens34: flags=<UP,BROADCAST,RUNNING,MULTICAST> mtu
inet 192.168.111.110 netmask 255.255.255.0 broadcast 192.168.111.255
inet6 fe80::febf:b561::f3b0 prefixlen scopeid 0x20<link>
ether :0c::::be txqueuelen (Ethernet)
RX packets bytes (11.3 MiB)
RX errors dropped overruns frame
TX packets bytes (19.1 MiB)
TX errors dropped overruns carrier collisions lo: flags=<UP,LOOPBACK,RUNNING> mtu
inet 127.0.0.1 netmask 255.0.0.0
inet6 :: prefixlen scopeid 0x10<host>
loop txqueuelen (Local Loopback)
RX packets bytes (6.5 KiB)
RX errors dropped overruns frame
TX packets bytes (6.5 KiB)
TX errors dropped overruns carrier collisions virbr0: flags=<UP,BROADCAST,MULTICAST> mtu
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether :::b6:: txqueuelen (Ethernet)
RX packets bytes (0.0 B)
RX errors dropped overruns frame
TX packets bytes (0.0 B)
TX errors dropped overruns carrier collisions