Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1.

and /etc/resolv.conf to be:

nameserver 192.168.1.1.

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

1 Answer 1

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: https://help.ubuntu.com/10.04/serverguide/C/network-configuration.html

share|improve this answer
    
workstation. but as I said, my problem is saving the static ip address after the lan cable was disconnected. –  Irit Malka 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 –  Irit Malka 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

 
discard

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.