Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
How to Disable NetworkManager in CentOS/RHEL 8?
NetworkManager is a daemon that manages network connections on Red Hat Enterprise Linux (RHEL) and CentOS systems. 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 mechanisms like DHCP (Dynamic Host Configuration Protocol), PPP (Point-to-Point Protocol), and static IP addresses to connect to networks dynamically. Additionally, it supports advanced features like bonding multiple interfaces together for increased bandwidth or redundancy.
Understanding NetworkManager
How NetworkManager Works
NetworkManager works by using a combination of tools and protocols. It uses DHCP to assign IP addresses automatically, Wireless Extensions (WEXT) for wireless network support, and various plugins like the wired plugin for Ethernet interfaces and the Wi-Fi plugin for wireless ones. It also interacts with system components such as dnsmasq for DNS resolution, wpa_supplicant for WPA/WPA2 encryption support, and ModemManager for managing cellular data modems.
Advantages and Disadvantages
| Advantages | Disadvantages |
|---|---|
| User-friendly GUI for easy network management | Resource consumption may slow system performance |
| Comprehensive features for various connection types | Conflicts with other network management tools |
| Automatic detection saves configuration time | Limited flexibility for advanced configurations |
Disabling NetworkManager
There are scenarios where disabling NetworkManager is necessary, such as when specific network configurations are required or when it interferes with other network services. Here are the methods to disable NetworkManager in CentOS/RHEL 8.
Method 1: Using systemctl Commands
First, stop the NetworkManager service
sudo systemctl stop NetworkManager
Disable it from starting at boot time
sudo systemctl disable NetworkManager
Verify the service status
sudo systemctl status NetworkManager
Method 2: Using nmcli Command
You can temporarily disable all network interfaces managed by NetworkManager using the nmcli utility
sudo nmcli networking off
To re-enable networking later
sudo nmcli networking on
Method 3: Complete Removal (Optional)
If you want to completely remove NetworkManager from the system
sudo yum remove -y NetworkManager*
Warning: Removing packages can cause dependency issues. Proceed with caution and ensure no critical dependencies are removed.
Alternative Network Management
After disabling NetworkManager, you can use traditional network configuration methods
Using network-scripts
Install the legacy network service
sudo yum install -y network-scripts
Enable and start the network service
sudo systemctl enable network sudo systemctl start network
Manual Configuration
Configure network interfaces manually by editing configuration files in /etc/sysconfig/network-scripts/. For example, edit /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet BOOTPROTO=static IPADDR=192.168.1.100 NETMASK=255.255.255.0 GATEWAY=192.168.1.1 DNS1=8.8.8.8 ONBOOT=yes
Benefits and Drawbacks
| Benefits of Disabling | Drawbacks of Disabling |
|---|---|
| Improved network performance | Loss of automatic network detection |
| Reduced resource consumption | More complex manual configuration |
| Greater control over network settings | No GUI for network management |
| Elimination of potential security vulnerabilities | Difficulty managing wireless connections |
| No conflicts with other network tools | Applications depending on NetworkManager may malfunction |
Conclusion
Disabling NetworkManager in CentOS/RHEL 8 provides greater control over network configurations and can improve system performance. However, it requires manual network management and removes the convenience of automatic network detection. The decision should be based on your specific requirements and technical expertise level.
