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:


Now, modify /etc/network/interfaces and add

auto eth0
iface eth0 inet static

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.


  1. I followed your instructions, but ran into problems. After looking, I noticed that the instruction
    iface inet eth0 static
    is incorrect. It should be
    iface eth0 inet static
    I was able to proceed after that change.

  2. Yeah, I found out the hard way the only way to make Ubuntu 8.10 actually use static IP addresses is to get rid of network-manager (check my comment here (it’s the very last one). This is pretty important for people wishing to use Host Networking for VirtualBox, like myself.

    @Gregory: It is true there should be no need to remove it, but that is why this seems to have been classified as a bug.

  3. That’s exactly where I was needing the static IP, host networking in VirtualBox 🙂

  4. There is no need to remove Network Manager
    just modify modify the
    /etc/resolv.conf with the dns servers and domain names:

    nameserver #.#.#.#
    nameserver #.#.#.#

    Now, modify /etc/network/interfaces and add

    auto eth0
    iface eth0 inet static
    address #.#.#.#
    netmask #.#.#.#
    gateway #.#.#.#

    and this is all……

  5. and
    for restart networking
    type in terminal
    sudo /etc/init.d/networking restart
    like mentioned above………:d
    srry for incomplete information

  6. @rajendra: i’ve done everything you said, after the restart my computer boots with dhcp, not static ip, so the network manager is realy messed up, removing the network manager was the only way to fix the problem with static ip, or i should have say to remember the changes after the reboot.

  7. @Kabel: i didn’t removed the network manager, n for me its working properly….
    so i really don’t know what u hv done…

    so u should try once more step by step…

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

    nameserver #.#.#.#
    nameserver #.#.#.#

    Now, modify /etc/network/interfaces and add

    auto eth0
    iface eth0 inet static
    address #.#.#.#
    netmask #.#.#.#
    gateway #.#.#.#
    for restart networking
    type in terminal
    sudo /etc/init.d/networking restart

    hey don’t forget saving all files…

    even after dis u r in trouble
    u may stick to the upper post…
    but do it in correct way…

  8. I finally got a static IP to work using the Network Manager.

    I had to do the following.
    Set my /etc/network/interfaces as follows:
    _______________ /etc/network/interfaces _______________
    # The loopback network interface
    auto lo
    iface lo inet loopback

    # Wireless interface
    auto wlan0
    #iface wlan0 inet dhcp

    # The primary network interface
    auto eth0
    #iface eth0 inet dhcp

    # The secondary network interface
    auto eth1
    #iface eth1 inet dhcp

    Then after a reboot I had to remove auto eth0.
    Then I created a new wired connection called Wired Ethernet 1.
    Once I did this I was able to set a static address and this new profile was written to

    I’ll look at getting a bridge network up for Virtual Box later.

  9. Wahey! That was just what I needed.
    I decided to check out Ubuntu (after using FreeBSD for ages), and was getting really fed up with that network manager thing.
    For some reason my resolv.conf would get wiped every time.

    I’m still not used to all these graphical config things. Why do you think a Unix system comes with a shell & vi?


  10. Would anyone care to enlighten me on how to
    if I’d like to set up a static ip over wireless.
    I don’t really use eth0 on my desktop and
    I’m a newbie to setting up wireless on linux.

  11. To set static IP:

    Need not to remove NetworkManager.

    First to edit (as root) /etc/NetworkManager/nm-system-settings.conf:


    then edit your /etc/network/interfaces and /etc/resolv.conf for your IP and name server.

    then reboot.

  12. What do we do when we have multiple internet connections? What would go in for the /etc/resolv.conf?

    Example: My configuration is as as follows..
    auto lo
    iface lo inet loopback

    # Wireless interface internet connection 1
    auto wlan0
    iface wlan0 inet dhcp

    # The primary network interface internet connection 2
    auto eth0
    iface eth0 inet dhcp

    Both are different providers with different nameservers

  13. hi ,

    i have removed my network manager, so help me how can i reinstall network manager offline ..??

  14. For those who followed artist’s instructions and still having problems with resolv.conf being overwritten, the following fixed it for me and I no longer need to modify resolv.conf and have not removed network manager (but made artist’s changes). Directions copied from here:


    If you want to make use of specific DNS, modify the following file /etc/resolv.conf
    Note that if you are using DHCP on one of your interfaces, the contents of this file will be overwritten by the DHCP client.

    To force the DHCP client to use a specific DNS, edit the file /etc/dhcp3/dhclient.conf

    Add the following line:
    prepend domain-name-servers,;

    DNS returned by DHCP are will be added after the DNS you specified.

  15. Oh, should have added that the DNS addresses in the directions above point to the servers. You are free to use them or replace with your own dns address. See for more info/restrictions.

  16. I’m sorry as what success said I had problems with resolv.conf, too. But I could not return here to point the problem until I got the e-mail with success’s reply (There is the URL here in the e-mail).

    I have ever wrote a file with DNS message and add a script auto to copy the message to the resolv.cionf after every reboot. But I thought it’s not a good way.

    Then I found that what I had to do is only to remove the line “auto eth0” in /etc/network/interfaces. Then NetworkManager will not rewrite resolv.conf again. Simple! 😀

    Thank success.

  17. To manoj: I think you can use “Synaptic Package Manager” in the menu of “System -> Administration” to install it if your system is UBUNTU Linux.

  18. I’m sorry I found I had the problem of resolv.conf too what as success said after I wrote that message. But I could not return here until I got an e-mail with success’s reply ( there is the URL here in it).

    Firstly I wrote a file with DNS message and wrote a script for auto copy the DNS message from the file to resolv.conf after every reboot. But I thought it’s stupid and then try again.

    Actually, the only thing have to do is to remove the line “auto eth0” from /etc/network/interfaces, then NetworkManager wil not rewrite resolv.conf again. 😀

    Success, Thank you.

  19. To manoj.
    Use the Ubuntu installation CD. Synaptic Package Manager can install packages from the CD.

  20. And how about two configurations — one with static manual IP, and the other DHCP?

    I was switching from Fedora, but after struggling with this for a day now I think not. Strange, I had been hearing about how everything just worked with Ubuntu….

  21. after you remove ( sudo apt-get remove –purge network-manager )

    #just edit file /etc/rc.local
    #give command
    ifconfig eth0 inet [your-ip] netmask [your-netmask]
    route add default gw [your-gateway]

    #and edit /etc/resolv.conf for DNS SERVER. after your PC reboot your system will reading this configuration

  22. I would just like to say thanks, after looking around the web and even ubuntu own site for help. I can across this, WORK 1st time for me 🙂

Comments are closed.