Super User is a question and answer site for computer enthusiasts and power users. 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've got a linux box with a static IP configured that seems to be ok. The static IP address works for a few hours, and then sets itself back with (what seems like) whatever DHCP tell it to use.

Here's my /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static

Any ideas?

share|improve this question
You could ask this in or and get better/faster answers – Toto Oct 29 '10 at 18:20
I believe this is my problem:…. Gnome is trying to manage my network for me. Thanks for the suggestion though. – shady Oct 29 '10 at 18:49
This looks like NetworkManager acting up. Do you have NetworkManager running? Do you want to? – Gilles Oct 30 '10 at 0:25
That's what the problem was. I disabled the Gnome networking and it's been ok. Thanks for the help. – shady Nov 14 '10 at 4:44

I got the same problem on Ubuntu Server, but I think I managed to solve it. When I restart networking, dhclient3 is still running. Looking at it from htop, it has some “eth0″ in the arguments, so I suspected it was still looking for renewals of dhcp for eth0. I failed to remove dhcp-client with apt-get, so I ran:

sudo kill $(ps -aux | grep dhc | grep eth0 | awk '{print $2}')

NOTICE: This code might kill other things on your server! Take it easy and replace “eth0″ with the interface name for which you have set a static IP! Alternatively kill dhclient OR dhclient3 for your interface through htop.

share|improve this answer

I've had the same issue. The dhclient daemon is insane. The sanity checks need work. It should go something like this:

  • Discover existing lease information (/var/lib/dhcp/*)
  • Validate all interfaces for DHCP configuration (/etc/network/interfaces)
  • If an interface is statically configured then clear DHCP lease information and ignore the interface for the duration of the execution.
  • If an interface is not statically configured and has existing lease information, then renew accordingly.
  • If an interface is not statically configured and does not have existing lease information, then discover accordingly.

HISTORY --------------------------------------------------------------

While the issue was ongoing I witnessed /var/log/syslog fill up with the following line:

May  3 06:25:36 xxxxxx dhclient: DHCPREQUEST on eth0 to port 67

The dhclient process was running in the background as confirmed with 'ps aux | grep dhc'

Having confirmed correct static IP setup for eth0 in '/etc/network/interfaces', I restarted the networking service. After the networking service was restarted the static IP was maintained until the lease reached halflife, at which point dhclient renewed the previously DHCP assigned address, which was received on initial configuration of the system. This information is maintained in '/var/lib/dhcp/*'.

This behavior has been witnessed on three systems I've been working on over the last few days. System info:

# cat /etc/
Debian GNU/Linux 7
# cat /proc/version
Linux version 3.2.0-4-amd64 ( (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.2.68-1+deb7u1
# dhclient -version
Internet Systems Consortium DHCP Client 4.2.2

RESOLUTION -----------------------------------------------------------

Note: Perform as root or add sudo to each command.

# dhclient -r
# dhclient -x
# rm /var/lib/dhcp/* 
# shutdown -r 0

Result: The dhclient process did not automatically start with the system, 'ifconfig' shows that eth0 was correctly configured with the static IP, syslog is clear of the DHCP spam, and the change is persistent through multiple system restarts.

CAUTION: My systems are reliant on a statically assigned IP address to operate correctly. If you're applying this fix to a laptop it will likely break wifi connectivity.

share|improve this answer

You must log in to answer this question.

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