📄 dhcpd.8
字号:
programs should use the dhcpctl API or OMAPI itself. Dhcpctl is awrapper that handles some of the housekeeping chores that OMAPI doesnot do automatically. Dhcpctl and OMAPI are documented in \fBdhcpctl(3)\fRand \fBomapi(3)\fR..PPOMAPI exports objects, which can then be examined and modified. TheDHCP server exports the following objects: lease, host,failover-state and group. Each object has a number of methods thatare provided: lookup, create, and destroy. In addition, it ispossible to look at attributes that are stored on objects, and in somecases to modify those attributes..SH THE LEASE OBJECTLeases can't currently be created or destroyed, but they can be lookedup to examine and modify their state..PPLeases have the following attributes:.PP.B state \fIinteger\fR lookup, examine.RS 0.5i.nf1 = free2 = active3 = expired4 = released5 = abandoned6 = reset7 = backup8 = reserved9 = bootp.fi.RE.PP.B ip-address \fIdata\fR lookup, examine.RS 0.5iThe IP address of the lease..RE.PP.B dhcp-client-identifier \fIdata\fR lookup, examine, update.RS 0.5iTheclient identifier that the client used when it acquired the lease.Not all clients send client identifiers, so this may be empty..RE.PP.B client-hostname \fIdata\fR examine, update.RS 0.5iThe value the client sent in the host-name option..RE.PP.B host \fIhandle\fR examine.RS 0.5ithe host declaration associated with this lease, if any..RE.PP.B subnet \fIhandle\fR examine.RS 0.5ithe subnet object associated with this lease (the subnet object is notcurrently supported)..RE.PP.B pool \fIhandle\fR examine.RS 0.5ithe pool object associted with this lease (the pool object is notcurrently supported)..RE.PP.B billing-class \fIhandle\fR examine.RS 0.5ithe handle to the class to which this lease is currently billed, ifany (the class object is not currently supported)..RE.PP.B hardware-address \fIdata\fR examine, update.RS 0.5ithe hardware address (chaddr) field sent by the client when itacquired its lease..RE.PP.B hardware-type \fIinteger\fR examine, update.RS 0.5ithe type of the network interface that the client reported when itacquired its lease..RE.PP.B ends \fItime\fR examine.RS 0.5ithe time when the lease's current state ends, as understood by theclient..RE.PP.B tstp \fItime\fR examine.RS 0.5ithe time when the lease's current state ends, as understood by theserver..RE.B tsfp \fItime\fR examine.RS 0.5ithe time when the lease's current state ends, as understood by thefailover peer (if there is no failover peer, this value isundefined)..RE.PP.B cltt \fItime\fR examine.RS 0.5iThe time of the last transaction with the client on this lease..RE.SH THE HOST OBJECTHosts can be created, destroyed, looked up, examined and modified.If a host declaration is created or deleted using OMAPI, thatinformation will be recorded in the dhcpd.leases file. It ispermissible to delete host declarations that are declared in thedhcpd.conf file..PPHosts have the following attributes:.PP.B name \fIdata\fR lookup, examine, modify.RS 0.5ithe name of the host declaration. This name must be unique among allhost declarations..RE.PP.B group \fIhandle\fR examine, modify.RS 0.5ithe named group associated with the host declaration, if there is one..RE.PP.B hardware-address \fIdata\fR lookup, examine, modify.RS 0.5ithe link-layer address that will be used to match the client, if any.Only valid if hardware-type is also present..RE.PP.B hardware-type \fIinteger\fR lookup, examine, modify.RS 0.5ithe type of the network interface that will be used to match theclient, if any. Only valid if hardware-address is also present..RE.PP.B dhcp-client-identifier \fIdata\fR lookup, examine, modify.RS 0.5ithe dhcp-client-identifier option that will be used to match theclient, if any..RE.PP.B ip-address \fIdata\fR examine, modify.RS 0.5ia fixed IP address which is reserved for a DHCP client that matchesthis host declaration. The IP address will only be assigned to theclient if it is valid for the network segment to which the client isconnected..RE.PP.B statements \fIdata\fR modify.RS 0.5ia list of statements in the format of the dhcpd.conf file that will beexecuted whenever a message from the client is being processed..RE.PP.B known \fIinteger\fR examine, modify.RS 0.5iif nonzero, indicates that a client matching this host declarationwill be treated as \fIknown\fR in pool permit lists. If zero, theclient will not be treated as known..RE.SH THE GROUP OBJECTNamed groups can be created, destroyed, looked up, examined andmodified. If a group declaration is created or deleted using OMAPI,that information will be recorded in the dhcpd.leases file. It ispermissible to delete group declarations that are declared in thedhcpd.conf file..PPNamed groups currently can only be associated withhosts - this allows one set of statements to be efficiently attachedto more than one host declaration. .PPGroups have the following attributes:.PP.B name \fIdata\fR.RS 0.5ithe name of the group. All groups that are created using OMAPI musthave names, and the names must be unique among all groups..RE.PP.B statements \fIdata\fR.RS 0.5ia list of statements in the format of the dhcpd.conf file that will beexecuted whenever a message from a client whose host declarationreferences this group is processed..RE.SH THE CONTROL OBJECTThe control object allows you to shut the server down. If the serveris doing failover with another peer, it will make a clean transitioninto the shutdown state and notify its peer, so that the peer can gointo partner down, and then record the "recover" state in the leasefile so that when the server is restarted, it will automaticallyresynchronize with its peer..PPOn shutdown the server will also attempt to cleanly shut down allOMAPI connections. If these connections do not go down cleanly afterfive seconds, they are shut down pre-emptively. It can take as muchas 25 seconds from the beginning of the shutdown process to the timethat the server actually exits..PPTo shut the server down, open its control object and set the stateattribute to 2..SH THE FAILOVER-STATE OBJECTThe failover-state object is the object that tracks the state of thefailover protocol as it is being managed for a given failover peer.The failover object has the following attributes (please see.B dhcpd.conf (5)for explanations about what these attributes mean):.PP.B name \fIdata\fR examine.RS 0.5iIndicates the name of the failover peer relationship, as described inthe server's \fBdhcpd.conf\fR file..RE.PP.B partner-address \fIdata\fR examine.RS 0.5iIndicates the failover partner's IP address..RE.PP.B local-address \fIdata\fR examine.RS 0.5iIndicates the IP address that is being used by the DHCP server forthis failover pair..RE.PP.B partner-port \fIdata\fR examine.RS 0.5iIndicates the TCP port on which the failover partner is listening forfailover protocol connections..RE.PP.B local-port \fIdata\fR examine.RS 0.5iIndicates the TCP port on which the DHCP server is listening forfailover protocol connections for this failover pair..RE.PP.B max-outstanding-updates \fIinteger\fR examine.RS 0.5iIndicates the number of updates that can be outstanding andunacknowledged at any given time, in this failover relationship..RE.PP.B mclt \fIinteger\fR examine.RS 0.5iIndicates the maximum client lead time in this failover relationship..RE.PP.B load-balance-max-secs \fIinteger\fR examine.RS 0.5iIndicates the maximum value for the secs field in a client requestbefore load balancing is bypassed..RE.PP.B load-balance-hba \fIdata\fR examine.RS 0.5iIndicates the load balancing hash bucket array for this failoverrelationship..RE.PP.B local-state \fIinteger\fR examine, modify.RS 0.5iIndicates the present state of the DHCP server in this failoverrelationship. Possible values for state are:.RE.RS 1i.PP.nf1 - partner down2 - normal3 - communications interrupted4 - resolution interrupted5 - potential conflict6 - recover7 - recover done8 - shutdown9 - paused10 - startup11 - recover wait.fi.RE.PP.RS 0.5iIn general it is not a good idea to make changes to this state.However, in the case that the failover partner is known to be down, itcan be useful to set the DHCP server's failover state to partnerdown. At this point the DHCP server will take over service of thefailover partner's leases as soon as possible, and will give outnormal leases, not leases that are restricted by MCLT. If you do putthe DHCP server into the partner-down when the other DHCP server isnot in the partner-down state, but is not reachable, IP addressassignment conflicts are possible, even likely. Once a server hasbeen put into partner-down mode, its failover partner must not bebrought back online until communication is possible between the twoservers..RE.PP.B partner-state \fIinteger\fR examine.RS 0.5iIndicates the present state of the failover partner..RE.PP.B local-stos \fIinteger\fR examine.RS 0.5iIndicates the time at which the DHCP server entered its present statein this failover relationship..RE.PP.B partner-stos \fIinteger\fR examine.RS 0.5iIndicates the time at which the failover partner entered its present state..RE.PP.B hierarchy \fIinteger\fR examine.RS 0.5iIndicates whether the DHCP server is primary (0) or secondary (1) inthis failover relationship..RE.PP.B last-packet-sent \fIinteger\fR examine.RS 0.5iIndicates the time at which the most recent failover packet was sentby this DHCP server to its failover partner..RE.PP.B last-timestamp-received \fIinteger\fR examine.RS 0.5iIndicates the timestamp that was on the failover message most recentlyreceived from the failover partner..RE.PP.B skew \fIinteger\fR examine.RS 0.5iIndicates the skew between the failover partner's clock and this DHCPserver's clock.RE.PP.B max-response-delay \fIinteger\fR examine.RS 0.5iIndicates the time in seconds after which, if no message is receivedfrom the failover partner, the partner is assumed to be out ofcommunication..RE.PP.B cur-unacked-updates \fIinteger\fR examine.RS 0.5iIndicates the number of update messages that have been received fromthe failover partner but not yet processed..RE.SH FILES.B ETCDIR/dhcpd.conf, DBDIR/dhcpd.leases, RUNDIR/dhcpd.pid,.B DBDIR/dhcpd.leases~..SH SEE ALSOdhclient(8), dhcrelay(8), dhcpd.conf(5), dhcpd.leases(5).SH AUTHOR.B dhcpd(8)was originally written by Ted Lemon under a contract with Vixie Labs.Funding for this project was provided by Internet SystemsConsortium. Version 3 of the DHCP server was funded by Nominum, Inc.Information about Internet Systems Consortium is available at.B http://www.isc.org/\fR.Information about Nominum can be found at \fBhttp://www.nominum.com/\fR.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -