centos6.2虚拟机无法配置IP地址的解决方法

发布时间:2021-01-08编辑:脚本学堂
centos6.2虚拟机无法配置IP地址的解决方法,有遇到类似问题的朋友,可以参考下。

centos6.2虚拟机无法配置IP地址的解决方法,有遇到类似问题的朋友,可以参考下。

centos6.2登录后发现ip配置不生效,网卡显示未激活状态。
[root@cheng ]# setup
[root@cheng ]# service network restart
正在关闭接口 eth0: 错误:断开设备 'eth0'(/org/freedesktop/NetworkManager/Devices/0)失败:This device is not active
                                                           [失败]
关闭环回接口:                                             [确定]
弹出环回接口:                                             [确定]
用#ifconfig排查发现没有配上ip,报错信息是网卡没有激活,进入配置文件修改
[root@cheng ]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes  --启用
IPADDR=192.168.0.10
BOOTPROTO=none
NETMASK=255.255.255.0
TYPE=Ethernet
GATEWAY=192.168.0.38
#HWADDR=00:50:56:b8:10:e8 --禁用mac行
[root@cheng]# init 6  
[root@cheng]# service network restart
正在关闭接口 eth0: 设备状态:3 (断开连接)
                                                           [确定]
关闭环回接口:                                             [确定]
弹出环回接口:                                             [确定]
弹出界面 eth0: 活跃连接状态:激活的
活跃连接路径:/org/freedesktop/NetworkManager/ActiveConnection/1 
                                                                         [确定]