Static IP address on Ubuntu 8.10

Last Friday I upgraded my install from Ubuntu 7.04 to 8.10 Intrepid Ibex on my office workstation and I noticed that I was unable to assign static IP to the machine. After reboot the netmask was getting messed up and reset to 22. Look at this bug for more info.

So, I ditched the native ubuntu Network Manager and installed wicd which is another open source network manager that works with Ubuntu. But after configuring wicd with the static IP, I had another problem. Everytime I restarted the machine, I had to manually start the wicd network manager. Instead of trying anything more with wicd, I decided to ditch a network manager altogether and just configure the files myself.

So, to get the network working with static IP, first remove the network manager (Many people have said that it is not necessary, but I prefer to remove it as I wont be using it anyway):

sudo apt-get remove --purge network-manager

Then modify the /etc/resolv.conf with the dns servers and domain names:

search foo.bar.com bar.com
nameserver 192.168.0.1
nameserver 192.168.0.2

Now, modify /etc/network/interfaces and add

auto eth0
iface eth0 inet static
address 192.168.0.10
netmask 255.255.252.0
gateway 192.168.0.253

Now, just restart the networking:

sudo /etc/init.d/networking restart

Obviously, you should figure out the netmask, gateway and name servers before you start these steps.

This is all that you need to do to configure the machine with a static IP.