How to Disable NetworkManager in CentOS/RHEL 8?


Introduction

NetworkManager is a daemon that manages the network connections on Red Hat Enterprise Linux (RHEL) and its community-based counterpart, CentOS. It handles both wired and wireless connections, including ethernet, WiFi, mobile broadband, VPNs, and other network interfaces. The daemon provides a graphical user interface for managing network settings on desktop environments such as GNOME or KDE.

NetworkManager is designed to automatically detect and configure connections based on the available network devices and their properties. It uses a variety of mechanisms to connect to networks dynamically, including DHCP (Dynamic Host Configuration Protocol), PPP (Point-to-Point Protocol), static IP addresses, etc. Additionally, it supports advanced features like bonding multiple interfaces together for increased bandwidth or redundancy.

Understanding NetworkManager

What is NetworkManager?

NetworkManager is a powerful and feature-rich tool that comes pre-installed on CentOS/RHEL 8 operating systems. It provides an easy way to manage network connections, both wired and wireless, by detecting and configuring network interfaces automatically.

This means that when you connect to a new network, NetworkManager will automatically configure the networking settings such as IP address, subnet mask, gateway, DNS servers and more. In addition to configuration management, NetworkManager also provides a graphical user interface for managing network settings.

How does it work?

NetworkManager works by using a combination of tools like the Dynamic Host Configuration Protocol (DHCP), which assigns IP addresses automatically to network devices as they connect to the network; Wireless Extensions (WEXT), which provides support for wireless networks; and ifupdown-scripts which are used for manually configuring networks on Linux. NetworkManager uses various plugins like the wired plugin for Ethernet interfaces and the Wi-Fi plugin for wireless ones. It also interacts with other system components such as dnsmasq for DNS resolution, wpa_supplicant for WPA/WPA2 encryption support, ModemManager for managing cellular data modems and others.

Pros and cons of using NetworkManagerPros

  • User Friendly − the primary advantage of using network manager is that it provides an easy-to-use gui interface that makes it simple to manage your networking configurations.

  • Fully-featured − Another key benefit is its comprehensive set of features are designed to manage many types of networking scenarios including different connection types such as VPNs.

  • Simplified Management − the automatic detection feature saves time in configuring your system's network settings by doing most of the work automatically.

Cons

  • Resource Consumption − networkmanager can consume a significant amount of system resources which may slow down your system performance in certain cases.

  • Incompatibility with other network management tools − Since NetworkManager is a powerful tool, it may conflict with other networking management tools you may have installed on your system.

  • Lack of Flexibility − While it provides ease-of-use, it may not give you the full flexibility that you need to configure certain aspects of your networking throughout the operating system.

NetworkManager has both advantages and disadvantages depending on what specific needs or situations arise. By understanding how this tool works, you can better utilize its features or make an informed decision on whether to disable it in your CentOS/RHEL 8 setup.

Disabling NetworkManager

NetworkManager is a powerful tool for managing network devices and connections in CentOS/RHEL 8. However, there may be instances where disabling it is necessary, such as when a specific network configuration needs to be applied, or when NetworkManager is interfering with other network-related services. In this section, we will provide you with a step-by-step guide on how to disable NetworkManager in CentOS/RHEL 8.

Step-by-step guide on how to disable NetworkManager in CentOS/RHEL 8Stopping the service

The first step to disabling NetworkManager in CentOS/RHEL 8 is to stop the service. To do this, open up a terminal and type the following command −

sudo systemctl stop NetworkManager      

This will immediately stop the running process of NetworkManager. Disabling the service from starting at boot time−

Once we have stopped the NetworkManager service, we can now disable it from starting at boot time. To achieve this, type−

sudo systemctl disable NetworkManager        

This command will prevent the NetworkManager service from starting automatically after rebooting your system. Removing the package (optional) −

If you no longer want to use NetworkManager, you can remove it completely by typing−

sudo yum remove -y NetworkManager*         

Keep in mind that removing packages can sometimes cause unexpected issues if not done correctly. Therefore, it's recommended that you proceed with caution and make sure that no important dependencies are removed alongside with it.

Alternative methods for disabling Network Manager

There are alternative methods for disabling Network Manager in CentOS/RHEL 8. One of them is using nmcli (Network Manager Command-Line Interface) utility which allows users to manage networks directly from their terminals without having to use any graphical interface.

To disable NetworkManager using nmcli, type the following command−

sudo nmcli networking off         

This will turn off all network interfaces managed by NetworkManager. Another alternative method is to use ifupdown, a legacy network management tool that is not pre-installed in CentOS/RHEL 8.

However, it may be worth installing if you prefer a more traditional method for managing your networks. To install ifupdown, type−

sudo yum install -y ifupdown          

Once installed, you can disable NetworkManager and start using ifupdown by modifying the configuration files.

Disabling NetworkManager in CentOS/RHEL 8 requires careful execution of commands and understanding of its potential impact on your system's network performance and stability. Therefore, it's essential to weigh the benefits against the drawbacks before proceeding with disabling it completely.

Benefits and Drawbacks of Disabling NetworkManager

Advantages of Disabling NetworkManager

Disabling NetworkManager in CentOS/RHEL 8 can lead to several benefits for users who require more control over their network settings. One of the biggest advantages is improved network performance, as well as reduced resource consumption.

When NetworkManager is disabled, it will no longer attempt to manage and connect to various networks, freeing up more system resources and reducing any potential delays or disruptions caused by the service. Furthermore, disabling NetworkManager will provide increased control over network settings.

Once the service is disabled, users can manually configure network settings and connections with greater precision if needed. This can be particularly useful for advanced users or those with specific networking requirements that may not be met by default configurations.

Another advantage of disabling NetworkManager is the ability to avoid some security vulnerabilities associated with the service. By removing it entirely from a system, a potential attack vector is eliminated which can improve overall system security.

Disadvantages of Disabling Network Manager

Despite its benefits, disabling NetworkManager can also have some drawbacks that must be taken into consideration before making changes to a system's networking configuration. One significant disadvantage is the potential loss of network connectivity when troubleshooting networking problems or when attempting to manage complex systems that require frequent changes in network configuration settings. In such situations, manually configuring networks without assistance from NetworkManager could lead to errors that may cause temporary or even permanent disruption in connectivity.

Additionally, disabling Network Manager could make managing complex networks more difficult for less experienced users. Without automated tools like those provided by NtworkManger, users must rely on manual processes which may consume significant time and effort in maintaining reliable connections.

Albeit rare cases exist where certain applications may depend on specific features offered by NetWork manager so switching off NetWork manager might make those apps unfunctional. Ultimately, the decision to disable NetworkManager will depend on a user's specific needs and requirements.

Conclusion

In this article, we have discussed what NetworkManager is and how to disable it in CentOS/RHEL 8. We also discussed the pros and cons of disabling NetworkManager and provided alternative methods for those who do not want to completely remove it. Overall, our goal was to provide a comprehensive guide for users who are looking for more control over their network settings.

Updated on: 10-Jul-2023

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements