CentOS / RHEL 5, 6 : how to disable NetworkManager

What is NetworkManager?

– NetworkManager is a dynamic network control and configuration system that attempts to keep network devices and connections up and active when they are available.
– NetworkManager consists of a core daemon, a GNOME Notification Area applet that provides network status information, and graphical configuration tools that can create, edit and remove connections and interfaces.
– NetworkManager can be used to configure the following types of connections: Ethernet, wireless, mobile broadband (such as cellular 3G), and DSL and PPPoE (Point-to-Point over Ethernet).
– If “NetworkManager” is not required then it can be removed from the system. Ideally, NetworkManager is not useful on a server systems. It is useful when we deal with dynamic connections, for eg: A Desktop/laptop with multiple connections (wired, wireless, broad band etc.) in such cases NetworkManager automatically detects the devices (through d-bus) and configure it.

Disabling NetworkManager in RHEL 5,6

The steps below will disable network manager and allow the interface to be managed by the network service instead.

1. Stop the NetworkManager service using service command.

# service NetworkManager stop

2. Disable it permanently so that the NetworkManager service will not be started on next boot. Use the command chkconfig to disable the NetworkManager service to not start across reboots.

# chkconfig NetworkManager off

3. Verify if the NetworkManager service has been disabled.

# chkconfig --list|grep NetworkManager

4. Add below parameter in /etc/sysconfig/network-scripts/ifcfg-ethX to ensure NetworkManagerdoes not take control of the interface in case if it is accidentally activated.

NM_CONTROLLED="no"
Note: If you do not change NM_CONTROLLED=”yes” to “no”, the network service may complain about “Connection activation failed” when it cannot find an interface to start.

Switching to the “network” service

Once NetworkManager is disabled, the interface can be configured for use with the network service.

1. Set the correct IP address by editing the file: /etc/sysconfig/network-scripts/ifcfg-eth0

IPADDR=......  
NETMASK=.....  
GATEWAY=.....  
ONBOOT=yes  
BOOPROTO=static
NM_CONTROLLED=no

2. Set the DNS servers to be used by editing the file /etc/resolv.conf.

nameserver 10.10.10.1
nameserver 10.10.10.2

3. Enable the network service to start after boot autmoatically and restart it.

# chkconfig network on
# service network restart
Related Post