解决办法如下:
1、如果是图形界面,需要关闭NetworkManager服务
service NetworkManager stop service network restart
因为该服务与network服务冲突。
2、编辑/etc/sysconfig/network-scripts/ifcfg-ethX文件
X代表网卡的序号
vim /etc/sysconfig/network-scripts/ifcfg-ethX
3、把ONBOOT=no改为ONBOOT=yes
这样就可以自动获取ip地址了。
推荐教程:centos教程
The above is the detailed content of What should I do if centos cannot automatically obtain the IP address?. For more information, please follow other related articles on the PHP Chinese website!