Networking Your Way

Some versions of Linux (e.g. Ubuntu) include a fabulous little package for managing the network called Network Manager. While this gem may be a good idea for someone's laptop (where the network address is acquired automagically by DHCP, and/or networking is done via multiple connections), its probably going to be a real pain in the butt if you want your machine to have a single, static IP address. Basically, this package is a piece of scrap that does not work. Sure, as we said, it will configure your network for use by DHCP but, if you want to change one of the interfaces to a static IP address, you'll waste a lot of time before you figure out what a piece of junk it is. Sure, it looks like it is configuring your interfaces the way you want them but in reality it is leading you down the garden path. After you carefully configure the interface just the way you want it, nothing happens. And, when you reboot, all your changes are gone and you're back to DHCP. Who needs this?

So, if you don't want to bother with all of the grief caused by trying to set up static IP addresses via the Network Manager, begin by uninstalling the Network Manager package, using the Package Manager. This is by far and away the easiest way to disable it. Pick the "Networking" section and then do a search for "network-manager". You should see the package at the head of the list. Uninstall it.

/etc/network/interfaces:

Edit this file so that it looks something like this:

     auto lo
     iface lo inet loopback
     auto eth0
     iface eth0 inet static
          address 192.168.1.8
          netmask 255.255.255.0
          gateway 192.168.1.1
     auto ethx
          .
          .
          .

/etc/resolv.conf:

You'll also need to put your DNS servers in the resolv.conf file so that they look something like this:

     nameserver 151.203.0.84
     nameserver 151.203.0.85
     nameserver 204.122.16.8
     nameserver 216.231.41.2

Once you're done, a reboot should prove that everything is working OK.