Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just installed 12.04 Server. After my first login, I saw the IP and it is dynamic (I guess). I tried to change it by sudo vi /etc/network/interface but this file is blank.

Can anyone help here?

share|improve this question

You typed:

sudo vi /etc/network/interface

You should have typed this:

sudo vi /etc/network/interfaces 

You forgot the s.

share|improve this answer

Adapted from: Create a Static IP from the Command Line

Basically, steps needed are:

Find out you current settings:

ifconfig eth0

Edit /etc/network/interfaces to meet your requirements.

Look for these two line:

auto eth0
iface eth0 inet dhcp

Change them to instead be: (example IP addresses)

auto eth0
#iface eth0 inet dhcp
iface eth0 inet static

Then re-start your server.

It should now be using:

share|improve this answer
12.04 also needs dns-nameservers 192.168.0.x as they changed how resolv.conf works. – charlesbridge Oct 5 '12 at 11:11
Sorry, I cribbed from my old notes for 10.04 LTS server. – david6 Oct 5 '12 at 12:52

Ubuntu uses Network Manager to manage the network configuration.

Run nm-connection-editor to set a static IP.

share|improve this answer

protected by Community Apr 12 '15 at 7:23

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.