dhcpd issue static lease on first request

Bob Proulx bob at proulx.com
Tue Oct 26 02:04:20 UTC 2010


Sten Carlsen wrote:
> > Christ Schlacta wrote:
> > is it possible to have dhcpd issue a static lease to a client on it's
> > first connection, such that later when the same MAC address tries to
> > connect again later, the same IP address is issued again and the same
> > DNS entries are updated?
>
> As long as you keep your leases file, one MAC should always get the same
> IP, except if it has been given out since last time that MAC was seen.
> The only reason it would be given out again is if you run out of IPs.

I was thinking the same thing.  What you are asking for is basically
the same as the default behavior.  There isn't any specific
configuration for it since it will do it by default.

> So if:
> - you always retain the leases file
> - have enough IPs that it will never be necessary to reuse IPs
> then the default behaviour (mandated by RFC) is to always give the same
> IP to a MAC.
> 
> I assume you see the problem? What does it look like when it happens?
> Any specific way to make it happen?

I have seen similar problems when the lease given out is already
somewhat long and the pool is somewhat small and that coupled with a
large number of drive-by devices.  All IP addresses become consumed in
leases and that forces the server to reclaim abandoned IPs and to
rotate IPs.  Increasing the size of the IP pool will help in that case
and is the first best help.  If the pool size is limited then reducing
the lease time is the next thing that would help.

Bob



More information about the dhcp-users mailing list