In this tutorial, we want to teach you How To Disable NetworkManager on AlmaLinux 8.
The NetworkManager daemon attempts to make networking configuration and operation as painless and automatic as possible by managing the primary network connection and other network interfaces, like Ethernet, WiFi, and Mobile Broadband devices. NetworkManager will connect any network device when a connection for that device becomes available unless that behavior is disabled. Information about networking is exported via a D-Bus interface to any interested application, providing a rich API with which to inspect and control network settings and operation.
If you plan to disable your NetworkManager service on your AlmaLinux server, follow the steps below.
Steps To Disable NetworkManager on AlmaLinux 8
To complete this guide, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide on Initial Server Setup with AlmaLinux 8.
Disabling NetworkManager on AlmaLinux 8
First, you need to update your local package index with the following command:
sudo dnf update -y
Then, you need to install the Epel repository on your AlmaLinux server:
sudo dnf install epel-release -y
Next, you need to install network scripts on AlmaLinux.
Install Network Scripts on AlmaLinux 8
The configuration files for network interfaces and the scripts to activate and deactivate them are located in the /etc/sysconfig/network-scripts/ directory. While the existence of interface files can differ from system to system, the three different types of files that exist in this directory, interface configuration files, interface control scripts, and network function files, work together to enable Red Hat Linux to use various network devices.
To install it on your server, run the command below:
sudo dnf install network-scripts
When you are done, you can use the command below to disable the NetworkManager:
sudo systemctl stop NetworkManager
You can verify your NetworkManager status by using the command below:
sudo systemctl status NetworkManager
Output ● NetworkManager.service - Network Manager Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; ven> Active: inactive (dead) since Mon 2022-11-07 08:15:22 EST; 6s ago Docs: man:NetworkManager(8) Process: 659 ExecStart=/usr/sbin/NetworkManager --no-daemon (code=exited, sta> Main PID: 659 (code=exited, status=0/SUCCESS) ...
At this point, you need to edit the /etc/sysconfig/network-scripts/ifcfg file and add the NM_Controlled=no to the interface config file.
Open the file with your favorite text editor and change the interface name from
sudo vi /etc/sysconfig/network-scripts/ifcfg-ens2
Add the following line to the file:
When you are done, save and close the file.
To apply the changes, restart the Network:
# sudo systemctl restart network # sudo systemctl enable network
For more information, you can visit the NetworkManager Documentation page.
At this point, you have learned to Disable NetworkManager on AlmaLinux 8.
Hope you enjoy it.
You may be like these articles:
Monitor Linux Network Bandwidth Usage with nload Command
How To Configure Networking on AlmaLinux