天天看點

How to disable NetworkManager in RHEL 8 ?How to disable NetworkManager in RHEL 8 ?

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 the 

    NetworkManager

     package by default.

    Raw

    # 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

    Raw
    # yum install network-scripts
    
    # readlink $(readlink $(which ifup))
    /etc/sysconfig/network-scripts/ifup
               
  • Be aware that you'll get a warning on deprecation:

    Raw

    # 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:

    Raw

    # 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
    Raw
    # 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 of 

      NetworkManager.service

      . For example:
    Raw
    # systemctl status network           

繼續閱讀