红联Linux门户
Linux帮助

正在关闭接口eth0: 错误:断开设备‘eth0’

发布时间:2016-01-04 10:53:26来源:linux网站作者:mchdba

1,问题描述
[root@pdshow ~]# ping www.baidu.com
connect: 网络不可达
[root@pdshow ~]#

[root@pdshow ~]# ping www.baidu.com
connect: 网络不可达
[root@pdshow ~]# ifconfig eth0 192.168.121.51 netmask 255.255.255.0 broadcast 192.168.121.255
[root@pdshow ~]# route add default gw 192.168.120.1
SIOCADDRT: 没有那个进程
[root@pdshow ~]#
网络ip地址设置没有成功,失效了。


2,network启动报错
正在关闭接口 eth0: 错误:断开设备 ‘eth0’(/org/freedesktop/NetworkManager/Devices/0) 失败:This device is not active;


3,关闭NetworkManager
看到网上有说的是NetworkManager影响了/etc/init.d/network,所以关闭NetworkManager
[root@192 ~]# service NetworkManager stop
停止 NetworkManager 守护进程: [确定]
[root@192 ~]#

也没有效果,service network restart失败。


4,查看ifcfg-eth0配置问题
[root@192 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
TYPE=Ethernet
UUID=fd7935ed-d944-4a1a-81eb-bf72b1e368c0
ONBOOT=no
NM_CONTROLLED=yes
BOOTPROTO=none
HWADDR=00:0c:29:cd:1f:68
IPADDR=192.168.121.52
PREFIX=23
GATEWAY=192.168.120.1
DNS1=192.168.121.212
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=”System eth0”

看到ONBOOT=no,这个配置失效了,应该配置成yes猜对,no是网卡不激活失效的设置。改成yes


5,重启network
/etc/init.d/network restart,之后生效,网络问题解决了。


Linux修改eth2到eth0:http://www.linuxdiyf.com/linux/15511.html

centos6.x修改网卡名称em1、2...为eth0、1...:http://www.linuxdiyf.com/linux/13843.html

Linux的网卡由eth0变成了eth1,如何修复:http://www.linuxdiyf.com/linux/13486.html

Linux下网卡eth1如何修改为eth0:http://www.linuxdiyf.com/linux/12604.html

CentOS 7将网卡名称eno16777736改为eth0:http://www.linuxdiyf.com/linux/14344.html