xref: /openbsd-src/usr.sbin/dhcpd/dhcpd.leases.5 (revision 50b7afb2c2c0993b0894d4e34bf857cb13ed9c80)
1.\"	$OpenBSD: dhcpd.leases.5,v 1.11 2014/01/03 16:21:58 jmc Exp $
2.\"
3.\" Copyright (c) 1997, 1998 The Internet Software Consortium.
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\"
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. Neither the name of The Internet Software Consortium nor the names
16.\"    of its contributors may be used to endorse or promote products derived
17.\"    from this software without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
20.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23.\" DISCLAIMED.  IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
24.\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
27.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE.
32.\"
33.\" This software has been written for the Internet Software Consortium
34.\" by Ted Lemon <mellon@fugue.com> in cooperation with Vixie
35.\" Enterprises.  To learn more about the Internet Software Consortium,
36.\" see ``http://www.isc.org/isc''.  To learn more about Vixie
37.\" Enterprises, see ``http://www.vix.com''.
38.\"
39.Dd $Mdocdate: January 3 2014 $
40.Dt DHCPD.LEASES 5
41.Os
42.Sh NAME
43.Nm dhcpd.leases
44.Nd DHCP server lease database
45.Sh DESCRIPTION
46The Internet Software Consortium DHCP Server keeps a persistent
47database of leases that it has assigned.
48This database is a free-form ASCII file containing a series of
49lease declarations.
50Every time a lease is acquired, renewed or released, its new value is
51recorded at the end of the lease file.
52So if more than one declaration appears for a given lease,
53the last one in the file is the current one.
54.Sh FORMAT
55Lease descriptions are stored in a format that is parsed by the same
56recursive descent parser used to read the
57.Xr dhcpd.conf 5
58and
59.Xr dhclient.conf 5
60files.
61Currently, the only declaration that is used in the
62.Nm
63file is the
64.Ic lease
65declaration.
66.Pp
67.D1 Ic lease Ar ip-address No { Ar statements... No }
68.Pp
69Each lease declaration includes the single IP address that has been
70leased to the client.
71The statements within the braces define the duration of the lease
72and to whom it is assigned.
73.Pp
74The start and end time of a lease are recorded using the ``starts''
75and ``ends'' statements:
76.Pp
77.D1 Ic starts Ar date ;
78.D1 Ic ends Ar date ;
79.Pp
80Dates are specified as follows:
81.Pp
82.D1 Ar weekday year Ns / Ns Ar month Ns / Ns Ar day hour : Ns Ar minute : Ns Ar second
83.Pp
84The weekday is present to make it easy for a human to tell when a
85lease expires \- it's specified as a number from zero to six, with zero
86being Sunday.
87The day of week is ignored on input.
88The year is specified with the century, so it should generally be four digits
89except for really long leases.
90The month is specified as a number starting with 1 for January.
91The day of the month is likewise specified starting with 1.
92The hour is a number from 0 to 23, the minute a number from 0 to 59,
93and the second also a number from 0 to 59.
94.Pp
95Lease times are specified in Coordinated Universal Time (UTC), not in the
96local time zone.
97.Pp
98The MAC address of the network interface that was used to acquire the
99lease is recorded with the
100.Ic hardware
101statement:
102.Pp
103.D1 Ic hardware Ar hardware-type mac-address ;
104.Pp
105The MAC address is specified as a series of hexadecimal octets,
106separated by colons.
107.Pp
108If the client uses a client identifier to acquire its address, the
109client identifier is recorded using the
110.Ic uid
111statement:
112.Pp
113.D1 Ic uid Ar client-identifier ;
114.Pp
115The client identifier is recorded as a series of hexadecimal octets,
116regardless of whether the client specifies an ASCII string or uses the
117newer hardware type/MAC address format.
118.Pp
119If the client sends a hostname using the
120.Ic Client Hostname
121option, as specified in some versions of the DHCP-DNS Interaction draft, that
122hostname is recorded using the
123.Ic client-hostname
124statement.
125.Pp
126.D1 Ic client-hostname Qq Ar hostname ;
127.Pp
128If the client sends its hostname using the
129.Ic Hostname
130option, it is recorded using the
131.Ic hostname
132statement.
133.Pp
134.D1 Ic hostname Qq Ar hostname ;
135.Pp
136The DHCP server may determine that a lease has been misused in some
137way, either because a client that has been assigned a lease NAKs it,
138or because the server's own attempt to see if an address is in use
139prior to reusing it reveals that the address is in fact already in
140use.
141In that case, the
142.Ic abandoned
143statement will be used to indicate that the lease should not be reassigned.
144.Pp
145.D1 Ic abandoned ;
146.Pp
147Abandoned leases are reclaimed automatically.
148When a client asks for a new address, and the server finds that there
149are no new addresses, it checks to see if there are any abandoned leases,
150and allocates the least recently abandoned lease.
151The standard mechanisms for checking for lease address conflicts are still
152followed, so if the abandoned lease's IP address is still in use,
153it will be reabandoned.
154.Pp
155If a client
156.Em requests
157an abandoned address, the server assumes that the reason the address was
158abandoned was that the lease file was corrupted, and that the client is
159the machine that responded when the lease was probed,
160causing it to be abandoned.
161In that case, the address is immediately assigned to the client.
162.Sh FILES
163.Bl -tag -width Ds -compact
164.It /var/db/dhcpd.leases
165.El
166.Sh SEE ALSO
167.Xr dhcp-options 5 ,
168.Xr dhcpd.conf 5 ,
169.Xr dhcpd 8
170.Sh STANDARDS
171.Rs
172.%A R. Droms
173.%D March 1997
174.%R RFC 2131
175.%T Dynamic Host Configuration Protocol
176.Re
177.Pp
178.Rs
179.%A S. Alexander
180.%A R. Droms
181.%D March 1997
182.%R RFC 2132
183.%T DHCP Options and BOOTP Vendor Extensions
184.Re
185.Sh AUTHORS
186.An -nosplit
187.Xr dhcpd 8
188was written by
189.An Ted Lemon Aq Mt mellon@vix.com
190under a contract with Vixie Labs.
191.Pp
192The current implementation was reworked by
193.An Henning Brauer Aq Mt henning@openbsd.org .
194