Friday, June 26, 2009

Setting up static IP in ubuntu 9.04 Jaunty

The network manager shipped with ubuntu 9.04 is not working properly when you try to setup a static ip.
Here is the solution.

$ sudo apt-get remove network-manager-gnome

The edit
/etc/network/interfaces
and set the interfaces manually

Here is my interfaces file.

auto lo
auto eth1
auto eth0

iface lo inet loopback
iface eth1 inet dhcp
iface eth0 inet static

address 192.168.0.1
netmask 255.255.255.0

4 comments:

Anonymous said...

Hi, I'm trying your Linux experimentations, I find your posts Very Informative and Simple for me.

Anyway, here's what mine looks like:

auto lo
iface lo inet loopback

So I just need to copy and paste yours?

What if I have these from Network Tools?

lo - loopback?
eth0 - Lan cable?
eth1 - wifi?
vboxnet0 - for virtualbox?
pan0 - dunno...

Do I need to:
auto lo
auto eth1
auto eth0
auto vboxnet0
auto pan0

?

address 192.168.0.1
netmask 255.255.255.0

For static address right?

Sorry, I was just trying to understand what's going to do these to my machine once network-manager-gnome is removed so I can troubleshoot it.

Also, what if it didn't work for me, and somehow I need to reinstall network-manager-gnome, can you pls. provide the steps on what I should do?

Thanks.

Fermi Level said...

@artpablico

auto lo
iface lo inet loopback

This means you have only loopback interace configured via /etc/network/interfaces.

If you uninstall network manager and plan to give static ip to each of your interface , you have to supply address and netmask.
Most probably your things like wifi will be accepting IP via DHCP which can also be configured from interfaces file.
Read man page of interfaces file
$ man interfaces
It has several examples

Anonymous said...

hi,,,i'm from Indonesia... I can't speak English very well.... so, I apologize if there are many mistakes in the phrase my sentence...
I am a newbie in linux, so Can you explain to me the purpose and use of the following instructions?
--------------------------------
auto lo
auto eth1
auto eth0

iface lo inet loopback
iface eth1 inet dhcp
iface eth0 inet static
---------------------------------
thanks before....

itsnen said...

Thanks man, its help me very much