問題:
執行service network restart指令後出現下面的錯誤:
Restarting network (via systemctl): Job for network.service failed because the control process exited with error code.
See "systemctl status network.service" and "journalctl -xe" for details. [失敗]
#(建議教學:centos使用教學)
解決方法:
1、.和NetworkManager 服務有衝突,直接關閉NetworkManger 服務就好了, service NetworkManager stop,並且禁止開機啟動chkconfig NetworkManager off 。之後重啟就好了。
2、和設定檔的MAC位址不匹配,這個也好解決,使用ip addr(或ifconfig)查看mac位址
[root@royfans royfans]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens33: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000 link/ether 00:0c:29:5f:9e:1d brd ff:ff:ff:ff:ff:ff 3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN qlen 1000 link/ether 52:54:00:67:8e:c3 brd ff:ff:ff:ff:ff:ff inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0 valid_lft forever preferred_lft forever 4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN qlen 1000 link/ether 52:54:00:67:8e:c3 brd ff:ff:ff:ff:ff:ff
00:0c:29:5f:9e:1d這個就是MAC位址了,將/etc/sysconfig/network-scripts/ifcfg-xxx中的HWADDR(如果沒有就加入上)改成這個MAC位址。
3、設定開機啟動一個名為NetworkManager-wait-online服務,指令為:
systemctl enable NetworkManager-wait-online.service
4、檢視/etc/sysconfig/network-scripts下,將其餘無關的網卡位置檔案全刪掉,避免不必要的影響,也就是只留一個以ifcfg開頭的檔案
5、將ifcfg-xxx檔案中的DEVICE一行註解掉。
6、將ifcfg-xxx中的NAME改為和檔案名稱一致。
相關影片教學分享:linux影片教學
以上是centos7系統重啟網卡失敗的詳細內容。更多資訊請關注PHP中文網其他相關文章!