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
orsudo 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 address 192.168.124.104 gateway 192.168.124.253 netmask 255.255.255.0
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?
Best Answer
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:
Hope this helps!
Regards, Glendon Gross