執行 service network restart 時出現:
Shutting down interface eth0: Error: Device 'eth0' disconnecting failed: This device is not active [FAILED]
Bringing up interface eth0: Error: Connection activation failed: Device not managed by NetworkManager or unavailable [FAILED]
ifconfig 顯示網卡無 IP,網路完全不可用。
NetworkManager 與傳統 network 服務衝突:NetworkManager 接管網卡管理,導致 network 服務無法控制介面,產生「not managed by NetworkManager」錯誤。
chkconfig NetworkManager off
service NetworkManager stop
chkconfig network on
service network start
service network restart
# 應顯示 [OK] [OK]
ifconfig eth0
# 應顯示 IP、UP BROADCAST RUNNING MULTICAST
[root@localhost Desktop]# service network restart
Shutting down interface eth0: Error: Device 'eth0' ... not active [FAILED]
...
[root@localhost Desktop]# chkconfig NetworkManager off
[root@localhost Desktop]# chkconfig network on
[root@localhost Desktop]# service NetworkManager stop
Stopping NetworkManager daemon: [OK]
[root@localhost Desktop]# service network start
Bringing up loopback interface: [OK]
Bringing up interface eth0: [OK]
RTNETLINK answers: File exists (多行,忽略即可)
[root@localhost Desktop]# service network restart
Shutting down interface eth0: [OK]
Bringing up interface eth0: [OK]
[root@localhost Desktop]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:A0:C6:44
inet addr:192.168.1.189 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
...
/etc/sysconfig/network-scripts/ifcfg-eth0:NM_CONTROLLED=no # 明確告知 NetworkManager 不管理此介面service network restartsystemctl stop NetworkManager
systemctl disable NetworkManager
systemctl enable network
systemctl start network
伺服器環境建議停用 NetworkManager,改用傳統 network 服務或 systemd-networkd,配置更穩定可預測。
service network restart 驗證遵循「停用 NM → 啟用 network → 驗證 → 固化配置」流程,即可徹底解決 Linux 伺服器網卡「not active」問題。