第一步,配置并啟用網上eth0
ifcfg-ethx網卡配置 檔案路徑,假設配置的是eth0網卡
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 #網卡裝置名稱
ONBOOT=yes #啟動時是否激活 yes|no
BOOTPROTO=static #協定類型 dhcp bootp none
IPADDR=192.168.1.90 #網絡IP位址
NETMASK=255.255.255.0 #網絡子網位址
GATEWAY=192.168.1.1 #網關位址
BROADCAST=192.168.1.255 #廣播位址
HWADDR=00:0C:29:FE:1A:09#網卡MAC位址
TYPE=Ethernet #網卡類型為以太網
:wq 儲存配置
[root@localhost ~]#service network restart
發現居然報錯如下,百思不得其解,隻能baidu了
bringing up interface eth0 error ... device not managed by networkmanager or unavailable
解決辦法:
1[root@localhost ~]#chkconfig NetworkManager off
2[root@localhost ~]#chkconfig network on
3 [root@localhost ~]#service NetworkManager stop
4 [root@localhost ~]#service network start
英文原文如下(大體意思是停掉NetworkManager,啟用預設的Manager):
================================================
1. Remove Network Manager from startup Services.
chkconfig NetworkManager off
2. Add Default Net Manager
chkconfig network on
Stop NetworkManager first
service NetworkManager stop
and then start Default Manager
service network start
or you can change it easy:
system-config-network
uncheck the box that sets the eth0 as managed by NetworkManager and set IP info from there.
system-config-services
stop and disable NetworkManager , start and enable network
you have problem because both of NetworkManager and Network using same Network driver and default network blocking access for NetworkManager. if you disable NetworkManager your problem will disappeared after restart.
本文轉自 苑洪武 51CTO部落格,原文連結:http://blog.51cto.com/12927979/1950396