How to Disable Network Manager on CentOS Stream 9
NetworkManager is the default tool for configuring and managing the network services on CentOS Stream 9, sometimes there are situations where we need to permanently disable the NetworkManager, and use alternative methods to configure and manage the network. This wiki describes how to permanently disable NetworkManager on CentOS Stream 9.
To check the service's status right now, run the command below,
systemctl status NetworkManager
Output:
[root@vps ~]# systemctl status NetworkManager
● NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; p>
Active: active (running) since Fri 2023-06-23 14:39:22 UTC; 16min ago
Docs: man:NetworkManager(8)
Main PID: 583 (NetworkManager)
Tasks: 3 (limit: 11134)
Memory: 9.7M
CPU: 1min 5.393s
CGroup: /system.slice/NetworkManager.service
└─583 /usr/sbin/NetworkManager --no-daemon
Jun 23 14:39:22 vps.server.com NetworkManager[583]: <info> [1687531162.8708] d>
Jun 23 14:39:24 vps.server.com NetworkManager[583]: <info> [1687531164.8747] d>
To stop the Network Manager Service, run the following command.,
systemctl stop NetworkManager
Output:
[root@vps ~]# systemctl stop NetworkManager
To disable the Network Manger service using the following command,
systemctl disable NetworkManager
Output:
[root@vps ~]# systemctl disable NetworkManager
Removed "/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service".
Removed "/etc/systemd/system/multi-user.target.wants/NetworkManager.service".
Removed "/etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service".
Verify the Network Manager Service is shut down and auto start across reboot is disabled, run the following command to confirm,
systemctl status NetworkManager
systemctl is-enabled NetworkManager
Output:
[root@vps ~]# systemctl status NetworkManager
○ NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; disabled; >
Active: inactive (dead)
Docs: man:NetworkManager(8)
Jun 23 14:56:44 vps.server.com systemd[1]: Stopping Network Manager...
Jun 23 14:56:44 vps.server.com NetworkManager[583]: <info> [1687532204.4558] c>
Jun 23 14:56:44 vps.server.com NetworkManager[583]: <info> [1687532204.4654] d>
Jun 23 14:56:44 vps.server.com NetworkManager[583]: <info> [1687532204.4654] d>
Jun 23 14:56:44 vps.server.com NetworkManager[583]: <info> [1687532204.4655] d>
Jun 23 14:56:44 vps.server.com NetworkManager[583]: <info> [1687532204.4673] m>
Jun 23 14:56:44 vps.server.com NetworkManager[583]: <info> [1687532204.4767] e>
Jun 23 14:56:44 vps.server.com systemd[1]: NetworkManager.service: Deactivated >
Jun 23 14:56:44 vps.server.com systemd[1]: Stopped Network Manager.
Jun 23 14:56:44 vps.server.com systemd[1]: NetworkManager.service: Consumed 1mi>
[root@vps ~]# systemctl is-enabled NetworkManager
disabled
Done! Network Manager Service is currently disabled and has been stopped across reboots.