How To Set A Static IP On Ubuntu 8.10

Known network manager bug https://bugs.edge.launchpad.net/ubuntu/+source/network-manager/+bug/284298

Due to a bug if you want to assign a static IP on Ubuntu 8.10 Desktop your setting will be overwritten after the next reboot because of a bug that escaped the Ubuntu team. The bug is annoying and silly that something so basic would escape the development team.

Any way there are two solutions one uses the command line and the second one the GUI.

First Solution

First solution is to get down and dirty with the command line, it takes less than 2 minutes. Edit /etc/network/interfaces and enter the following values.

sudo nano /etc/network/interfaces
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.3
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1

And save it.

Now move on to edit the /etc/resolv.conf. And add the name server.

sudo nano /etc/resolv.conf
nameserver 192.168.1.1

If you don’t want to reboot the system restart the networking service instead.

sudo /etc/init.d/networking restart

Second Solution

  1. Right click on the network icon located in the top panel. Select Edit Connections…
  2. Right click on Add. This is when we add the new configuration.
  3. Now you are presented with empty fields. Check Connect automatically at the top, otherwise the older configuration will take over. For the configuration to work you need to provide the MAC address of your network interface card in my case it’s eth0.Tip : Issue ifconfig in the command line and copy and paste the resulting MAC address.
  4. In the same windows select the IPv4 Setting tab, the drop down menu will offer various option select Manual.
  5. After selecting Manual you have to provide the IP Address, Netmask, Gateway and DNS Server. Now click OK to save the settings.
  6. Now the new connection named “Wired connection 1″ is available.
  7. Go back to the network icon located in the top panel and right click on it. Wired Connection 1 is now an option right click on it. The system will now change from the previous interface configuration the the new one.Tip :  To verify the changes issue the ifconfig command.
  8. The last and perhaps most important step is to go back in to Edit Connections… and unchecked the Connect automatically option on Auto eth0 which is the previous faulty Ubuntu configuration. Failure to do so will result in the Auto eth0 taking over the new configuration on the next reboot.

Drop me a line if this was of any help to you.

50 Responses to “How To Set A Static IP On Ubuntu 8.10”

  1. Fida says:

    Looks like the problem will be solved by this. Thanks and let’s hope it works. I’ll give you another thanks if it really works.

  2. pannerrammer says:

    The second method didn’t work for me. When I next reboot I get an extra Auto eth0 which then take precedence over my static entry.

  3. kholis says:

    same as pannerrammer. the 2nd method not work.

    it always make a new “Auto eth0″ after reboot even the “Auto eth0″ has been deleted.

    it should be chosen manually to “Wired connection 1″.

  4. CrispyCritter says:

    Thanks, both methods worked fine for me. My particular machine is an NFS file server among other things, so the “interfaces” solution is more appropriate since it works without having to login after power failure reboot.

  5. Prem Nath says:

    Thanks a lot………….. for such helpful tutorial.
    I am new to ubuntu…….installed just to experience it. After installing main problem i faced in connecting to network. After spending a lot of time in google I came across this helpful tutorial. and finally I could connect to internet.

    As I am new to ubuntu pictorial tutorial helped me a lot, instead of writing so much complex commands.

    Thanks a lot again.

  6. John says:

    Hi,
    Thanks for the tutorial. Mine failed. When I tried to uncheck “connect automatically” for etho0, it pops up with this error message:

    Updating connection failed: nm-ifupdown-connection.c.82 – connection update not supported (read-only)..

    John

  7. Jose Luis says:

    Your secon solution is very simple and works perfectly. It is not necessary to remove anything.

    You save my day. Thank you very much.

  8. Hakam says:

    Can this be applied on the wireless connection? I tried your steps and created a new string “eth1″ along with the original one “eth0″, but it didnt work. Any suggestion?

  9. dataninja says:

    Hakam you have a good question. Remember that wireless adapters appear under different names. For example “rausb0″ or “wlan0″ instead of “eth0″. I suggest you first issue the “iwconfig” command to see if your adapter is visible, if so my only recommendation is to change the string “eth” to the name that appears under the command line.

    I would like to help you more but at the moment I am too having an unrelated problem with this server. Good luck!.

  10. Felipe says:

    Hey Man,

    Either solutions didn’t work for me. When I restart, I get new Interfaces listes (the originals, Auto eth0 and Auto eth1).

    Have you heard about another method?

    Cheers

  11. […] i followed what appeared to be a good blog post on fixing this issue. it was very straight forward and i followed the given instructions in that […]

  12. bod says:

    great!! nice and simple, you rock!

  13. Bruno says:

    I used the first solution, did reboot and i get the expected result. Is working great.
    Thanks

  14. I have an HP Pavilion DV6500CTO Notebook. I installed Ubuntu V8.10 from its factory loaded Vista environment. I followed your Second Solution through GUI. It did not work initially because the default Auto eth0 kept on taking over, even with it deleted then power cycled. However, I then found that I could simply pull down the Network list and clicked on the “Wired connection 1″ entry, it would switch! I verified this through ifconfig as well PINGing with other interconnected PCs. This is just fine for my purpose of testing behaviors of my HAN (Home Area Network) that is based on static IP address. Thanks a lot!

  15. Thanks, I had to use the first method to get this working. Cheers, Mike.

  16. Russell says:

    Second solution did not work. I tried exactly what you said, but as the others reported, it kept adding back a Auto eth0 entry and that took precedence. After trying this a few times and making sure I followed your instructions, I started experimenting with settings to try to make it stick. It never would. I can’t try the first solution at the moment, because I need to specify the DNS servers and I’m not sure of that syntax. Plus, others said it did not work. Here is a possible solution (I have not tried it, but I probably will soon): http://ubuntuforums.org/showthread.php?t=974382

  17. […] am using a static IP. Due to a bug in the GNOME Network Manager (described here and here, I edited the network interfaces as follows: pgadmin@pgfs:/etc$ cat /etc/network/interfaces auto lo […]

  18. Jason says:

    Note on the second solution, I tried it and was still getting eth0 coming back up after a reboot. There appears to be a config file in your home directory that tells the network manager what to do. I deleted my gnome config files, and it seems to be working now. If anyone knows where that config file is, it may help others.

  19. John Jensen says:

    I too had problems with Network Manager overwriting /etc/resolv.conf, so I got around that setting the immutable bit on that file:

    sudo chattr +i /etc/resolv.conf

    just for good measure I did the same to /etc/network/interfaces. No problems now.

  20. Aubrey says:

    None of these two approaches works for me in Ubuntu 8.10 – I have to following instructions here

    http://ubuntuforums.org/showthread.php?t=974382

    to remove the Network Manager to get the static IP without breaking the internet connection.

  21. Fabio says:

    Thank you very much for the tips. I tried the second solution but it did not work for me.. after re-booting the Auto Eth0 would always come back. I fidgeted around and I found a solution that works for me:
    1. create a second connection “Wired Connection 1″ (just a normal one, with DHCP)and change the connection in Network Manager (left click on Icon on top bar) from “Auto Eth0″ to “Wired Connection 1″ (like in step 7 above”
    2. select “Auto Eth0″ and click “edit” – copy the “MAC address” line content
    3. delete the connection called “Auto Eth0″
    3. create a new connection and name it “Auto Eth0″ – give it the same “MAC address” as the previous one.
    4. check both “connect automatically” and “system settings”
    5. in the “IPv4 settings” set “Mehtod” to “manual” and insert the desired IP Address, Mask, Gateway and DNS server
    6. When you give the OK, it should ask you for the password (because you are changing a system setting). Put it in and you should be fine…
    Let me know if it works for you… I hope it does.

  22. Uns' Uwe says:

    Second Solution didn’t work for me, no idea why. So I tried the first one, i.e. going back to good ol’ config file hacking. Guess what: this did the trick! So thanks for pointing out both solutions.

    BTW, this seems to be a known bug of network manager:
    https://bugs.edge.launchpad.net/ubuntu/+source/network-manager/+bug/284298

  23. Eric Del Sesto says:

    The second solution did not work at first, but I combined it with a suggestion I found elsewhere into a working solution on two different Ubuntu 8.10 (server) machines.

    The problem is that no matter what you do to disable/delete the “Auth eth0″ connection in the Network Connections dialog, that connection will get recreated/re-enabled on reboot, and it insists on using DHCP. The solution is to ALSO remove the DHCP package from Ubuntu: sudo apt-get remove dhcp3-client. When rebooting, Ubuntu will first try the “Auth eth0″ connection, and then after a few seconds fail over to the other “Wired Connection 1″ connection that you created. Hope this helps someone.

  24. netronix says:

    Hey, you`re greate man ;)

    You save my problem.

    It works perfect for me second solution…

    Regards,
    Mumun

  25. […] sugiren desinstarlo, pero yo no buscaba una solución tan drástica. Afortunamente encontré un workaround. Aún no reinicio mi computadora para ver si realmente funciona, pero todo indica que […]

  26. Trika says:

    thank you, it is very helpful. My computer is working with a new static ip.

  27. r0bin says:

    Thanks, this worked for me on my wireless connection.
    Running the iwconfig command showed me that the name for my wireless USB adapter was “ra0″.

  28. Titon Oruna says:

    Well, creating a new network connection via the manager worked perfectly. It is brilliantly easy solution for a small and nasty problem. Thanks a lot.

  29. Marcio says:

    Thanks a lot. It works nicely. Solution 2

    I was having always he ETH0 again and again, so I have re-done this tutorial, and I’ve follow, LINE BY LINE, LETTER BY LETTER, (don’t pay attention the the images, just FOLLOW THE TEXT, and the order in the text AND, you will get it to work.

    Regards,
    Márcio

  30. Alex says:

    Fabio’s trick works perfectly for me also (on Intrepid Ibex 8.10), in my case, it was not necessary to delete and re-create the connection called “Auto Eth0″ as described @ 3.
    I just edited the “Auto Eth0″ created by NM

    Thanks a lot!

  31. Bhaskar says:

    I have installed Ubuntu 8.10 in VMware 6.5, both these method are not working.How can I run internet?

  32. Philip says:

    I did 2nd method and it keep going back to default. I am using Vmware (Window) on Ubuntu 8.10.

    I follow Fabian advice above and I got it to work.

    Thanks!

  33. […] means that after a reboot the network reverts to the automatic settings. There are a couple of workaround suggestions here, but they didn’t work on my system. Instead, the following workaround from the official bug […]

  34. blue says:

    Followed method 2 using the GUI… didn’t work. THEN followed Fabio’s suggestion to delete and re-create Auto eth0… didn’t work.

    Finally, leaving both the manual “wired connection 1″ and the re-created “Auto eth0″ … then edited the re-created Auto eth0 to UNCHECK connect automatically and system setting… ka-ching!

    strange how things seem to work differently on different ubuntu installations. what’s up with that?

  35. jim says:

    Ubuntu 9.04
    Used your method to set static address except in step 5 had to press enter before ok.(apply)
    Otherwise gateway would revert to all zeros.
    Thank you for the help.
    Jim

  36. cane says:

    was able to make changes to assign static ip. but my router is showing the computer with MAC address. if I use hostname to connect its referring to old ip address. any ideas what would be the issue?

    THanks

  37. redge vergara says:

    thanks guys.. i hope this simple bugs will surely be fix in update.

  38. shahzad says:

    thanxxxx, i just found the way to connect with internet at my office which was impossible for me since 7 days ago.

  39. Drifter says:

    I am having intermittent connection failures booting into Ubuntu 9.04. Also if my connection drops whilst working out on the web and connects again then Ubuntu will not auto connect. Would the above instructions perhaps solve the problem too?

  40. Whit says:

    Drifter, I’m having the same problem. NetworkManager will remove static IP assignments and associated routes when an interface loses its connection – which can be for instance because a switch or hub goes down for a moment. Then although it recognizes when the connection is back, it doesn’t restore the IP assignments or routes.

    IMHO it is a serious error to have NetworkManager installed on anything but a notebook, or to use DHCP instead of static addresses for workstations. But getting Ubuntu to work correctly without NetworkManager is a pain; they’ve really built the system around it.

  41. NavinBetamax says:

    This post was very helpful to me as I had been struggling to setup my static IP etc, I am a migrant from WIn Xp OS. Thankyou very much.

  42. Rahul Jawale says:

    Thank you. Helped me! :)

  43. kamranj6 says:

    EXCELLENT WORK U HAVE DONE
    DEAR BROTHER
    I WAS UNABLE TO MAKE PROPER SETTING IN MY UBUNTU.
    NOT IT IS OK

    2ND METHOD I HAVE TRIED AND IT WORKSSSSSSSSSSSSS
    THANKS AGAIN

  44. George says:

    Thank you very much I have connected after strugling for some hours.

    This is realy working.

  45. […] methods, as the UI-based Network Manager in Lucid is reported to have several issues. See this article for detailed instructions on how to do this.While following the procedure, we recommend that you assign a high address number […]

  46. Michael Lee says:

    failed

  47. […] every thing’s fine even after reboot, and you can still use that gnome-networkmanager.Check this simple guideCredit Goes […]

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>