Easy Steps To Disable NetworkManager on AlmaLinux 8

[rank_math_breadcrumb]

Share your love

In this tutorial on the Orcacore website, 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 guide 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 filesinterface 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 -y

Stop NetworkManager Service

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
Stop Network Manager AlmaLinux 8

Disable NetworkManager Control

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 ifconfig -a:

sudo vi /etc/sysconfig/network-scripts/ifcfg-ens2

Add the following line to the file:

NM_CONTROLLED="no"

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.

Conclusion

At this point, you have learned to Disable NetworkManager on AlmaLinux 8. Stopping and Disabling NetworkManager on AlmaLinux 8 will prevent conflicts with manual network configurations or other network management tools.

Hope you enjoy it. You may also like these articles:

Monitor Linux Network Bandwidth Usage with nload Command

How To Configure Networking on AlmaLinux

How To Configure Networking on Rocky Linux

FAQs

Why disable NetworkManager on AlmaLinux 8?

To avoid conflicts with manual network configurations or other network management tools like network-scripts.

What replaces NetworkManager after disabling it?

You can use network.service (legacy network-scripts) or configure networking manually with nmcli and ip commands.

Will disabling NetworkManager affect my internet connection?

Yes, unless you configure networking manually or use another network management tool.

Can I re-enable NetworkManager if needed?

Yes, you can use the following commands:
systemctl unmask NetworkManager
systemctl enable --now NetworkManager
Share your love

Stay informed and not overwhelmed, subscribe now!