⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dhcpd.leases.5

📁 DHCP服务器源码
💻 5
字号:
.\"	dhcpd.leases.5.\".\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC").\" Copyright (c) 1996-2003 by Internet Software Consortium.\".\" Permission to use, copy, modify, and distribute this software for any.\" purpose with or without fee is hereby granted, provided that the above.\" copyright notice and this permission notice appear in all copies..\".\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF.\" MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT.\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE..\".\"   Internet Systems Consortium, Inc..\"   950 Charter Street.\"   Redwood City, CA 94063.\"   <info@isc.org>.\"   http://www.isc.org/.\".\" This software has been written for Internet Systems Consortium.\" by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc..\" To learn more about Internet Systems 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''..\".\" $Id: dhcpd.leases.5,v 1.8.2.6 2004/06/10 17:59:53 dhankins Exp $.\".TH dhcpd.leases 5.SH NAMEdhcpd.leases - DHCP client lease database.SH DESCRIPTIONThe Internet Systems Consortium DHCP Server keeps a persistentdatabase of leases that it has assigned.  This database is a free-formASCII file containing a series of lease declarations.  Every time alease is acquired, renewed or released, its new value is recorded atthe end of the lease file.  So if more than one declaration appearsfor a given lease, the last one in the file is the current one..PPWhen dhcpd is first installed, there is no lease database.   However,dhcpd requires that a lease database be present before it will start.To make the initial lease database, just create an empty file calledDBDIR/dhcpd.leases.   You can do this with:.PP.nf	touch DBDIR/dhcpd.leases.fi.PPIn order to prevent the lease database from growing without bound, thefile is rewritten from time to time.   First, a temporary leasedatabase is created and all known leases are dumped to it.   Then, theold lease database is renamed DBDIR/dhcpd.leases~.   Finally, thenewly written lease database is moved into place..SH FORMATLease descriptions are stored in a format that is parsed by the samerecursive descent parser used to read the.B dhcpd.conf(5)and.B dhclient.conf(5)files.  Lease files can contain lease declarations, and also group andsubgroup declarations, host declarations and failover statedeclarations.  Group, subgroup and host declarations are used torecord objects created using the OMAPI protocol..PPThe lease file is a log-structured file - whenever a lease changes,the contents of that lease are written to the end of the file.   Thismeans that it is entirely possible and quite reasonable for there tobe two or more declarations of the same lease in the lease file at thesame time.   In that case, the instance of that particular lease thatappears last in the file is the one that is in effect..PPGroup, subgroup and host declarations in the lease file are handled inthe same manner, except that if any of these objects are deleted, a\fIrubout\fR is written to the lease file.   This is just the samedeclaration, with \fB{ deleted; }\fR in the scope of thedeclaration.   When the lease file is rewritten, any such rubouts thatcan be eliminated are eliminated.   It is possible to delete adeclaration in the \fBdhcpd.conf\fR file; in this case, the ruboutcan never be eliminated from the \fBdhcpd.leases\fR file..SH THE LEASE DECLARATION.PP.B lease \fIip-address\fB { \fIstatements...\fB }.PPEach lease declaration includes the single IP address that has beenleased to the client.   The statements within the braces define theduration of the lease and to whom it is assigned..PP.nf.B starts \fIdate\fB;\fR.B ends \fIdate\fB;\fR.B tstp \fIdate\fB;\fR.B tsfp \fIdate\fB;\fR.fi.PPThe start and end time of a lease are recorded using the \fBstarts\fRand \fBends\fR statements.   The \fBtstp\fR statement is specified ifthe failover protocol is being used, and indicates what time the peerhas been told the lease expires.   The \fBtsfp\fR statement isalso specified if the failover protocol is being used, and indicatesthe lease expiry time that the peer has acknowledged.   The \fIdate\fRis specified as follows:.PP.I weekday year\fB/\fImonth\fB/\fIday hour\fB:\fIminute\fB:\fIsecond\fR.PPThe weekday is present to make it easy for a human to tell when alease expires - it's specified as a number from zero to six, with zerobeing Sunday.  The day of week is ignored on input.  The year isspecified with the century, so it should generally be four digitsexcept for really long leases.  The month is specified as a numberstarting with 1 for January.  The day of the month is likewisespecified starting with 1.  The hour is a number between 0 and 23, theminute a number between 0 and 59, and the second also a number between0 and 59..PPLease times are specified in Universal Coordinated Time (UTC), not inthe local time zone.  There is probably nowhere in the world where thetimes recorded on a lease are always the same as wall clock times.  Onmost unix machines, you can display the current time in UTC by typing\fBdate -u\fR..PPIf a lease will never expire, \fIdate\fR is \fBnever\fR instead of anactual date..PP.B hardware \fIhardware-type mac-address\fB;\fR.PPThe hardware statement records the MAC address of the networkinterface on which the lease will be used.   It is specified as aseries of hexadecimal octets, separated by colons..PP.B uid \fIclient-identifier\fB;\fR.PPThe \fBuid\fR statement records the client identifier used by theclient to acquire the lease.   Clients are not required to send clientidentifiers, and this statement only appears if the client did in factsend one.   Client identifiers are normally an ARP type (1 forethernet) followed by the MAC address, just like in the \fBhardware\fIstatement, but this is not required..PPThe client identifier is recorded as a colon-separated hexadecimallist or as a quoted string.   If it is recorded as a quoted string andit contains one or more non-printable characters, those characters arerepresented as octal escapes - a backslash character followed by threeoctal digits..PP.B client-hostname "\fIhostname\fB";\fR.PPMost DHCP clients will send their hostname in the \fIhost-name\fRoption.  If a client sends its hostname in this way, the hostname isrecorded on the lease with a \fBclient-hostname\fR statement.   Thisis not required by the protocol, however, so many specialized DHCPclients do not send a host-name option..PP.B abandoned;.PPThe \fBabandoned\fR statement indicates that the DHCP server hasabandoned the lease.   In that case, the \fBabandoned\fR statementwill be used to indicate that the lease should not be reassigned.Please see the \fBdhcpd.conf(5)\fR manual page for information aboutabandoned leases..PP.B binding state \fIstate\fB;.B next binding state \fIstate\fB;.PPThe \fBbinding state\fR statement declares the lease's binding state.When the DHCP server is not configured to use the failover protocol, alease's binding state will be either \fBactive\fR or \fBfree\fR.   Thefailover protocol adds some additional transitional states, as well asthe \fBbackup\fR state, which indicates that the lease is availablefor allocation by the failover secondary..PPThe \fBnext binding state\fR statement indicates what state the leasewill move to when the current state expires.   The time when thecurrent state expires is specified in the \fIends\fR statement..PP.B option agent.circuit-id \fIstring\fR;.B option agent.remote-id \fIstring\fR;.PPThe \fBoption agent.circuit-id\fR and \fBoption agent.remote-id\fRstatements are used to record the circuit ID and remote ID optionssend by the relay agent, if the relay agent uses the \fIrelay agentinformation option\fR.   This allows these options to be usedconsistently in conditional evaluations even when the client iscontacting the server directly rather than through its relay agent..PP.B set \fIvariable\fB = \fIvalue\fB;.PPThe \fBset\fR statement sets the value of a variable on the lease.For general information on variables, see the \fBdhcp-eval(5)\fRmanual page..PP.B The \fIddns-text\fB variable.PPThe \fIddns-text\fR variable is used to record the value of theclient's TXT identification record when the interim ddns updatestyle has been used to update the DNS for a particular lease..PP.B The \fIddns-fwd-name\fB variable.PPThe \fIddns-fwd-name\fB variable records the value of the name used inupdating the client's A record if a DDNS update has been successfullydone by the server.   The server may also have used this name toupdate the client's PTR record..PP.B The \fIddns-client-fqdn\fB variable.PPIf the server is configured to use the interim ddns update style, andis also configured to allow clients to update their own fqdns, and theclient did in fact update its own fqdn, then the\fIddns-client-fqdn\fR variable records the name that the client hasindicated it is using.   This is the name that the server will haveused to update the client's PTR record in this case..PP.B The \fIddns-rev-name\fB variable.PPIf the server successfully updates the client's PTR record, thisvariable will record the name that the DHCP server used for the PTRrecord.   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 acertain event occurs.   The possible events that can occur for anactive lease are \fBrelease\fR and \fBexpiry\fR.   More than one eventcan be specified - if so, the events are separated by '|' characters..SH THE FAILOVER PEER STATE DECLARATIONThe state of any failover peering arrangements is also recorded in thelease 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.PPThe states of the peer named \fIname\fR is being recorded.   Both thestate of the running server (\fBmy state\fR) and the other failoverpartner (\fIpeer state\fR) are recorded.   The following states arepossible: \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.SH SEE ALSOdhcpd(8), dhcp-options(5), dhcp-eval(5), dhcpd.conf(5), RFC2132, RFC2131..SH AUTHOR.B dhcpd(8)was written by Ted Lemonunder a contract with Vixie Labs.   Fundingfor this project was provided by Internet Systems Consortium.Information about Internet Systems Consortium can be found at:.B http://www.isc.org/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -