Super User is a question and answer site for computer enthusiasts and power users. 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 try to have a static ip adress on an host.

I execute the following commands :

$ ip address eth0 netmask

$ route add default gw

But later my IP address changes on unless I have commented the request command in dhcplient.conf and I have put into /etc/network/interfaces the following:

iface eth0 inet static

Please help me I don't understand why my ip changes ?

Thanks in advance.


share|improve this question

/etc/network/interfaces holds your default configuration... so if you need a permanent static IP, put it in there like this:

iface eth0 inet static
address <THE IP YOU WANT>
gateway <THE IP OF YOUR GATEWAY (Usually your router)>

The commands you executed only adjusts your configuration temporarily.

share|improve this answer
You also need to remove the line for dhcp, or at least you should. iface eth0 inet dhcp # <== Remove this – peelman Jul 21 '10 at 21:44
I don't see the difference than I have made – user32433 Jul 22 '10 at 6:46
@user32433 - Your IP shouldn't change when that is in your interfaces file. – BloodPhilia Jul 22 '10 at 14:43

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.