Shutting down interface eth0: Error: Device 'eth0' (/org/freedesktop/NetworkManager/Devices/0) disc

本文记录了在CentOS系统中手动配置IP地址和DNS后遇到的问题及解决过程。通过调整NetworkManager和network服务设置,并正确配置MAC地址,最终解决了网络配置不生效的问题。

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

安装CENT OS时手动配置了IP和DNS,安装完成后,IP未生效

[root@localhost network-scripts]# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
BROADCAST=10.205.1.255
GATEWAY=10.205.0.254
IPADDR=10.205.0.70
NETMASK=255.255.255.0
NM_CONTROLLED=yes
ONBOOT=yes
TYPE=Ethernet
UUID="cbf78fc4-dca7-431f-bacb-66e9fb152dcd"
HWADDR=5A:2D:8A:5F:F7:9C
PREFIX=23
DNS1=211.155.27.88
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
LAST_CONNECT=1417162738


service network restart:

有如下报错

hutting down interface eth0:  Error: Device 'eth0' (/org/freedesktop/NetworkManager/Devices/0) disconnecting failed: This device is not active                                                           [FAILED]
Shutting down interface eth1:  Error: Device 'eth1' (/org/freedesktop/NetworkManager/Devices/1) disconnecting failed: This device is not active                                                           [FAILED]

搜索网上解决方案:

  1. chkconfig NetworkManager off
  2. chkconfig network on
  3.  service NetworkManager stop
  4. Stopping NetworkManager daemon: [ OK ]
  5. service network start
结果报如下错:

Bringing up interface eth0:  Device eth0 has different MAC address than expected, ignoring

搜解决方案:

#ifconfig eth0 down
#cd /etc/sysconfig/network-scripts 
#vi ifcfg-eth0
修改其中的"HWADDR=xx:xx:xx:xx:xx:xx"为"MACADDR=xx:xx:xx:xx:xx:xx"
#ifconfig eth0 up
#service network start

问题解决,日志如下:
Bringing up loopback interface:  [  OK  ]
Bringing up interface eth0:  RTNETLINK answers: Device or resource busy
[  OK  ]
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
[root@localhost network-scripts]# ifconfig
eth0      Link encap:Ethernet  HWaddr B6:D7:97:82:7A:26  
          inet addr:10.205.0.70  Bcast:10.205.1.255  Mask:255.255.254.0


[user@localhost network-scripts]$ sudo systemctl restart network Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details. [user@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 Fri 2025-07-25 09:49:13 CST; 15s ago Docs: man:systemd-sysv-generator(8) Process: 3647 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE) Jul 25 09:49:13 localhost.localdomain network[3647]: RTNETLINK answers: File exists Jul 25 09:49:13 localhost.localdomain network[3647]: RTNETLINK answers: File exists Jul 25 09:49:13 localhost.localdomain network[3647]: RTNETLINK answers: File exists Jul 25 09:49:13 localhost.localdomain network[3647]: RTNETLINK answers: File exists Jul 25 09:49:13 localhost.localdomain network[3647]: RTNETLINK answers: File exists Jul 25 09:49:13 localhost.localdomain network[3647]: RTNETLINK answers: File exists Jul 25 09:49:13 localhost.localdomain systemd[1]: network.service: control process exited, code=exited status=1 Jul 25 09:49:13 localhost.localdomain systemd[1]: Failed to start LSB: Bring up/down networking. Jul 25 09:49:13 localhost.localdomain systemd[1]: Unit network.service entered failed state. Jul 25 09:49:13 localhost.localdomain systemd[1]: network.service failed. [user@localhost network-scripts]$ journalctl -xe Jul 25 09:49:13 localhost.localdomain network[3647]: RTNETLINK answers: File exists Jul 25 09:49:13 localhost.localdomain network[3647]: RTNETLINK answers: File exists Jul 25 09:49:13 localhost.localdomain network[3647]: RTNETLINK answers: File exists Jul 25 09:49:13 localhost.localdomain systemd[1]: network.service: control process exited, code=exited status=1 Jul 25 09:49:13 localhost.localdomain systemd[1]: Failed to start LSB: Bring up/down networking. -- 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 25 09:49:13 localhost.localdomain systemd[1]: Unit network.service entered failed state. Jul 25 09:49:13 localhost.localdomain systemd[1]: network.service failed. Jul 25 09:49:13 localhost.localdomain polkitd[927]: Unregistered Authentication Agent for unix-process:3641:60721 ( Jul 25 09:49:13 localhost.localdomain sudo[3640]: pam_unix(sudo:session): session closed for user root Jul 25 09:50:01 localhost.localdomain systemd[1]: Created slice User Slice of root. -- Subject: Unit user-0.slice has finished start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit user-0.slice has finished starting up. -- -- The start-up result is done. Jul 25 09:50:01 localhost.localdomain systemd[1]: Started Session 3 of user root. -- Subject: Unit session-3.scope has finished start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit session-3.scope has finished starting up. -- -- The start-up result is done. Jul 25 09:50:01 localhost.localdomain CROND[3825]: (root) CMD (/usr/lib64/sa/sa1 1 1) Jul 25 09:50:01 localhost.localdomain systemd[1]: Removed slice User Slice of root. -- Subject: Unit user-0.slice has finished shutting down -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit user-0.slice has finished shutting down. lines 2615-2653/2653 (END)
最新发布
07-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值