example config for "automatic allocation"?

Glenn Satchell Glenn.Satchell at uniq.com.au
Fri Sep 29 07:09:59 UTC 2006

>Date: Thu, 28 Sep 2006 22:05:11 -0700 (PDT)
>From: Chuck Kollars <ckollars9 at yahoo.com>
>Subject: example config for "automatic allocation"?
>To: dhcp-users at isc.org
>According to RFC 2131 there are three different
>possible methods of IP address allocation.
>One of them, "automatic allocation": assigning a
>permanent address to every client the first time, is
>exactly what I want. 
>But I'm having an awful time configuring my DHCP
>daemon to actually do it. Can somebody point me to an
>example configuration for "automatic allocation" (not
>the usual "dynamic allocation")?
>(Quote from RFC 2131: "DHCP supports three mechanisms
>for IP address allocation. In "automatic allocation",
>DHCP assigns a permanent IP address to a client. In
>"dynamic allocation", DHCP assigns an IP address to a
>client for a limited period of time (or until the
>client explicitly relinquishes the address). In
>"manual allocation", a client's IP address is assigned
>by the network administrator, and DHCP is used simply
>to convey the assigned address to the client. A
>particular network will use one or more of these
>mechanisms, depending on the policies of the network administrator.")

Set the lease time to be a very long period. In dynamic allocation, ie
where you want to re-use addresses the lease time is typically set to
periods ranging form 10s of minutes up to a day or so. In normal
operation the dhcp client will attepmt to renew its IP address part way
through the lease period. This means that as long as the client stays
on the network it will keep the same IP address.

If the client is shut down for a while (say for longer than the lease
period) then the lease will be freed and the server is then allowed to
reallocate it to a different client. However, rfc2131 says that the
server must try really hard to keep giving the same IP address back to
a given client. So dhcpd will try to find an unused IP address to
allocate to a new client before it hands out a freed IP address.

In practical terms if you have more IP addresses than clients then the
clients will tend to keep the same IP address anyway. You can force
this by using a really long lease time, eg 1 month or more. ISC dhcpd
does not support "infinite" leases, which is what you're probably
thinking about. However, if you set a lease time to be a month (or 2 or
3 or 6 if you feel like it) then in all practical terms it will behave
this way.

The down side is that if a client comes onto the network temporarily,
eg a visiting laptop, then it will hold onto an IP address for the
lease period before it is free to be reassigned.

The settings required are:

min-lease-time 2592000; # 30 days
default-lease-time 2592000; # 30 days
max-lease-time 2592000; # 30 days

You can use these statements in the global scope, or just in the subnet
where you want really persistant IP addresses. You only need to set
min-lease-time, but it is probably good practise to set all of them.

Glenn Satchell     mailto:glenn.satchell at uniq.com.au | Some days we are
Uniq Advances Pty Ltd         http://www.uniq.com.au | the flies;  some
PO Box 70 Paddington NSW Australia 2021              | days we  are the
tel:0409-458-580  tel:02-9380-6360  fax:02-9380-6416 | windscreens...

More information about the dhcp-users mailing list