Centos-启动network报错RTNETLINK answers: File exists解决方法

本文介绍了解决克隆虚拟机后网卡配置冲突的问题。通过修改网卡名称及配置文件,确保克隆后的虚拟机能够正确识别并配置网卡。

背景:今天在Vcenter上,用模板克隆了一个虚拟机,启动之后,网卡启动不了,报错如下:RTNETLINK answers: File exists


wKioL1YFAhqSb9hqAAEl-2RUejw314.jpg


说明:  环境 Centos6.6_X64 ; 网卡两个


原因: 由于用模板克隆虚拟机,所以网卡的配置文件也会进行克隆,克隆之后网卡的名称也会相应改变,如模板机上是eth0和eth1, 克隆机变成eth2和eth3, 而网卡的配置文件并没有改变,会冲突。


解决方法:

  1.   更改网卡的名称。 正常来说,linux在识别网卡时第一张会是eth0,第二张才是eth1。在这里成这样是因为复制系统的过程中复制的文件已经有2个网卡在/etc /udev/rules.d/70-persistent-net.rules被识别成了eth0,而虚拟机中的识别成了eth1。 

    编辑/etc/udev/rules.d/70-persistent-net.rules


    找到与ifconfig -a得出的MAC相同的一行(NAME='eth2'这一行),把它改为"NAME=eth0 ",然后把上面一行(NAME='eth0')删除掉。

 (NAME='eth3'这一行),把它改为"NAME=eth1",

wKioL1YFCGTQluvcAAL5ul22xak422.jpg




2 查看MAC地址,编辑/etc/sysconfig/network-script/ifcfg-eth0和ifcfg-eth1
把MAC改为正确的,把UUID删掉。

wKiom1YFBFrTpDznAADXIv7Deek957.jpg



本文转自pizibaidu 51CTO博客,原文链接:http://blog.51cto.com/pizibaidu/1698263,如需转载请自行联系原作者

我的设备实在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.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 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、付费专栏及课程。

余额充值