记一次移动云服务器IP消失的原因

问题:移动云服务器,初始化系统后,ifconfig发现网卡eth0没有IP地址了,经过复盘,发现是关闭了NetworkManager,查看network(chkconfig --list),发现也是off。

解决方法一:关闭NetworkManager服务(网上常用方法)

[root@test ~]# systemctl disable NetworkManager
Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
[root@test ~]# systemctl stop NetworkManager.service 
#重启network即可
[root@test ~]# systemctl restart network
[root@test ~]# systemctl enable network

解决方法二:关闭network服务

[root@test ~]# systemctl stop network
[root@test ~]# systemctl disable network
#启动NetworkManager
[root@test ~]# systemctl enable NetworkManager.service
[root@test ~]# systemctl start NetworkManager.service

#network与NetworkManager差别

network是linux直接配置网卡的程序
NetworkManager是提供一个丰富的API来检查和控制网络设置和操作的应用程序
network和NetworkManager一起工作时就会出现冲突

 

posted @ 2022-12-01 09:46  Leonardo-li  阅读(218)  评论(0编辑  收藏  举报