歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 正在關閉接口 eth0: 錯誤:斷開設備 ‘eth0’

正在關閉接口 eth0: 錯誤:斷開設備 ‘eth0’

日期:2017/2/28 13:55:23   编辑:Linux教程

1,問題描述
[root@pdshow ~]# ping www.linuxidc.com
connect: 網絡不可達
[root@pdshow ~]#

[root@pdshow ~]# ping www.linuxidc.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,之後生效,網絡問題解決了。

Copyright © Linux教程網 All Rights Reserved