How to Disable Network Manager in CentOS 7

How to Disable Network Manager in CentOS 7, Network Manager, although at times useful, will prevent the installation of certain applications in CentOS. In this article, we will show you how to disable it.

Updated: 14 Apr, 23 by Oliver K 3 Min

List of content you will read in this article:

Network manager is a service that runs in the background of the system. It allows users to easily set up new network connections. Its true usefulness can be seen when attempting to configure a wireless connection or a virtual private network (i.e. VPN).

There are, however, circumstances where this service needs to be disabled and today we will show you exactly how to do that.

 

In order to install some applications on CentOS 7 VPS Server, we have to disable the network manager. Consider that we want to install cPanel, unless the network manager has been disabled, an error will occur at the first step of installation.

Throughout this article, we will provide a step-by-step guide on how to make this and other installations possible. Let’s dive straight into it:

Step 1: First, log in to the CentOS server using an SSH connection. (check out this blog if you want more info)

Step 2: Enter the following commands to stop the network manager and remove it from the Linux VPS server startup.
systemctl stop NetworkManager.service
systemctl disable NetworkManager.service

Step 3: Then enter the following directory:
cd /etc/sysconfig/network-scripts

Step 4: Use the ls command to list all files in this directory and find out your network adapter name.

ls
Step 5: Then, use an editor to open the file. For example, our network adaptor name is “eno2656”, therefore we use the VI editor to open this file.
VI eno2656
Note: you can also use the “nano” editor to open this file.
Step 6: Once in the editor, you can see the network adaptor configuration. Add the following line at the bottom and save the file.
NM_CONTROLLED=no
Please note: you should enter the command in the same way as you see above (including upper and lower case letters).

Step 7: Now, enter the following command to start the Linux default network service.
systemctl enable network.service
chkconfig network on
With these steps, you changed the network interface controller from network manager to Linux default network manager.
Optional Step: In the end, you can remove the network manager service with the following command:
yum remove NetworkManager

 

While for regular everyday use the network manager could bring a lot of convenience, for more server-related tasks, the service needs to be disabled. We hope that with the help of this short tutorial you were able to successfully disable the network manager. If you have any questions or suggestions, please leave them in the comment section below.

Oliver K

Oliver K

I’m Oliver k. I have MS degree in Computer Engineering. For nearly 5 years that I have been working on web programing and also in last 2 years I have worked on windows and Linux VPS. This is my honor to share my experiences with a new community.

user monovm

arash

2020, Aug, 20

hello Thanks for this tutorial I think NM_CONTROLED=no should change to NM_CONTROLLED=no

user monovm

Susith Nonis

2020, Aug, 20

Hey! Thanks for the input Arash! We will change it ;)