码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-12-07 20:57:54      阅读:292      评论:0      收藏:0      [点我收藏+]

标签:

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,之后生效,网络问题解决了。

参考文章地址:http://blog.sina.com.cn/s/blog_6f74890d010195xm.html

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

标签:

原文地址:http://blog.csdn.net/mchdba/article/details/50210003

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!