FedoraRHEL Based

How To Disable NetworkManager on Fedora 39

Disable NetworkManager on Fedora 39

In this tutorial, we will show you how to install Disable NetworkManager on Fedora 39. NetworkManager is a powerful tool that simplifies network configuration and management on Fedora and other Linux distributions. It automatically detects and configures network devices, manages wireless connections, and supports VPN connectivity. While NetworkManager is convenient for most users, there may be situations where you need to disable it, such as when using custom network configuration scripts, troubleshooting network issues, or setting up advanced networking features like bridging or bonding.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step disable NetworkManager on a Fedora 39.

Prerequisites

Before diving into the installation process, let’s ensure that you have everything you need:

  • A server running one of the following operating systems: Fedora 39.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • You will need access to the terminal to execute commands. Fedora 39 provides the Terminal application for this purpose. It can be found in your Applications menu.
  • A network connection or internet access.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Disable NetworkManager on Fedora 39

Step 1. Keeping your system up-to-date is crucial for security and stability. Start by running the following command to update your Fedora 39 installation:

sudo dnf clean all
sudo dnf update

Step 2. Checking if NetworkManager is Running.

Before disabling NetworkManager, it’s a good idea to check if it’s currently running on your Fedora 39 system. You can do this using the systemctl command:

sudo systemctl status NetworkManager

If NetworkManager is active, you’ll see output similar to the following:

● NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2024-03-07 09:30:15 EDT; 2h 16min ago
Docs: man:NetworkManager(8)
Main PID: 1234 (NetworkManager)
Tasks: 3 (limit: 4915)
Memory: 20.3M
CPU: 2.643s
CGroup: /system.slice/NetworkManager.service
└─1234 /usr/sbin/NetworkManager --no-daemon

Alternatively, you can use the nmcli tool to list the interfaces managed by NetworkManager:

nmcli device

This command will display a list of network interfaces and their current state, indicating whether they are managed by NetworkManager.

Step 3. Disable NetworkManager on Fedora 39.

To disable NetworkManager on Fedora, follow these steps:

First, stop the NetworkManager service:

sudo systemctl stop NetworkManager

Disable the NetworkManager service to prevent it from starting at boot:

sudo systemctl disable NetworkManager

(Optional) Mask the NetworkManager service to prevent it from being started manually:

sudo systemctl mask NetworkManager

Masking a service is a stronger form of disabling, as it prevents the service from being started even if another service or process tries to start it.

After disabling NetworkManager, your system will no longer have an active network connection. You’ll need to configure your network interfaces manually to restore connectivity.

Configure a static IP address using Fedora’s network scripts. Open the configuration file for your primary network interface (e.g., ifcfg-eth0) in a text editor:

sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0

Modify the file to include the following lines, replacing the IP address, netmask, gateway, and DNS server values with your own:

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.1.100
NETMASK=255.255.255.0 
GATEWAY=192.168.1.1
DNS1=8.8.8.8

Save the file and exit the text editor, then restart the network service for the changes to take effect:

sudo systemctl restart network

Your system should now have a working network connection using the manually configured static IP address.

To re-enable NetworkManager in the future, simply unmask (if masked), enable, and start the service:

sudo systemctl unmask NetworkManager
sudo systemctl enable NetworkManager
sudo systemctl start NetworkManager

Step 4. Disabling NetworkManager for a Specific Interface.

In some cases, you may want to disable NetworkManager for a specific network interface while keeping it active for others. To achieve this, you can configure the interface manually in the /etc/network/interfaces file and update NetworkManager to ignore the interface.

Open the /etc/network/interfaces file in a text editor:

sudo nano /etc/network/interfaces

Add the following lines to the file, replacing <interface-name> with the actual name of the interface you want to configure manually:

auto <interface-name>
iface <interface-name> inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8

Adjust the address, netmask, gateway, and dns-nameservers values according to your network setup.

Next, open the NetworkManager configuration file (/etc/NetworkManager/NetworkManager.conf) in a text editor:

sudo nano /etc/NetworkManager/NetworkManager.conf

Locate the [main] section and add the following line to ignore the interface configured in /etc/network/interfaces:

[main]
plugins=ifupdown,keyfile
...
[ifupdown]
managed=false

Save the file and exit the text editor, then restart the NetworkManager service for the changes to take effect:

sudo systemctl restart NetworkManager

NetworkManager will now ignore the specified interface, allowing it to be managed manually while continuing to manage other interfaces automatically.

Congratulations! You have successfully disabled NetworkManager. Thanks for using this tutorial for Disable NetworkManager on your Fedora 39 system. For additional or useful information, we recommend you check the official Fedora 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 a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button