Mixing fixed-address host declations in dhcpd.conf with dynamic entries created via omapi

Kristian Pedersen kristian.pedersen at vejen-net.dk
Tue Jul 17 13:33:53 UTC 2012

On 07/17/2012 01:57 PM, Simon Hobson wrote:
> Kristian Pedersen wrote:
>> So the question goes, how does the dhcp server handle overlaps in 
>> dhcpd.conf vs. dynamic entries in dhcpd.leases?
> It doesn't - DON'T DO IT
>> When the server starts up and checks the dhcpd.leases, will any 
>> config in dhcpd.conf override the ones from the lease-file? Do you 
>> see any problems in this implementation or have suggestions for other 
>> ways to implement this?
> There are no checks, it's assumed that the administrator knows what he 
> is doing ! Depending on various factors, it may result in the address 
> being marked as abandoned in the leases file (fairly innocuous), or at 
> the other extreme it may result in two clients being given the same 
> address.
> The simple answer is : never have an address i a dynamic range AND a 
> fixed address statement. If you must have a fixed address in the 
> middle of a dynamic range, then split the range :
> range
> range
> ...
> fixed-address

I think there is a misunderstanding here (most likely bad wording from 
my side :). Maybe it is the "dynamic" wording? The host entries added 
through omapi on the fly, and then later via dhcpd.conf are all 
"fixed-address", and never within a pool/range ip area.

In dhcpd.conf a lease might look like:

host pc0018f8afeded {
   hardware ethernet 00:18:f8:af:ed:ed;

I found an example of a what a static lease added through OMAPI might 
look like in dhcpd.leases ( 
http://jpmens.net/2011/07/20/dynamically-add-static-leases-to-dhcpd/ ):

host pc0018f8afeded {
   hardware ethernet 00:18:f8:af:ed:ed;

What (is supposed) to happen if the server has both above fixed-address 

> As an alternative, you may wish to consider whether reserved leases 
> would suit your needs. A reserved lease is just like any other, goes 
> through the same lifecycle, takes part (properly) in dynamic DNS 
> updates, and is recorded in the leases file. However, being marked as 
> reserved, it will not be reused (even if long expired) for any other 
> client.
> I believe you should be able to create a lease and mark it reserved, 
> or just mark an existing lease as reserved, via OMAPI.

I looked a bit into reserved leases, but I dont think they fit my 
scenario very well since i am not really interested in dynamic/pool 
assigned addresses.


Kristian Pedersen

More information about the dhcp-users mailing list