How to disable NetworkManager in RHEL 8 ?
环境
Red Hat Enterprise Linux (RHEL) 8
问题
What steps are needed to disable the NetworkManager service?
决议
At first, please note that the old networks-scripts have been deprecated and are not the defaults anymore.
-
ifupbelongs to theNetworkManagerpackage by default.# readlink $(which ifup) /etc/alternatives/ifup # readlink $(readlink $(which ifup)) /usr/libexec/nm-ifup -
You can change this behaviour by installing the package below. After that, the ifcfg configurations will be handled by the
network.service# yum install network-scripts # readlink $(readlink $(which ifup)) /etc/sysconfig/network-scripts/ifup -
Be aware that you'll get a warning on deprecation:
# ifup ens3 WARN : [ifup] You are using 'ifup' script provided by 'network-scripts', which are now deprecated. WARN : [ifup] 'network-scripts' will be removed in one of the next major releases of RHEL. WARN : [ifup] It is advised to switch to 'NetworkManager' instead - it provides 'ifup/ifdown' scripts as well. -
If you are annoyed by this warning, you can disable them at your own risk:
# touch /etc/sysconfig/disable-deprecation-warnings -
After that, you should be able to do the same configuration as on your RHEL 7:
- Stop and disable the NetworkManager
# systemctl stop NetworkManager # systemctl disable NetworkManager-
Add the
NM_CONTROLLED="no"parameter to your/etc/sysconfig/network-scripts/ifcfg-<DEV>files to ensure that NetworkManager won't handle your device, where<DEV>is your network interface card (e.g. eth0, ens3, enp2s0f0, ...). -
Use the
network.serviceinstead ofNetworkManager.service. For example:
# systemctl status network

本文指导如何在Red Hat Enterprise Linux 8中禁用NetworkManager服务,包括停止服务、禁用启动、更改配置文件以确保NetworkManager不控制网络设备,并切换到使用network.service进行网络配置。
527

被折叠的 条评论
为什么被折叠?



