装了CentOS 6.4,但是发现
第一步,配置并启用网上eth0网卡没有ip,只有lo网卡有127.0.0.1,然后/etc/sysconfig/network-scripts/下面也没有ifcfg-eth0文件。
解决办法:
新增ifcfg-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
结果报错
[root@localhost ~]#service NetworkManager restart
也是报错
bringing up interface eth0 error ... device not managed by networkmanager or unavailable
百度说network和NetworkManager 有冲突,停掉一个。
解决办法:
1 chkconfig NetworkManager off
2 chkconfig network on
3 service NetworkManager stop
4 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.
本文出自 “完美主义” 博客,请务必保留此出处http://liangxueming.blog.51cto.com/3911546/1547023
原文地址:http://liangxueming.blog.51cto.com/3911546/1547023