]> git.ipfire.org Git - thirdparty/dhcp.git/blob - server/dhcpd.conf.5
spelling
[thirdparty/dhcp.git] / server / dhcpd.conf.5
1 .\" dhcpd.conf.5
2 .\"
3 .\" Copyright (c) 2004-2017 by Internet Systems Consortium, Inc. ("ISC")
4 .\" Copyright (c) 1996-2003 by Internet Software Consortium
5 .\"
6 .\" This Source Code Form is subject to the terms of the Mozilla Public
7 .\" License, v. 2.0. If a copy of the MPL was not distributed with this
8 .\" file, You can obtain one at http://mozilla.org/MPL/2.0/.
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 .\" https://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 .\"
27 .\" Support and other services are available for ISC products - see
28 .\" https://www.isc.org for more information or to learn more about ISC.
29 .\"
30 .\" $Id: dhcpd.conf.5,v 1.114 2012/04/02 22:47:35 sar Exp $
31 .\"
32 .TH dhcpd.conf 5
33 .SH NAME
34 dhcpd.conf - dhcpd configuration file
35 .SH DESCRIPTION
36 The dhcpd.conf file contains configuration information for
37 .IR dhcpd,
38 the Internet Systems Consortium DHCP Server.
39 .PP
40 The dhcpd.conf file is a free-form ASCII text file. It is parsed by
41 the recursive-descent parser built into dhcpd. The file may contain
42 extra tabs and newlines for formatting purposes. Keywords in the file
43 are case-insensitive. Comments may be placed anywhere within the
44 file (except within quotes). Comments begin with the # character and
45 end at the end of the line.
46 .PP
47 The file essentially consists of a list of statements. Statements
48 fall into two broad categories - parameters and declarations.
49 .PP
50 Parameter statements either say how to do something (e.g., how long a
51 lease to offer), whether to do something (e.g., should dhcpd provide
52 addresses to unknown clients), or what parameters to provide to the
53 client (e.g., use gateway 220.177.244.7).
54 .PP
55 Declarations are used to describe the topology of the
56 network, to describe clients on the network, to provide addresses that
57 can be assigned to clients, or to apply a group of parameters to a
58 group of declarations. In any group of parameters and declarations,
59 all parameters must be specified before any declarations which depend
60 on those parameters may be specified.
61 .PP
62 Declarations about network topology include the \fIshared-network\fR
63 and the \fIsubnet\fR declarations. If clients on a subnet are to be
64 assigned addresses
65 dynamically, a \fIrange\fR declaration must appear within the
66 \fIsubnet\fR declaration. For clients with statically assigned
67 addresses, or for installations where only known clients will be
68 served, each such client must have a \fIhost\fR declaration. If
69 parameters are to be applied to a group of declarations which are not
70 related strictly on a per-subnet basis, the \fIgroup\fR declaration
71 can be used.
72 .PP
73 For every subnet which will be served, and for every subnet
74 to which the dhcp server is connected, there must be one \fIsubnet\fR
75 declaration, which tells dhcpd how to recognize that an address is on
76 that subnet. A \fIsubnet\fR declaration is required for each subnet
77 even if no addresses will be dynamically allocated on that subnet.
78 .PP
79 Some installations have physical networks on which more than one IP
80 subnet operates. For example, if there is a site-wide requirement
81 that 8-bit subnet masks be used, but a department with a single
82 physical ethernet network expands to the point where it has more than
83 254 nodes, it may be necessary to run two 8-bit subnets on the same
84 ethernet until such time as a new physical network can be added. In
85 this case, the \fIsubnet\fR declarations for these two networks must be
86 enclosed in a \fIshared-network\fR declaration.
87 .PP
88 Note that even when the \fIshared-network\fR declaration is absent, an
89 empty one is created by the server to contain the \fIsubnet\fR (and any scoped
90 parameters included in the \fIsubnet\fR). For practical purposes, this means
91 that "stateless" DHCP clients, which are not tied to addresses (and therefore
92 subnets) will receive the same configuration as stateful ones.
93 .PP
94 Some sites may have departments which have clients on more than one
95 subnet, but it may be desirable to offer those clients a uniform set
96 of parameters which are different than what would be offered to
97 clients from other departments on the same subnet. For clients which
98 will be declared explicitly with \fIhost\fR declarations, these
99 declarations can be enclosed in a \fIgroup\fR declaration along with
100 the parameters which are common to that department. For clients
101 whose addresses will be dynamically assigned, class declarations and
102 conditional declarations may be used to group parameter assignments
103 based on information the client sends.
104 .PP
105 When a client is to be booted, its boot parameters are determined by
106 consulting that client's \fIhost\fR declaration (if any), and then
107 consulting any \fIclass\fR declarations matching the client,
108 followed by the \fIpool\fR, \fIsubnet\fR and \fIshared-network\fR
109 declarations for the IP address assigned to the client. Each of
110 these declarations itself appears within a lexical scope, and all
111 declarations at less specific lexical scopes are also consulted for
112 client option declarations. Scopes are never considered
113 twice, and if parameters are declared in more than one scope, the
114 parameter declared in the most specific scope is the one that is
115 used.
116 .PP
117 When dhcpd tries to find a \fIhost\fR declaration for a client, it
118 first looks for a \fIhost\fR declaration which has a
119 \fIfixed-address\fR declaration that lists an IP address that is valid
120 for the subnet or shared network on which the client is booting. If
121 it doesn't find any such entry, it tries to find an entry which has
122 no \fIfixed-address\fR declaration.
123 .SH EXAMPLES
124 .PP
125 A typical dhcpd.conf file will look something like this:
126 .nf
127
128 .I global parameters...
129
130 subnet 204.254.239.0 netmask 255.255.255.224 {
131 \fIsubnet-specific parameters...\fR
132 range 204.254.239.10 204.254.239.30;
133 }
134
135 subnet 204.254.239.32 netmask 255.255.255.224 {
136 \fIsubnet-specific parameters...\fR
137 range 204.254.239.42 204.254.239.62;
138 }
139
140 subnet 204.254.239.64 netmask 255.255.255.224 {
141 \fIsubnet-specific parameters...\fR
142 range 204.254.239.74 204.254.239.94;
143 }
144
145 group {
146 \fIgroup-specific parameters...\fR
147 host zappo.test.isc.org {
148 \fIhost-specific parameters...\fR
149 }
150 host beppo.test.isc.org {
151 \fIhost-specific parameters...\fR
152 }
153 host harpo.test.isc.org {
154 \fIhost-specific parameters...\fR
155 }
156 }
157
158 .ce 1
159 Figure 1
160
161 .fi
162 .PP
163 Notice that at the beginning of the file, there's a place
164 for global parameters. These might be things like the organization's
165 domain name, the addresses of the name servers (if they are common to
166 the entire organization), and so on. So, for example:
167 .nf
168
169 option domain-name "isc.org";
170 option domain-name-servers ns1.isc.org, ns2.isc.org;
171
172 .ce 1
173 Figure 2
174 .fi
175 .PP
176 As you can see in Figure 2, you can specify host addresses in
177 parameters using their domain names rather than their numeric IP
178 addresses. If a given hostname resolves to more than one IP address
179 (for example, if that host has two ethernet interfaces), then where
180 possible, both addresses are supplied to the client.
181 .PP
182 The most obvious reason for having subnet-specific parameters as
183 shown in Figure 1 is that each subnet, of necessity, has its own
184 router. So for the first subnet, for example, there should be
185 something like:
186 .nf
187
188 option routers 204.254.239.1;
189 .fi
190 .PP
191 Note that the address here is specified numerically. This is not
192 required - if you have a different domain name for each interface on
193 your router, it's perfectly legitimate to use the domain name for that
194 interface instead of the numeric address. However, in many cases
195 there may be only one domain name for all of a router's IP addresses, and
196 it would not be appropriate to use that name here.
197 .PP
198 In Figure 1 there is also a \fIgroup\fR statement, which provides
199 common parameters for a set of three hosts - zappo, beppo and harpo.
200 As you can see, these hosts are all in the test.isc.org domain, so it
201 might make sense for a group-specific parameter to override the domain
202 name supplied to these hosts:
203 .nf
204
205 option domain-name "test.isc.org";
206 .fi
207 .PP
208 Also, given the domain they're in, these are probably test machines.
209 If we wanted to test the DHCP leasing mechanism, we might set the
210 lease timeout somewhat shorter than the default:
211
212 .nf
213 max-lease-time 120;
214 default-lease-time 120;
215 .fi
216 .PP
217 You may have noticed that while some parameters start with the
218 \fIoption\fR keyword, some do not. Parameters starting with the
219 \fIoption\fR keyword correspond to actual DHCP options, while
220 parameters that do not start with the option keyword either control
221 the behavior of the DHCP server (e.g., how long a lease dhcpd will
222 give out), or specify client parameters that are not optional in the
223 DHCP protocol (for example, server-name and filename).
224 .PP
225 In Figure 1, each host had \fIhost-specific parameters\fR. These
226 could include such things as the \fIhostname\fR option, the name of a
227 file to upload (the \fIfilename\fR parameter) and the address of the
228 server from which to upload the file (the \fInext-server\fR
229 parameter). In general, any parameter can appear anywhere that
230 parameters are allowed, and will be applied according to the scope in
231 which the parameter appears.
232 .PP
233 Imagine that you have a site with a lot of NCD X-Terminals. These
234 terminals come in a variety of models, and you want to specify the
235 boot files for each model. One way to do this would be to have host
236 declarations for each server and group them by model:
237 .nf
238
239 group {
240 filename "Xncd19r";
241 next-server ncd-booter;
242
243 host ncd1 { hardware ethernet 0:c0:c3:49:2b:57; }
244 host ncd4 { hardware ethernet 0:c0:c3:80:fc:32; }
245 host ncd8 { hardware ethernet 0:c0:c3:22:46:81; }
246 }
247
248 group {
249 filename "Xncd19c";
250 next-server ncd-booter;
251
252 host ncd2 { hardware ethernet 0:c0:c3:88:2d:81; }
253 host ncd3 { hardware ethernet 0:c0:c3:00:14:11; }
254 }
255
256 group {
257 filename "XncdHMX";
258 next-server ncd-booter;
259
260 host ncd1 { hardware ethernet 0:c0:c3:11:90:23; }
261 host ncd4 { hardware ethernet 0:c0:c3:91:a7:8; }
262 host ncd8 { hardware ethernet 0:c0:c3:cc:a:8f; }
263 }
264 .fi
265 .SH ADDRESS POOLS
266 .PP
267 The
268 \fBpool\fR and \fBpool6\fR
269 declarations can be used to specify a pool of addresses that will be
270 treated differently than another pool of addresses, even on the same
271 network segment or subnet. For example, you may want to provide a
272 large set of addresses that can be assigned to DHCP clients that are
273 registered to your DHCP server, while providing a smaller set of
274 addresses, possibly with short lease times, that are available for
275 unknown clients. If you have a firewall, you may be able to arrange
276 for addresses from one pool to be allowed access to the Internet,
277 while addresses in another pool are not, thus encouraging users to
278 register their DHCP clients. To do this, you would set up a pair of
279 pool declarations:
280 .PP
281 .nf
282 subnet 10.0.0.0 netmask 255.255.255.0 {
283 option routers 10.0.0.254;
284
285 # Unknown clients get this pool.
286 pool {
287 option domain-name-servers bogus.example.com;
288 max-lease-time 300;
289 range 10.0.0.200 10.0.0.253;
290 allow unknown-clients;
291 }
292
293 # Known clients get this pool.
294 pool {
295 option domain-name-servers ns1.example.com, ns2.example.com;
296 max-lease-time 28800;
297 range 10.0.0.5 10.0.0.199;
298 deny unknown-clients;
299 }
300 }
301 .fi
302 .PP
303 It is also possible to set up entirely different subnets for known and
304 unknown clients - address pools exist at the level of shared networks,
305 so address ranges within pool declarations can be on different
306 subnets.
307 .PP
308 As you can see in the preceding example, pools can have permit lists
309 that control which clients are allowed access to the pool and which
310 aren't. Each entry in a pool's permit list is introduced with the
311 .I allow
312 or \fIdeny\fR keyword. If a pool has a permit list, then only those
313 clients that match specific entries on the permit list will be
314 eligible to be assigned addresses from the pool. If a pool has a
315 deny list, then only those clients that do not match any entries on
316 the deny list will be eligible. If both permit and deny lists exist
317 for a pool, then only clients that match the permit list and do not
318 match the deny list will be allowed access.
319 .PP
320 The \fBpool6\fR declaration is similar to the \fBpool\fR declaration.
321 Currently it is only allowed within a \fBsubnet6\fR declaration, and
322 may not be included directly in a shared network declaration.
323 In addition to the \fBrange6\fR statement it allows the \fBprefix6\fR
324 statement to be included. You may include \fBrange6\fR statements
325 for both NA and TA and \fBprefixy6\fR statements in a single
326 \fBpool6\fR statement.
327 .SH DYNAMIC ADDRESS ALLOCATION
328 Address allocation is actually only done when a client is in the INIT
329 state and has sent a DHCPDISCOVER message. If the client thinks it
330 has a valid lease and sends a DHCPREQUEST to initiate or renew that
331 lease, the server has only three choices - it can ignore the
332 DHCPREQUEST, send a DHCPNAK to tell the client it should stop using
333 the address, or send a DHCPACK, telling the client to go ahead and use
334 the address for a while.
335 .PP
336 If the server finds the address the client is requesting, and that
337 address is available to the client, the server will send a DHCPACK.
338 If the address is no longer available, or the client isn't permitted
339 to have it, the server will send a DHCPNAK. If the server knows
340 nothing about the address, it will remain silent, unless the address
341 is incorrect for the network segment to which the client has been
342 attached and the server is authoritative for that network segment, in
343 which case the server will send a DHCPNAK even though it doesn't know
344 about the address.
345 .PP
346 There may be a host declaration matching the client's identification.
347 If that host declaration contains a fixed-address declaration that
348 lists an IP address that is valid for the network segment to which the
349 client is connected, the DHCP server will never do dynamic address allocation.
350 In this case, the client is \fIrequired\fR to take the address specified
351 in the host declaration. If the client sends a DHCPREQUEST for some other
352 address, the server will respond with a DHCPNAK.
353 .PP
354 When the DHCP server allocates a new address for a client (remember,
355 this only happens if the client has sent a DHCPDISCOVER), it first
356 looks to see if the client already has a valid lease on an IP address,
357 or if there is an old IP address the client had before that hasn't yet
358 been reassigned. In that case, the server will take that address and
359 check it to see if the client is still permitted to use it. If the
360 client is no longer permitted to use it, the lease is freed if the
361 server thought it was still in use - the fact that the client has sent
362 a DHCPDISCOVER proves to the server that the client is no longer using
363 the lease.
364 .PP
365 If no existing lease is found, or if the client is forbidden to
366 receive the existing lease, then the server will look in the list of
367 address pools for the network segment to which the client is attached
368 for a lease that is not in use and that the client is permitted to
369 have. It looks through each pool declaration in sequence (all
370 .I range
371 declarations that appear outside of pool declarations are grouped into
372 a single pool with no permit list). If the permit list for the pool
373 allows the client to be allocated an address from that pool, the pool
374 is examined to see if there is an address available. If so, then the
375 client is tentatively assigned that address. Otherwise, the next
376 pool is tested. If no addresses are found that can be assigned to
377 the client, no response is sent to the client.
378 .PP
379 If an address is found that the client is permitted to have, and that
380 has never been assigned to any client before, the address is
381 immediately allocated to the client. If the address is available for
382 allocation but has been previously assigned to a different client, the
383 server will keep looking in hopes of finding an address that has never
384 before been assigned to a client.
385 .PP
386 The DHCP server generates the list of available IP addresses from a
387 hash table. This means that the addresses are not sorted in any
388 particular order, and so it is not possible to predict the order in
389 which the DHCP server will allocate IP addresses. Users of previous
390 versions of the ISC DHCP server may have become accustomed to the DHCP
391 server allocating IP addresses in ascending order, but this is no
392 longer possible, and there is no way to configure this behavior with
393 version 3 of the ISC DHCP server.
394 .SH IP ADDRESS CONFLICT PREVENTION
395 The DHCP server checks IP addresses to see if they are in use before
396 allocating them to clients. It does this by sending an ICMP Echo
397 request message to the IP address being allocated. If no ICMP Echo
398 reply is received within a second, the address is assumed to be free.
399 This is only done for leases that have been specified in range
400 statements, and only when the lease is thought by the DHCP server to
401 be free - i.e., the DHCP server or its failover peer has not listed
402 the lease as in use.
403 .PP
404 If a response is received to an ICMP Echo request, the DHCP server
405 assumes that there is a configuration error - the IP address is in use
406 by some host on the network that is not a DHCP client. It marks the
407 address as abandoned, and will not assign it to clients. The lease will
408 remain abandoned for a minimum of abandon-lease-time seconds.
409 .PP
410 If a DHCP client tries to get an IP address, but none are available,
411 but there are abandoned IP addresses, then the DHCP server will
412 attempt to reclaim an abandoned IP address. It marks one IP address
413 as free, and then does the same ICMP Echo request check described
414 previously. If there is no answer to the ICMP Echo request, the
415 address is assigned to the client.
416 .PP
417 The DHCP server does not cycle through abandoned IP addresses if the
418 first IP address it tries to reclaim is free. Rather, when the next
419 DHCPDISCOVER comes in from the client, it will attempt a new
420 allocation using the same method described here, and will typically
421 try a new IP address.
422 .SH DHCP FAILOVER
423 This version of the ISC DHCP server supports the DHCP failover
424 protocol as documented in draft-ietf-dhc-failover-12.txt. This is
425 not a final protocol document, and we have not done interoperability
426 testing with other vendors' implementations of this protocol, so you
427 must not assume that this implementation conforms to the standard.
428 If you wish to use the failover protocol, make sure that both failover
429 peers are running the same version of the ISC DHCP server.
430 .PP
431 The failover protocol allows two DHCP servers (and no more than two)
432 to share a common address pool. Each server will have about half of
433 the available IP addresses in the pool at any given time for
434 allocation. If one server fails, the other server will continue to
435 renew leases out of the pool, and will allocate new addresses out of
436 the roughly half of available addresses that it had when
437 communications with the other server were lost.
438 .PP
439 It is possible during a prolonged failure to tell the remaining server
440 that the other server is down, in which case the remaining server will
441 (over time) reclaim all the addresses the other server had available
442 for allocation, and begin to reuse them. This is called putting the
443 server into the PARTNER-DOWN state.
444 .PP
445 You can put the server into the PARTNER-DOWN state either by using the
446 .B omshell (1)
447 command or by stopping the server, editing the last failover state
448 declaration in the lease file, and restarting the server. If you use
449 this last method, change the "my state" line to:
450 .PP
451 .nf
452 .B failover peer "\fIname\fB" state {
453 .B my state partner-down;.
454 .B peer state \fIstate\fB at \fIdate\fB;
455 .B }
456 .fi
457 .PP
458 It is only required to change "my state" as shown above.
459 .PP
460 When the other server comes back online, it should automatically
461 detect that it has been offline and request a complete update from the
462 server that was running in the PARTNER-DOWN state, and then both
463 servers will resume processing together.
464 .PP
465 It is possible to get into a dangerous situation: if you put one
466 server into the PARTNER-DOWN state, and then *that* server goes down,
467 and the other server comes back up, the other server will not know
468 that the first server was in the PARTNER-DOWN state, and may issue
469 addresses previously issued by the other server to different clients,
470 resulting in IP address conflicts. Before putting a server into
471 PARTNER-DOWN state, therefore, make
472 .I sure
473 that the other server will not restart automatically.
474 .PP
475 The failover protocol defines a primary server role and a secondary
476 server role. There are some differences in how primaries and
477 secondaries act, but most of the differences simply have to do with
478 providing a way for each peer to behave in the opposite way from the
479 other. So one server must be configured as primary, and the other
480 must be configured as secondary, and it doesn't matter too much which
481 one is which.
482 .SH FAILOVER STARTUP
483 When a server starts that has not previously communicated with its
484 failover peer, it must establish communications with its failover peer
485 and synchronize with it before it can serve clients. This can happen
486 either because you have just configured your DHCP servers to perform
487 failover for the first time, or because one of your failover servers
488 has failed catastrophically and lost its database.
489 .PP
490 The initial recovery process is designed to ensure that when one
491 failover peer loses its database and then resynchronizes, any leases
492 that the failed server gave out before it failed will be honored.
493 When the failed server starts up, it notices that it has no saved
494 failover state, and attempts to contact its peer.
495 .PP
496 When it has established contact, it asks the peer for a complete copy
497 its peer's lease database. The peer then sends its complete database,
498 and sends a message indicating that it is done. The failed server
499 then waits until MCLT has passed, and once MCLT has passed both
500 servers make the transition back into normal operation. This waiting
501 period ensures that any leases the failed server may have given out
502 while out of contact with its partner will have expired.
503 .PP
504 While the failed server is recovering, its partner remains in the
505 partner-down state, which means that it is serving all clients. The
506 failed server provides no service at all to DHCP clients until it has
507 made the transition into normal operation.
508 .PP
509 In the case where both servers detect that they have never before
510 communicated with their partner, they both come up in this recovery
511 state and follow the procedure we have just described. In this case,
512 no service will be provided to DHCP clients until MCLT has expired.
513 .SH CONFIGURING FAILOVER
514 In order to configure failover, you need to write a peer declaration
515 that configures the failover protocol, and you need to write peer
516 references in each pool declaration for which you want to do
517 failover. You do not have to do failover for all pools on a given
518 network segment. You must not tell one server it's doing failover
519 on a particular address pool and tell the other it is not. You must
520 not have any common address pools on which you are not doing
521 failover. A pool declaration that utilizes failover would look like this:
522 .PP
523 .nf
524 pool {
525 failover peer "foo";
526 \fIpool specific parameters\fR
527 };
528 .fi
529 .PP
530 The server currently does very little sanity checking, so if you
531 configure it wrong, it will just fail in odd ways. I would recommend
532 therefore that you either do failover or don't do failover, but don't
533 do any mixed pools. Also, use the same master configuration file for
534 both servers, and have a separate file that contains the peer
535 declaration and includes the master file. This will help you to avoid
536 configuration mismatches. As our implementation evolves, this will
537 become less of a problem. A basic sample dhcpd.conf file for a
538 primary server might look like this:
539 .PP
540 .nf
541 failover peer "foo" {
542 primary;
543 address anthrax.rc.example.com;
544 port 519;
545 peer address trantor.rc.example.com;
546 peer port 520;
547 max-response-delay 60;
548 max-unacked-updates 10;
549 mclt 3600;
550 split 128;
551 load balance max seconds 3;
552 }
553
554 include "/etc/dhcpd.master";
555 .fi
556 .PP
557 The statements in the peer declaration are as follows:
558 .PP
559 The
560 .I primary
561 and
562 .I secondary
563 statements
564 .RS 0.25i
565 .PP
566 [ \fBprimary\fR | \fBsecondary\fR ]\fB;\fR
567 .PP
568 This determines whether the server is primary or secondary, as
569 described earlier under DHCP FAILOVER.
570 .RE
571 .PP
572 The
573 .I address
574 statement
575 .RS 0.25i
576 .PP
577 .B address \fIaddress\fR\fB;\fR
578 .PP
579 The \fBaddress\fR statement declares the IP address or DNS name on which the
580 server should listen for connections from its failover peer, and also the
581 value to use for the DHCP Failover Protocol server identifier. Because this
582 value is used as an identifier, it may not be omitted.
583 .RE
584 .PP
585 The
586 .I peer address
587 statement
588 .RS 0.25i
589 .PP
590 .B peer address \fIaddress\fR\fB;\fR
591 .PP
592 The \fBpeer address\fR statement declares the IP address or DNS name to
593 which the server should connect to reach its failover peer for failover
594 messages.
595 .RE
596 .PP
597 The
598 .I port
599 statement
600 .RS 0.25i
601 .PP
602 .B port \fIport-number\fR\fB;\fR
603 .PP
604 The \fBport\fR statement declares the TCP port on which the server
605 should listen for connections from its failover peer. This statement
606 may be omitted, in which case the IANA assigned port number 647 will be
607 used by default.
608 .RE
609 .PP
610 The
611 .I peer port
612 statement
613 .RS 0.25i
614 .PP
615 .B peer port \fIport-number\fR\fB;\fR
616 .PP
617 The \fBpeer port\fR statement declares the TCP port to which the
618 server should connect to reach its failover peer for failover
619 messages. This statement may be omitted, in which case the IANA
620 assigned port number 647 will be used by default.
621 .RE
622 .PP
623 The
624 .I max-response-delay
625 statement
626 .RS 0.25i
627 .PP
628 .B max-response-delay \fIseconds\fR\fB;\fR
629 .PP
630 The \fBmax-response-delay\fR statement tells the DHCP server how
631 many seconds may pass without receiving a message from its failover
632 peer before it assumes that connection has failed. This number
633 should be small enough that a transient network failure that breaks
634 the connection will not result in the servers being out of
635 communication for a long time, but large enough that the server isn't
636 constantly making and breaking connections. This parameter must be
637 specified.
638 .RE
639 .PP
640 The
641 .I max-unacked-updates
642 statement
643 .RS 0.25i
644 .PP
645 .B max-unacked-updates \fIcount\fR\fB;\fR
646 .PP
647 The \fBmax-unacked-updates\fR statement tells the remote DHCP server how
648 many BNDUPD messages it can send before it receives a BNDACK
649 from the local system. We don't have enough operational experience
650 to say what a good value for this is, but 10 seems to work. This
651 parameter must be specified.
652 .RE
653 .PP
654 The
655 .I mclt
656 statement
657 .RS 0.25i
658 .PP
659 .B mclt \fIseconds\fR\fB;\fR
660 .PP
661 The \fBmclt\fR statement defines the Maximum Client Lead Time. It
662 must be specified on the primary, and may not be specified on the
663 secondary. This is the length of time for which a lease may be
664 renewed by either failover peer without contacting the other. The
665 longer you set this, the longer it will take for the running server to
666 recover IP addresses after moving into PARTNER-DOWN state. The
667 shorter you set it, the more load your servers will experience when
668 they are not communicating. A value of something like 3600 is
669 probably reasonable, but again bear in mind that we have no real
670 operational experience with this.
671 .RE
672 .PP
673 The
674 .I split
675 statement
676 .RS 0.25i
677 .PP
678 .B split \fIbits\fR\fB;\fR
679 .PP
680 The split statement specifies the split between the primary and
681 secondary for the purposes of load balancing. Whenever a client
682 makes a DHCP request, the DHCP server runs a hash on the client
683 identification, resulting in value from 0 to 255. This is used as
684 an index into a 256 bit field. If the bit at that index is set,
685 the primary is responsible. If the bit at that index is not set,
686 the secondary is responsible. The \fBsplit\fR value determines
687 how many of the leading bits are set to one. So, in practice, higher
688 split values will cause the primary to serve more clients than the
689 secondary. Lower split values, the converse. Legal values are between
690 0 and 256 inclusive, of which the most reasonable is 128. Note that
691 a value of 0 makes the secondary responsible for all clients and a value
692 of 256 makes the primary responsible for all clients.
693 .RE
694 .PP
695 The
696 .I hba
697 statement
698 .RS 0.25i
699 .PP
700 .B hba \fIcolon-separated-hex-list\fB;\fR
701 .PP
702 The hba statement specifies the split between the primary and
703 secondary as a bitmap rather than a cutoff, which theoretically allows
704 for finer-grained control. In practice, there is probably no need
705 for such fine-grained control, however. An example hba statement:
706 .PP
707 .nf
708 hba ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:
709 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00;
710 .fi
711 .PP
712 This is equivalent to a \fBsplit 128;\fR statement, and identical. The
713 following two examples are also equivalent to a \fBsplit\fR of 128, but
714 are not identical:
715 .PP
716 .nf
717 hba aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:
718 aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa:aa;
719
720 hba 55:55:55:55:55:55:55:55:55:55:55:55:55:55:55:55:
721 55:55:55:55:55:55:55:55:55:55:55:55:55:55:55:55;
722 .fi
723 .PP
724 They are equivalent, because half the bits are set to 0, half are set to
725 1 (0xa and 0x5 are 1010 and 0101 binary respectively) and consequently this
726 would roughly divide the clients equally between the servers. They are not
727 identical, because the actual peers this would load balance to each server
728 are different for each example.
729 .PP
730 You must only have \fBsplit\fR or \fBhba\fR defined, never both. For most
731 cases, the fine-grained control that \fBhba\fR offers isn't necessary, and
732 \fBsplit\fR should be used.
733 .RE
734 .PP
735 The
736 .I load balance max seconds
737 statement
738 .RS 0.25i
739 .PP
740 .B load balance max seconds \fIseconds\fR\fB;\fR
741 .PP
742 This statement allows you to configure a cutoff after which load
743 balancing is disabled. The cutoff is based on the number of seconds
744 since the client sent its first DHCPDISCOVER or DHCPREQUEST message,
745 and only works with clients that correctly implement the \fIsecs\fR
746 field - fortunately most clients do. We recommend setting this to
747 something like 3 or 5. The effect of this is that if one of the
748 failover peers gets into a state where it is responding to failover
749 messages but not responding to some client requests, the other
750 failover peer will take over its client load automatically as the
751 clients retry.
752 .PP
753 It is possible to disable load balancing between peers by setting this
754 value to 0 on both peers. Bear in mind that this means both peers will
755 respond to all DHCPDISCOVERs or DHCPREQUESTs.
756 .RE
757 .PP
758 The
759 .I auto-partner-down
760 statement
761 .RS 0.25i
762 .PP
763 .B auto-partner-down \fIseconds\fR\fB;\fR
764 .PP
765 This statement instructs the server to initiate a timed delay upon entering
766 the communications-interrupted state (any situation of being out-of-contact
767 with the remote failover peer). At the conclusion of the timer, the server
768 will automatically enter the partner-down state. This permits the server
769 to allocate leases from the partner's free lease pool after an STOS+MCLT
770 timer expires, which can be dangerous if the partner is in fact operating
771 at the time (the two servers will give conflicting bindings).
772 .PP
773 Think very carefully before enabling this feature. The partner-down and
774 communications-interrupted states are intentionally segregated because
775 there do exist situations where a failover server can fail to communicate
776 with its peer, but still has the ability to receive and reply to requests
777 from DHCP clients. In general, this feature should only be used in those
778 deployments where the failover servers are directly connected to one
779 another, such as by a dedicated hardwired link ("a heartbeat cable").
780 .PP
781 A zero value disables the auto-partner-down feature (also the default), and
782 any positive value indicates the time in seconds to wait before automatically
783 entering partner-down.
784 .RE
785 .PP
786 The Failover pool balance statements.
787 .RS 0.25i
788 .PP
789 \fBmax-lease-misbalance \fIpercentage\fR\fB;\fR
790 \fBmax-lease-ownership \fIpercentage\fR\fB;\fR
791 \fBmin-balance \fIseconds\fR\fB;\fR
792 \fBmax-balance \fIseconds\fR\fB;\fR
793 .PP
794 This version of the DHCP Server evaluates pool balance on a schedule,
795 rather than on demand as leases are allocated. The latter approach
796 proved to be slightly klunky when pool misbalanced reach total
797 saturation \(em when any server ran out of leases to assign, it also lost
798 its ability to notice it had run dry.
799 .PP
800 In order to understand pool balance, some elements of its operation
801 first need to be defined. First, there are \'free\' and \'backup\' leases.
802 Both of these are referred to as \'free state leases\'. \'free\' and
803 \'backup\'
804 are \'the free states\' for the purpose of this document. The difference
805 is that only the primary may allocate from \'free\' leases unless under
806 special circumstances, and only the secondary may allocate \'backup\' leases.
807 .PP
808 When pool balance is performed, the only plausible expectation is to
809 provide a 50/50 split of the free state leases between the two servers.
810 This is because no one can predict which server will fail, regardless
811 of the relative load placed upon the two servers, so giving each server
812 half the leases gives both servers the same amount of \'failure endurance\'.
813 Therefore, there is no way to configure any different behaviour, outside of
814 some very small windows we will describe shortly.
815 .PP
816 The first thing calculated on any pool balance run is a value referred to
817 as \'lts\', or "Leases To Send". This, simply, is the difference in the
818 count of free and backup leases, divided by two. For the secondary,
819 it is the difference in the backup and free leases, divided by two.
820 The resulting value is signed: if it is positive, the local server is
821 expected to hand out leases to retain a 50/50 balance. If it is negative,
822 the remote server would need to send leases to balance the pool. Once
823 the lts value reaches zero, the pool is perfectly balanced (give or take
824 one lease in the case of an odd number of total free state leases).
825 .PP
826 The current approach is still something of a hybrid of the old approach,
827 marked by the presence of the \fBmax-lease-misbalance\fR statement. This
828 parameter configures what used to be a 10% fixed value in previous versions:
829 if lts is less than free+backup * \fBmax-lease-misbalance\fR percent, then
830 the server will skip balancing a given pool (it won't bother moving any
831 leases, even if some leases "should" be moved). The meaning of this value
832 is also somewhat overloaded, however, in that it also governs the estimation
833 of when to attempt to balance the pool (which may then also be skipped over).
834 The oldest leases in the free and backup states are examined. The time
835 they have resided in their respective queues is used as an estimate to
836 indicate how much time it is probable it would take before the leases at
837 the top of the list would be consumed (and thus, how long it would take
838 to use all leases in that state). This percentage is directly multiplied
839 by this time, and fit into the schedule if it falls within
840 the \fBmin-balance\fR and \fBmax-balance\fR configured values. The
841 scheduled pool check time is only moved in a downwards direction, it is
842 never increased. Lastly, if the lts is more than double this number in
843 the negative direction, the local server will \'panic\' and transmit a
844 Failover protocol POOLREQ message, in the hopes that the remote system
845 will be woken up into action.
846 .PP
847 Once the lts value exceeds the \fBmax-lease-misbalance\fR percentage of
848 total free state leases as described above, leases are moved to the remote
849 server. This is done in two passes.
850 .PP
851 In the first pass, only leases whose most recent bound client would have
852 been served by the remote server - according to the Load Balance Algorithm
853 (see above \fBsplit\fR and \fBhba\fR configuration statements) - are given
854 away to the peer. This first pass will happily continue to give away leases,
855 decrementing the lts value by one for each, until the lts value has reached
856 the negative of the total number of leases multiplied by
857 the \fBmax-lease-ownership\fR percentage. So it is through this value that
858 you can permit a small misbalance of the lease pools - for the purpose of
859 giving the peer more than a 50/50 share of leases in the hopes that their
860 clients might some day return and be allocated by the peer (operating
861 normally). This process is referred to as \'MAC Address Affinity\', but this
862 is somewhat misnamed: it applies equally to DHCP Client Identifier options.
863 Note also that affinity is applied to leases when they enter the state
864 \'free\' from \'expired\' or \'released\'. In this case also, leases will not
865 be moved from free to backup if the secondary already has more than its
866 share.
867 .PP
868 The second pass is only entered into if the first pass fails to reduce
869 the lts underneath the total number of free state leases multiplied by
870 the \fBmax-lease-ownership\fR percentage. In this pass, the oldest
871 leases are given over to the peer without second thought about the Load
872 Balance Algorithm, and this continues until the lts falls under this
873 value. In this way, the local server will also happily keep a small
874 percentage of the leases that would normally load balance to itself.
875 .PP
876 So, the \fBmax-lease-misbalance\fR value acts as a behavioural gate.
877 Smaller values will cause more leases to transition states to balance
878 the pools over time, higher values will decrease the amount of change
879 (but may lead to pool starvation if there's a run on leases).
880 .PP
881 The \fBmax-lease-ownership\fR value permits a small (percentage) skew
882 in the lease balance of a percentage of the total number of free state
883 leases.
884 .PP
885 Finally, the \fBmin-balance\fR and \fBmax-balance\fR make certain that a
886 scheduled rebalance event happens within a reasonable timeframe (not
887 to be thrown off by, for example, a 7 year old free lease).
888 .PP
889 Plausible values for the percentages lie between 0 and 100, inclusive, but
890 values over 50 are indistinguishable from one another (once lts exceeds
891 50% of the free state leases, one server must therefore have 100% of the
892 leases in its respective free state). It is recommended to select
893 a \fBmax-lease-ownership\fR value that is lower than the value selected
894 for the \fBmax-lease-misbalance\fR value. \fBmax-lease-ownership\fR
895 defaults to 10, and \fBmax-lease-misbalance\fR defaults to 15.
896 .PP
897 Plausible values for the \fBmin-balance\fR and \fBmax-balance\fR times also
898 range from 0 to (2^32)-1 (or the limit of your local time_t value), but
899 default to values 60 and 3600 respectively (to place balance events between
900 1 minute and 1 hour).
901 .RE
902 .SH CLIENT CLASSING
903 Clients can be separated into classes, and treated differently
904 depending on what class they are in. This separation can be done
905 either with a conditional statement, or with a match statement within
906 the class declaration. It is possible to specify a limit on the
907 total number of clients within a particular class or subclass that may
908 hold leases at one time, and it is possible to specify automatic
909 subclassing based on the contents of the client packet.
910 .PP
911 Classing support for DHCPv6 clients was added in 4.3.0. It follows
912 the same rules as for DHCPv4 except that support for billing classes
913 has not been added yet.
914 .PP
915 To add clients to classes based on conditional evaluation, you can
916 specify a matching expression in the class statement:
917 .PP
918 .nf
919 class "ras-clients" {
920 match if substring (option dhcp-client-identifier, 1, 3) = "RAS";
921 }
922 .fi
923 .PP
924 Note that whether you use matching expressions or add statements (or
925 both) to classify clients, you must always write a class declaration
926 for any class that you use. If there will be no match statement and
927 no in-scope statements for a class, the declaration should look like
928 this:
929 .PP
930 .nf
931 class "ras-clients" {
932 }
933 .fi
934 .SH SUBCLASSES
935 .PP
936 In addition to classes, it is possible to declare subclasses. A
937 subclass is a class with the same name as a regular class, but with a
938 specific submatch expression which is hashed for quick matching.
939 This is essentially a speed hack - the main difference between five
940 classes with match expressions and one class with five subclasses is
941 that it will be quicker to find the subclasses. Subclasses work as
942 follows:
943 .PP
944 .nf
945 class "allocation-class-1" {
946 match pick-first-value (option dhcp-client-identifier, hardware);
947 }
948
949 class "allocation-class-2" {
950 match pick-first-value (option dhcp-client-identifier, hardware);
951 }
952
953 subclass "allocation-class-1" 1:8:0:2b:4c:39:ad;
954 subclass "allocation-class-2" 1:8:0:2b:a9:cc:e3;
955 subclass "allocation-class-1" 1:0:0:c4:aa:29:44;
956
957 subnet 10.0.0.0 netmask 255.255.255.0 {
958 pool {
959 allow members of "allocation-class-1";
960 range 10.0.0.11 10.0.0.50;
961 }
962 pool {
963 allow members of "allocation-class-2";
964 range 10.0.0.51 10.0.0.100;
965 }
966 }
967 .fi
968 .PP
969 The data following the class name in the subclass declaration is a
970 constant value to use in matching the match expression for the class.
971 When class matching is done, the server will evaluate the match
972 expression and then look the result up in the hash table. If it
973 finds a match, the client is considered a member of both the class and
974 the subclass.
975 .PP
976 Subclasses can be declared with or without scope. In the above
977 example, the sole purpose of the subclass is to allow some clients
978 access to one address pool, while other clients are given access to
979 the other pool, so these subclasses are declared without scopes. If
980 part of the purpose of the subclass were to define different parameter
981 values for some clients, you might want to declare some subclasses
982 with scopes.
983 .PP
984 In the above example, if you had a single client that needed some
985 configuration parameters, while most didn't, you might write the
986 following subclass declaration for that client:
987 .PP
988 .nf
989 subclass "allocation-class-2" 1:08:00:2b:a1:11:31 {
990 option root-path "samsara:/var/diskless/alphapc";
991 filename "/tftpboot/netbsd.alphapc-diskless";
992 }
993 .fi
994 .PP
995 In this example, we've used subclassing as a way to control address
996 allocation on a per-client basis. However, it's also possible to use
997 subclassing in ways that are not specific to clients - for example, to
998 use the value of the vendor-class-identifier option to determine what
999 values to send in the vendor-encapsulated-options option. An example
1000 of this is shown under the VENDOR ENCAPSULATED OPTIONS head in the
1001 .B dhcp-options(5)
1002 manual page.
1003 .SH PER-CLASS LIMITS ON DYNAMIC ADDRESS ALLOCATION
1004 .PP
1005 You may specify a limit to the number of clients in a class that can
1006 be assigned leases. The effect of this will be to make it difficult
1007 for a new client in a class to get an address. Once a class with
1008 such a limit has reached its limit, the only way a new client in that
1009 class can get a lease is for an existing client to relinquish its
1010 lease, either by letting it expire, or by sending a DHCPRELEASE
1011 packet. Classes with lease limits are specified as follows:
1012 .PP
1013 .nf
1014 class "limited-1" {
1015 lease limit 4;
1016 }
1017 .fi
1018 .PP
1019 This will produce a class in which a maximum of four members may hold
1020 a lease at one time.
1021 .SH SPAWNING CLASSES
1022 .PP
1023 It is possible to declare a
1024 .I spawning class\fR.
1025 A spawning class is a class that automatically produces subclasses
1026 based on what the client sends. The reason that spawning classes
1027 were created was to make it possible to create lease-limited classes
1028 on the fly. The envisioned application is a cable-modem environment
1029 where the ISP wishes to provide clients at a particular site with more
1030 than one IP address, but does not wish to provide such clients with
1031 their own subnet, nor give them an unlimited number of IP addresses
1032 from the network segment to which they are connected.
1033 .PP
1034 Many cable modem head-end systems can be configured to add a Relay
1035 Agent Information option to DHCP packets when relaying them to the
1036 DHCP server. These systems typically add a circuit ID or remote ID
1037 option that uniquely identifies the customer site. To take advantage
1038 of this, you can write a class declaration as follows:
1039 .PP
1040 .nf
1041 class "customer" {
1042 spawn with option agent.circuit-id;
1043 lease limit 4;
1044 }
1045 .fi
1046 .PP
1047 Now whenever a request comes in from a customer site, the circuit ID
1048 option will be checked against the class\'s hash table. If a subclass
1049 is found that matches the circuit ID, the client will be classified in
1050 that subclass and treated accordingly. If no subclass is found
1051 matching the circuit ID, a new one will be created and logged in the
1052 .B dhcpd.leases
1053 file, and the client will be classified in this new class. Once the
1054 client has been classified, it will be treated according to the rules
1055 of the class, including, in this case, being subject to the per-site
1056 limit of four leases.
1057 .PP
1058 The use of the subclass spawning mechanism is not restricted to relay
1059 agent options - this particular example is given only because it is a
1060 fairly straightforward one.
1061 .SH COMBINING MATCH, MATCH IF AND SPAWN WITH
1062 .PP
1063 In some cases, it may be useful to use one expression to assign a
1064 client to a particular class, and a second expression to put it into a
1065 subclass of that class. This can be done by combining the \fBmatch
1066 if\fR and \fBspawn with\fR statements, or the \fBmatch if\fR and
1067 \fBmatch\fR statements. For example:
1068 .PP
1069 .nf
1070 class "jr-cable-modems" {
1071 match if option dhcp-vendor-identifier = "jrcm";
1072 spawn with option agent.circuit-id;
1073 lease limit 4;
1074 }
1075
1076 class "dv-dsl-modems" {
1077 match if option dhcp-vendor-identifier = "dvdsl";
1078 spawn with option agent.circuit-id;
1079 lease limit 16;
1080 }
1081 .fi
1082 .PP
1083 This allows you to have two classes that both have the same \fBspawn
1084 with\fR expression without getting the clients in the two classes
1085 confused with each other.
1086 .SH DYNAMIC DNS UPDATES
1087 .PP
1088 The DHCP server has the ability to dynamically update the Domain Name
1089 System. Within the configuration files, you can define how you want
1090 the Domain Name System to be updated. These updates are RFC 2136
1091 compliant so any DNS server supporting RFC 2136 should be able to
1092 accept updates from the DHCP server.
1093 .PP
1094 There are two DNS schemes implemented. The interim option is
1095 based on draft revisions of the DDNS documents while the standard
1096 option is based on the RFCs for DHCP-DNS interaction and DHCIDs.
1097 A third option, ad-hoc, was deprecated and has now been removed
1098 from the code base. The DHCP server must be configured to use
1099 one of the two currently-supported methods, or not to do DNS updates.
1100 .PP
1101 New installations should use the standard option. Older
1102 installations may want to continue using the interim option for
1103 backwards compatibility with the DNS database until the database
1104 can be updated. This can be done with the
1105 .I ddns-update-style
1106 configuration parameter.
1107 .SH THE DNS UPDATE SCHEME
1108 the interim and standard DNS update schemes operate mostly according
1109 to work from the IETF. The interim version was based on the drafts
1110 in progress at the time while the standard is based on the completed
1111 RFCs. The standard RFCs are:
1112 .PP
1113 .nf
1114 .ce 3
1115 RFC 4701 (updated by RF5494)
1116 RFC 4702
1117 RFC 4703
1118 .fi
1119 .PP
1120 And the corresponding drafts were:
1121 .PP
1122 .nf
1123 .ce 3
1124 draft-ietf-dnsext-dhcid-rr-??.txt
1125 draft-ietf-dhc-fqdn-option-??.txt
1126 draft-ietf-dhc-ddns-resolution-??.txt
1127 .fi
1128 .PP
1129 The basic framework for the two schemes is similar with the main
1130 material difference being that a DHCID RR is used in the standard
1131 version while the interim versions uses a TXT RR. The format
1132 of the TXT record bears a resemblance to the DHCID RR but it is not
1133 equivalent (MD5 vs SHA2, field length differences etc).
1134 .PP
1135 In these two schemes the DHCP server does not necessarily
1136 always update both the A and the PTR records. The FQDN option
1137 includes a flag which, when sent by the client, indicates that the
1138 client wishes to update its own A record. In that case, the server
1139 can be configured either to honor the client\'s intentions or ignore
1140 them. This is done with the statement \fIallow client-updates;\fR or
1141 the statement \fIignore client-updates;\fR. By default, client
1142 updates are allowed.
1143 .PP
1144 If the server is configured to allow client updates, then if the
1145 client sends a fully-qualified domain name in the FQDN option, the
1146 server will use that name the client sent in the FQDN option to update
1147 the PTR record. For example, let us say that the client is a visitor
1148 from the "radish.org" domain, whose hostname is "jschmoe". The
1149 server is for the "example.org" domain. The DHCP client indicates in
1150 the FQDN option that its FQDN is "jschmoe.radish.org.". It also
1151 indicates that it wants to update its own A record. The DHCP server
1152 therefore does not attempt to set up an A record for the client, but
1153 does set up a PTR record for the IP address that it assigns the
1154 client, pointing at jschmoe.radish.org. Once the DHCP client has an
1155 IP address, it can update its own A record, assuming that the
1156 "radish.org" DNS server will allow it to do so.
1157 .PP
1158 If the server is configured not to allow client updates, or if the
1159 client doesn\'t want to do its own update, the server will simply
1160 choose a name for the client. By default, the server will choose
1161 from the following three values:
1162 .PP
1163 1. \fBfqdn\fR option (if present)
1164 2. hostname option (if present)
1165 3. Configured hostname option (if defined).
1166 .PP
1167 If these defaults for choosing the host name are not appropriate
1168 you can write your own statement to set the ddns-hostname variable
1169 as you wish. If none of the above are found the server will use
1170 the host declaration name (if one) and use-host-decl-names is on.
1171 .PP
1172 It will use its own domain name for the client. It will then update
1173 both the A and PTR record, using the name that it chose for the client.
1174 If the client sends a fully-qualified domain name in the \fBfqdn\fR option,
1175 the server uses only the leftmost part of the domain name - in the example
1176 above, "jschmoe" instead of "jschmoe.radish.org".
1177 .PP
1178 Further, if the \fIignore client-updates;\fR directive is used, then
1179 the server will in addition send a response in the DHCP packet, using
1180 the FQDN Option, that implies to the client that it should perform its
1181 own updates if it chooses to do so. With \fIdeny client-updates;\fR, a
1182 response is sent which indicates the client may not perform updates.
1183 .PP
1184 Both the standard and interim options also include a method to
1185 allow more than one DHCP server to update the DNS database without
1186 accidentally deleting A records that shouldn\'t be deleted nor failing
1187 to add A records that should be added. For the standard option the
1188 method works as follows:
1189 .PP
1190 When the DHCP server issues a client a new lease, it creates a text
1191 string that is an SHA hash over the DHCP client\'s identification (see
1192 RFCs 4701 & 4702 for details). The update attempts to add an A
1193 record with the name the server chose and a DHCID record containing the
1194 hashed identifier string (hashid). If this update succeeds, the
1195 server is done.
1196 .PP
1197 If the update fails because the A record already exists, then the DHCP
1198 server attempts to add the A record with the prerequisite that there
1199 must be a DHCID record in the same name as the new A record, and that
1200 DHCID record\'s contents must be equal to hashid. If this update
1201 succeeds, then the client has its A record and PTR record. If it
1202 fails, then the name the client has been assigned (or requested) is in
1203 use, and can\'t be used by the client. At this point the DHCP server
1204 gives up trying to do a DNS update for the client until the client
1205 chooses a new name.
1206 .PP
1207 The server also does not update very aggressively. Because each
1208 DNS update involves a round trip to the DNS server, there is a cost
1209 associated with doing updates even if they do not actually modify
1210 the DNS database. So the DHCP server tracks whether or not it has
1211 updated the record in the past (this information is stored on the
1212 lease) and does not attempt to update records that it
1213 thinks it has already updated.
1214 .PP
1215 This can lead to cases where the DHCP server adds a record, and then
1216 the record is deleted through some other mechanism, but the server
1217 never again updates the DNS because it thinks the data is already
1218 there. In this case the data can be removed from the lease through
1219 operator intervention, and once this has been done, the DNS will be
1220 updated the next time the client renews.
1221 .PP
1222 The interim DNS update scheme was written before the RFCs were finalized
1223 and does not quite follow them. The RFCs call for a new DHCID RRtype
1224 while the interim DNS update scheme uses a TXT record. In addition
1225 the ddns-resolution draft called for the DHCP server to put a DHCID RR
1226 on the PTR record, but the \fIinterim\fR update method does not do this.
1227 In the final RFC this requirement was relaxed such that a server may
1228 add a DHCID RR to the PTR record.
1229 .PP
1230 .SH DYNAMIC DNS UPDATE SECURITY
1231 .PP
1232 When you set your DNS server up to allow updates from the DHCP server,
1233 you may be exposing it to unauthorized updates. To avoid this, you
1234 should use TSIG signatures - a method of cryptographically signing
1235 updates using a shared secret key. As long as you protect the
1236 secrecy of this key, your updates should also be secure. Note,
1237 however, that the DHCP protocol itself provides no security, and that
1238 clients can therefore provide information to the DHCP server which the
1239 DHCP server will then use in its updates, with the constraints
1240 described previously.
1241 .PP
1242 The DNS server must be configured to allow updates for any zone that
1243 the DHCP server will be updating. For example, let us say that
1244 clients in the sneedville.edu domain will be assigned addresses on the
1245 10.10.17.0/24 subnet. In that case, you will need a key declaration
1246 for the TSIG key you will be using, and also two zone declarations -
1247 one for the zone containing A records that will be updates and one for
1248 the zone containing PTR records - for ISC BIND, something like this:
1249 .PP
1250 .nf
1251 key DHCP_UPDATER {
1252 algorithm HMAC-MD5.SIG-ALG.REG.INT;
1253 secret pRP5FapFoJ95JEL06sv4PQ==;
1254 };
1255
1256 zone "example.org" {
1257 type master;
1258 file "example.org.db";
1259 allow-update { key DHCP_UPDATER; };
1260 };
1261
1262 zone "17.10.10.in-addr.arpa" {
1263 type master;
1264 file "10.10.17.db";
1265 allow-update { key DHCP_UPDATER; };
1266 };
1267 .fi
1268 .PP
1269 You will also have to configure your DHCP server to do updates to
1270 these zones. To do so, you need to add something like this to your
1271 dhcpd.conf file:
1272 .PP
1273 .nf
1274 key DHCP_UPDATER {
1275 algorithm HMAC-MD5.SIG-ALG.REG.INT;
1276 secret pRP5FapFoJ95JEL06sv4PQ==;
1277 };
1278
1279 zone EXAMPLE.ORG. {
1280 primary 127.0.0.1;
1281 key DHCP_UPDATER;
1282 }
1283
1284 zone 17.127.10.in-addr.arpa. {
1285 primary 127.0.0.1;
1286 key DHCP_UPDATER;
1287 }
1288 .fi
1289 .PP
1290 The \fIprimary\fR statement specifies the IP address of the name
1291 server whose zone information is to be updated. In addition to
1292 the \fIprimary\fR statement there are also the \fIprimary6\fR ,
1293 \fIsecondary\fR and \fIsecondary6\fR statements. The \fIprimary6\fR
1294 statement specifies an IPv6 address for the name server. The
1295 secondaries provide for additional addresses for name servers
1296 to be used if the primary does not respond. The number of name
1297 servers the DDNS code will attempt to use before giving up
1298 is limited and is currently set to three.
1299 .PP
1300 Note that the zone declarations have to correspond to authority
1301 records in your name server - in the above example, there must be an
1302 SOA record for "example.org." and for "17.10.10.in-addr.arpa.". For
1303 example, if there were a subdomain "foo.example.org" with no separate
1304 SOA, you could not write a zone declaration for "foo.example.org."
1305 Also keep in mind that zone names in your DHCP configuration should end in a
1306 "."; this is the preferred syntax. If you do not end your zone name in a
1307 ".", the DHCP server will figure it out. Also note that in the DHCP
1308 configuration, zone names are not encapsulated in quotes where there are in
1309 the DNS configuration.
1310 .PP
1311 You should choose your own secret key, of course. The ISC BIND 9
1312 distribution comes with a program for generating secret keys called
1313 dnssec-keygen. If you are using BIND 9\'s
1314 dnssec-keygen, the above key would be created as follows:
1315 .PP
1316 .nf
1317 dnssec-keygen -a HMAC-MD5 -b 128 -n USER DHCP_UPDATER
1318 .fi
1319 .PP
1320 The key name, algorithm, and secret must match that being used by the DNS
1321 server. The DHCP server currently supports the following algorithms:
1322 .nf
1323
1324 HMAC-MD5
1325 HMAC-SHA1
1326 HMAC-SHA224
1327 HMAC-SHA256
1328 HMAC-SHA384
1329 HMAC-SHA512
1330 .fi
1331 .PP
1332 You may wish to enable logging of DNS updates on your DNS server.
1333 To do so, you might write a logging statement like the following:
1334 .PP
1335 .nf
1336 logging {
1337 channel update_debug {
1338 file "/var/log/update-debug.log";
1339 severity debug 3;
1340 print-category yes;
1341 print-severity yes;
1342 print-time yes;
1343 };
1344 channel security_info {
1345 file "/var/log/named-auth.info";
1346 severity info;
1347 print-category yes;
1348 print-severity yes;
1349 print-time yes;
1350 };
1351
1352 category update { update_debug; };
1353 category security { security_info; };
1354 };
1355 .fi
1356 .PP
1357 You must create the /var/log/named-auth.info and
1358 /var/log/update-debug.log files before starting the name server. For
1359 more information on configuring ISC BIND, consult the documentation
1360 that accompanies it.
1361 .SH REFERENCE: EVENTS
1362 .PP
1363 There are three kinds of events that can happen regarding a lease, and
1364 it is possible to declare statements that occur when any of these
1365 events happen. These events are the commit event, when the server
1366 has made a commitment of a certain lease to a client, the release
1367 event, when the client has released the server from its commitment,
1368 and the expiry event, when the commitment expires.
1369 .PP
1370 To declare a set of statements to execute when an event happens, you
1371 must use the \fBon\fR statement, followed by the name of the event,
1372 followed by a series of statements to execute when the event happens,
1373 enclosed in braces.
1374 .SH REFERENCE: DECLARATIONS
1375 .PP
1376 .B The
1377 .I include
1378 .B statement
1379 .PP
1380 .nf
1381 \fBinclude\fR \fI"filename"\fR\fB;\fR
1382 .fi
1383 .PP
1384 The \fIinclude\fR statement is used to read in a named file, and process
1385 the contents of that file as though it were entered in place of the
1386 include statement.
1387 .PP
1388 .B The
1389 .I shared-network
1390 .B statement
1391 .PP
1392 .nf
1393 \fBshared-network\fR \fIname\fR \fB{\fR
1394 [ \fIparameters\fR ]
1395 [ \fIdeclarations\fR ]
1396 \fB}\fR
1397 .fi
1398 .PP
1399 The \fIshared-network\fR statement is used to inform the DHCP server
1400 that some IP subnets actually share the same physical network. Any
1401 subnets in a shared network should be declared within a
1402 \fIshared-network\fR statement. Parameters specified in the
1403 \fIshared-network\fR statement will be used when booting clients on
1404 those subnets unless parameters provided at the subnet or host level
1405 override them. If any subnet in a shared network has addresses
1406 available for dynamic allocation, those addresses are collected into a
1407 common pool for that shared network and assigned to clients as needed.
1408 There is no way to distinguish on which subnet of a shared network a
1409 client should boot.
1410 .PP
1411 .I Name
1412 should be the name of the shared network. This name is used when
1413 printing debugging messages, so it should be descriptive for the
1414 shared network. The name may have the syntax of a valid domain name
1415 (although it will never be used as such), or it may be any arbitrary
1416 name, enclosed in quotes.
1417 .PP
1418 .B The
1419 .I subnet
1420 .B statement
1421 .PP
1422 .nf
1423 \fBsubnet\fR \fIsubnet-number\fR \fBnetmask\fR \fInetmask\fR \fB{\fR
1424 [ \fIparameters\fR ]
1425 [ \fIdeclarations\fR ]
1426 \fB}\fR
1427 .fi
1428 .PP
1429 The \fIsubnet\fR statement is used to provide dhcpd with enough
1430 information to tell whether or not an IP address is on that subnet.
1431 It may also be used to provide subnet-specific parameters and to
1432 specify what addresses may be dynamically allocated to clients booting
1433 on that subnet. Such addresses are specified using the \fIrange\fR
1434 declaration.
1435 .PP
1436 The
1437 .I subnet-number
1438 should be an IP address or domain name which resolves to the subnet
1439 number of the subnet being described. The
1440 .I netmask
1441 should be an IP address or domain name which resolves to the subnet mask
1442 of the subnet being described. The subnet number, together with the
1443 netmask, are sufficient to determine whether any given IP address is
1444 on the specified subnet.
1445 .PP
1446 Although a netmask must be given with every subnet declaration, it is
1447 recommended that if there is any variance in subnet masks at a site, a
1448 subnet-mask option statement be used in each subnet declaration to set
1449 the desired subnet mask, since any subnet-mask option statement will
1450 override the subnet mask declared in the subnet statement.
1451 .PP
1452 .B The
1453 .I subnet6
1454 .B statement
1455 .PP
1456 .nf
1457 \fBsubnet6\fR \fIsubnet6-number\fR \fB{\fR
1458 [ \fIparameters\fR ]
1459 [ \fIdeclarations\fR ]
1460 \fB}\fR
1461 .fi
1462 .PP
1463 The \fIsubnet6\fR statement is used to provide dhcpd with enough
1464 information to tell whether or not an IPv6 address is on that subnet6.
1465 It may also be used to provide subnet-specific parameters and to
1466 specify what addresses may be dynamically allocated to clients booting
1467 on that subnet.
1468 .PP
1469 The
1470 .I subnet6-number
1471 should be an IPv6 network identifier, specified as ip6-address/bits.
1472 .PP
1473 .B The
1474 .I range
1475 .B statement
1476 .PP
1477 .nf
1478 .B range\fR [ \fBdynamic-bootp\fR ] \fIlow-address\fR [ \fIhigh-address\fR]\fB;\fR
1479 .fi
1480 .PP
1481 For any subnet on which addresses will be assigned dynamically, there
1482 must be at least one \fIrange\fR statement. The range statement
1483 gives the lowest and highest IP addresses in a range. All IP
1484 addresses in the range should be in the subnet in which the
1485 \fIrange\fR statement is declared. The \fIdynamic-bootp\fR flag may
1486 be specified if addresses in the specified range may be dynamically
1487 assigned to BOOTP clients as well as DHCP clients. When specifying a
1488 single address, \fIhigh-address\fR can be omitted.
1489 .PP
1490 .B The
1491 .I range6
1492 .B statement
1493 .PP
1494 .nf
1495 .B range6\fR \fIlow-address\fR \fIhigh-address\fR\fB;\fR
1496 .B range6\fR \fIsubnet6-number\fR\fB;\fR
1497 .B range6\fR \fIsubnet6-number\fR \fBtemporary\fR\fB;\fR
1498 .B range6\fR \fIaddress\fR \fBtemporary\fR\fB;\fR
1499 .fi
1500 .PP
1501 For any IPv6 subnet6 on which addresses will be assigned dynamically, there
1502 must be at least one \fIrange6\fR statement. The \fIrange6\fR statement
1503 can either be the lowest and highest IPv6 addresses in a \fIrange6\fR, or
1504 use CIDR notation, specified as ip6-address/bits. All IP addresses
1505 in the \fIrange6\fR should be in the subnet6 in which the
1506 \fIrange6\fR statement is declared.
1507 .PP
1508 The \fItemporary\fR variant makes the prefix (by default on 64 bits) available
1509 for temporary (RFC 4941) addresses. A new address per prefix in the shared
1510 network is computed at each request with an IA_TA option. Release and Confirm
1511 ignores temporary addresses.
1512 .PP
1513 Any IPv6 addresses given to hosts with \fIfixed-address6\fR are excluded
1514 from the \fIrange6\fR, as are IPv6 addresses on the server itself.
1515 .PP
1516 .PP
1517 .B The
1518 .I prefix6
1519 .B statement
1520 .PP
1521 .nf
1522 .B prefix6\fR \fIlow-address\fR \fIhigh-address\fR \fB/\fR \fIbits\fR\fB;\fR
1523 .fi
1524 .PP
1525 The \fIprefix6\fR is the \fIrange6\fR equivalent for Prefix Delegation
1526 (RFC 3633). Prefixes of \fIbits\fR length are assigned between
1527 \fIlow-address\fR and \fIhigh-address\fR.
1528 .PP
1529 Any IPv6 prefixes given to static entries (hosts) with \fIfixed-prefix6\fR
1530 are excluded from the \fIprefix6\fR.
1531 .PP
1532 This statement is currently global but it should have a shared-network scope.
1533 .PP
1534 .B The
1535 .I host
1536 .B statement
1537 .PP
1538 .nf
1539 \fBhost\fR \fIhostname\fR {
1540 [ \fIparameters\fR ]
1541 [ \fIdeclarations\fR ]
1542 \fB}\fR
1543 .fi
1544 .PP
1545 The
1546 .B host
1547 declaration provides a way for the DHCP server to identify a DHCP or
1548 BOOTP client. This allows the server to provide configuration
1549 information including fixed addresses or, in DHCPv6, fixed prefixes
1550 for a specific client.
1551 .PP
1552 If it is desirable to be able to boot a DHCP or BOOTP client on more than one
1553 subnet with fixed v4 addresses, more than one address may be specified in the
1554 .I fixed-address
1555 declaration, or more than one
1556 .B host
1557 statement may be specified matching the same client.
1558 .PP
1559 The
1560 .I fixed-address6
1561 declaration is used for v6 addresses. At this time it only works with a single
1562 address. For multiple addresses specify multiple
1563 .B host
1564 statements.
1565 .PP
1566 If client-specific boot parameters must change based on the network
1567 to which the client is attached, then multiple
1568 .B host
1569 declarations should be used. The
1570 .B host
1571 declarations will only match a client if one of their
1572 .I fixed-address
1573 statements is viable on the subnet (or shared network) where the client is
1574 attached. Conversely, for a
1575 .B host
1576 declaration to match a client being allocated a dynamic address, it must not
1577 have any
1578 .I fixed-address
1579 statements. You may therefore need a mixture of
1580 .B host
1581 declarations for any given client...some having
1582 .I fixed-address
1583 statements, others without.
1584 .PP
1585 .I hostname
1586 should be a name identifying the host. If a \fIhostname\fR option is
1587 not specified for the host, \fIhostname\fR is used.
1588 .PP
1589 \fIHost\fR declarations are matched to actual DHCP or BOOTP clients
1590 by matching the \fRdhcp-client-identifier\fR option specified in the
1591 \fIhost\fR declaration to the one supplied by the client, or, if the
1592 \fIhost\fR declaration or the client does not provide a
1593 \fRdhcp-client-identifier\fR option, by matching the \fIhardware\fR
1594 parameter in the \fIhost\fR declaration to the network hardware
1595 address supplied by the client. BOOTP clients do not normally
1596 provide a \fIdhcp-client-identifier\fR, so the hardware address must
1597 be used for all clients that may boot using the BOOTP protocol.
1598 .PP
1599 DHCPv6 servers can use the \fIhost-identifier option\fR parameter in
1600 the \fIhost\fR declaration, and specify any option with a fixed value
1601 to identify hosts.
1602 .PP
1603 Please be aware that
1604 .B only
1605 the \fIdhcp-client-identifier\fR option and the hardware address can be
1606 used to match a host declaration, or the \fIhost-identifier option\fR
1607 parameter for DHCPv6 servers. For example, it is not possible to
1608 match a host declaration to a \fIhost-name\fR option. This is
1609 because the host-name option cannot be guaranteed to be unique for any
1610 given client, whereas both the hardware address and
1611 \fIdhcp-client-identifier\fR option are at least theoretically
1612 guaranteed to be unique to a given client.
1613 .PP
1614 .B The
1615 .I group
1616 .B statement
1617 .PP
1618 .nf
1619 \fBgroup\fR {
1620 [ \fIparameters\fR ]
1621 [ \fIdeclarations\fR ]
1622 \fB}\fR
1623 .fi
1624 .PP
1625 The group statement is used simply to apply one or more parameters to
1626 a group of declarations. It can be used to group hosts, shared
1627 networks, subnets, or even other groups.
1628 .SH REFERENCE: ALLOW AND DENY
1629 The
1630 .I allow
1631 and
1632 .I deny
1633 statements can be used to control the response of the DHCP server to
1634 various sorts of requests. The allow and deny keywords actually have
1635 different meanings depending on the context. In a pool context, these
1636 keywords can be used to set up access lists for address allocation
1637 pools. In other contexts, the keywords simply control general server
1638 behavior with respect to clients based on scope. In a non-pool
1639 context, the
1640 .I ignore
1641 keyword can be used in place of the
1642 .I deny
1643 keyword to prevent logging of denied requests.
1644 .PP
1645 .SH ALLOW DENY AND IGNORE IN SCOPE
1646 The following usages of allow and deny will work in any scope,
1647 although it is not recommended that they be used in pool
1648 declarations.
1649 .PP
1650 .B The
1651 .I unknown-clients
1652 .B keyword
1653 .PP
1654 \fBallow unknown-clients;\fR
1655 \fBdeny unknown-clients;\fR
1656 \fBignore unknown-clients;\fR
1657 .PP
1658 The \fBunknown-clients\fR flag is used to tell dhcpd whether
1659 or not to dynamically assign addresses to unknown clients. Dynamic
1660 address assignment to unknown clients is \fBallow\fRed by default.
1661 An unknown client is simply a client that has no host declaration.
1662 .PP
1663 The use of this option is now \fIdeprecated\fR. If you are trying to
1664 restrict access on your network to known clients, you should use \fBdeny
1665 unknown-clients;\fR inside of your address pool, as described under the
1666 heading ALLOW AND DENY WITHIN POOL DECLARATIONS.
1667 .PP
1668 .B The
1669 .I bootp
1670 .B keyword
1671 .PP
1672 \fBallow bootp;\fR
1673 \fBdeny bootp;\fR
1674 \fBignore bootp;\fR
1675 .PP
1676 The \fBbootp\fR flag is used to tell dhcpd whether
1677 or not to respond to bootp queries. Bootp queries are \fBallow\fRed
1678 by default.
1679 .PP
1680 .B The
1681 .I booting
1682 .B keyword
1683 .PP
1684 \fBallow booting;\fR
1685 \fBdeny booting;\fR
1686 \fBignore booting;\fR
1687 .PP
1688 The \fBbooting\fR flag is used to tell dhcpd whether or not to respond
1689 to queries from a particular client. This keyword only has meaning
1690 when it appears in a host declaration. By default, booting is
1691 \fBallow\fRed, but if it is disabled for a particular client, then
1692 that client will not be able to get an address from the DHCP server.
1693 .PP
1694 .B The
1695 .I duplicates
1696 .B keyword
1697 .PP
1698 \fBallow duplicates;\fR
1699 \fBdeny duplicates;\fR
1700 .PP
1701 Host declarations can match client messages based on the DHCP Client
1702 Identifier option or based on the client's network hardware type and
1703 MAC address. If the MAC address is used, the host declaration will
1704 match any client with that MAC address - even clients with different
1705 client identifiers. This doesn't normally happen, but is possible
1706 when one computer has more than one operating system installed on it -
1707 for example, Microsoft Windows and NetBSD or Linux.
1708 .PP
1709 The \fBduplicates\fR flag tells the DHCP server that if a request is
1710 received from a client that matches the MAC address of a host
1711 declaration, any other leases matching that MAC address should be
1712 discarded by the server, even if the UID is not the same. This is a
1713 violation of the DHCP protocol, but can prevent clients whose client
1714 identifiers change regularly from holding many leases at the same time.
1715 By default, duplicates are \fBallow\fRed.
1716 .PP
1717 .B The
1718 .I declines
1719 .B keyword
1720 .PP
1721 \fBallow declines;\fR
1722 \fBdeny declines;\fR
1723 \fBignore declines;\fR
1724 .PP
1725 The DHCPDECLINE message is used by DHCP clients to indicate that the
1726 lease the server has offered is not valid. When the server receives
1727 a DHCPDECLINE for a particular address, it normally abandons that
1728 address, assuming that some unauthorized system is using it.
1729 Unfortunately, a malicious or buggy client can, using DHCPDECLINE
1730 messages, completely exhaust the DHCP server's allocation pool. The
1731 server will eventually reclaim these leases, but not while the client
1732 is running through the pool. This may cause serious thrashing in the DNS,
1733 and it will also cause the DHCP server to forget old DHCP client address
1734 allocations.
1735 .PP
1736 The \fBdeclines\fR flag tells the DHCP server whether or not to honor
1737 DHCPDECLINE messages. If it is set to \fBdeny\fR or \fBignore\fR in
1738 a particular scope, the DHCP server will not respond to DHCPDECLINE
1739 messages.
1740 .PP
1741 The \fBdeclines\fR flag is only supported by DHCPv4 servers. Given the large
1742 IPv6 address space and the internal limits imposed by the server's
1743 address generation mechanism we don't think it is necessary for DHCPv6
1744 servers at this time.
1745 .PP
1746 Currently, abandoned IPv6 addresses are reclaimed in one of two ways:
1747 a) Client renews a specific address:
1748 If a client using a given DUID submits a DHCP REQUEST containing
1749 the last address abandoned by that DUID, the address will be
1750 reassigned to that client.
1751
1752 b) Upon the second restart following an address abandonment. When
1753 an address is abandoned it is both recorded as such in the lease
1754 file and retained as abandoned in server memory until the server
1755 is restarted. Upon restart, the server will process the lease file
1756 and all addresses whose last known state is abandoned will be
1757 retained as such in memory but not rewritten to the lease file.
1758 This means that a subsequent restart of the server will not see the
1759 abandoned addresses in the lease file and therefore have no record
1760 of them as abandoned in memory and as such perceive them as free
1761 for assignment.
1762 .PP
1763 The total number addresses in a pool, available for a given DUID value,
1764 is internally limited by the server's address generation mechanism. If
1765 through mistaken configuration, multiple clients are using the same
1766 DUID they will competing for the same addresses causing the server to reach
1767 this internal limit rather quickly. The internal limit isolates this type
1768 of activity such that address range is not exhausted for other DUID values.
1769 The appearance of the following error log, can be an indication of this
1770 condition:
1771
1772 "Best match for DUID <XX> is an abandoned address, This may be a
1773 result of multiple clients attempting to use this DUID"
1774
1775 where <XX> is an actual DUID value depicted as colon separated
1776 string of bytes in hexadecimal values.
1777 .PP
1778 .B The
1779 .I client-updates
1780 .B keyword
1781 .PP
1782 \fBallow client-updates;\fR
1783 \fBdeny client-updates;\fR
1784 .PP
1785 The \fBclient-updates\fR flag tells the DHCP server whether or not to
1786 honor the client's intention to do its own update of its A record. See
1787 the documentation under the heading THE DNS UPDATE SCHEME for details.
1788 .PP
1789 .B The
1790 .I leasequery
1791 .B keyword
1792 .PP
1793 \fBallow leasequery;\fR
1794 \fBdeny leasequery;\fR
1795 .PP
1796 The \fBleasequery\fR flag tells the DHCP server whether or not to
1797 answer DHCPLEASEQUERY packets. The answer to a DHCPLEASEQUERY packet
1798 includes information about a specific lease, such as when it was
1799 issued and when it will expire. By default, the server will not
1800 respond to these packets.
1801 .SH ALLOW AND DENY WITHIN POOL DECLARATIONS
1802 .PP
1803 The uses of the allow and deny keywords shown in the previous section
1804 work pretty much the same way whether the client is sending a
1805 DHCPDISCOVER or a DHCPREQUEST message - an address will be allocated
1806 to the client (either the old address it's requesting, or a new
1807 address) and then that address will be tested to see if it's okay to
1808 let the client have it. If the client requested it, and it's not
1809 okay, the server will send a DHCPNAK message. Otherwise, the server
1810 will simply not respond to the client. If it is okay to give the
1811 address to the client, the server will send a DHCPACK message.
1812 .PP
1813 The primary motivation behind pool declarations is to have address
1814 allocation pools whose allocation policies are different. A client
1815 may be denied access to one pool, but allowed access to another pool
1816 on the same network segment. In order for this to work, access
1817 control has to be done during address allocation, not after address
1818 allocation is done.
1819 .PP
1820 When a DHCPREQUEST message is processed, address allocation simply
1821 consists of looking up the address the client is requesting and seeing
1822 if it's still available for the client. If it is, then the DHCP
1823 server checks both the address pool permit lists and the relevant
1824 in-scope allow and deny statements to see if it's okay to give the
1825 lease to the client. In the case of a DHCPDISCOVER message, the
1826 allocation process is done as described previously in the ADDRESS
1827 ALLOCATION section.
1828 .PP
1829 When declaring permit lists for address allocation pools, the
1830 following syntaxes are recognized following the allow or deny keywords:
1831 .PP
1832 \fBknown-clients;\fR
1833 .PP
1834 If specified, this statement either allows or prevents allocation from
1835 this pool to any client that has a host declaration (i.e., is known).
1836 A client is known if it has a host declaration in \fIany\fR scope, not
1837 just the current scope.
1838 .PP
1839 \fBunknown-clients;\fR
1840 .PP
1841 If specified, this statement either allows or prevents allocation from
1842 this pool to any client that has no host declaration (i.e., is not
1843 known).
1844 .PP
1845 \fBmembers of "\fRclass\fB";\fR
1846 .PP
1847 If specified, this statement either allows or prevents allocation from
1848 this pool to any client that is a member of the named class.
1849 .PP
1850 \fBdynamic bootp clients;\fR
1851 .PP
1852 If specified, this statement either allows or prevents allocation from
1853 this pool to any bootp client.
1854 .PP
1855 \fBauthenticated clients;\fR
1856 .PP
1857 If specified, this statement either allows or prevents allocation from
1858 this pool to any client that has been authenticated using the DHCP
1859 authentication protocol. This is not yet supported.
1860 .PP
1861 \fBunauthenticated clients;\fR
1862 .PP
1863 If specified, this statement either allows or prevents allocation from
1864 this pool to any client that has not been authenticated using the DHCP
1865 authentication protocol. This is not yet supported.
1866 .PP
1867 \fBall clients;\fR
1868 .PP
1869 If specified, this statement either allows or prevents allocation from
1870 this pool to all clients. This can be used when you want to write a
1871 pool declaration for some reason, but hold it in reserve, or when you
1872 want to renumber your network quickly, and thus want the server to
1873 force all clients that have been allocated addresses from this pool to
1874 obtain new addresses immediately when they next renew.
1875 .PP
1876 \fBafter \fItime\fR\fB;\fR
1877 .PP
1878 If specified, this statement either allows or prevents allocation from
1879 this pool after a given date. This can be used when you want to move
1880 clients from one pool to another. The server adjusts the regular lease
1881 time so that the latest expiry time is at the given time+min-lease-time.
1882 A short min-lease-time enforces a step change, whereas a longer
1883 min-lease-time allows for a gradual change.
1884 \fItime\fR is either second since epoch, or a UTC time string e.g.
1885 4 2007/08/24 09:14:32 or a string with time zone offset in seconds
1886 e.g. 4 2007/08/24 11:14:32 -7200
1887 .SH REFERENCE: PARAMETERS
1888 The
1889 .I abandon-lease-time
1890 statement
1891 .RS 0.25i
1892 .PP
1893 .B abandon-lease-time \fItime\fR\fB;\fR
1894 .PP
1895 .I Time
1896 should be the maximum amount of time (in seconds) that an abandoned IPv4 lease
1897 remains unavailable for assignment to a client. Abandoned leases will only be
1898 offered to clients if there are no free leases. If not defined, the default
1899 abandon lease time is 86400 seconds (24 hours). Note the abandoned lease time
1900 for a given lease is preserved across server restarts. The parameter may only
1901 be set at the global scope and is evaluated only once during server startup.
1902 .PP
1903 Values less than sixty seconds are not recommended as this is below the ping
1904 check threshold and can cause leases once abandoned but since returned to the
1905 free state to not be pinged before being offered. If the requested time is
1906 larger than 0x7FFFFFFF - 1 or the sum of the current time plus the abandoned time isgreater than 0x7FFFFFFF it is treated as infinite.
1907 .RE
1908 .PP
1909 The
1910 .I adaptive-lease-time-threshold
1911 statement
1912 .RS 0.25i
1913 .PP
1914 .B adaptive-lease-time-threshold \fIpercentage\fR\fB;\fR
1915 .PP
1916 When the number of allocated leases within a pool rises above
1917 the \fIpercentage\fR given in this statement, the DHCP server decreases
1918 the lease length for new clients within this pool to \fImin-lease-time\fR
1919 seconds. Clients renewing an already valid (long) leases get at least the
1920 remaining time from the current lease. Since the leases expire faster,
1921 the server may either recover more quickly or avoid pool exhaustion
1922 entirely. Once the number of allocated leases drop below the threshold,
1923 the server reverts back to normal lease times. Valid percentages are
1924 between 1 and 99.
1925 .RE
1926 .PP
1927 The
1928 .I always-broadcast
1929 statement
1930 .RS 0.25i
1931 .PP
1932 .B always-broadcast \fIflag\fR\fB;\fR
1933 .PP
1934 The DHCP and BOOTP protocols both require DHCP and BOOTP clients to
1935 set the broadcast bit in the flags field of the BOOTP message header.
1936 Unfortunately, some DHCP and BOOTP clients do not do this, and
1937 therefore may not receive responses from the DHCP server. The DHCP
1938 server can be made to always broadcast its responses to clients by
1939 setting this flag to \'on\' for the relevant scope; relevant scopes would be
1940 inside a conditional statement, as a parameter for a class, or as a parameter
1941 for a host declaration. To avoid creating excess broadcast traffic on your
1942 network, we recommend that you restrict the use of this option to as few
1943 clients as possible. For example, the Microsoft DHCP client is known not
1944 to have this problem, as are the OpenTransport and ISC DHCP clients.
1945 .RE
1946 .PP
1947 The
1948 .I always-reply-rfc1048
1949 statement
1950 .RS 0.25i
1951 .PP
1952 .B always-reply-rfc1048 \fIflag\fR\fB;\fR
1953 .PP
1954 Some BOOTP clients expect RFC1048-style responses, but do not follow
1955 RFC1048 when sending their requests. You can tell that a client is
1956 having this problem if it is not getting the options you have
1957 configured for it and if you see in the server log the message
1958 "(non-rfc1048)" printed with each BOOTREQUEST that is logged.
1959 .PP
1960 If you want to send rfc1048 options to such a client, you can set the
1961 .B always-reply-rfc1048
1962 option in that client's host declaration, and the DHCP server will
1963 respond with an RFC-1048-style vendor options field. This flag can
1964 be set in any scope, and will affect all clients covered by that
1965 scope.
1966 .RE
1967 .PP
1968 The
1969 .I authoritative
1970 statement
1971 .RS 0.25i
1972 .PP
1973 .B authoritative;
1974 .PP
1975 .B not authoritative;
1976 .PP
1977 The DHCP server will normally assume that the configuration
1978 information about a given network segment is not known to be correct
1979 and is not authoritative. This is so that if a naive user installs a
1980 DHCP server not fully understanding how to configure it, it does not
1981 send spurious DHCPNAK messages to clients that have obtained addresses
1982 from a legitimate DHCP server on the network.
1983 .PP
1984 Network administrators setting up authoritative DHCP servers for their
1985 networks should always write \fBauthoritative;\fR at the top of their
1986 configuration file to indicate that the DHCP server \fIshould\fR send
1987 DHCPNAK messages to misconfigured clients. If this is not done,
1988 clients will be unable to get a correct IP address after changing
1989 subnets until their old lease has expired, which could take quite a
1990 long time.
1991 .PP
1992 Usually, writing \fBauthoritative;\fR at the top level of the file
1993 should be sufficient. However, if a DHCP server is to be set up so
1994 that it is aware of some networks for which it is authoritative and
1995 some networks for which it is not, it may be more appropriate to
1996 declare authority on a per-network-segment basis.
1997 .PP
1998 Note that the most specific scope for which the concept of authority
1999 makes any sense is the physical network segment - either a
2000 shared-network statement or a subnet statement that is not contained
2001 within a shared-network statement. It is not meaningful to specify
2002 that the server is authoritative for some subnets within a shared
2003 network, but not authoritative for others, nor is it meaningful to
2004 specify that the server is authoritative for some host declarations
2005 and not others.
2006 .RE
2007 .PP
2008 The \fIboot-unknown-clients\fR statement
2009 .RS 0.25i
2010 .PP
2011 .B boot-unknown-clients \fIflag\fB;\fR
2012 .PP
2013 If the \fIboot-unknown-clients\fR statement is present and has a value
2014 of \fIfalse\fR or \fIoff\fR, then clients for which there is no
2015 .I host
2016 declaration will not be allowed to obtain IP addresses. If this
2017 statement is not present or has a value of \fItrue\fR or \fIon\fR,
2018 then clients without host declarations will be allowed to obtain IP
2019 addresses, as long as those addresses are not restricted by
2020 .I allow
2021 and \fIdeny\fR statements within their \fIpool\fR declarations.
2022 .RE
2023 .PP
2024 The \fIcheck-secs-byte-order\fR statement
2025 .RS 0.25i
2026 .PP
2027 .B check-secs-byte-order \fIflag\fB;\fR
2028 .PP
2029 When \fIcheck-secs-byte-order\fR is enabled, the server will check for DHCPv4
2030 clients that do the byte ordering on the secs field incorrectly. This field
2031 should be in network byte order but some clients get it wrong. When this
2032 parameter is enabled the server will examine the secs field and if it looks
2033 wrong (high byte non zero and low byte zero) swap the bytes. The default
2034 is disabled. This parameter is only useful when doing load balancing within
2035 failover. (Formerly, this behavior had to be enabled during compilation
2036 configuration via --enable-secs-byteorder).
2037 .PP
2038 The \fIdb-time-format\fR statement
2039 .RS 0.25i
2040 .PP
2041 .B db-time-format \fR[ \fIdefault\fR | \fIlocal\fR ] \fB;\fR
2042 .PP
2043 The DHCP server software outputs several timestamps when writing leases to
2044 persistent storage. This configuration parameter selects one of two output
2045 formats. The \fIdefault\fR format prints the day, date, and time in UTC,
2046 while the \fIlocal\fR format prints the system seconds-since-epoch, and
2047 helpfully provides the day and time in the system timezone in a comment.
2048 The time formats are described in detail in the dhcpd.leases(5) manpage.
2049 .RE
2050 .PP
2051 The \fIddns-hostname\fR statement
2052 .RS 0.25i
2053 .PP
2054 .B ddns-hostname \fIname\fB;\fR
2055 .PP
2056 The \fIname\fR parameter should be the hostname that will be used in
2057 setting up the client's A and PTR records. If no \fIddns-hostname\fR is
2058 specified in scope, then the server will derive the hostname
2059 automatically, using an algorithm that varies for each of the
2060 different update methods.
2061 .RE
2062 .PP
2063 The \fIddns-domainname\fR statement
2064 .RS 0.25i
2065 .PP
2066 .B ddns-domainname \fIname\fB;\fR
2067 .PP
2068 The \fIname\fR parameter should be the domain name that will be
2069 appended to the client's hostname to form a fully-qualified
2070 domain-name (FQDN).
2071 .RE
2072 .PP
2073 The \fddns-local-address4\fR and \fddns-local-address6\fR statements
2074 .RS 0.25i
2075 .PP
2076 .B ddns-local-address4 \fIaddress\fB;\fR
2077 .PP
2078 .B ddns-local-address6 \fIaddress\fB;\fR
2079 .PP
2080 The \fIaddress\fR parameter should be the local IPv4 or IPv6 address
2081 the server should use as the from address when sending DDNS update
2082 requests.
2083 .RE
2084 .PP
2085 The \fIddns-rev-domainname\fR statement
2086 .RS 0.25i
2087 .PP
2088 .B ddns-rev-domainname \fIname\fB;\fR
2089 .PP
2090 The \fIname\fR parameter should be the domain name that will be
2091 appended to the client's reversed IP address to produce a name for use
2092 in the client's PTR record. By default, this is "in-addr.arpa.", but
2093 the default can be overridden here.
2094 .PP
2095 The reversed IP address to which this domain name is appended is
2096 always the IP address of the client, in dotted quad notation, reversed
2097 - for example, if the IP address assigned to the client is
2098 10.17.92.74, then the reversed IP address is 74.92.17.10. So a
2099 client with that IP address would, by default, be given a PTR record
2100 of 10.17.92.74.in-addr.arpa.
2101 .RE
2102 .PP
2103 The \fIddns-update-style\fR parameter
2104 .RS 0.25i
2105 .PP
2106 .B ddns-update-style \fIstyle\fB;\fR
2107 .PP
2108 The
2109 .I style
2110 parameter must be one of \fBstandard\fR, \fBinterim\fR or \fBnone\fR.
2111 The \fIddns-update-style\fR statement is only meaningful in the outer
2112 scope - it is evaluated once after reading the dhcpd.conf file, rather
2113 than each time a client is assigned an IP address, so there is no way
2114 to use different DNS update styles for different clients. The default
2115 is \fBnone\fR.
2116 .RE
2117 .PP
2118 .B The
2119 .I ddns-updates
2120 .B statement
2121 .RS 0.25i
2122 .PP
2123 \fBddns-updates \fIflag\fR\fB;\fR
2124 .PP
2125 The \fIddns-updates\fR parameter controls whether or not the server will
2126 attempt to do a DNS update when a lease is confirmed. Set this to \fIoff\fR
2127 if the server should not attempt to do updates within a certain scope.
2128 The \fIddns-updates\fR parameter is on by default. To disable DNS
2129 updates in all scopes, it is preferable to use the
2130 \fIddns-update-style\fR statement, setting the style to \fInone\fR.
2131 .RE
2132 .PP
2133 The
2134 .I default-lease-time
2135 statement
2136 .RS 0.25i
2137 .PP
2138 .B default-lease-time \fItime\fR\fB;\fR
2139 .PP
2140 .I Time
2141 should be the length in seconds that will be assigned to a lease if
2142 the client requesting the lease does not ask for a specific expiration
2143 time. This is used for both DHCPv4 and DHCPv6 leases (it is also known
2144 as the "valid lifetime" in DHCPv6).
2145 The default is 43200 seconds.
2146 .RE
2147 .PP
2148 The
2149 .I delayed-ack
2150 and
2151 .I max-ack-delay
2152 statements
2153 .RS 0.25i
2154 .PP
2155 .B delayed-ack \fIcount\fR\fB;\fR
2156 .PP
2157 .B max-ack-delay \fImicroseconds\fR\fB;\fR
2158 .PP
2159 .I Count
2160 should be an integer value from zero to 2^16-1, and defaults to 28. The
2161 count represents how many DHCPv4 replies maximum will be queued pending
2162 transmission until after a database commit event. If this number is
2163 reached, a database commit event (commonly resulting in fsync() and
2164 representing a performance penalty) will be made, and the reply packets
2165 will be transmitted in a batch afterwards. This preserves the RFC2131
2166 direction that "stable storage" be updated prior to replying to clients.
2167 Should the DHCPv4 sockets "go dry" (select() returns immediately with no
2168 read sockets), the commit is made and any queued packets are transmitted.
2169 .PP
2170 Similarly, \fImicroseconds\fR indicates how many microseconds are permitted
2171 to pass inbetween queuing a packet pending an fsync, and performing the
2172 fsync. Valid values range from 0 to 2^32-1, and defaults to 250,000 (1/4 of
2173 a second).
2174 .PP
2175 The delayed-ack feature is not compiled in by default, but must be enabled
2176 at compile time with \'./configure --enable-delayed-ack\'. While we no
2177 longer consider it experimental and we don't know of any issues with it,
2178 in order to minimize problems with existing configuration files we have
2179 left it disabled by default.
2180 .RE
2181 .PP
2182 The
2183 .I dhcp-cache-threshold
2184 statement
2185 .RS 0.25i
2186 .PP
2187 .B dhcp-cache-threshold \fIpercentage\fB;\fR
2188 .PP
2189 The \fIdhcp-cache-threshold\fR statement takes one integer parameter
2190 with allowed values between 0 and 100. The default value is 25 (25% of
2191 the lease time). This parameter expresses the percentage of the total
2192 lease time, measured from the beginning, during which a
2193 client's attempt to renew its lease will result in getting
2194 the already assigned lease, rather than an extended lease.
2195 .PP
2196 Clients that attempt renewal frequently can cause the server to
2197 update and write the database frequently resulting in a performance
2198 impact on the server. The \fIdhcp-cache-threshold\fR
2199 statement instructs the DHCP server to avoid updating leases too
2200 frequently thus avoiding this behavior. Instead the server assigns the
2201 same lease (i.e. reuses it) with no modifications except for CLTT (Client Last
2202 Transmission Time) which does not require disk operations. This
2203 feature applies to IPv4 only.
2204 .PP
2205 When an existing lease is matched to a renewing client, it will be reused
2206 if all of the following conditions are true:
2207 .nf
2208 1. The dhcp-cache-threshold is larger than zero
2209 2. The current lease is active
2210 3. The percentage of the lease time that has elapsed is less than
2211 dhcp-cache-threshold
2212 4. The client information provided in the renewal does not alter
2213 any of the following:
2214 a. DNS information and DNS updates are enabled
2215 b. Billing class to which the lease is associated
2216 c. The host declaration associated with the lease
2217 d. The client id - this may happen if a client boots without
2218 a client id and then starts using one in subsequent requests.
2219 .fi
2220 .PP
2221 Note that the lease can be reused if the options the client or relay agent
2222 sends are changed. These changes will not be recorded in the in-memory or
2223 on-disk databases until the client renews after the threshold time is reached.
2224 .RE
2225 .PP
2226 The
2227 .I do-forward-updates
2228 statement
2229 .RS 0.25i
2230 .PP
2231 .B do-forward-updates \fIflag\fB;\fR
2232 .PP
2233 The \fIdo-forward-updates\fR statement instructs the DHCP server as
2234 to whether it should attempt to update a DHCP client\'s A record
2235 when the client acquires or renews a lease. This statement has no
2236 effect unless DNS updates are enabled. Forward updates are enabled
2237 by default. If this statement is used to disable forward updates,
2238 the DHCP server will never attempt to update the client\'s A record,
2239 and will only ever attempt to update the client\'s PTR record if the
2240 client supplies an FQDN that should be placed in the PTR record using
2241 the \fBfqdn\fR option. If forward updates are enabled, the DHCP server
2242 will still honor the setting of the \fBclient-updates\fR flag.
2243 .RE
2244 .PP
2245 The
2246 .I dont-use-fsync
2247 statement
2248 .RS 0.25i
2249 .PP
2250 .B dont-use-fsync \fIflag\fB;\fR
2251 .PP
2252 The \fIdont-use-fsync\fR statement instructs the DHCP server if
2253 it should call fsync() when writing leases to the lease file. By
2254 default and if the flag is set to false the server \fBwill\fR call
2255 fsync(). Suppressing the call to fsync() may increase the performance
2256 of the server but it also adds a risk that a lease will not be
2257 properly written to the disk after it has been issued to a client
2258 and before the server stops. This can lead to duplicate leases
2259 being issued to different clients. Using this option is \fBnot
2260 recommended\FR.
2261 .RE
2262 .PP
2263 The
2264 .I dynamic-bootp-lease-cutoff
2265 statement
2266 .RS 0.25i
2267 .PP
2268 .B dynamic-bootp-lease-cutoff \fIdate\fB;\fR
2269 .PP
2270 The \fIdynamic-bootp-lease-cutoff\fR statement sets the ending time
2271 for all leases assigned dynamically to BOOTP clients. Because BOOTP
2272 clients do not have any way of renewing leases, and don't know that
2273 their leases could expire, by default dhcpd assigns infinite leases
2274 to all BOOTP clients. However, it may make sense in some situations
2275 to set a cutoff date for all BOOTP leases - for example, the end of a
2276 school term, or the time at night when a facility is closed and all
2277 machines are required to be powered off.
2278 .PP
2279 .I Date
2280 should be the date on which all assigned BOOTP leases will end. The
2281 date is specified in the form:
2282 .PP
2283 .ce 1
2284 W YYYY/MM/DD HH:MM:SS
2285 .PP
2286 W is the day of the week expressed as a number
2287 from zero (Sunday) to six (Saturday). YYYY is the year, including the
2288 century. MM is the month expressed as a number from 1 to 12. DD is
2289 the day of the month, counting from 1. HH is the hour, from zero to
2290 23. MM is the minute and SS is the second. The time is always in
2291 Coordinated Universal Time (UTC), not local time.
2292 .RE
2293 .PP
2294 The
2295 .I dynamic-bootp-lease-length
2296 statement
2297 .RS 0.25i
2298 .PP
2299 .B dynamic-bootp-lease-length\fR \fIlength\fR\fB;\fR
2300 .PP
2301 The \fIdynamic-bootp-lease-length\fR statement is used to set the
2302 length of leases dynamically assigned to BOOTP clients. At some
2303 sites, it may be possible to assume that a lease is no longer in
2304 use if its holder has not used BOOTP or DHCP to get its address within
2305 a certain time period. The period is specified in \fIlength\fR as a
2306 number of seconds. If a client reboots using BOOTP during the
2307 timeout period, the lease duration is reset to \fIlength\fR, so a
2308 BOOTP client that boots frequently enough will never lose its lease.
2309 Needless to say, this parameter should be adjusted with extreme
2310 caution.
2311 .RE
2312 .PP
2313 The
2314 .I echo-client-id
2315 statement
2316 .RS 0.25i
2317 .PP
2318 .B echo-client-id\fR \fIflag\fR\fB;\fR
2319 .PP
2320 The \fIecho-client-id\fR statement is used to enable or disable RFC 6842
2321 compliant behavior. If the echo-client-id statement is present and has a
2322 value of true or on, and a DHCP DISCOVER or REQUEST is received which contains
2323 the client identifier option (Option code 61), the server will copy the option
2324 into its response (DHCP ACK or NAK) per RFC 6842. In other words if the
2325 client sends the option it will receive it back. By default, this flag is off
2326 and client identifiers will not echoed back to the client.
2327 .RE
2328 .PP
2329 The
2330 .I filename
2331 statement
2332 .RS 0.25i
2333 .PP
2334 .B filename\fR \fB"\fR\fIfilename\fR\fB";\fR
2335 .PP
2336 The \fIfilename\fR statement can be used to specify the name of the
2337 initial boot file which is to be loaded by a client. The
2338 .I filename
2339 should be a filename recognizable to whatever file transfer protocol
2340 the client can be expected to use to load the file.
2341 .RE
2342 .PP
2343 The
2344 .I fixed-address
2345 declaration
2346 .RS 0.25i
2347 .PP
2348 .B fixed-address address\fR [\fB,\fR \fIaddress\fR ... ]\fB;\fR
2349 .PP
2350 The \fIfixed-address\fR declaration is used to assign one or more fixed
2351 IP addresses to a client. It should only appear in a \fIhost\fR
2352 declaration. If more than one address is supplied, then when the
2353 client boots, it will be assigned the address that corresponds to the
2354 network on which it is booting. If none of the addresses in the
2355 \fIfixed-address\fR statement are valid for the network to which the client
2356 is connected, that client will not match the \fIhost\fR declaration
2357 containing that \fIfixed-address\fR declaration. Each \fIaddress\fR
2358 in the \fIfixed-address\fR declaration should be either an IP address or
2359 a domain name that resolves to one or more IP addresses.
2360 .RE
2361 .PP
2362 The
2363 .I fixed-address6
2364 declaration
2365 .RS 0.25i
2366 .PP
2367 .B fixed-address6 ip6-address\fR ;\fR
2368 .PP
2369 The \fIfixed-address6\fR declaration is used to assign a fixed
2370 IPv6 addresses to a client. It should only appear in a \fIhost\fR
2371 declaration.
2372 .RE
2373 .PP
2374 The
2375 .I fixed-prefix6
2376 declaration
2377 .RS 0.25i
2378 .PP
2379 .B fixed-prefix6\fR \fIlow-address\fR \fB/\fR \fIbits\fR\fB;\fR
2380 .PP
2381 The \fIfixed-prefix6\fR declaration is used to assign a fixed
2382 IPv6 prefix to a client. It should only appear in a \fIhost\fR
2383 declaration, but multiple \fIfixed-prefix6\fR statements may appear
2384 in a single \fIhost\fR declaration.
2385 .PP
2386 The \fIlow-address\fR specifies the start of the prefix and the \fIbits\fR
2387 specifies the size of the prefix in bits.
2388 .PP
2389 If there are multiple prefixes for a given host entry the server will
2390 choose one that matches the requested prefix size or, if none match,
2391 the first one.
2392 .PP
2393 If there are multiple \fIhost\fR declarations the server will try to
2394 choose a declaration where the \fIfixed-address6\fR matches the client's
2395 subnet. If none match it will choose one that doesn't have a \fIfixed-address6\fR
2396 statement.
2397 .PP
2398 Note Well: Unlike the fixed address the fixed prefix does not need to match
2399 a subnet in order to be served. This allows you to provide a prefix to
2400 a client that is outside of the subnet on which the client makes the request
2401 to the the server.
2402 .RE
2403 .PP
2404 The
2405 .I get-lease-hostnames
2406 statement
2407 .RS 0.25i
2408 .PP
2409 .B get-lease-hostnames\fR \fIflag\fR\fB;\fR
2410 .PP
2411 The \fIget-lease-hostnames\fR statement is used to tell dhcpd whether
2412 or not to look up the domain name corresponding to the IP address of
2413 each address in the lease pool and use that address for the DHCP
2414 \fIhostname\fR option. If \fIflag\fR is true, then this lookup is
2415 done for all addresses in the current scope. By default, or if
2416 \fIflag\fR is false, no lookups are done.
2417 .RE
2418 .PP
2419 The
2420 .I hardware
2421 statement
2422 .RS 0.25i
2423 .PP
2424 .B hardware \fIhardware-type hardware-address\fB;\fR
2425 .PP
2426 In order for a BOOTP client to be recognized, its network hardware
2427 address must be declared using a \fIhardware\fR clause in the
2428 .I host
2429 statement.
2430 .I hardware-type
2431 must be the name of a physical hardware interface type. Currently,
2432 only the
2433 .B ethernet
2434 and
2435 .B token-ring
2436 types are recognized, although support for a
2437 .B fddi
2438 hardware type (and others) would also be desirable.
2439 The
2440 .I hardware-address
2441 should be a set of hexadecimal octets (numbers from 0 through ff)
2442 separated by colons. The \fIhardware\fR statement may also be used
2443 for DHCP clients.
2444 .RE
2445 .PP
2446 The
2447 .I host-identifier option
2448 statement
2449 .RS 0.25i
2450 .PP
2451 .B host-identifier option \fIoption-name option-data\fB;\fR
2452 .PP
2453 or
2454 .PP
2455 .B host-identifier v6relopt \fInumber option-name option-data\fB;\fR
2456 .PP
2457 This identifies a DHCPv6 client in a
2458 .I host
2459 statement.
2460 .I option-name
2461 is any option, and
2462 .I option-data
2463 is the value for the option that the client will send. The
2464 .I option-data
2465 must be a constant value. In the v6relopts case the additional number
2466 is the relay to examine for the specified option name and value. The
2467 values are the same as for the v6relay option. 0 is a no-op, 1 is the
2468 relay closest to the client, 2 the next one in and so on. Values that
2469 are larger than the maximum number of relays (currently 32) indicate the
2470 relay closest to the server independent of number.
2471 .RE
2472 .PP
2473 The
2474 .I ignore-client-uids
2475 statement
2476 .RS 0.25i
2477 .PP
2478 .B ignore-client-uids \fIflag\fB;\fR
2479 .PP
2480 If the \fIignore-client-uids\fR statement is present and has a value of
2481 \fItrue\fR or \fIon\fR, the UID for clients will not be recorded.
2482 If this statement is not present or has a value of \fIfalse\fR or
2483 \fIoff\fR, then client UIDs will be recorded.
2484 .RE
2485 .PP
2486 The
2487 .I infinite-is-reserved
2488 statement
2489 .RS 0.25i
2490 .PP
2491 .B infinite-is-reserved \fIflag\fB;\fR
2492 .PP
2493 ISC DHCP now supports \'reserved\' leases. See the section on RESERVED LEASES
2494 below. If this \fIflag\fR is on, the server will automatically reserve leases
2495 allocated to clients which requested an infinite (0xffffffff) lease-time.
2496 .PP
2497 The default is off.
2498 .RE
2499 .PP
2500 The
2501 .I lease-file-name
2502 statement
2503 .RS 0.25i
2504 .PP
2505 .B lease-file-name \fIname\fB;\fR
2506 .PP
2507 .I Name
2508 should be the name of the DHCP server's lease file. By default, this
2509 is DBDIR/dhcpd.leases. This statement \fBmust\fR appear in the outer
2510 scope of the configuration file - if it appears in some other scope,
2511 it will have no effect. Furthermore, it has no effect if overridden
2512 by the
2513 .B -lf
2514 flag or the
2515 .B PATH_DHCPD_DB
2516 environment variable.
2517 .RE
2518 .PP
2519 The
2520 .I limit-addrs-per-ia
2521 statement
2522 .RS 0.25i
2523 .PP
2524 .B limit-addrs-per-ia \fInumber\fB;\fR
2525 .PP
2526 By default, the DHCPv6 server will limit clients to one IAADDR per IA
2527 option, meaning one address. If you wish to permit clients to hang onto
2528 multiple addresses at a time, configure a larger \fInumber\fR here.
2529 .PP
2530 Note that there is no present method to configure the server to forcibly
2531 configure the client with one IP address per each subnet on a shared network.
2532 This is left to future work.
2533 .RE
2534 .PP
2535 The
2536 .I dhcpv6-lease-file-name
2537 statement
2538 .RS 0.25i
2539 .PP
2540 .B dhcpv6-lease-file-name \fIname\fB;\fR
2541 .PP
2542 .I Name
2543 is the name of the lease file to use if and only if the server is running
2544 in DHCPv6 mode. By default, this is DBDIR/dhcpd6.leases. This statement,
2545 like
2546 .I lease-file-name,
2547 \fBmust\fR appear in the outer scope of the configuration file. It
2548 has no effect if overridden by the
2549 .B -lf
2550 flag or the
2551 .B PATH_DHCPD6_DB
2552 environment variable. If
2553 .I dhcpv6-lease-file-name
2554 is not specified, but
2555 .I lease-file-name
2556 is, the latter value will be used.
2557 .RE
2558 .PP
2559 The
2560 .I lease-id-format
2561 parameter
2562 .RS 0.25i
2563 .PP
2564 .B lease-id-format \fIformat\fB;\fR
2565 .PP
2566 The \fIformat\fR parameter must be either \fBoctal\fR or \fBhex\fR.
2567 This parameter governs the format used to write certain values to lease
2568 files. With the default format, octal, values are written as quoted strings in
2569 which non-printable characters are represented as octal escapes -
2570 a backslash character followed by three octal digits. When the hex format
2571 is specified, values are written as an unquoted series of pairs of
2572 hexadecimal digits, separated by colons.
2573
2574 Currently, the values written out based on lease-id-format are the server-duid,
2575 the uid (DHCPv4 leases), and the IAID_DUID (DHCPv6 leases). Note the server
2576 automatically reads the values in either format.
2577 .RE
2578 .PP
2579 The
2580 .I local-port
2581 statement
2582 .RS 0.25i
2583 .PP
2584 .B local-port \fIport\fB;\fR
2585 .PP
2586 This statement causes the DHCP server to listen for DHCP requests on
2587 the UDP port specified in \fIport\fR, rather than on port 67.
2588 .RE
2589 .PP
2590 The
2591 .I local-address
2592 statement
2593 .RS 0.25i
2594 .PP
2595 .B local-address \fIaddress\fB;\fR
2596 .PP
2597 This statement causes the DHCP server to listen for DHCP requests sent
2598 to the specified \fIaddress\fR, rather than requests sent to all addresses.
2599 Since serving directly attached DHCP clients implies that the server must
2600 respond to requests sent to the all-ones IP address, this option cannot be
2601 used if clients are on directly attached networks; it is only realistically
2602 useful for a server whose only clients are reached via unicasts, such as via
2603 DHCP relay agents.
2604 .PP
2605 Note: This statement is only effective if the server was compiled using
2606 the USE_SOCKETS #define statement, which is default on a small number of
2607 operating systems, and must be explicitly chosen at compile-time for all
2608 others. You can be sure if your server is compiled with USE_SOCKETS if
2609 you see lines of this format at startup:
2610 .PP
2611 Listening on Socket/eth0
2612 .PP
2613 Note also that since this bind()s all DHCP sockets to the specified
2614 address, that only one address may be supported in a daemon at a given
2615 time.
2616 .RE
2617 .PP
2618 The
2619 .I log-facility
2620 statement
2621 .RS 0.25i
2622 .PP
2623 .B log-facility \fIfacility\fB;\fR
2624 .PP
2625 This statement causes the DHCP server to do all of its logging on the
2626 specified log facility once the dhcpd.conf file has been read. By
2627 default the DHCP server logs to the daemon facility. Possible log
2628 facilities include auth, authpriv, cron, daemon, ftp, kern, lpr, mail,
2629 mark, news, ntp, security, syslog, user, uucp, and local0 through
2630 local7. Not all of these facilities are available on all systems,
2631 and there may be other facilities available on other systems.
2632 .PP
2633 In addition to setting this value, you may need to modify your
2634 .I syslog.conf
2635 file to configure logging of the DHCP server. For example, you might
2636 add a line like this:
2637 .PP
2638 .nf
2639 local7.debug /var/log/dhcpd.log
2640 .fi
2641 .PP
2642 The syntax of the \fIsyslog.conf\fR file may be different on some
2643 operating systems - consult the \fIsyslog.conf\fR manual page to be
2644 sure. To get syslog to start logging to the new file, you must first
2645 create the file with correct ownership and permissions (usually, the
2646 same owner and permissions of your /var/log/messages or
2647 /usr/adm/messages file should be fine) and send a SIGHUP to syslogd.
2648 Some systems support log rollover using a shell script or program
2649 called newsyslog or logrotate, and you may be able to configure this
2650 as well so that your log file doesn't grow uncontrollably.
2651 .PP
2652 Because the \fIlog-facility\fR setting is controlled by the dhcpd.conf
2653 file, log messages printed while parsing the dhcpd.conf file or before
2654 parsing it are logged to the default log facility. To prevent this,
2655 see the README file included with this distribution, which describes
2656 BUG: where is that mentioned in README?
2657 how to change the default log facility. When this parameter is used,
2658 the DHCP server prints its startup message a second time after parsing
2659 the configuration file, so that the log will be as complete as
2660 possible.
2661 .RE
2662 .PP
2663 The
2664 .I log-threshold-high
2665 and
2666 .I log-threshold-low
2667 statements
2668 .RS 0.25i
2669 .PP
2670 .B log-threshold-high \fIpercentage\fB;\fR
2671 .PP
2672 .B log-threshold-low \fIpercentage\fB;\fR
2673 .PP
2674 The \fIlog-threshold-low\fR and \fIlog-threshold-high\fR statements
2675 are used to control when a message is output about pool usage. The
2676 value for both of them is the percentage of the pool in use. If the
2677 high threshold is 0 or has not been specified, no messages will be
2678 produced. If a high threshold is given, a message is output once the
2679 pool usage passes that level. After that, no more messages will be
2680 output until the pool usage falls below the low threshold. If the low
2681 threshold is not given, it default to a value of zero.
2682 .PP
2683 A special case occurs when the low threshold is set to be higer than
2684 the high threshold. In this case, a message will be generated each time
2685 a lease is acknowledged when the pool usage is above the high threshold.
2686 .PP
2687 Note that threshold logging will be automatically disabled for shared
2688 subnets whose total number of addresses is larger than (2^64)-1. The server
2689 will emit a log statement at startup when threshold logging is disabled as
2690 shown below:
2691
2692 "Threshold logging disabled for shared subnet of ranges: <addresses>"
2693
2694 This is likely to have no practical runtime effect as CPUs are unlikely
2695 to support a server actually reaching such a large number of leases.
2696 .RE
2697 .PP
2698 The
2699 .I max-lease-time
2700 statement
2701 .RS 0.25i
2702 .PP
2703 .B max-lease-time \fItime\fR\fB;\fR
2704 .PP
2705 .I Time
2706 should be the maximum length in seconds that will be assigned to a
2707 lease.
2708 If not defined, the default maximum lease time is 86400.
2709 The only exception to this is that Dynamic BOOTP lease
2710 lengths, which are not specified by the client, are not limited by
2711 this maximum.
2712 .RE
2713 .PP
2714 The
2715 .I min-lease-time
2716 statement
2717 .RS 0.25i
2718 .PP
2719 .B min-lease-time \fItime\fR\fB;\fR
2720 .PP
2721 .I Time
2722 should be the minimum length in seconds that will be assigned to a
2723 lease.
2724 The default is the minimum of 300 seconds or
2725 \fBmax-lease-time\fR.
2726 .RE
2727 .PP
2728 The
2729 .I min-secs
2730 statement
2731 .RS 0.25i
2732 .PP
2733 .B min-secs \fIseconds\fR\fB;\fR
2734 .PP
2735 .I Seconds
2736 should be the minimum number of seconds since a client began trying to
2737 acquire a new lease before the DHCP server will respond to its request.
2738 The number of seconds is based on what the client reports, and the maximum
2739 value that the client can report is 255 seconds. Generally, setting this
2740 to one will result in the DHCP server not responding to the client's first
2741 request, but always responding to its second request.
2742 .PP
2743 This can be used
2744 to set up a secondary DHCP server which never offers an address to a client
2745 until the primary server has been given a chance to do so. If the primary
2746 server is down, the client will bind to the secondary server, but otherwise
2747 clients should always bind to the primary. Note that this does not, by
2748 itself, permit a primary server and a secondary server to share a pool of
2749 dynamically-allocatable addresses.
2750 .RE
2751 .PP
2752 The
2753 .I next-server
2754 statement
2755 .RS 0.25i
2756 .PP
2757 .B next-server\fR \fIserver-name\fR\fB;\fR
2758 .PP
2759 The \fInext-server\fR statement is used to specify the host address of
2760 the server from which the initial boot file (specified in the
2761 \fIfilename\fR statement) is to be loaded. \fIServer-name\fR should
2762 be a numeric IP address or a domain name.
2763 .RE
2764 .PP
2765 The
2766 .I omapi-port
2767 statement
2768 .RS 0.25i
2769 .PP
2770 .B omapi-port\fR \fIport\fR\fB;\fR
2771 .PP
2772 The \fIomapi-port\fR statement causes the DHCP server to listen for
2773 OMAPI connections on the specified port. This statement is required
2774 to enable the OMAPI protocol, which is used to examine and modify the
2775 state of the DHCP server as it is running.
2776 .RE
2777 .PP
2778 The
2779 .I one-lease-per-client
2780 statement
2781 .RS 0.25i
2782 .PP
2783 .B one-lease-per-client \fIflag\fR\fB;\fR
2784 .PP
2785 If this flag is enabled, whenever a client sends a DHCPREQUEST for a
2786 particular lease, the server will automatically free any other leases
2787 the client holds. This presumes that when the client sends a
2788 DHCPREQUEST, it has forgotten any lease not mentioned in the
2789 DHCPREQUEST - i.e., the client has only a single network interface
2790 .I and
2791 it does not remember leases it's holding on networks to which it is
2792 not currently attached. Neither of these assumptions are guaranteed
2793 or provable, so we urge caution in the use of this statement.
2794 .RE
2795 .PP
2796 The
2797 .I pid-file-name
2798 statement
2799 .RS 0.25i
2800 .PP
2801 .B pid-file-name
2802 .I name\fR\fB;\fR
2803 .PP
2804 .I Name
2805 should be the name of the DHCP server's process ID file. This is the
2806 file in which the DHCP server's process ID is stored when the server
2807 starts. By default, this is RUNDIR/dhcpd.pid. Like the
2808 .I lease-file-name
2809 statement, this statement must appear in the outer scope
2810 of the configuration file. It has no effect if overridden by the
2811 .B -pf
2812 flag or the
2813 .B PATH_DHCPD_PID
2814 environment variable.
2815 .PP
2816 The
2817 .I dhcpv6-pid-file-name
2818 statement
2819 .RS 0.25i
2820 .PP
2821 .B dhcpv6-pid-file-name \fIname\fB;\fR
2822 .PP
2823 .I Name
2824 is the name of the pid file to use if and only if the server is running
2825 in DHCPv6 mode. By default, this is DBDIR/dhcpd6.pid. This statement,
2826 like
2827 .I pid-file-name,
2828 \fBmust\fR appear in the outer scope of the configuration file. It
2829 has no effect if overridden by the
2830 .B -pf
2831 flag or the
2832 .B PATH_DHCPD6_PID
2833 environment variable. If
2834 .I dhcpv6-pid-file-name
2835 is not specified, but
2836 .I pid-file-name
2837 is, the latter value will be used.
2838 .RE
2839 .PP
2840 The
2841 .I ping-check
2842 statement
2843 .RS 0.25i
2844 .PP
2845 .B ping-check
2846 .I flag\fR\fB;\fR
2847 .PP
2848 When the DHCP server is considering dynamically allocating an IP
2849 address to a client, it first sends an ICMP Echo request (a \fIping\fR)
2850 to the address being assigned. It waits for a second, and if no
2851 ICMP Echo response has been heard, it assigns the address. If a
2852 response \fIis\fR heard, the lease is abandoned, and the server does
2853 not respond to the client. The lease will remain abandoned for a minimum
2854 of abandon-lease-time seconds.
2855 .PP
2856 If a there are no free addressses but there are abandoned IP addresses, the
2857 DHCP server will attempt to reclaim an abandoned IP address regardless of the
2858 value of abandon-lease-time.
2859 .PP
2860 This \fIping check\fR introduces a default one-second delay in responding
2861 to DHCPDISCOVER messages, which can be a problem for some clients. The
2862 default delay of one second may be configured using the ping-timeout
2863 parameter. The ping-check configuration parameter can be used to control
2864 checking - if its value is false, no ping check is done.
2865 .RE
2866 .PP
2867 The
2868 .I ping-timeout
2869 statement
2870 .RS 0.25i
2871 .PP
2872 .B ping-timeout
2873 .I seconds\fR\fB;\fR
2874 .PP
2875 If the DHCP server determined it should send an ICMP echo request (a
2876 \fIping\fR) because the ping-check statement is true, ping-timeout allows
2877 you to configure how many seconds the DHCP server should wait for an
2878 ICMP Echo response to be heard, if no ICMP Echo response has been received
2879 before the timeout expires, it assigns the address. If a response \fIis\fR
2880 heard, the lease is abandoned, and the server does not respond to the client.
2881 If no value is set, ping-timeout defaults to 1 second.
2882 .RE
2883 .PP
2884 The
2885 .I preferred-lifetime
2886 statement
2887 .RS 0.25i
2888 .PP
2889 .B preferred-lifetime
2890 .I seconds\fR\fB;\fR
2891 .PP
2892 IPv6 addresses have \'valid\' and \'preferred\' lifetimes. The valid lifetime
2893 determines at what point at lease might be said to have expired, and is no
2894 longer useable. A preferred lifetime is an advisory condition to help
2895 applications move off of the address and onto currently valid addresses
2896 (should there still be any open TCP sockets or similar).
2897 .PP
2898 The preferred lifetime defaults to 5/8 the default lease time.
2899 .RE
2900 .PP
2901 The
2902 .I prefix-length-mode
2903 statement
2904 .RS 0.25i
2905 .PP
2906 .B prefix-length-mode
2907 .I mode\fR\fB;\fR
2908 .PP
2909 According to RFC 3633, DHCPv6 clients may specify preferences when soliciting
2910 prefixes by including an IA_PD Prefix option within the IA_PD option. Among
2911 the preferences that may be conveyed is the "prefix-length". When non-zero it
2912 indicates a client's desired length for offered prefixes. The RFC states that
2913 servers "MAY choose to use the information...to select prefix(es)" but does
2914 not specify any particular rules for doing so. The prefix-length-mode statement
2915 can be used to set the prefix selection rules employed by the server,
2916 when clients send a non-zero prefix-length value. The mode parameter must
2917 be one of \fBignore\fR, \fBprefer\fR, \fBexact\fR, \fBminimum\fR, or
2918 \fBmaximum\fR where:
2919 .PP
2920 1. ignore - The requested length is ignored. The server will offer the first
2921 available prefix.
2922 .PP
2923 2. prefer - The server will offer the first available prefix with the same
2924 length as the requested length. If none are found then it will offer the
2925 first available prefix of any length.
2926 .PP
2927 3. exact - The server will offer the first available prefix with the same
2928 length as the requested length. If none are found, it will return a status
2929 indicating no prefixes available. This is the default behavior.
2930 .PP
2931 4. minimum - The server will offer the first available prefix with the same
2932 length as the requested length. If none are found, it will return the first
2933 available prefix whose length is greater than (e.g. longer than), the
2934 requested value. If none of those are found, it will return a status
2935 indicating no prefixes available. For example, if client requests a length
2936 of /60, and the server has available prefixes of lengths /56 and /64, it will
2937 offer prefix of length /64.
2938 .PP
2939 5. maximum - The server will offer the first available prefix with the same
2940 length as the requested length. If none are found, it will return the first
2941 available prefix whose length is less than (e.g. shorter than), the
2942 requested value. If none of those are found, it will return a status
2943 indicating no prefixes available. For example, if client requests a length
2944 of /60, and the server has available prefixes of lengths /56 and /64, it will
2945 offer a prefix of length /56.
2946 .PP
2947 In general "first available" is determined by the order in which pools are
2948 defined in the server's configuration. For example, if a subnet is defined
2949 with three prefix pools A,B, and C:
2950 .PP
2951 .nf
2952 subnet 3000::/64 {
2953 # pool A
2954 pool6 {
2955 :
2956 }
2957 # pool B
2958 pool6 {
2959 :
2960 }
2961 # pool C
2962 pool6 {
2963 :
2964 }
2965 }
2966 .fi
2967 .PP
2968 then the pools will be checked in the order A, B, C. For modes \fBprefer\fR,
2969 \fBminimum\fR, and \fBmaximum\fR this may mean checking the pools in that order
2970 twice. A first pass through is made looking for an available prefix of exactly
2971 the preferred length. If none are found, then a second pass is performed
2972 starting with pool A but with appropriately adjusted length criteria.
2973 .RE
2974 .PP
2975 The
2976 .I remote-port
2977 statement
2978 .RS 0.25i
2979 .PP
2980 .B remote-port \fIport\fB;\fR
2981 .PP
2982 This statement causes the DHCP server to transmit DHCP responses to DHCP
2983 clients upon the UDP port specified in \fIport\fR, rather than on port 68.
2984 In the event that the UDP response is transmitted to a DHCP Relay, the
2985 server generally uses the \fBlocal-port\fR configuration value. Should the
2986 DHCP Relay happen to be addressed as 127.0.0.1, however, the DHCP Server
2987 transmits its response to the \fBremote-port\fR configuration value. This
2988 is generally only useful for testing purposes, and this configuration value
2989 should generally not be used.
2990 .RE
2991 .PP
2992 The
2993 .I server-identifier
2994 statement
2995 .RS 0.25i
2996 .PP
2997 .B server-identifier \fIhostname\fR\fB;\fR
2998 .PP
2999 The server-identifier statement can be used to define the value that
3000 is sent in the DHCP Server Identifier option for a given scope. The
3001 value specified \fBmust\fR be an IP address for the DHCP server, and
3002 must be reachable by all clients served by a particular scope.
3003 .PP
3004 The use of the server-identifier statement is not recommended - the only
3005 reason to use it is to force a value other than the default value to be
3006 sent on occasions where the default value would be incorrect. The default
3007 value is the first IP address associated with the physical network interface
3008 on which the request arrived.
3009 .PP
3010 The usual case where the
3011 \fIserver-identifier\fR statement needs to be sent is when a physical
3012 interface has more than one IP address, and the one being sent by default
3013 isn't appropriate for some or all clients served by that interface.
3014 Another common case is when an alias is defined for the purpose of
3015 having a consistent IP address for the DHCP server, and it is desired
3016 that the clients use this IP address when contacting the server.
3017 .PP
3018 Supplying a value for the dhcp-server-identifier option is equivalent
3019 to using the server-identifier statement.
3020 .RE
3021 .PP
3022 The
3023 .I server-id-check
3024 statement
3025 .RS 0.25i
3026 .PP
3027 .B server-id-check \fIflag\fR\fB;\fR
3028 .PP
3029 The server-id-check statement is used to control whether or not a server,
3030 participating in failover, verifies that the value of the
3031 dhcp-server-identifier option in received DHCP REQUESTs match the server's
3032 id before processing the request. Server id checking is disabled by default.
3033 Setting this flag enables id checking and thereafter the server will only
3034 process requests that match. Note the flag setting should be consistent
3035 between failover partners.
3036 .PP
3037 Unless overridden by use of the server-identifier statement, the value the
3038 server uses as its id will be the first IP address associated with the
3039 physical network interface on which the request arrived.
3040 .PP
3041 In order to reduce runtime overhead the server only checks for a server id
3042 option in the global and subnet scopes. Complicated configurations
3043 may result in different server ids for this check and when the server id for
3044 a reply packet is determined, which would prohibit the server from responding.
3045 .PP
3046 The primary use for this option is when a client broadcasts a request
3047 but requires that the response come from a specific failover peer.
3048 An example of this would be when a client reboots while its lease is still
3049 active - in this case both servers will normally respond. Most of the
3050 time the client won't check the server id and can use either of the responses.
3051 However if the client does check the server id it may reject the response
3052 if it came from the wrong peer. If the timing is such that the "wrong"
3053 peer responds first most of the time the client may not get an address for
3054 some time.
3055 .PP
3056 Care should be taken before enabling this option.
3057 .PP
3058 .RE
3059 .PP
3060 The
3061 .I server-duid
3062 statement
3063 .RS 0.25i
3064 .PP
3065 .B server-duid \fILLT\fR [ \fIhardware-type\fR \fItimestamp\fR \fIhardware-address\fR ] \fB;\fR
3066
3067 .B server-duid \fIEN\fR \fIenterprise-number\fR \fIenterprise-identifier\fR \fB;\fR
3068
3069 .B server-duid \fILL\fR [ \fIhardware-type\fR \fIhardware-address\fR ] \fB;\fR
3070 .PP
3071 The server-duid statement configures the server DUID. You may pick either
3072 LLT (link local address plus time), EN (enterprise), or LL (link local).
3073 .PP
3074 If you choose LLT or LL, you may specify the exact contents of the DUID.
3075 Otherwise the server will generate a DUID of the specified type.
3076 .PP
3077 If you choose EN, you must include the enterprise number and the
3078 enterprise-identifier.
3079 .PP
3080 If there is a server-duid statement in the lease file it will take precedence
3081 over the server-duid statement from the config file and a
3082 dhcp6.server-id option in the config file will override both.
3083 .PP
3084 The default server-duid type is LLT.
3085 .RE
3086 .PP
3087 The
3088 .I server-name
3089 statement
3090 .RS 0.25i
3091 .PP
3092 .B server-name "\fIname\fB";\fR
3093 .PP
3094 The \fIserver-name\fR statement can be used to inform the client of
3095 the name of the server from which it is booting. \fIName\fR should
3096 be the name that will be provided to the client.
3097 .RE
3098 .PP
3099 The
3100 .I dhcpv6-set-tee-times
3101 statement
3102 .RS 0.25i
3103 .PP
3104 .B dhcpv6-set-tee-times\fR \fIflag\fR\fB;\fR
3105 .PP
3106 The \fIdhcpv6-set-tee-times\fR statement enables setting T1 and T2 to the
3107 values recommended in RFC 3315 (Section 22.4). When setting T1 and T2, the
3108 server will use dhcp-renewal-time and dhcp-rebinding-time, respectively.
3109 A value of zero tells the client it may choose its own value.
3110
3111 When those options are not defined then values will be set to zero unless the
3112 global \fIdhcpv6-set-tee-times\R is enabled. When this option is enabled the
3113 times are calculated as recommended by RFC 3315, Section 22.4:
3114
3115 T1 will be set to 0.5 times the shortest preferred lifetime
3116 in the reply. If the "shortest" preferred lifetime is
3117 0xFFFFFFFF, T1 will set to 0xFFFFFFFF.
3118
3119 T2 will be set to 0.8 times the shortest preferred lifetime
3120 in the reply. If the "shortest" preferred lifetime is
3121 0xFFFFFFFF, T2 will set to 0xFFFFFFFF.
3122
3123 Keep in mind that given sufficiently small lease lifetimes, the above
3124 calculations will result in the two values being equal. For example, a 9 second
3125 lease lifetime would yield T1 = T2 = 4 seconds, which would cause clients to
3126 issue rebinds only. In such a case it would likely be better to explicitly
3127 define the values.
3128
3129 Note that dhcpv6-set-tee-times is intended to be transitional and will likely
3130 be removed in a future release. Once removed the behavior will be to use
3131 the configured values when present or calculate them per the RFC. If you want
3132 zeros, define them as zeros.
3133 .RE
3134 .PP
3135 The
3136 .I site-option-space
3137 statement
3138 .RS 0.25i
3139 .PP
3140 .B site-option-space "\fIname\fB";\fR
3141 .PP
3142 The \fIsite-option-space\fR statement can be used to determine from
3143 what option space site-local options will be taken. This can be used
3144 in much the same way as the \fIvendor-option-space\fR statement.
3145 Site-local options in DHCP are those options whose numeric codes are
3146 greater than 224. These options are intended for site-specific
3147 uses, but are frequently used by vendors of embedded hardware that
3148 contains DHCP clients. Because site-specific options are allocated
3149 on an ad hoc basis, it is quite possible that one vendor's DHCP client
3150 might use the same option code that another vendor's client uses, for
3151 different purposes. The \fIsite-option-space\fR option can be used
3152 to assign a different set of site-specific options for each such
3153 vendor, using conditional evaluation (see \fBdhcp-eval (5)\fR for
3154 details).
3155 .RE
3156 .PP
3157 The
3158 .I stash-agent-options
3159 statement
3160 .RS 0.25i
3161 .PP
3162 .B stash-agent-options \fIflag\fB;\fR
3163 .PP
3164 If the \fIstash-agent-options\fR parameter is true for a given client,
3165 the server will record the relay agent information options sent during
3166 the client's initial DHCPREQUEST message when the client was in the
3167 SELECTING state and behave as if those options are included in all
3168 subsequent DHCPREQUEST messages sent in the RENEWING state. This
3169 works around a problem with relay agent information options, which is
3170 that they usually not appear in DHCPREQUEST messages sent by the
3171 client in the RENEWING state, because such messages are unicast
3172 directly to the server and not sent through a relay agent.
3173 .RE
3174 .PP
3175 The
3176 .I update-conflict-detection
3177 statement
3178 .RS 0.25i
3179 .PP
3180 .B update-conflict-detection \fIflag\fB;\fR
3181 .PP
3182 If the \fIupdate-conflict-detection\fR parameter is true, the server will
3183 perform standard DHCID multiple-client, one-name conflict detection. If
3184 the parameter has been set false, the server will skip this check and
3185 instead simply tear down any previous bindings to install the new
3186 binding without question. The default is true.
3187 .RE
3188 .PP
3189 The
3190 .I update-optimization
3191 statement
3192 .RS 0.25i
3193 .PP
3194 .B update-optimization \fIflag\fB;\fR
3195 .PP
3196 If the \fIupdate-optimization\fR parameter is false for a given client,
3197 the server will attempt a DNS update for that client each time the
3198 client renews its lease, rather than only attempting an update when it
3199 appears to be necessary. This will allow the DNS to heal from
3200 database inconsistencies more easily, but the cost is that the DHCP
3201 server must do many more DNS updates. We recommend leaving this option
3202 enabled, which is the default. If this parameter is not specified,
3203 or is true, the DHCP server
3204 will only update when the client information changes, the client gets a
3205 different lease, or the client's lease expires.
3206 .RE
3207 .PP
3208 The
3209 .I update-static-leases
3210 statement
3211 .RS 0.25i
3212 .PP
3213 .B update-static-leases \fIflag\fB;\fR
3214 .PP
3215 The \fIupdate-static-leases\fR flag, if enabled, causes the DHCP
3216 server to do DNS updates for clients even if those clients are being
3217 assigned their IP address using a \fIfixed-address\fR statement - that
3218 is, the client is being given a static assignment. It is not
3219 recommended because the DHCP server has no way to tell that the update
3220 has been done, and therefore will not delete the record when it is not
3221 in use. Also, the server must attempt the update each time the
3222 client renews its lease, which could have a significant performance
3223 impact in environments that place heavy demands on the DHCP server.
3224 .RE
3225
3226
3227 .PP
3228 The
3229 .I use-eui-64
3230 statement
3231 .RS 0.25i
3232 .PP
3233 .B use-eui-64 \fIflag\fB;\fR
3234 .PP
3235
3236 (Support for this must be enabled at compile time, see EUI_64 in
3237 includes/site.h)
3238
3239 The \fIuse-eui-64\fR flag, if enabled, instructs the server to construct an
3240 address using the client's EUI-64 DUID (Type 3, HW Type EUI-64), rather than
3241 creating an address using the dynamic algorithm. This means that a given DUID
3242 will always generate the same address for a given pool and further that the
3243 address is guaranteed to be unique to that DUID. The IPv6 address will be
3244 calculated from the EUI-64 link layer address, conforming to RFC 2373, unless
3245 there is a host declaration for the client-id.
3246
3247 The range6 statement for EUI-64 must define full /64 bit ranges. Invalid ranges
3248 will be flagged during configuration parsing as errors. See the following
3249 example:
3250
3251 subnet6 fc00:e4::/64 {
3252 use-eui-64 true;
3253 range6 fc00:e4::/64;
3254 }
3255
3256 The statement may be specified down to the pool level, allowing a mixture of
3257 dynamic and EUI-64 based pools.
3258
3259 During lease file parsing, any leases which map to an EUI-64 pool, that have a
3260 non-EUI-64 DUID or for which the lease address is not the EUI-64 address for
3261 that DUID in that pool, will be discarded.
3262
3263 If a host declaration exists for the DUID, the server grants the address
3264 (fixed-prefix6, fixed-address6) according to the host declaration, regardless
3265 of the DUID type of the client (even for EUI-64 DUIDs).
3266
3267 If a client request's an EUI-64 lease for a given network, and the resultant
3268 address conflicts with a fixed address reservation, the server will send the
3269 client a "no addresses available" response.
3270
3271 Any client with a non-conforming DUID (not type 3 or not hw type EUI-64) that
3272 is not linked to a host declaration, which requests an address from an EUI-64
3273 enabled pool will be ignored and the event will be logged.
3274
3275 Pools that are configured for EUI-64 will be skipped for dynamic allocation.
3276 If there are no pools in the shared network from which to allocate, the client
3277 will get back a no addresses available status.
3278
3279 On an EUI-64 enabled pool, any client with a DUID 3, HW Type EUI-64, requesting
3280 a solicit/renew and including IA_NA that do not match the EUI-64 policy, they
3281 will be treated as though they are "outside" the subnet for a given client
3282 message:
3283
3284 Solicit - Server will advertise with EUI-64 ia suboption, but with rapid
3285 commit off
3286 Request - Server will send "an address not on link status", and no ia
3287 suboption Renew/Rebind - Server will send the requested address ia
3288 suboption with lifetimes of 0, plus an EUI-64 ia
3289 .RE
3290 .PP
3291 The
3292 .I use-host-decl-names
3293 statement
3294 .RS 0.25i
3295 .PP
3296 .B use-host-decl-names \fIflag\fB;\fR
3297 .PP
3298 If the \fIuse-host-decl-names\fR parameter is true in a given scope,
3299 then for every host declaration within that scope, the name provided
3300 for the host declaration will be supplied to the client as its
3301 hostname. So, for example,
3302 .PP
3303 .nf
3304 group {
3305 use-host-decl-names on;
3306
3307 host joe {
3308 hardware ethernet 08:00:2b:4c:29:32;
3309 fixed-address joe.example.com;
3310 }
3311 }
3312
3313 is equivalent to
3314
3315 host joe {
3316 hardware ethernet 08:00:2b:4c:29:32;
3317 fixed-address joe.example.com;
3318 option host-name "joe";
3319 }
3320 .fi
3321 .PP
3322 Additionally, enabling use-host-decl-names instructs the server to use
3323 the host declaration name in the the forward DNS name, if no other values
3324 are available. This value selection process is discussed in more detail
3325 under DNS updates.
3326 .PP
3327 An \fIoption host-name\fR statement within a host declaration will
3328 override the use of the name in the host declaration.
3329 .PP
3330 It should be noted here that most DHCP clients completely ignore the
3331 host-name option sent by the DHCP server, and there is no way to
3332 configure them not to do this. So you generally have a choice of
3333 either not having any hostname to client IP address mapping that the
3334 client will recognize, or doing DNS updates. It is beyond
3335 the scope of this document to describe how to make this
3336 determination.
3337 .RE
3338 .PP
3339 The
3340 .I use-lease-addr-for-default-route
3341 statement
3342 .RS 0.25i
3343 .PP
3344 .B use-lease-addr-for-default-route \fIflag\fR\fB;\fR
3345 .PP
3346 If the \fIuse-lease-addr-for-default-route\fR parameter is true in a
3347 given scope, then instead of sending the value specified in the
3348 routers option (or sending no value at all), the IP address of the
3349 lease being assigned is sent to the client. This supposedly causes
3350 Win95 machines to ARP for all IP addresses, which can be helpful if
3351 your router is configured for proxy ARP. The use of this feature is
3352 not recommended, because it won't work for many DHCP clients.
3353 .RE
3354 .PP
3355 The
3356 .I vendor-option-space
3357 statement
3358 .RS 0.25i
3359 .PP
3360 .B vendor-option-space \fIstring\fR\fB;\fR
3361 .PP
3362 The \fIvendor-option-space\fR parameter determines from what option
3363 space vendor options are taken. The use of this configuration
3364 parameter is illustrated in the \fBdhcp-options(5)\fR manual page, in
3365 the \fIVENDOR ENCAPSULATED OPTIONS\fR section.
3366 .RE
3367 .SH SETTING PARAMETER VALUES USING EXPRESSIONS
3368 Sometimes it's helpful to be able to set the value of a DHCP server
3369 parameter based on some value that the client has sent. To do this,
3370 you can use expression evaluation. The
3371 .B dhcp-eval(5)
3372 manual page describes how to write expressions. To assign the result
3373 of an evaluation to an option, define the option as follows:
3374 .nf
3375 .sp 1
3376 \fImy-parameter \fB= \fIexpression \fB;\fR
3377 .fi
3378 .PP
3379 For example:
3380 .nf
3381 .sp 1
3382 ddns-hostname = binary-to-ascii (16, 8, "-",
3383 substring (hardware, 1, 6));
3384 .fi
3385 .RE
3386 .SH RESERVED LEASES
3387 It's often useful to allocate a single address to a single client, in
3388 approximate perpetuity. Host statements with \fBfixed-address\fR clauses
3389 exist to a certain extent to serve this purpose, but because host statements
3390 are intended to approximate \'static configuration\', they suffer from not
3391 being referenced in a littany of other Server Services, such as dynamic DNS,
3392 failover, \'on events\' and so forth.
3393 .PP
3394 If a standard dynamic lease, as from any range statement, is marked
3395 \'reserved\', then the server will only allocate this lease to the client it
3396 is identified by (be that by client identifier or hardware address).
3397 .PP
3398 In practice, this means that the lease follows the normal state engine, enters
3399 ACTIVE state when the client is bound to it, expires, or is released, and any
3400 events or services that would normally be supplied during these events are
3401 processed normally, as with any other dynamic lease. The only difference
3402 is that failover servers treat reserved leases as special when they enter
3403 the FREE or BACKUP states - each server applies the lease into the state it
3404 may allocate from - and the leases are not placed on the queue for allocation
3405 to other clients. Instead they may only be \'found\' by client identity. The
3406 result is that the lease is only offered to the returning client.
3407 .PP
3408 Care should probably be taken to ensure that the client only has one lease
3409 within a given subnet that it is identified by.
3410 .PP
3411 Leases may be set \'reserved\' either through OMAPI, or through the
3412 \'infinite-is-reserved\' configuration option (if this is applicable to your
3413 environment and mixture of clients).
3414 .PP
3415 It should also be noted that leases marked \'reserved\' are effectively treated
3416 the same as leases marked \'bootp\'.
3417 .RE
3418 .SH REFERENCE: OPTION STATEMENTS
3419 DHCP option statements are documented in the
3420 .B dhcp-options(5)
3421 manual page.
3422 .SH REFERENCE: EXPRESSIONS
3423 Expressions used in DHCP option statements and elsewhere are
3424 documented in the
3425 .B dhcp-eval(5)
3426 manual page.
3427 .SH SEE ALSO
3428 dhcpd(8), dhcpd.leases(5), dhcp-options(5), dhcp-eval(5), RFC2132, RFC2131.
3429 .SH AUTHOR
3430 .B dhcpd.conf(5)
3431 is maintained by ISC.
3432 Information about Internet Systems Consortium can be found at
3433 .B https://www.isc.org.