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 have a Debian Lenny server, that was setup with DHCP at install time, but I have changed it to have a static IP instead.

Now it changes between having a dhcp and a static ip almost randomly.

Is this /etc/network/interfaces correct?

auto lo
iface lo inet loopback

auto eth0

iface eth0 inet static
       address 192.168.0.24
       netmask 255.255.255.0
       network 192.168.0.0
       broadcast 192.168.0.255
       gateway 192.168.0.1

dns-nameservers 192.168.0.9
dns-search example.com

Or are there other config files I have to change?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Is there a DHCP client running? If it is and picks up a lease, it will override the static IP; I often find that I have to manually kill it (the DHCP client) once I've set the interfaces static and restarted networking.

share|improve this answer
    
There sure was =) How do I disable it, so it doesn't start at boot up? chkconfig --list doesn't list anything dhcp related. –  Sandra Aug 3 '10 at 14:45
    
Killing it did the trick. It didn't restart after reboot. Great! –  Sandra Aug 3 '10 at 15:07

Are you running a GUI? If you are, you want to check to see if you have got networkmanager running anywhere. If it is, you can choose to use that instead of editing your /etc/networking/interfaces directly.

share|improve this answer
    
Interesting idea. Just checked. No GUI and no NetworkManager though. –  Sandra Aug 3 '10 at 13:00

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.