step:1 用root用户进入该目录

cd /etc/sysconfig/network-scripts/

step2: 编辑该文件

vim ifcfg-eth0

step3: 修改文件

把no改为yes

ONBOOT=yes
NM_CONTROLLED=yes

 step4: 重启

/etc/init.d/network restart