今天使用虛擬機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