Server Fault is a question and answer site for system and network administrators. 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 have an Ubuntu 10.04 server with static IP address configuration:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static

From time to time (between once a month or once every 3 days depending on load) the server will spontaneously discard this IP address and change to one configured via DHCP.

When this happens I need to SSH into the server (using its .local hostname) and do /etc/init.d/networking restart to get it to use the static IP again.

How can this happen, and more importantly, how can I stop it?

share|improve this question
I would suggest you installing auditd to see 'who' made changes to the /etc/networking/interfaces. – quanta Nov 7 '11 at 11:01
@quanta I made the file, but that's not the problem. The file doesn't change, just the actual IP address does. – Bart van Heukelom Nov 7 '11 at 11:55

Is it possible that there is a DHCP client process still running?

Perhaps you changed the server from DHCP to static, performed a network restart but the dhclient process didn't exit correctly.

You can do

johnf@zoot:~$ ps ax | grep [d]hclient
28248 ?        S      0:00 /sbin/dhclient # Other args

to check.

If so kill this process off or reboot.

share|improve this answer
I can check but I'm pretty sure the server has been rebooted multiple times since it was given a static IP. – Bart van Heukelom Dec 4 '11 at 3:37

Why not configure the DHCP server to hand out the IP address you want based on the server's MAC address? With ISC dhcpd (the de-facto standard DHCP server for unix systems) just put something like this in the config (make sure that subnet mask and gateway are already configured properly):

host server01
    hardware ethernet MA:CA:DD:RE:SS;
    option host-name "server01";
share|improve this answer
The server is actually in a small business network with a consumer router-modem, but it's a Linksys so maybe a static lease is possible. Still, it shouldn't be necessary. Another server in the same network is configured with a static IP the same way, and it never has problems. – Bart van Heukelom Nov 14 '11 at 10:25

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.