• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Disable NetworkManager in CentOS/RHEL 8

by admin

Although NetworkManager is the default tool for configuring and managing the network services on CentOS/RHEL 8, there are situations where it may be necessary to permanently disable NetworkManager, and use alternative methods to configure and manage the network. This document describes how to permanently disable NetworkManager on CentOS/RHEL 8.

Note: Use of “networks-scripts” is deprecated in CentOS/RHEL 8.

Disabling NetworkManager in CentOS/RHEL 8

1. The following three commands are needed to stop immediately the NetworkManager service and prevent it being restarted subsequently during this session and after rebooting:

# systemctl mask NetworkManager.service
# systemctl stop NetworkManager.service
# systemctl disable NetworkManager.service

2. Confirm that he NetworkManager service has been disabled:

# systemctl list-unit-files | grep NetworkManager

3. If systemctl list-unit files shows output similar to the out below, then follow the next step:

# systemctl list-unit-files | grep NetworkManager

  NetworkManager-dispatcher.service disabled
  NetworkManager-wait-online.service enabled
  NetworkManager.service disabled

4. If you see NetworkManager-wait-online.service enabled then disable the same as below:

# systemctl mask NetworkManager-wait-online.service
# systemctl disable NetworkManager-wait-online.service

Re-check the status.

# systemctl list-unit-files | grep NetworkManager

Enabling network-scripts in CentOS/RHEL 8

Although network-scripts is disabled in CentOS/RHEL 8, some of you may still want the old way of configuring networking. You can still do it by installing the “network-scripts” package for that.

# yum install network-scripts

Once you have installed the above package, all the ifcfg configurations will now be managed by the network.service. You may get below warnings, on using the ifup/ifdown command:

# ifup ens4
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.

These warnings are harmless and can be ignored. You can also disable these warning by:

# touch /etc/sysconfig/disable-deprecation-warnings

You can start using network.service instead of NetwrokManager.service from here on. For examample:

# systemctl status network

You may also want to enable the network service to start after boot:

# systemctl enable network

Disabling NetworkManager in “network-scripts”

Add the below parameter in /etc/sysconfig/network-scripts/ifcfg-ethX of interfaces that are managed by NetworkManager to make it unmanaged. Here, ethX is the interface on which you want to disable the NetworkManager.

# vi /etc/sysconfig/network-scripts/ifcfg-ethX
NM_CONTROLLED="no"
Note: Be sure to change the NM_CONTROLLED=”yes” to “no” or the network service may complain about “Connection activation failed” when it cannot find an interface to start.
CentOS / RHEL 5, 6 : how to disable NetworkManager
How to disable NetworkManager on CentOS / RHEL 7

Filed Under: CentOS/RHEL 8, Linux

Some more articles you might also be interested in …

  1. How To Customize The Screensaver Options In Gnome on CentOS/RHEL 7
  2. Linux OS Service ‘iptables’
  3. mktemp Command Examples in Linux
  4. How to Change the Default Timeout Settings for Telnet Session in CentOS/RHEL
  5. Yum Command – RPM Based Package Management Utility
  6. Linux OS Service ‘smartd’
  7. apt-key: command not found
  8. numactl Command Examples in Linux
  9. How To Auto Mount a FileSystem Using Systemd
  10. How to Configure YUM to connect to Oracle Public Repository in Oracle Enterprise Linux

You May Also Like

Primary Sidebar

Recent Posts

  • raw: command not found
  • raw Command Examples in Linux
  • rankmirrors Command Examples in Linux
  • radeontop: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright