Methods of payment Abuse

How to disable Network Manager

02.03.2021, 20:45

In some Linux distributions, a feature-rich network connection management manager called Network Manager is installed by default. In some cases, it is no longer needed and users are looking for ways to disable it.

The reasons are varied: the need to manage the Wi-Fi adapter, to configure the Internet from the console, there is an alternative way to manage the network. Regardless of the distribution for this purpose you can use the utility systemctl.

So, to disable Network Manager Ubuntu, CentOS or Debian, all you need to do is run the command:

$ sudo systemctl stop

Make sure to disable the NetworkManager program using nmcli:

$ nmcli list

A service message will appear that the program no longer manages network settings. To disable NetworkManager immediately after the system boots, run the command:

$ sudo systemctl disable

You can prevent the program from configuring the network for interfaces. To do this, add the command to the line /etc/NetworkManager/NetworkManager.conf:

$ vi /etc/NetworkManager/NetworkManager.conf
managed = false

Next you need to add the configuration for the interface, for example enp0s2 to the file, /etc/network/interfaces, if it is not there:

$ vi /etc/network/interfaces
iface eth1 inet static
address 192.168.0.102
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 8.8.8.8

For CentOS or Fedora you need to create a similar interface configuration file in the /etc/sysconfig/network/ folder.

For example:

vi /etc/sysconfig/network/enp0s3.conf
TYPE=Ethernet
BOOTPROTO=dhcp
NAME=enp0s3
UUID=9c3362c0-a615-4504-bb07-f2951f3810dd
DEVICE=enp0s3
ONBOOT=yes
IPADDR=192.168.1.2
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=8.8.8.8


After a reboot, the specified interface will no longer be managed via NetworkManager. But that's not all. If you decide to uninstall the program because you no longer need it at all, run this command:

$ sudo apt remove network-manager

In older versions of Ubuntu, the command is slightly different:

$ echo "manual" | sudo tee /etc/init/network-manager.override

Enter the password and reboot the system. If you did not delete the manager, but just disabled it, and after a while it became necessary, use the commands:

$ sudo systemctl enable NetworkManager
$ sudo systemctl start NetworkManager

But don't forget to delete the managed=false line.