最好連接配接到console,而不要在SSH下面進行,因為可能導緻網絡中斷,到時候你就連不到機器了
本文轉自http://libin0019.iteye.com/blog/1216894
chkconfig --level 35 network on
chkconfig --level 0123456 NetworkManager off
service NetworkManager stop
service network stop
service network start
如果還不行,重新開機系統看看
service network start 出現RTNETLINK answers: File exists錯誤解決 或者
/etc/init.d/network start 出現RTNETLINK answers: File exists錯誤解決 (呵呵,其實兩者是等效的,其實前者執行的就是這個指令)。
在centos下出現該故障的原因是啟動網絡的兩個服務有沖突:/etc/init.d/network 和 /etc/init.d/NetworkManager這兩個服務有沖突吧。
從根本上說是NetworkMaganager(NM)的帶來的沖突,停用NetworkManager即可解決。重新開機即可。
1.切換到root賬戶,并用chkconfig指令檢視network 和 NetworkManager兩個服務的開機啟動配置情況;
[wzb@embedded ~]$ su - root
密碼:
[root@embedded ~]# chkconfig --list network
network 0:關閉 1:關閉 2:啟用 3:啟用 4:啟用 5:啟用 6:關閉
[root@embedded ~]# chkconfig --list NetworkManager
NetworkManager 0:關閉 1:關閉 2:關閉 3:啟用 4:關閉 5:關閉 6:關閉
[root@embedded ~]#
2.停用NetworkManager,開機時,不讓其啟動:
[root@embedded ~]# chkconfig --level123456 NetworkManager off
3.啟用network服務,開機啟動。在3、4、5使用者模式下;
[root@embedded ~]# chkconfig --level345 network on
或者 通過編輯 vi /etc/rc.d/rc.local檔案在最後添加一行:/etc/init.d/network start
[root@embedded ~]# vi /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
/etc/init.d/network start
4.停用NetworkManager.,通過重新開機如果是遠端的話,比較安全。
[root@embedded ~]# reboot
注意:如果不是遠端的話也可以通過如下指令解決,不過上述配置将在下次重新開機後,生效。
[root@embedded ~]# /etc/init.d/NetworkManager stop //若果是遠端的的話,這将中斷你的網絡,即不能進行遠端控制了(相當于自殺)
[root@embedded ~]# /etc/init.d/NetworkManager status
NetworkManager 已停
[root@embedded ~]# /etc/init.d/network stop //若果是遠端的的話,這将中斷你的網絡,即不能進行遠端控制了(相當于自殺)
[root@embedded ~]# /etc/init.d/network start
彈出環回接口: [确定]
彈出界面 eth0: [确定]
[root@embedded ~