今天使用虚拟机centos7的时候发现没法远程访问centos7 了。
centos
检查发现,ipv4没有启动起来,bash
而后重启网卡 ide
# systemctl restart network
发现网卡启动了,ipv4有IP地址可是过了没有几分钟后ipv4 又消失了,检查配置没有问题。
this
找资料发现 centos7 的network 与 NetworkManager 有冲突
centos7
而后只能停用掉 NetworkManager 这里区分大小的spa
#systemctl stop NetworkManager //暂时关闭 #systemctl disable NetworkManager //永久关闭
停用掉 NetworkManager 发现ipv4能够正常使用rest
方法二(没有试验过)ip
或者在/etc/sysconfig/network-scripts/ifcfg-enXXX最后面添加一条虚拟机
NM_CONTROLLED=no # add this line