×

CentOS7重启网络服务报错:the control process exited with error code

hqy hqy 发表于2020-05-20 15:17:18 浏览3600 评论0

抢沙发发表评论

CentOS7重启网络服务报错:the control process exited with error code

mportant;">转载

刚上架一台服务器,配置好网络,重启网络服务器报错。

 

[root@localhost network-scripts]# 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.   [失败]

 

[root@localhost network-scripts]#  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  2017-07-05 08:09:37 CST; 1min 15s ago

     Docs: man:systemd-sysv-generator(8)

  Process: 7132 ExecStop=/etc/rc.d/init.d/network stop (code=exited, status=0/SUCCESS)

  Process: 8159 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

7 05 08:09:37 localhost.localdomain network[8159]: RTNETLINK answers: File exists

7 05 08:09:37 localhost.localdomain network[8159]: RTNETLINK answers: File exists

7 05 08:09:37 localhost.localdomain network[8159]: RTNETLINK answers: File exists

7 05 08:09:37 localhost.localdomain network[8159]: RTNETLINK answers: File exists

7 05 08:09:37 localhost.localdomain network[8159]: RTNETLINK answers: File exists

7 05 08:09:37 localhost.localdomain network[8159]: RTNETLINK answers: File exists

7 05 08:09:37 localhost.localdomain systemd[1]: network.service: control process exited, code=exited status=1

7 05 08:09:37 localhost.localdomain systemd[1]: Failed to start LSB: Bring up/down networking.

7 05 08:09:37 localhost.localdomain systemd[1]: Unit network.service entered failed state.

7 05 08:09:37 localhost.localdomain systemd[1]: network.service failed.

 

[root@localhost network-scripts]#  cat /var/log/messages | grep network

Jul  5 08:09:35 localhost systemd: Starting LSB: Bring up/down networking...

Jul  5 08:09:35 localhost network: 正在打开环回接口: [  确定  ]

Jul  5 08:09:35 localhost network: 正在打开接口 enp1s0f0 RTNETLINK answers: File exists

Jul  5 08:09:37 localhost network: [  确定  ]

Jul  5 08:09:37 localhost network: 正在打开接口 有线连接_1: 错误:激活连接失败:No suitable device found for this connection.

Jul  5 08:09:37 localhost network: [失败]

Jul  5 08:09:37 localhost network: RTNETLINK answers: File exists

Jul  5 08:09:37 localhost network: RTNETLINK answers: File exists

Jul  5 08:09:37 localhost network: RTNETLINK answers: File exists

Jul  5 08:09:37 localhost network: RTNETLINK answers: File exists

Jul  5 08:09:37 localhost network: RTNETLINK answers: File exists

Jul  5 08:09:37 localhost network: RTNETLINK answers: File exists

Jul  5 08:09:37 localhost network: RTNETLINK answers: File exists

Jul  5 08:09:37 localhost network: RTNETLINK answers: File exists

Jul  5 08:09:37 localhost network: RTNETLINK answers: File exists

Jul  5 08:09:37 localhost systemd: network.service: control process exited, code=exited status=1

Jul  5 08:09:37 localhost systemd: Failed to start LSB: Bring up/down networking.

Jul  5 08:09:37 localhost systemd: Unit network.service entered failed state.

Jul  5 08:09:37 localhost systemd: network.service failed.

[root@localhost network-scripts]#

 

关键点: 


为什么是打开 有线连接_1 接口而不是 enp1s0f0 ,不管怎样我们配置的是enp1s0f0,所以我们希望他打开enp1s0f0,所以我尝试将有线连接_1 配置注释。

[root@localhost network-scripts]/etc/sysconfig/network-scripts

[root@localhost network-scripts]/mv ifcfg-有线连接_1  backup-ifcfg-有线连接_1

再次重启网络服务就成功了。

[root@localhost network-scripts]# service network restart

Restarting network (via systemctl):                        [  确定  ]

 

 

————————————————-————————end——————————————————-—————————

 

我在百度的时候还发现一些其他的错误情况,都说要修改mac地址。

 

下面说说具体的处理步骤。首先查看网卡接口的MAC地址,然后写入配置文件。

 

[root@localhost network-scripts]# ip addr

1: lo: mtu 65536 qdisc noqueue state UNKNOWN qlen 1

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

       valid_lft forever preferred_lft forever

    inet6 ::1/128 scope host

       valid_lft forever preferred_lft forever

2: enp1s0f0: mtu 1500 qdisc mq state UP qlen 1000

    link/ether 00:8c:fa:03:fe:24 brd ff:ff:ff:ff:ff:ff

    inet 58.64.197.207/27 brd 58.64.197.223 scope global enp1s0f0

       valid_lft forever preferred_lft forever

    inet 59.188.138.183/27 brd 59.188.138.191 scope global enp1s0f0

       valid_lft forever preferred_lft forever

    inet6 fe80::28c:faff:fe03:fe24/64 scope link

       valid_lft forever preferred_lft forever

3: enp1s0f1: mtu 1500 qdisc mq state DOWN qlen 1000

link/ether 00:8c:fa:03:fe:25 brd ff:ff:ff:ff:ff:ff

 

[root@localhost network-scripts]# vi ifcfg-enp1s0f0  

添加一下,

HWADDR: 00:8c:fa:03:fe:24   

//红色标注为enp1s0f0MAC地址,修改为自己的即可。         

 

 

 

 

还有一些其他的情况,比如虚拟机里边的CentOS7重启之后无法联网了,重启network发现报错。

 

百度了一圈,都是叫修改mac地址的说法,但是改了之后并没有什么用,最后谷歌解决了。

解决方式:禁用NetworkManager

1. systemctl stop NetworkManager

2. systemctl disable NetworkManager

 

然后重启网络服务,能正常联网了!

    





-----------------------


centos7 无法启动网络(service network restart)错误解决办法:

(以下方法均为网上COPY,同时感谢原博主分享)



systemctl status network.service 出现以下错误

“rtnetlink answers file exists” 的解决方法



第一种: 和 NetworkManager 服务有冲突,这个好解决,直接关闭 NetworkManger 服务就好了, service 



NetworkManager stop,并且禁止开机启动 chkconfig NetworkManager off 。之后重启就好了。(我使用第一种成功)



第二种:和配置文件的MAC地址不匹配,这个也好解决,直接修改 /etc/udev/rules.d/70-persistent-net.rules文件的MAC



地址和 /etc/sysconfig/network-scripts/ifcfg-eth0一样就好了。



(两种都不行的话可以试试这个)

ip addr flush dev enoXXXXX

(copy地址:http://www.2cto.com/os/201411/350848.html)





三种方法解决 Failed to start LSB: Bring up/down networking 问题





《—》

1、执行 service network restart 出现以下错误

Restarting network (via systemctl):  Job for network.service failed. See 'systemctl status network.service' 

and 'journalctl -xn' for details.



2、根据上面的提示,执行“systemctl status network.service”输出以下的类似信息:



[root@localhost ~]# systemctl status network.service

network.service - LSB: Bring up/down networking

   Loaded: loaded (/etc/rc.d/init.d/network)

   Active: failed (Result: exit-code) since三 2014-11-05 15:30:10 CST; 1min 5s ago

11月 05 15:30:10 localhost.localdomain network[2920]: RTNETLINK answers: File exists

11月 05 15:30:10 localhost.localdomain network[2920]: RTNETLINK answers: File exists

11月 05 15:30:10 localhost.localdomain network[2920]: RTNETLINK answers: File exists

11月 05 15:30:10 localhost.localdomain network[2920]: RTNETLINK answers: File exists

11月 05 15:30:10 localhost.localdomain network[2920]: RTNETLINK answers: File exists

11月 05 15:30:10 localhost.localdomain network[2920]: RTNETLINK answers: File exists

11月 05 15:30:10 localhost.localdomain network[2920]: RTNETLINK answers: File exists

11月 05 15:30:10 localhost.localdomain systemd[1]: network.service: control process exited, code=exited 

status=1

11月 05 15:30:10 localhost.localdomain systemd[1]: Failed to start LSB: Bring up/down networking.

11月 05 15:30:10 localhost.localdomain systemd[1]: Unit network.service entered failed state.



3、解决的办法(由于centos7中没有70-persistent-net.rules这个文件,复制出来的虚拟机(vmware)需要修改mac地址)

,就是修改mac地址。



4、如何查看centos7复制出来的虚拟机的mac地址,需要执行 “ip addr”,输出如下的类似信息:

[root@localhost ~]# ip addr



1: lo:

link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

inet 127.0.0.1/8 scope host lo

valid_lft forever preferred_lft forever

inet6 ::1/128 scope host

       valid_lft forever preferred_lft forever



2: eno16777736:

    link/ether00:0f:19:10:12:f1 brd ff:ff:ff:ff:ff:ff

    inet 192.168.38.135/24 brd 192.168.38.255 scope global dynamic eno16777736

       valid_lft 1681sec preferred_lft 1681sec

    inet6 fe80::20c:11aa:ae11:4fe4/64 scope link

       valid_lft forever preferred_lft forever



注意上面加粗加红的字,这就是新的mac地址。

接下来就剩下修改ifcfg-XXX文件了,只修改HWADDR就可以了。接下来执行service network restart就正常了。



《二》



如果还是启动失败    查看是否有如下错误信息



Nov 23 22:09:07 hdcoe02 network[597]: Bringing up loopback interface:  Could not load file 

'/etc/sysconfig/network-scripts/ifcfg-lo'  

Nov 23 22:09:07 hdcoe02 network[597]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo' 

Nov 23 22:09:08 hdcoe02 network[597]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo' 

Nov 23 22:09:08 hdcoe02 network[597]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'  Nov 23 

22:09:08 hdcoe02 network[597]: [  OK  ] 

Nov 23 22:09:08 hdcoe02 network[597]: Bringing up interface enp0s25:  Error: Connection activation failed: 

Connection 'enp0s25' is not available on the device enp0s25 at this time. 



设定开机启动一个名为NetworkManager-wait-online服务,命令为:

systemctl enable NetworkManager-wait-online.service



《三》



我也是上面方法都测试完了 一直不成功,最后发现时因为在VMware 虚拟机里面的系统  右上角显示的连接都没有连接上,

虽然报错都一样,最后我在虚拟机设置里面将原来的网络适配器删掉,重新建了一个新的网络适配器,这次进去,显示连接

成功,再用上面的方法,问题解决。

(copy地址:http://blog.csdn.net/qq_21398167/article/details/46694179)




打赏

本文链接:https://www.kinber.cn/post/1265.html 转载需授权!

分享到:


推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

 您阅读本篇文章共花了: 

群贤毕至

访客