DHCP question: dhclient won't request same IP.

Scott Garman sgarman at iname.com
Wed Jan 31 20:06:49 EST 2007


Hi folks,

All of the modern Linux distros I've used (since RedHat 6.2 or so) have
exhibited a certain behavior as DHCP clients that I'm trying to
understand. When their DHCP lease expires, and they go to renew it, they
always get the same IP address again. The only time this doesn't happen
is when they are shut down for a period of time and the IP address ends
up being assigned to another machine. I believe that in a DHCP request,
the client can ask for a particular IP, and the server will offer it if
the address is not already in use by another client.

This doesn't seem to be working with an embedded system I have running
Debian Sarge (stable). I'll have the system running for several hours
with ssh sessions open into it, and suddenly it will renew its IP
address, and the IP address will change, killing my ssh sessions and
causing me to log in at the console to see what the IP address changed to.

This does not happen to an Ubuntu client running on the same network, so
I'm guessing there's something specific about this Debian system (I'm
inclined to rule out hardware, but I guess that's not a given).

To test things further, I placed both machines behind a Linux DHCP
server so I could look for any unusual error messages. Sure enough, I
found the following in my logs after the Debian system exhibited the
IP-changing behavior. The Debian system started out with IP
192.168.1.215, and ended up with 192.168.1.210:

Jan 31 12:32:03 dhcpd: DHCPDISCOVER from 00:d0:c9:9e:ae:59 via eth1
Jan 31 12:32:03 dhcpd: ICMP Echo reply while lease 192.168.1.215 valid.
Jan 31 12:32:03 dhcpd: Abandoning IP address 192.168.1.215: pinged
before offer
Jan 31 12:32:03 dhcpd: Wrote 0 deleted host decls to leases file.
Jan 31 12:32:03 dhcpd: Wrote 0 new dynamic host decls to leases file.
Jan 31 12:32:03 dhcpd: Wrote 9 leases to leases file.
Jan 31 12:32:05 dhcpd: DHCPDISCOVER from 00:d0:c9:9e:ae:59 via eth1
Jan 31 12:32:06 dhcpd: DHCPOFFER on 192.168.1.210 to 00:d0:c9:9e:ae:59
via eth1
Jan 31 12:32:08 dhcpd: DHCPREQUEST for 192.168.1.210 (192.168.1.1) from
00:d0:c9:9e:ae:59 via eth1
Jan 31 12:32:08 dhcpd: DHCPACK on 192.168.1.210 to 00:d0:c9:9e:ae:59 via
eth1

I've Googled for this and not found any satisfying answers on how to fix
it. I've also traced through the dhclient scripts on my Ubuntu and
Debian system and not found any obvious places where this behavior can
be set in a configuration file or hard-coded into the script.

Does anyone have any suggestions on what I could try next?

I'm thinking the only thing left to do is try to shoehorn a newer
dhcp-client package onto the Sarge system. If I need to do that, does
anyone recommend a tutorial or doc on recompiling a .deb package from
Unstable/Testing to use on Stable?

Thanks,

Scott

-- 
Scott Garman
sgarman at iname dot com



More information about the gnhlug-discuss mailing list