CentOSRHEL Based

How To Disable NetworkManager on CentOS Stream 10

Disable NetworkManager on CentOS Stream 10

In this tutorial, we will show you how to install Disable NetworkManager on CentOS Stream 10.  NetworkManager is a powerful tool for managing network connections on Linux systems, including CentOS Stream 10. However, there are scenarios where disabling NetworkManager might be necessary, such as when you need more control over your network settings or when it interferes with specific configurations. In this article, we will guide you through the process of disabling NetworkManager on CentOS Stream 10, along with troubleshooting tips and alternative methods for managing your network.

Understanding NetworkManager

NetworkManager is a dynamic network control and configuration system that automatically detects and configures network connections. It supports various types of connections, including Ethernet, wireless, mobile broadband, and VPNs. NetworkManager is particularly useful for managing multiple network interfaces and provides a user-friendly interface for configuring network settings.

However, NetworkManager can consume system resources and may not be ideal for all environments, especially those requiring precise control over network configurations. In such cases, disabling NetworkManager and using alternative methods to manage network settings can be beneficial.

Preparing Your System

Before disabling NetworkManager, ensure your system is up-to-date. This step is crucial for ensuring that all packages are current and compatible with the changes you will make.

  1. Update CentOS Stream 10:
    sudo dnf update -y
  2. Check NetworkManager Status:
    To verify if NetworkManager is running, use the following command:

    systemctl status NetworkManager

Disabling NetworkManager

Disabling NetworkManager involves stopping the service and preventing it from starting automatically on boot.

Step-by-Step Instructions

  1. Stop NetworkManager:
    Use the following command to immediately stop the NetworkManager service:

    sudo systemctl stop NetworkManager
  2. Disable NetworkManager at Boot:
    To prevent NetworkManager from starting automatically on reboot, run:

    sudo systemctl disable NetworkManager
  3. Verify NetworkManager Status:
    Confirm that NetworkManager is disabled by checking its status and whether it is enabled to start at boot:

    systemctl status NetworkManager
    systemctl is-enabled NetworkManager

Alternative Methods for Disabling NetworkManager

Besides using systemctl, you can also disable NetworkManager using other tools.

Using nmcli

The nmcli command allows you to manage networks directly from the terminal. To disable NetworkManager using nmcli, run:

sudo nmcli networking off

Configuring Devices as Unmanaged

To prevent NetworkManager from managing specific devices, you can modify the device configuration files.

  1. Edit the Interface Configuration File:
    Open the configuration file for your network interface, typically located in /etc/sysconfig/network-scripts/. For example, for eth0, edit /etc/sysconfig/network-scripts/ifcfg-eth0.
  2. Set NM_CONTROLLED to “no”:
    Add or modify the line NM_CONTROLLED=no to prevent NetworkManager from managing this interface.
NAME="eth0"
HWADDR=...
ONBOOT=yes
BOOTPROTO=none
IPADDR=...
NETMASK=...
GATEWAY=...
TYPE=Ethernet
NM_CONTROLLED=no

Removing NetworkManager (Optional)

If you no longer need NetworkManager, you can remove it completely.

  1. Remove NetworkManager Package:
    Use the following command to remove NetworkManager:

    sudo dnf remove -y NetworkManager*

Configuring Network Settings Manually

After disabling NetworkManager, you will need to configure your network settings manually. This can be done using traditional network scripts.

Using ifupdown or Network Scripts

  1. Install Network Scripts Package (if necessary):
    In CentOS Stream 10, network scripts are not deprecated like in CentOS 8, but if you’re using a version where they are, you might need to install them:

    sudo dnf install -y network-scripts
  2. Configure Network Interface:
    Edit the configuration file for your network interface (e.g., /etc/sysconfig/network-scripts/ifcfg-eth0) and set the IP address, netmask, gateway, and other necessary settings.

    NAME="eth0"
    HWADDR=...
    ONBOOT=yes
    BOOTPROTO=none
    IPADDR=192.168.1.100
    NETMASK=255.255.255.0
    GATEWAY=192.168.1.1
    TYPE=Ethernet
    NM_CONTROLLED=no
  3. Set DNS Servers:
    Configure your DNS servers by editing /etc/resolv.conf:

    nameserver 8.8.8.8
    nameserver 8.8.4.4
  4. Enable and Restart Network Service:
    To apply your manual network settings, enable and restart the network service:

    sudo systemctl enable network
    sudo systemctl restart network

Benefits and Drawbacks of Disabling NetworkManager

Benefits

  • Improved Performance: Disabling NetworkManager can reduce system resource usage, which might improve overall system performance.
  • Increased Control: Manual network configuration provides more control over network settings, which is beneficial for specific network environments.

Drawbacks

  • Loss of Automatic Configuration: Without NetworkManager, you will lose the ability to automatically detect and configure network connections.
  • Potential Issues: Manual configuration can lead to errors if not done correctly, potentially causing network connectivity issues.

Troubleshooting Common Issues

If you encounter network connectivity issues after disabling NetworkManager, here are some troubleshooting steps:

  1. Check Network Interface Status:
    Use ip addr to verify that your network interfaces are up and configured correctly.
  2. Restart Network Service:
    Try restarting the network service to apply any changes:

    sudo systemctl restart network
  3. Verify DNS Configuration:
    Ensure that your DNS servers are correctly configured in /etc/resolv.conf.
  4. Test Internet Connectivity:
    Use ping to test connectivity to external hosts:

    ping -c 4 8.8.8.8

Congratulations! You have successfully disabled NetworkManager. Thanks for using this tutorial for Disable NetworkManager on your CentOS Stream 10 system. For additional or useful information, we recommend you check the official CentOS website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button