How To Uninstall, Disable, and Remove NetworkManager from RHEL6 and CentOS6

The default install of Red Hat Enterprise Linux 6 (RHEL6 and CentOS6) automatically includes the NetworkManager service which was optional in previous versions. The purpose for NetworkManager is to make RHEL6 more portable which is great for a notebook computer or perhaps a desktop. Portability is not a major concern for a server. Usually servers are fairly fixed and configuration of network settings is done statically using manual tools. NetworkManager also does not support many advanced networking features like IP forwarding.

Textbooks and forum posts tell us to simply use yum to uninstall NetworkManager and then go about setting up our server manually as we have in the past. Unfortunately it is not that easy. RHEL6 also includes the new udev system that is great for removeable devices, but presents problems for server network configuration. In my humble opinion, there is no simple way to reverse these changes in RHEL6.

After researching on the Internet, and a little trial and error, here are my suggestions on how to uninstall, disable, and remove NetworkManager from a RHEL6 server:

  1. Turn off the service, uninstall it, and make sure you do not try to run it after a reboot:
    service NetworkManager stop
    chkconfig NetworkManager off
    yum erase NetworkManager
  2. Find and remove 70-persistent-net.rules and 75-persistent-net-generator.rules:
    rm -f /etc/udev/rules.d/70-persistent-net.rules
    rm -f /lib/udev/rules.d/75-persistent-net-generator.rules
    
  3. Manually configure your network interfaces and DNS, and then restart the network service. Here is an example /etc/sysconfig/network-scripts/ifcfg-eth0 file from one of our VMware virtual servers that has been successfully cloned many times:
    DEVICE=eth0
    NM_CONTROLLED=no     
    ONBOOT=yes
    BOOTPROTO=dhcp       # DHCP client; dynamic address assignment
    TYPE=Ethernet
    DNS1=192.168.10.254  # Insert your nameserver address in this directive
    USERCTL=no
    PEERDNS=yes
    IPV6INIT=no

    Check your interfaces and DNS, then restart the network service:

    system-config-network
    service network restart
    

At this point you should have total manual control of your network interfaces similar to the way we did it back in the days of RHEL4 and 5. If you receive an error message informing you that your interface does not exist, try rebooting your server. You may have to manually edit the /etc/sysconfig/network-scripts/ifcfg-ethx  file to remove unneeded lines created by NetworkManager. If all else fails, create a new /etc/sysconfig/network-scripts/ifcfg-ethx  file from scratch and start the network service.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress spam blocked by CleanTalk.