50

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.

luis ventura

50 Comments

  1. 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. 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″.

  3. 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.

  4. 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.

  5. 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

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

    You save my day. Thank you very much.

  7. 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?

  8. 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!.

  9. 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

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

  11. 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!

  12. 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

  13. 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.

  14. 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.

  15. 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.

  16. 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.

  17. Hey, you`re greate man ;)

    You save my problem.

    It works perfect for me second solution…

    Regards,
    Mumun

  18. Pingback: yorch @ web [in]
  19. 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″.

  20. 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.

  21. 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

  22. 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!

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

  24. 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!

  25. 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?

  26. 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

  27. 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

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

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

  30. 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?

  31. 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.

  32. 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.

  33. 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

Leave a Reply

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