Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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'm trying to set auto static ip. I've set the content of /etc/network/interfaces to be:

auto lo

auto eth0
iface eth0 inet static

and /etc/resolv.conf to be:


It seems that the ip address have set successfully. However, when I plug out the lan cable and then plug it back, the ip address is not set. How can I make it automatically set the static ip when the lan cable is connected?

share|improve this question
up vote 1 down vote accepted

Ubuntu workstation or server? In workstation you can right click the networking icon to bring up network connections, wired tab, highlight auto eth0, click edit, and go to ipv4 settings and method manual and enter your settings there.

It looks like there may be some settings that are handled "automagically," otherwise, including changes to the file you're altering. Take a look at this site for instructions:

share|improve this answer
workstation. but as I said, my problem is saving the static ip address after the lan cable was disconnected. – Forge Mar 8 '11 at 14:36
Did you look at the article where udev controls network configuration? – Bart Silverstrim Mar 8 '11 at 15:01
I did, I'm sorry I don't see the connection – Forge Mar 8 '11 at 15:18
Sorry, I was referring to that article for having the udev stuff. If you use udev down and up, the address is correctly applied? – Bart Silverstrim Mar 8 '11 at 15:26
When you unplug the cable and plug it back in, is it still the same device name? – Bart Silverstrim Mar 8 '11 at 15:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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