One of my headless systems is assigned a static IP address through /etc/network/interfaces on a wired Ethernet. It is connected to a router which is also a DHCP server. After a couple of days, the static address is dropped and replaced by a DHCP address. Why would that be?

  • If I do a sudo ifdown eth0 && sudo ifup eth0 or sudo service networking restart or a reboot, the system takes on its static address again, but then a couple of days later, the IP address changes to a dynamic one.
  • There is no other system on the network with (accidentally) the same static address.
  • NetworkManager is not running on the system.
  • I have set up the system to email me as soon as the address changes, but the times at which that occurs seem completely random. DHCP Lease time is 24h but that doesn't seem to correlate, and anyway that shouldn't matter for a static address.
  • My /etc/network/interfaces is this:
    auto lo
    iface lo inet loopback
    auto eth0
    iface eth0 inet static

It's a bit of a puzzle.

What would cause a system to give up its static address and request a DHCP address instead? What to look for, in which log file?

  • That's not suppose to happen is network manager trying to manage the interface? nmcli dev status if not post your /etc/network/interfaces
    – meccooll
    Jun 21, 2014 at 19:47
  • @meccooll As I said, Network Manager does not run.
    – Jos
    Jun 21, 2014 at 19:50
  • Only thing i can think of is misconfigured /etc/network/interfaces post it or maybe some cron job running dhclient?
    – meccooll
    Jun 21, 2014 at 19:57
  • The gateway is x.253 and not x.254? Where are the DNS nameservers declared?
    – chili555
    Jun 21, 2014 at 20:15
  • @chili555 gateway and DNS should have no effect on DHCP. Look at sudo grep eth0 /var/log/dmesg
    – meccooll
    Jun 21, 2014 at 20:20

4 Answers 4


Recently I stumbled on this problem and after some investigation it turned out that /etc/dhcp/dhcp.conf needed a block to be added, (or uncommented,) similar to this:

alias {   interface "eth0";   
option subnet-mask; }

Hope this helps!

Regards, Glendon Gross

  • Thanks Glendon. I will uncomment and modify those lines and see what happens. The problem still occurs, but very infrequently.
    – Jos
    Mar 17, 2015 at 17:54
  • Thanks much, Glendon. This fixed it for me. Seems non-sensical that a static config in /etc/network/interfaces is still being set up by dhcp daemon...
    – pztrick
    Oct 19, 2015 at 21:21
  • Interesting fix, when my NIC went back to DHCP, this created an alias NIC with the correct IP and my clients were none the wiser and everything hummed along. Still not sure why this is happening, but this fix will do for now! Jun 21, 2016 at 15:59
  • 2
    also it seems to be /etc/dhcp/dhclient.conf for me. Jun 21, 2016 at 15:59

Hmmm, strange... I'm not sure it matters, but for neatness sake I would place the netmask parameter directly after "address" and not after "gateway". You should also uninstall/deactivate the (isc-)dhcp-client package from the host, and beware of ipv6 and the resolveconf package. Before that: A way to find out what's going on is to put in place a firewall rule that accepts & logs all traffic to and from the DHCP ports (server 67 UDP and client 68 UDP) or create logging for the devices state, the dhcp-client or sniff your traffic.

A workaround (or alternative solution) though is to configure DHCP reservations for some of your hosts or an infinite lease-time for their DHCP addresses. For me that works really well, and the advantage is centralized management. If your DHCP server is your modem/router you can probably configure it in the web-interface (either the lease-time or the reservation) and on some routers you can even check a "fixed address" checkbox. If you configured your own server (Ubuntu?) you need to edit the dhcpd.conf file adding some lines like this:

host Accountant {
  hardware ethernet 00:1F:6A:XX:XX:XX;

I know this is old, but I ran into a similar issue that I was struggling with. I also opened a case with Canonical to ask for help.

I've since resolved my issue and have come back to this post in the hope that this might prove useful to someone else who might stumble upon this. My issue in the end, turned out to be 'wicd-daemon'. I'm not sure how or why the package was installed, but it was the main contributor of dropping my static address and causing other networking issues for me.

A symptom of my problem was dhclient would startup if I unplugged the network cable and plugged it back in. Similar to the issue reported here I would then get a different IP address. If I set my NIC manually it was OK, but then some random time later it would get a different IP (due to dhclient running in the background it seems). Check if dhclient is running. As for why dhclient is even running that is another problem. Below I describe what resolved dhclient for me, which I ended up tracing down several paths (avahi, ntpd, ifup, ...). For my case it was wicd-daemon.

The issue originally came to light in testing as I was switching networks that required me to physically move my network cable. This caused networking issue for me which it shouldn't have. It also took a bit of time to discover the problem as well, as I was not expected my static IP to have dropped or changed.

In the end, purging wicd-daemon and python-wicd took care of the issue. My system now retains the static IP address even when the network cable has been unplugged. I've not seen dhclient start up either, so I'm thinking that issue has also resolved itself. I went down other paths as well, looking at avahi which seemed to play a roll in the issues I was having, I also looked at ntpd as well (weird I know, but it was showing up in the syslogs at the same time other issues did; NTPD probably didn't have anything to do with it but it was producing suspicious logs). I ran down several rabbit holes until by chance I stumbled on a wicd process running while doing other testing.

So long story short check if dhclient is running and if you have a network manager like wicd running on your system. It could be what is causing you problems with your static address.


Just wanted to add that if you have multiple interfaces, make sure you define the right interface in your /etc/network/interfaces file.

For me, the issue was that auto lo was defined at the beginning of the file. But actually instead of that there needed to be auto eth0.

Once defined correctly, my static IP is kept on reboot.

Hopes this helps someone.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .