远程解决centos的网络问题: service network start 出现RTNETLINK answers: File exists错误解决

本文介绍了解决CentOS系统中启动网络服务时出现的RTNETLINK答案:File exists错误的方法。通过调整NetworkManager与network服务的配置避免冲突,确保网络正常运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

service network start 出现RTNETLINK answers: File exists错误解决 或者

/etc/init.d/network start   出现RTNETLINK answers: File exists错误解决 (呵呵,其实两者是等效的,其实前者执行的就是这个命令)。

在centos下出现该故障的原因是启动网络的两个服务有冲突:/etc/init.d/network 和 /etc/init.d/NetworkManager这两个服务有冲突吧。

从根本上说是NetworkMaganager(NM)的带来的冲突,停用NetworkManager即可解决。重启即可。

1.切换到root账户,并用chkconfig命令查看network 和 NetworkManager两个服务的开机启动配置情况;

[wzb@embedded ~]$ su - root
口令:
[root@embedded ~]# chkconfig --list network
network         0:关闭  1:关闭  2:启用  3:启用  4:启用  5:启用  6:关闭
[root@embedded ~]# chkconfig --list NetworkManager
NetworkManager  0:关闭  1:关闭  2:关闭  3:启用  4:关闭  5:关闭  6:关闭
[root@embedded ~]#
2.停用NetworkManager,开机时,不让其启动:

[root@embedded ~]# chkconfig --level123456 NetworkManager off

3.启用network服务,开机启动。在3、4、5用户模式下;

[root@embedded ~]# chkconfig --level345 network on

或者 通过编辑 vi /etc/rc.d/rc.local文件在最后添加一行:/etc/init.d/network start

[root@embedded ~]# vi /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

/etc/init.d/network start

4.停用NetworkManager.,通过重启如果是远程的话,比较安全。

[root@embedded ~]#  reboot

注意:如果不是远程的话也可以通过如下命令解决,不过上述配置将在下次重启后,生效。

[root@embedded ~]#   /etc/init.d/NetworkManager stop         //若果是远程的的话,这将中断你的网络,即不能进行远程控制了(相当于自杀)

[root@embedded ~]# /etc/init.d/NetworkManager status
NetworkManager 已停

[root@embedded ~]# /etc/init.d/network stop                    //若果是远程的的话,这将中断你的网络,即不能进行远程控制了(相当于自杀)

[root@embedded ~]# /etc/init.d/network start
弹出环回接口:                                             [确定]
弹出界面 eth0:                                            [确定]
[root@embedded ~]#
5.测试网络: ping http://www.baidu.com/ 

如果能够ping通的话,说明网络已经无错误了。

如果ping不通的话,说明网络dns配置有问题,既然远程连上你的主机,说明主机的网络没问题,而你用的是ip。而你的远程主机ping域名ping不通,当时你若尝试ping ip话也是能ping通的,这就更进一步说明,是dns配置的问题。这都network Manager带来的问题,使DNS的配置文件 /etc/resolv.conf 为默认状态,即没有配置域名服务器;

可以通过编辑 vi  /etc/resolv.conf  文件:

以google的域名服务器为例:在最后添加两句:

search google.com

nameserver 8.8.8.8

保存/etc/resolv.conf 并退出。

再次ping www.baidu.com 发现成功了。

 

6.总结: 问题产生的原因:是两个配置网络的服务的冲突造成的。卸载 NetworkManager这个罪魁祸首,是根本。

 你两次执行 /etc/init.d/network start 同样会产生上述问题的症状。正常的情况下,在网络开启的状态下,应该用 /etc/init.d/network restart.

(可能网络的配置文件 ip 、dns的配置文件,是这两个配置服务的临界资源吧,这可能是造成冲突的主要原因)。

.

我的设备实在centos7上运行,现在出现如下问题,请给我详细的解决方案: [root@imx6ull 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. [FAILED] [root@imx6ull network-scripts]# [root@imx6ull network-scripts]# serivce NetworkManager stop -bash: serivce: command not found [root@imx6ull network-scripts]# service NetworkManager stop Redirecting to /bin/systemctl stop NetworkManager.service [root@imx6ull 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. [FAILED] [root@imx6ull network-scripts]# systemctl status network.servicenetwork.service - LSB: Bring up/down networking Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2025-07-30 14:31:17 CST; 24s ago Docs: man:systemd-sysv-generator(8) Process: 1507 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE) Jul 30 14:31:17 imx6ull network[1507]: RTNETLINK answers: File exists Jul 30 14:31:17 imx6ull network[1507]: RTNETLINK answers: File exists Jul 30 14:31:17 imx6ull network[1507]: RTNETLINK answers: File exists Jul 30 14:31:17 imx6ull network[1507]: RTNETLINK answers: File exists Jul 30 14:31:17 imx6ull network[1507]: RTNETLINK answers: File exists Jul 30 14:31:17 imx6ull network[1507]: RTNETLINK answers: File exists Jul 30 14:31:17 imx6ull systemd[1]: network.service: control process exited...=1 Jul 30 14:31:17 imx6ull systemd[1]: Failed to start LSB: Bring up/down netw...g. Jul 30 14:31:17 imx6ull systemd[1]: Unit network.service entered failed state. Jul 30 14:31:17 imx6ull systemd[1]: network.service failed. Hint: Some lines were ellipsized, use -l to show in full. [root@imx6ull network-scripts]# journalctl -xe Jul 30 14:31:16 imx6ull network[1507]: Bringing up interface eth3: RTNETLINK an Jul 30 14:31:17 imx6ull network[1507]: [ OK ] Jul 30 14:31:17 imx6ull network[1507]: RTNETLINK answers: File exists Jul 30 14:31:17 imx6ull network[1507]: RTNETLINK answers: File exists Jul 30 14:31:17 imx6ull network[1507]: RTNETLINK answers: File exists Jul 30 14:31:17 imx6ull network[1507]: RTNETLINK answers: File exists Jul 30 14:31:17 imx6ull network[1507]: RTNETLINK answers: File exists Jul 30 14:31:17 imx6ull network[1507]: RTNETLINK answers: File exists Jul 30 14:31:17 imx6ull network[1507]: RTNETLINK answers: File exists Jul 30 14:31:17 imx6ull network[1507]: RTNETLINK answers: File exists Jul 30 14:31:17 imx6ull network[1507]: RTNETLINK answers: File exists Jul 30 14:31:17 imx6ull systemd[1]: network.service: control process exited, cod Jul 30 14:31:17 imx6ull systemd[1]: Failed to start LSB: Bring up/down networkin -- Subject: Unit network.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit network.service has failed. -- -- The result is failed. Jul 30 14:31:17 imx6ull systemd[1]: Unit network.service entered failed state. Jul 30 14:31:17 imx6ull systemd[1]: network.service failed. Jul 30 14:31:17 imx6ull polkitd[212]: Unregistered Authentication Agent for unix lines 1251-1273/1273 (END)
07-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值