Nuke unused macro and comment
[dragonfly.git] / contrib / dhcp-3.0 / server / dhcpd.leases.5
blobbc06b2f81b7de0563178b779f5433f25784c66eb
1 .\"     dhcpd.leases.5
2 .\"
3 .\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
4 .\" Copyright (c) 1996-2003 by Internet Software Consortium
5 .\"
6 .\" Permission to use, copy, modify, and distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
9 .\"
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
16 .\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .\"
18 .\"   Internet Systems Consortium, Inc.
19 .\"   950 Charter Street
20 .\"   Redwood City, CA 94063
21 .\"   <info@isc.org>
22 .\"   http://www.isc.org/
23 .\"
24 .\" This software has been written for Internet Systems Consortium
25 .\" by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
26 .\" To learn more about Internet Systems Consortium, see
27 .\" ``http://www.isc.org/''.  To learn more about Vixie Enterprises,
28 .\" see ``http://www.vix.com''.   To learn more about Nominum, Inc., see
29 .\" ``http://www.nominum.com''.
30 .\"
31 .\" $Id: dhcpd.leases.5,v 1.8.2.6 2004/06/10 17:59:53 dhankins Exp $
32 .\"
33 .TH dhcpd.leases 5
34 .SH NAME
35 dhcpd.leases - DHCP client lease database
36 .SH DESCRIPTION
37 The Internet Systems Consortium DHCP Server keeps a persistent
38 database of leases that it has assigned.  This database is a free-form
39 ASCII file containing a series of lease declarations.  Every time a
40 lease is acquired, renewed or released, its new value is recorded at
41 the end of the lease file.  So if more than one declaration appears
42 for a given lease, the last one in the file is the current one.
43 .PP
44 When dhcpd is first installed, there is no lease database.   However,
45 dhcpd requires that a lease database be present before it will start.
46 To make the initial lease database, just create an empty file called
47 DBDIR/dhcpd.leases.   You can do this with:
48 .PP
49 .nf
50         touch DBDIR/dhcpd.leases
51 .fi
52 .PP
53 In order to prevent the lease database from growing without bound, the
54 file is rewritten from time to time.   First, a temporary lease
55 database is created and all known leases are dumped to it.   Then, the
56 old lease database is renamed DBDIR/dhcpd.leases~.   Finally, the
57 newly written lease database is moved into place.
58 .SH FORMAT
59 Lease descriptions are stored in a format that is parsed by the same
60 recursive descent parser used to read the
61 .B dhcpd.conf(5)
62 and
63 .B dhclient.conf(5)
64 files.  Lease files can contain lease declarations, and also group and
65 subgroup declarations, host declarations and failover state
66 declarations.  Group, subgroup and host declarations are used to
67 record objects created using the OMAPI protocol.
68 .PP
69 The lease file is a log-structured file - whenever a lease changes,
70 the contents of that lease are written to the end of the file.   This
71 means that it is entirely possible and quite reasonable for there to
72 be two or more declarations of the same lease in the lease file at the
73 same time.   In that case, the instance of that particular lease that
74 appears last in the file is the one that is in effect.
75 .PP
76 Group, subgroup and host declarations in the lease file are handled in
77 the same manner, except that if any of these objects are deleted, a
78 \fIrubout\fR is written to the lease file.   This is just the same
79 declaration, with \fB{ deleted; }\fR in the scope of the
80 declaration.   When the lease file is rewritten, any such rubouts that
81 can be eliminated are eliminated.   It is possible to delete a
82 declaration in the \fBdhcpd.conf\fR file; in this case, the rubout
83 can never be eliminated from the \fBdhcpd.leases\fR file.
84 .SH THE LEASE DECLARATION
85 .PP
86 .B lease \fIip-address\fB { \fIstatements...\fB }
87 .PP
88 Each lease declaration includes the single IP address that has been
89 leased to the client.   The statements within the braces define the
90 duration of the lease and to whom it is assigned.
91 .PP
92 .nf
93 .B starts \fIdate\fB;\fR
94 .B ends \fIdate\fB;\fR
95 .B tstp \fIdate\fB;\fR
96 .B tsfp \fIdate\fB;\fR
97 .fi
98 .PP
99 The start and end time of a lease are recorded using the \fBstarts\fR
100 and \fBends\fR statements.   The \fBtstp\fR statement is specified if
101 the failover protocol is being used, and indicates what time the peer
102 has been told the lease expires.   The \fBtsfp\fR statement is
103 also specified if the failover protocol is being used, and indicates
104 the lease expiry time that the peer has acknowledged.   The \fIdate\fR
105 is specified as follows:
107 .I weekday year\fB/\fImonth\fB/\fIday hour\fB:\fIminute\fB:\fIsecond\fR
109 The weekday is present to make it easy for a human to tell when a
110 lease expires - it's specified as a number from zero to six, with zero
111 being Sunday.  The day of week is ignored on input.  The year is
112 specified with the century, so it should generally be four digits
113 except for really long leases.  The month is specified as a number
114 starting with 1 for January.  The day of the month is likewise
115 specified starting with 1.  The hour is a number between 0 and 23, the
116 minute a number between 0 and 59, and the second also a number between
117 0 and 59.
119 Lease times are specified in Universal Coordinated Time (UTC), not in
120 the local time zone.  There is probably nowhere in the world where the
121 times recorded on a lease are always the same as wall clock times.  On
122 most unix machines, you can display the current time in UTC by typing
123 \fBdate -u\fR.
125 If a lease will never expire, \fIdate\fR is \fBnever\fR instead of an
126 actual date.
128 .B hardware \fIhardware-type mac-address\fB;\fR
130 The hardware statement records the MAC address of the network
131 interface on which the lease will be used.   It is specified as a
132 series of hexadecimal octets, separated by colons.
134 .B uid \fIclient-identifier\fB;\fR
136 The \fBuid\fR statement records the client identifier used by the
137 client to acquire the lease.   Clients are not required to send client
138 identifiers, and this statement only appears if the client did in fact
139 send one.   Client identifiers are normally an ARP type (1 for
140 ethernet) followed by the MAC address, just like in the \fBhardware\fI
141 statement, but this is not required.
143 The client identifier is recorded as a colon-separated hexadecimal
144 list or as a quoted string.   If it is recorded as a quoted string and
145 it contains one or more non-printable characters, those characters are
146 represented as octal escapes - a backslash character followed by three
147 octal digits.
149 .B client-hostname "\fIhostname\fB";\fR
151 Most DHCP clients will send their hostname in the \fIhost-name\fR
152 option.  If a client sends its hostname in this way, the hostname is
153 recorded on the lease with a \fBclient-hostname\fR statement.   This
154 is not required by the protocol, however, so many specialized DHCP
155 clients do not send a host-name option.
157 .B abandoned;
159 The \fBabandoned\fR statement indicates that the DHCP server has
160 abandoned the lease.   In that case, the \fBabandoned\fR statement
161 will be used to indicate that the lease should not be reassigned.
162 Please see the \fBdhcpd.conf(5)\fR manual page for information about
163 abandoned leases.
165 .B binding state \fIstate\fB;
166 .B next binding state \fIstate\fB;
168 The \fBbinding state\fR statement declares the lease's binding state.
169 When the DHCP server is not configured to use the failover protocol, a
170 lease's binding state will be either \fBactive\fR or \fBfree\fR.   The
171 failover protocol adds some additional transitional states, as well as
172 the \fBbackup\fR state, which indicates that the lease is available
173 for allocation by the failover secondary.
175 The \fBnext binding state\fR statement indicates what state the lease
176 will move to when the current state expires.   The time when the
177 current state expires is specified in the \fIends\fR statement.
179 .B option agent.circuit-id \fIstring\fR;
180 .B option agent.remote-id \fIstring\fR;
182 The \fBoption agent.circuit-id\fR and \fBoption agent.remote-id\fR
183 statements are used to record the circuit ID and remote ID options
184 send by the relay agent, if the relay agent uses the \fIrelay agent
185 information option\fR.   This allows these options to be used
186 consistently in conditional evaluations even when the client is
187 contacting the server directly rather than through its relay agent.
189 .B set \fIvariable\fB = \fIvalue\fB;
191 The \fBset\fR statement sets the value of a variable on the lease.
192 For general information on variables, see the \fBdhcp-eval(5)\fR
193 manual page.
195 .B The \fIddns-text\fB variable
197 The \fIddns-text\fR variable is used to record the value of the
198 client's TXT identification record when the interim ddns update
199 style has been used to update the DNS for a particular lease.
201 .B The \fIddns-fwd-name\fB variable
203 The \fIddns-fwd-name\fB variable records the value of the name used in
204 updating the client's A record if a DDNS update has been successfully
205 done by the server.   The server may also have used this name to
206 update the client's PTR record.
208 .B The \fIddns-client-fqdn\fB variable
210 If the server is configured to use the interim ddns update style, and
211 is also configured to allow clients to update their own fqdns, and the
212 client did in fact update its own fqdn, then the
213 \fIddns-client-fqdn\fR variable records the name that the client has
214 indicated it is using.   This is the name that the server will have
215 used to update the client's PTR record in this case.
217 .B The \fIddns-rev-name\fB variable
219 If the server successfully updates the client's PTR record, this
220 variable will record the name that the DHCP server used for the PTR
221 record.   The name to which the PTR record points will be either the
222 \fIddns-fwd-name\fR or the \fIddns-client-fqdn\fR.
224 .B on \fIevents\fB { \fIstatements...\fB }
225 The \fBon\fI statement records a list of statements to execute if a
226 certain event occurs.   The possible events that can occur for an
227 active lease are \fBrelease\fR and \fBexpiry\fR.   More than one event
228 can be specified - if so, the events are separated by '|' characters.
229 .SH THE FAILOVER PEER STATE DECLARATION
230 The state of any failover peering arrangements is also recorded in the
231 lease file, using the \fBfailover peer\fR statement:
234 .B failover peer "\fIname\fB" state {
235 .B   my   state \fIstate\fB at \fIdate\fB;
236 .B   peer state \fIstate\fB at \fIdate\fB;
237 .B }
240 The states of the peer named \fIname\fR is being recorded.   Both the
241 state of the running server (\fBmy state\fR) and the other failover
242 partner (\fIpeer state\fR) are recorded.   The following states are
243 possible: \fBunknown-state\fR, \fBpartner-down\fR, \fBnormal\fR,
244 \fBcommunications-interrupted\fR, \fBresolution-interrupted\fR,
245 \fBpotential-conflict\fR, \fBrecover\fR, \fBrecover-done\fR,
246 \fBshutdown\fR, \fBpaused\fR, and \fBstartup\fR.
247 .B DBDIR/dhcpd.leases
248 .SH SEE ALSO
249 dhcpd(8), dhcp-options(5), dhcp-eval(5), dhcpd.conf(5), RFC2132, RFC2131.
250 .SH AUTHOR
251 .B dhcpd(8)
252 was written by Ted Lemon
253 under a contract with Vixie Labs.   Funding
254 for this project was provided by Internet Systems Consortium.
255 Information about Internet Systems Consortium can be found at:
256 .B http://www.isc.org/