Mixing fixed-address host declations in dhcpd.conf with dynamic entries created via omapi
Steve van der Burg
steve.vanderburg at lhsc.on.ca
Tue Jul 17 12:00:35 UTC 2012
> We are implementing a new provisioning system that needs to signal our
> dhcp-server to create or remove fixed-address host entries. The
> provisioning system will quite frequently be doing updates, so omapi
> would be nice to avoid having to restart the dhcp service.
>
> On the other hand we use more than one dhcp server for redundancy and to
> avoid these servers getting "out of sync" due to updates while one or
> more servers are down, I would like to generate a completely updated
> dhcpd.conf with all the static host entries. I could generate the config
> as part of the dhcp startup script so im sure dhcpd.conf is always
> accurate at service start.
>
> So the question goes, how does the dhcp server handle overlaps in
> dhcpd.conf vs. dynamic entries in dhcpd.leases? 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?
You can consider the leases file to be another configuration file, since the server reads it when it starts up. A system that I set up and that also manages host entries (20,000+) does it this way (this is a block comment lifted right out of my code):
# The basic strategy is:
#
# - Build list of MACs (with assoc. IP addrs for some) from the database,
# assuming that we'll be adding them all
# - Build list of host objs from the server's lease file. Assume that we'll be deleting them all
# - Compare lists:
# - remove 'host-delete' from the host list when we find a match in the database list
# - remove 'db-add' when the database record matches the host object
# - change 'db-add' to 'db-update' when changes have been made (db needs to update host object)
# - leave 'db-add' alone when it really is a new record
# - Use omshell to run the updates to the servers
'host-delete', 'db-add' and 'db-update' refer to actions that will be taken for each host object.
In order for this to work, you need to have your DHCP servers send their lease files to a central spot. If a server has been down for, say, 8 hours, when it starts up again, 8 hours of changes will be applied.
...Steve
--------------------------------------------------------------------------------
This information is directed in confidence solely to the person named above and may contain confidential and/or privileged material. This information may not otherwise be distributed, copied or disclosed. If you have received this e-mail in error, please notify the sender immediately via a return e-mail and destroy original message. Thank you for your cooperation.
More information about the dhcp-users
mailing list