前言
这两个东西在centOS7最小安装无勾选附加时就存在 Ubuntu20.04中只有NetworkManager , 没有network服务
CentOS 7 最小安装下的测试 220511
默认两个都是打开的
关闭network打开重启NetworkManager
sudo systemctl stop network
发现 network和NetworkManager都关闭了, 用ip addr查看, 没有ip地址
sudo systemctl restart NetworkManager
ip addr 有ip了
关闭NetworkManager重启network
sudo systemctl stop NetworkManager
sudo systemctl restart network
有ip, 能访问网络 两个都关闭竟然也能上网
sudo systemctl stop network
sudo systemctl stop NetworkManager
居然也能上网 有ip 能ping通 能yum 重复关闭两个
sudo systemctl stop network
sudo systemctl stop NetworkManager
sudo systemctl stop network
sudo systemctl stop network
sudo systemctl stop NetworkManager
sudo systemctl stop NetworkManager
sudo systemctl stop network
sudo systemctl stop NetworkManager
还是能ping通!!!
启动又关闭network
sudo systemctl start network
sudo systemctl stop network
断网了, 无ip , 不能ping
启动又关闭NetworkManager
sudo systemctl start NetworkManager
sudo systemctl stop NetworkManager
有ip 能ping
心得:
启动network能打开网络, 关闭network能关闭网络
启动NetworkManager能打开网络,关闭不会关闭网络
在两者都启动的情况下, 单停network会断网,单停NetworkManager不会
一些摘抄
- 系统会优先启动NetworkManager,再启动network避免NetworkManager的配置被篡改。
- -在启动时,network读取所有ifcfg文件,对于每个ONBOOT=yes的文件,它检查NetworkManager是否已经从该ifcfg文件启动设备。如果NetworkManager正在启动该设备或已经启动该设备,则不再对该文件执行任何操作,并检查下一个ONBOOT=yes文件。如果NetworkManager还没有启动该设备,那么初始化脚本将继续下去,并为该ifcfg文件调用ifup。
|