1.\" $OpenBSD: dhcpd.leases.5,v 1.12 2014/11/15 14:41:02 bentley 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: November 15 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 75.Ic starts 76and 77.Ic ends 78statements: 79.Pp 80.D1 Ic starts Ar date ; 81.D1 Ic ends Ar date ; 82.Pp 83Dates are specified as follows: 84.Pp 85.D1 Ar weekday year Ns / Ns Ar month Ns / Ns Ar day hour : Ns Ar minute : Ns Ar second 86.Pp 87The weekday is present to make it easy for a human to tell when a 88lease expires \- it's specified as a number from zero to six, with zero 89being Sunday. 90The day of week is ignored on input. 91The year is specified with the century, so it should generally be four digits 92except for really long leases. 93The month is specified as a number starting with 1 for January. 94The day of the month is likewise specified starting with 1. 95The hour is a number from 0 to 23, the minute a number from 0 to 59, 96and the second also a number from 0 to 59. 97.Pp 98Lease times are specified in Coordinated Universal Time (UTC), not in the 99local time zone. 100.Pp 101The MAC address of the network interface that was used to acquire the 102lease is recorded with the 103.Ic hardware 104statement: 105.Pp 106.D1 Ic hardware Ar hardware-type mac-address ; 107.Pp 108The MAC address is specified as a series of hexadecimal octets, 109separated by colons. 110.Pp 111If the client uses a client identifier to acquire its address, the 112client identifier is recorded using the 113.Ic uid 114statement: 115.Pp 116.D1 Ic uid Ar client-identifier ; 117.Pp 118The client identifier is recorded as a series of hexadecimal octets, 119regardless of whether the client specifies an ASCII string or uses the 120newer hardware type/MAC address format. 121.Pp 122If the client sends a hostname using the 123.Ic Client Hostname 124option, as specified in some versions of the DHCP-DNS Interaction draft, that 125hostname is recorded using the 126.Ic client-hostname 127statement. 128.Pp 129.D1 Ic client-hostname Qq Ar hostname ; 130.Pp 131If the client sends its hostname using the 132.Ic Hostname 133option, it is recorded using the 134.Ic hostname 135statement. 136.Pp 137.D1 Ic hostname Qq Ar hostname ; 138.Pp 139The DHCP server may determine that a lease has been misused in some 140way, either because a client that has been assigned a lease NAKs it, 141or because the server's own attempt to see if an address is in use 142prior to reusing it reveals that the address is in fact already in 143use. 144In that case, the 145.Ic abandoned 146statement will be used to indicate that the lease should not be reassigned. 147.Pp 148.D1 Ic abandoned ; 149.Pp 150Abandoned leases are reclaimed automatically. 151When a client asks for a new address, and the server finds that there 152are no new addresses, it checks to see if there are any abandoned leases, 153and allocates the least recently abandoned lease. 154The standard mechanisms for checking for lease address conflicts are still 155followed, so if the abandoned lease's IP address is still in use, 156it will be reabandoned. 157.Pp 158If a client 159.Em requests 160an abandoned address, the server assumes that the reason the address was 161abandoned was that the lease file was corrupted, and that the client is 162the machine that responded when the lease was probed, 163causing it to be abandoned. 164In that case, the address is immediately assigned to the client. 165.Sh FILES 166.Bl -tag -width Ds -compact 167.It /var/db/dhcpd.leases 168.El 169.Sh SEE ALSO 170.Xr dhcp-options 5 , 171.Xr dhcpd.conf 5 , 172.Xr dhcpd 8 173.Sh STANDARDS 174.Rs 175.%A R. Droms 176.%D March 1997 177.%R RFC 2131 178.%T Dynamic Host Configuration Protocol 179.Re 180.Pp 181.Rs 182.%A S. Alexander 183.%A R. Droms 184.%D March 1997 185.%R RFC 2132 186.%T DHCP Options and BOOTP Vendor Extensions 187.Re 188.Sh AUTHORS 189.An -nosplit 190.Xr dhcpd 8 191was written by 192.An Ted Lemon Aq Mt mellon@vix.com 193under a contract with Vixie Labs. 194.Pp 195The current implementation was reworked by 196.An Henning Brauer Aq Mt henning@openbsd.org . 197