DHCP Static binding not working as expected??

Simon Hobson dhcp1 at thehobsons.co.uk
Mon Sep 10 07:06:57 UTC 2012

chamara samarakoon wrote:

>subnet netmask {
>option ntp-servers;
>deny client-updates;
>option broadcast-address;
>option routers;
>max-lease-time 31536000;
>default-lease-time 31536000;
>pool {
>failover peer "XXXX";
>deny dynamic bootp clients;

>include "/etc/dhcp_static_lease/";
>                        hardware ethernet 00:20:d2:3a:51:69;
>                     fixed-address;
>                     }

Well there is one problem. Defining a static address does **NOT** 
exclude it from being offered as a dynamic address if it is still in 
a pool/range.

>2.Unplug device A and change the static conf MAC to B's MAC(Restart 
>dhcpd server) and Plug device B

What does this mean ?
I read this as you edited /etc/dhcp_static_lease/ and 
changed the MAC address for the host statement to that of device B 
and restarted the server - is that correct ?

If so then you you observe is "correct" behaviour - correct in as 
much as what you told the server to do.

You plug in device A. It gets a dynamic lease which is recorded in 
the lease file.
You unplug device A, manually edit the MAC address in the config file 
to that of B and restart server. At this point, there is a lease in 
the leases file for device A, and a static assignment for device B
You plug in device B. It gets offered the static assignment - which 
does not create a lease record.
You plug in device A. It has an already active lease for the same 
address so this is selected. The ping-before-offer check detects 
device B and the lease is abandoned. Because you only have one 
address in the range, the server then attempts to reclaim abandoned 
leases in order to free up an address.

However, while you say there is only one address in the range, your 
config you posted shows a whole subnet - 245 addresses in the range.

For what you appear to be trying to do, you may be better off with 
reserved leases.

Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.

More information about the dhcp-users mailing list