2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-29 05:17:57 +00:00

Revamp lease file documentation for 3.0.

This commit is contained in:
Ted Lemon 2001-02-22 22:50:32 +00:00
parent 95848a1fe0
commit b276ad7569

View File

@ -1,20 +1,39 @@
.\" dhcpd.leases.5 .\" dhcpd.leases.5
.\" .\"
.\" Copyright (c) 1996-1999 Internet Software Consortium. .\" Copyright (c) 1996-2001 Internet Software Consortium.
.\" Use is subject to license terms which appear in the file named .\" Redistribution and use in source and binary forms, with or without
.\" ISC-LICENSE that should have accompanied this file when you .\" modification, are permitted provided that the following conditions
.\" received it. If a file named ISC-LICENSE did not accompany this .\" are met:
.\" file, or you are not sure the one you have is correct, you may
.\" obtain an applicable copy of the license at:
.\" .\"
.\" http://www.isc.org/isc-license-1.0.html. .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of The Internet Software Consortium nor the names
.\" of its contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\" .\"
.\" This file is part of the ISC DHCP distribution. The documentation .\" THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
.\" associated with this file is listed in the file DOCUMENTATION, .\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
.\" included in the top-level directory of this release. .\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
.\" DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
.\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\" .\"
.\" Support and other services are available for ISC products - see .\" This software has been written for the Internet Software Consortium
.\" http://www.isc.org for more information. .\" by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
.\" To learn more about the Internet Software Consortium, see
.\" ``http://www.isc.org/''. To learn more about Vixie Enterprises,
.\" see ``http://www.vix.com''. To learn more about Nominum, Inc., see
.\" ``http://www.nominum.com''.
.TH dhcpd.leases 5 .TH dhcpd.leases 5
.SH NAME .SH NAME
dhcpd.leases - DHCP client lease database dhcpd.leases - DHCP client lease database
@ -46,27 +65,50 @@ recursive descent parser used to read the
.B dhcpd.conf(5) .B dhcpd.conf(5)
and and
.B dhclient.conf(5) .B dhclient.conf(5)
files. Currently, the only declaration that is files. Lease files can contain lease declarations, and also group and
used in the dhcpd.leases file is the subgroup declarations, host declarations and failover state
.B lease declarations. Group, subgroup and host declarations are used to
declaration. record objects created using the OMAPI protocol.
.PP .PP
\fBlease \fIip-address\fB { \fIstatements...\fB } The lease file is a log-structured file - whenever a lease changes,
the contents of that lease are written to the end of the file. This
means that it is entirely possible and quite reasonable for there to
be two or more declarations of the same lease in the lease file at the
same time. In that case, the instance of that particular lease that
appears last in the file is the one that is in effect.
.PP
Group, subgroup and host declarations in the lease file are handled in
the same manner, except that if any of these objects are deleted, a
\fIrubout\fR is written to the lease file. This is just the same
declaration, with \fB{ deleted; }\fR in the scope of the
declaration. When the lease file is rewritten, any such rubouts that
can be eliminated are eliminated. It is possible to delete a
declaration in the \fBdhcpd.conf\fR file; in this case, the rubout
can never be eliminated from the \fBdhcpd.leases\fR file.
.SH THE LEASE DECLARATION
.PP
.B lease \fIip-address\fB { \fIstatements...\fB }
.PP .PP
Each lease declaration include the single IP address that has been Each lease declaration include the single IP address that has been
leased to the client. The statements within the braces define the leased to the client. The statements within the braces define the
duration of the lease and to whom it is assigned. duration of the lease and to whom it is assigned.
.PP .PP
The start and end time of a lease are recorded using the ``starts'' .nf
and ``ends'' statements: .B starts \fIdate\fB;\fR
.B ends \fIdate\fB;\fR
.B tstp \fIdate\fB;\fR
.B tsfp \fIdate\fB;\fR
.fi
.PP .PP
\fB starts \fIdate\fB;\fR The start and end time of a lease are recorded using the \fBstarts\fR
\fB ends \fIdate\fB;\fR and \fBends\fR statements. The \fBtstp\fR statement is specified if
the failover protocol is being used, and indicates what time the peer
has been told the lease expires. The \fBtsfp\fR statement is
also specified if the failover protocol is being used, and indicates
the lease expiry time that the peer has acknowledged. The \fIdate\fR
is specified as follows:
.PP .PP
Dates are specified as follows: .I weekday year\fB/\fImonth\fB/\fIday hour\fB:\fIminute\fB:\fIsecond\fR
.PP
\fIweekday year\fB/\fImonth\fB/\fIday
hour\fB:\fIminute\fB:\fIsecond\fR
.PP .PP
The weekday is present to make it easy for a human to tell when a The weekday is present to make it easy for a human to tell when a
lease expires - it's specified as a number from zero to six, with zero lease expires - it's specified as a number from zero to six, with zero
@ -78,66 +120,137 @@ specified starting with 1. The hour is a number between 0 and 23, the
minute a number between 0 and 59, and the second also a number between minute a number between 0 and 59, and the second also a number between
0 and 59. 0 and 59.
.PP .PP
Lease times are specified in Greenwich Mean Time (GMT), not in the Lease times are specified in Universal Coordinated Time (UTC), not in
local time zone. Since Greenwich is actually on Daylight Savings the local time zone. There is probably nowhere in the world where the
Time part of the year, there is probably nowhere in the world where times recorded on a lease are always the same as wall clock times. On
the times recorded on a lease are always the same as wall clock times. most unix machines, you can display the current time in UTC by typing
On a unix machine, one can often figure out the current time in GMT by \fBdate -u\fR.
typing \fBdate -u\fR.
.PP .PP
The MAC address of the network interface that was used to acquire the If a lease will never expire, \fIdate\fR is \fBnever\fR instead of an
lease is recorded with the \fBhardware\fR statement: actual date.
.PP .PP
\fBhardware \fIhardware-type mac-address\fB;\fR .B hardware \fIhardware-type mac-address\fB;\fR
.PP .PP
The MAC address is specified as a series of hexadecimal octets, The hardware statement records the MAC address of the network
seperated by colons. interface on which the lease will be used. It is specified as a
series of hexadecimal octets, seperated by colons.
.PP .PP
If the client used a client identifier to acquire its address, the .B uid \fIclient-identifier\fB;\fR
client identifier is recorded using the \fBuid\fR statement:
.PP .PP
\fBuid \fIclient-identifier\fB;\fR The \fBuid\fR statement records the client identifier used by the
client to acquire the lease. Clients are not required to send client
identifiers, and this statement only appears if the client did in fact
send one. Client identifiers are normally an ARP type (1 for
ethernet) followed by the MAC address, just like in the \fBhardware\fI
statement, but this is not required.
.PP .PP
The client identifier is recorded as a series of hexadecimal octets, The client identifier is normally recorded as a series of hexadecimal
regardless of whether the client specifies an ASCII string or uses the octets, seperated by colons. Some DHCP clients can be configured to
newer hardware type/MAC address format. send a text string as a client identifier, in which case the client
identifier is stored as a quoted string rather than a list of
hexadecimal octets.
.PP .PP
If the client sends a hostname using the \fIClient Hostname\fR option, .B client-hostname "\fIhostname\fB";\fR
as specified in some versions of the DHCP-DNS Interaction draft, that
hostname is recorded using the \fBclient-hostname\fR statement.
.PP .PP
\fBclient-hostname "\fIhostname\fB";\fR Most DHCP clients will send their hostname in the \fIhost-name\fR
option. If a client sends its hostname in this way, the hostname is
recorded on the lease with a \fBclient-hostname\fR statement. This
is not required by the protocol, however, so many specialized DHCP
clients do not send a host-name option.
.PP .PP
If the client sends its hostname using the \fIHostname\fR option, as .B abandoned;
Windows 95 does, it is recorded using the \fBhostname\fR statement.
.PP .PP
\fBhostname "\fIhostname\fB";\fR The \fBabandoned\fR statement indicates that the DHCP server has
abandoned the lease. In that case, the \fBabandoned\fR statement
will be used to indicate that the lease should not be reassigned.
Please see the \fBdhcpd.conf(5)\fR manual page for information about
abandoned leases.
.PP .PP
The DHCP server may determine that a lease has been misused in some .B binding state \fIstate\fB;
way, either because a client that has been assigned a lease DECLINEs it, .B next binding state \fIstate\fB;
or because the server's own attempt to see if an address is in use
prior to reusing it reveals that the address is in fact already in
use. In that case, the \fBabandoned\fR statement will be used to
indicate that the lease should not be reassigned.
.PP .PP
\fBabandoned;\fR The \fBbinding state\fR statement declares the lease's binding state.
When the DHCP server is not configured to use the failover protocol, a
lease's binding state will be either \fBactive\fR or \fBfree\fR. The
failover protocol adds some additional transitional states, as well as
the \fBbackup\fR state, which indicates that the lease is available
for allocation by the failover secondary.
.PP .PP
Abandoned leases are reclaimed automatically. When a client asks for The \fBnext binding state\fR statement indicates what state the lease
a new address, and the server finds that there are no new addresses, will move to when the current state expires. The time when the
it checks to see if there are any abandoned leases, and allocates the current state expires is specified in the \fIends\fR statement.
least recently abandoned lease. The standard mechanisms for checking
for lease address conflicts are still followed, so if the abandoned
lease's IP address is still in use, it will be reabandoned.
.PP .PP
If a client \fBrequests\fR an abandoned address, the server assumes .B option agent.circuit-id \fIstring\fR;
that the reason the address was abandoned was that the lease file was .B option agent.remote-id \fIstring\fR;
corrupted, and that the client is the machine that responded when the .PP
lease was probed, causing it to be abandoned. In that case, the The \fBoption agent.circuit-id\fR and \fBoption agent.remote-id\fR
address is immediately assigned to the client. statements are used to record the circuit ID and remote ID options
.SH FILES send by the relay agent, if the relay agent uses the \fIrelay agent
information option\fR. This allows these options to be used
consistently in conditional evaluations even when the client is
contacting the server directly rather than through its relay agent.
.PP
.B set \fIvariable\fB = \fIvalue\fB;
.PP
The \fBset\fR statement sets the value of a variable on the lease.
For general information on variables, see the \fBdhcp-eval(5)\fR
manual page.
.PP
.B The \fIddns-text\fB variable
.PP
The \fIddns-text\fR variable is used to record the value of the
client's TXT identification record when the interim ddns update
style has been used to update the DNS for a particular lease.
.PP
.B The \fIddns-fwd-name\fB variable
.PP
The \fIddns-fwd-name\fB variable records the value of the name used in
updating the client's A record if a DDNS update has been successfully
done by the server. The server may also have used this name to
update the client's PTR record.
.PP
.B The \fIddns-client-fqdn\fB variable
.PP
If the server is configured to use the interim ddns update style, and
is also configured to allow clients to update their own fqdns, and the
client did in fact update its own fqdn, then the
\fIddns-client-fqdn\fR variable records the name that the client has
indicated it is using. This is the name that the server will have
used to update the client's PTR record in this case.
.PP
.B The \fIddns-rev-name\fB variable
.PP
If the server successfully updates the client's PTR record, this
variable will record the name that the DHCP server used for the PTR
record. The name to which the PTR record points will be either the
\fIddns-fwd-name\fR or the \fIddns-client-fqdn\fR.
.PP
.B on \fIevents\fB { \fIstatements...\fB }
The \fBon\fI statement records a list of statements to execute if a
certain event occurs. The possible events that can occur for an
active lease are \fBrelease\fR and \fBexpiry\fR. More than one event
can be specified - if so, the events are seperated by '|' characters.
.SH THE FAILOVER PEER STATE DECLARATION
The state of any failover peering arrangements is also recorded in the
lease file, using the \fBfailover peer\fR statement:
.PP
.nf
.B failover peer "\fIname\fB" state {
.B my state \fIstate\fB at \fIdate\fB;
.B peer state \fIstate\fB at \fIdate\fB;
.B }
.fi
.PP
The states of the peer named \fIname\fR is being recorded. Both the
state of the running server (\fBmy state\fR) and the other failover
partner (\fIpeer state\fR) are recorded. The following states are
possible: \fBunknown-state\fR, \fBpartner-down\fR, \fBnormal\fR,
\fBcommunications-interrupted\fR, \fBresolution-interrupted\fR,
\fBpotential-conflict\fR, \fBrecover\fR, \fBrecover-done\fR,
\fBshutdown\fR, \fBpaused\fR, and \fBstartup\fR.
.B DBDIR/dhcpd.leases .B DBDIR/dhcpd.leases
.SH SEE ALSO .SH SEE ALSO
dhcpd(8), dhcp-options(5), dhcpd.conf(5), RFC2132, RFC2131. dhcpd(8), dhcp-options(5), dhcp-eval(5), dhcpd.conf(5), RFC2132, RFC2131.
.SH AUTHOR .SH AUTHOR
.B dhcpd(8) .B dhcpd(8)
was written by Ted Lemon <mellon@vix.com> was written by Ted Lemon <mellon@vix.com>