虚拟机开机之后ssh连不上,ifconfig和ip addr show 命令没有ip
- 检查network和NetworkManager服务运行状态,
- 如果network运行不正常,检查NetworkManager,如果NetworkManager运行,先关掉NetworkManager
# 查看network
systemctl status network
# 查看NetworkManager
systemctl status NetworkManager
# 停止NetworkManager
systemctl stop NetworkManager
# 禁用NetworkManager,不禁用的话重启之后还得停止NetworkManager
systemctl disable NetworkManager
- 重启下就正常了