Network Manager, a HOWTO

That accursed network manager

I hate network manager, and you should too!

As near as I can tell, network manager (popularly known as network mangler), ALWAYS does the WRONG THING. It has cost me time and money, and I am looking for ways to get even.

In particular, a wrong thing it does is to trash my resolv.conf file on every reboot. I would use a LOT of really strong language to describe how I feel about this piece of software, except that it is possible that women, small children, and people of gentle and sensitive dispositions might find and read this page. Let it just be said that network manager is a cheeseball piece of crap.

So what is it that network manager does so badly?

  1. Makes the simple world of static network configuration ugly.
  2. Overwrites my resolv.conf file.
  3. Reconfigures my network after rc.local runs, obliterating some special routes I set up there.

OK, so how do I just get rid of it?

One might hope that the following simple steps would solve this problem, but it seems that these are not always quite enough:

service NetworkManager stop
chkconfig NetworkManager off
yum erase NetworkManager
NOTE: Do not do this remotely, as the system will drop off the network when you do this; better do this from the console. The bottom line is that after doing the right thing and nuking network manager from orbit, you will need to do:
chkconfig network on
service network restart
I haven't figured out a way to do this remotely yet. In fact one machine I remotely administer was using LDAP to handle all of the user logins, and did not allow root logins from the console, so after nuking network manager, the only way to get back into this machine and straighten out the mess was to boot the machine single user and then use chkconfig to reenable the network.

Other suggestions

As you might expect, I am not the only person who has suffered with the business of network manager trashing the resolv.conf file. None of this rude behavior is documented, and there seems to be more to it that just eliminating network manager, as meritorious as that indeed is. Here are some random suggestions from other suffering fedora users:

  1. Make the resolv.conf file immutable via:
    su
    chattr +i /etc/resolv.conf
    
  2. Modify the file /etc/sysconfig/networking/profiles/default/resolv.conf
    cp /etc/resolv.conf /etc/sysconfig/networking/profiles/default/resolv.conf
    
  3. Ensure that you do NOT have a file /etc/resolv.conf.save, as several scripts will copy this over the top of /etc/resolv.conf.

  4. Use System->Administration->Network to run the network configuration utility (system-config-network), double-click on the network interface of choice and:
    unclick "Controlled by network manager"
    
  5. Edit the file /etc/sysconfig/networking/devices/ifcfg-eth0 and add a line PEERDNS=no. This is supposed to (someday) be a flag that network manager will check and respect, but this may or may not be the case with your current release. You can also add lines to this same file with DNS1=xxx, DNS2=yyy, and so on.

    There is some tool called nm-connection-editor that you can use to do this.

  6. One hardy soul even got so fed up that he hacked the network manager binary itself so that it would install his dns servers in resolv.conf (now that is using the big hammer!!).

But what if I have a laptop with wireless?

I don't know and don't care. I gave up on linux on laptops years ago. But I will say this, I would consider running windows rather than dealing with network manager. (This is a lot like saying "my wife drove me to drink"). It is clear that the horrors that network manager afflicts on the world at large (i.e. those of us with static IP addresses) are a side effect of whatever network dynamics network manager is trying to cope with in the world of wireless.

Not my problem, I don't care, best of luck to you.


Have any comments? Questions? Drop me a line!

Adventures in Computing / [email protected]