Entries in dhcpd.leases file

Simon Hobson dhcp at thehobsons.co.uk
Thu May 25 09:43:25 UTC 2006


Usman Wahid wrote:

>I am using the latest version of ISC DHCP V3.0.4. I have noticed that 
>dhcpd logs leases in lease database even if a client has not accepted 
>its offer. Like when they are more than one DHCP server on a network 
>and client can choose IP from one of them. Is there a configuration 
>option that will force DHCP to only log its accepted offers (in other
>words, those for which it sends DHCPACKs).

Short answer: No, that would break a requirement of the protocol specification.

Longer explanation: It is a requirement that all lease offers are 
written to permanent storage before being offered to the client - 
that is so that should the power fail, server crash, or whatever, the 
network isn't left with client that believe they have a lease but the 
lease is unknown to the server.

When the server makes an offer, it keeps track of the offer by 
creating a short lease (you'll see that they are only 2 minutes). 
Should the client not take up the offer then it times out, if it does 
take up the offer then a longer lease is offered.

This is partly due to implementation technique. The server is single 
threaded and processes each request as it comes in - there is no such 
thing as a 'connection'. By creating these short leases, it means 
that when the client makes a request, rather than having to remember 
what offers have been made recently, the server can see that it has 
an existing lease that it can extend. The alternative is that the 
server would need to keep track of offers separately across different 
invocations of the program loop - and why write a separate pile of 
logic when there's a perfectly good system already there ?


The return question must be: why are you bothered ? The leases file 
is not for human consumption anyway.

If you are worried about using up your IP pool, bear in mind that 
even if the offer was nto written to the leases file, the address 
would still have to be reserved for a while to allow for the client 
to request it.

If you are writing a program to parse the file (for example, to 
report on addresses in use), then you can filter these out if it 
bothers you.


Simon


More information about the dhcp-users mailing list