Saturday 23 November 2019

How to Disable Network Manager on CentOS 8




The Network Manager Service is enabled by default on CentOS 8 and all the network services are managed by Network Manager. Network Manager is not suitable for advanced networking setup, such as configuring Network Bridge, aliases and interface name conversions etc. Alternatively, add "NM_CONTROLLED=no" directive in the network configuration files instead of disabling Network Manager.

This article describes How to Disable Network Manager on CentOS8. By disabling Network Manager allows the interface to be managed only by network service.

Step 1:  Service Status: Run the following command to check the current status of the service:

[root@linuxcnf ~]# systemctl status NetworkManager
NetworkManager.service - Network Manager
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2019-11-23 11:21:18 IST; 7min ago
     Docs: man:NetworkManager(8)
………………..
Nov 23 11:22:32 linuxcnf.localdomain NetworkManager[724]: <info>  [1574488352.1261] dhcp6 (enp0s3):   nameserver 2405:200:800::1
Nov 23 11:22:32 linuxcnf.localdomain NetworkManager[724]: <info>  [1574488352.1611] dhcp6 (enp0s3): state changed unknown -> bound
[root@linuxcnf ~]#

Step 2. Stop Service: Run the following command to stop Network Manager Service:

[root@linuxcnf ~]# systemctl stop NetworkManager
[root@linuxcnf ~]#

Step 3: Disable the Service: Run the following command to disable the service to start on machine reboot:

[root@linuxcnf ~]# systemctl disable NetworkManager
Removed /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.
Removed /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
Removed /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service.
[root@linuxcnf ~]#

Step 4: Verification: Run the following command to verify the Network Manager Service is stopped and disable auto start across reboot:

[root@linuxcnf ~]# systemctl status NetworkManager
NetworkManager.service - Network Manager
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; disabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2019-11-23 11:35:13 IST; 5min ago
     Docs: man:NetworkManager(8)
………………..
Nov 23 11:35:12 linuxcnf.localdomain NetworkManager[724]: <info>  [1574489112.1061] exiting (success)
Nov 23 11:35:13 linuxcnf.localdomain systemd[1]: Stopped Network Manager.
[root@linuxcnf ~]#

[root@linuxcnf ~]# systemctl is-enabled NetworkManager
disabled
[root@linuxcnf ~]#

Done!!! Now Network Manager Service is stopped and disabled across reboot.

No comments:

Post a Comment