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.
-
ifup
belongs to theNetworkManager
package 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.service
instead ofNetworkManager.service
. For example:
# systemctl status network