]> git.ipfire.org Git - thirdparty/dhcp.git/blob - server/dhcpd.conf.5
Finished merge of t39262 (DHCP build from another directory)
[thirdparty/dhcp.git] / server / dhcpd.conf.5
1 .\" dhcpd.conf.5
2 .\"
3 .\" Copyright (c) 2004-2015 by Internet Systems Consortium, Inc. ("ISC")
4 .\" Copyright (c) 1996-2003 by Internet Software Consortium
5 .\"
6 .\" Permission to use, copy, modify, and distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
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. In this case, the DHCP server will never do
350 dynamic address allocation. In this case, the client is \fIrequired\fR
351 to take the address specified in the host declaration. If the
352 client sends a DHCPREQUEST for some other address, the server will respond
353 with a DHCPNAK.
354 .PP
355 When the DHCP server allocates a new address for a client (remember,
356 this only happens if the client has sent a DHCPDISCOVER), it first
357 looks to see if the client already has a valid lease on an IP address,
358 or if there is an old IP address the client had before that hasn't yet
359 been reassigned. In that case, the server will take that address and
360 check it to see if the client is still permitted to use it. If the
361 client is no longer permitted to use it, the lease is freed if the
362 server thought it was still in use - the fact that the client has sent
363 a DHCPDISCOVER proves to the server that the client is no longer using
364 the lease.
365 .PP
366 If no existing lease is found, or if the client is forbidden to
367 receive the existing lease, then the server will look in the list of
368 address pools for the network segment to which the client is attached
369 for a lease that is not in use and that the client is permitted to
370 have. It looks through each pool declaration in sequence (all
371 .I range
372 declarations that appear outside of pool declarations are grouped into
373 a single pool with no permit list). If the permit list for the pool
374 allows the client to be allocated an address from that pool, the pool
375 is examined to see if there is an address available. If so, then the
376 client is tentatively assigned that address. Otherwise, the next
377 pool is tested. If no addresses are found that can be assigned to
378 the client, no response is sent to the client.
379 .PP
380 If an address is found that the client is permitted to have, and that
381 has never been assigned to any client before, the address is
382 immediately allocated to the client. If the address is available for
383 allocation but has been previously assigned to a different client, the
384 server will keep looking in hopes of finding an address that has never
385 before been assigned to a client.
386 .PP
387 The DHCP server generates the list of available IP addresses from a
388 hash table. This means that the addresses are not sorted in any
389 particular order, and so it is not possible to predict the order in
390 which the DHCP server will allocate IP addresses. Users of previous
391 versions of the ISC DHCP server may have become accustomed to the DHCP
392 server allocating IP addresses in ascending order, but this is no
393 longer possible, and there is no way to configure this behavior with
394 version 3 of the ISC DHCP server.
395 .SH IP ADDRESS CONFLICT PREVENTION
396 The DHCP server checks IP addresses to see if they are in use before
397 allocating them to clients. It does this by sending an ICMP Echo
398 request message to the IP address being allocated. If no ICMP Echo
399 reply is received within a second, the address is assumed to be free.
400 This is only done for leases that have been specified in range
401 statements, and only when the lease is thought by the DHCP server to
402 be free - i.e., the DHCP server or its failover peer has not listed
403 the lease as in use.
404 .PP
405 If a response is received to an ICMP Echo request, the DHCP server
406 assumes that there is a configuration error - the IP address is in use
407 by some host on the network that is not a DHCP client. It marks the
408 address as abandoned, and will not assign it to clients.
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.vix.com;
544 port 519;
545 peer address trantor.rc.vix.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 .RE
753 .PP
754 The
755 .I auto-partner-down
756 statement
757 .RS 0.25i
758 .PP
759 .B auto-partner-down \fIseconds\fR\fB;\fR
760 .PP
761 This statement instructs the server to initiate a timed delay upon entering
762 the communications-interrupted state (any situation of being out-of-contact
763 with the remote failover peer). At the conclusion of the timer, the server
764 will automatically enter the partner-down state. This permits the server
765 to allocate leases from the partner's free lease pool after an STOS+MCLT
766 timer expires, which can be dangerous if the partner is in fact operating
767 at the time (the two servers will give conflicting bindings).
768 .PP
769 Think very carefully before enabling this feature. The partner-down and
770 communications-interrupted states are intentionally segregated because
771 there do exist situations where a failover server can fail to communicate
772 with its peer, but still has the ability to receive and reply to requests
773 from DHCP clients. In general, this feature should only be used in those
774 deployments where the failover servers are directly connected to one
775 another, such as by a dedicated hardwired link ("a heartbeat cable").
776 .PP
777 A zero value disables the auto-partner-down feature (also the default), and
778 any positive value indicates the time in seconds to wait before automatically
779 entering partner-down.
780 .RE
781 .PP
782 The Failover pool balance statements.
783 .RS 0.25i
784 .PP
785 \fBmax-lease-misbalance \fIpercentage\fR\fB;\fR
786 \fBmax-lease-ownership \fIpercentage\fR\fB;\fR
787 \fBmin-balance \fIseconds\fR\fB;\fR
788 \fBmax-balance \fIseconds\fR\fB;\fR
789 .PP
790 This version of the DHCP Server evaluates pool balance on a schedule,
791 rather than on demand as leases are allocated. The latter approach
792 proved to be slightly klunky when pool misbalanced reach total
793 saturation \(em when any server ran out of leases to assign, it also lost
794 its ability to notice it had run dry.
795 .PP
796 In order to understand pool balance, some elements of its operation
797 first need to be defined. First, there are \'free\' and \'backup\' leases.
798 Both of these are referred to as \'free state leases\'. \'free\' and
799 \'backup\'
800 are \'the free states\' for the purpose of this document. The difference
801 is that only the primary may allocate from \'free\' leases unless under
802 special circumstances, and only the secondary may allocate \'backup\' leases.
803 .PP
804 When pool balance is performed, the only plausible expectation is to
805 provide a 50/50 split of the free state leases between the two servers.
806 This is because no one can predict which server will fail, regardless
807 of the relative load placed upon the two servers, so giving each server
808 half the leases gives both servers the same amount of \'failure endurance\'.
809 Therefore, there is no way to configure any different behaviour, outside of
810 some very small windows we will describe shortly.
811 .PP
812 The first thing calculated on any pool balance run is a value referred to
813 as \'lts\', or "Leases To Send". This, simply, is the difference in the
814 count of free and backup leases, divided by two. For the secondary,
815 it is the difference in the backup and free leases, divided by two.
816 The resulting value is signed: if it is positive, the local server is
817 expected to hand out leases to retain a 50/50 balance. If it is negative,
818 the remote server would need to send leases to balance the pool. Once
819 the lts value reaches zero, the pool is perfectly balanced (give or take
820 one lease in the case of an odd number of total free state leases).
821 .PP
822 The current approach is still something of a hybrid of the old approach,
823 marked by the presence of the \fBmax-lease-misbalance\fR statement. This
824 parameter configures what used to be a 10% fixed value in previous versions:
825 if lts is less than free+backup * \fBmax-lease-misbalance\fR percent, then
826 the server will skip balancing a given pool (it won't bother moving any
827 leases, even if some leases "should" be moved). The meaning of this value
828 is also somewhat overloaded, however, in that it also governs the estimation
829 of when to attempt to balance the pool (which may then also be skipped over).
830 The oldest leases in the free and backup states are examined. The time
831 they have resided in their respective queues is used as an estimate to
832 indicate how much time it is probable it would take before the leases at
833 the top of the list would be consumed (and thus, how long it would take
834 to use all leases in that state). This percentage is directly multiplied
835 by this time, and fit into the schedule if it falls within
836 the \fBmin-balance\fR and \fBmax-balance\fR configured values. The
837 scheduled pool check time is only moved in a downwards direction, it is
838 never increased. Lastly, if the lts is more than double this number in
839 the negative direction, the local server will \'panic\' and transmit a
840 Failover protocol POOLREQ message, in the hopes that the remote system
841 will be woken up into action.
842 .PP
843 Once the lts value exceeds the \fBmax-lease-misbalance\fR percentage of
844 total free state leases as described above, leases are moved to the remote
845 server. This is done in two passes.
846 .PP
847 In the first pass, only leases whose most recent bound client would have
848 been served by the remote server - according to the Load Balance Algorithm
849 (see above \fBsplit\fR and \fBhba\fR configuration statements) - are given
850 away to the peer. This first pass will happily continue to give away leases,
851 decrementing the lts value by one for each, until the lts value has reached
852 the negative of the total number of leases multiplied by
853 the \fBmax-lease-ownership\fR percentage. So it is through this value that
854 you can permit a small misbalance of the lease pools - for the purpose of
855 giving the peer more than a 50/50 share of leases in the hopes that their
856 clients might some day return and be allocated by the peer (operating
857 normally). This process is referred to as \'MAC Address Affinity\', but this
858 is somewhat misnamed: it applies equally to DHCP Client Identifier options.
859 Note also that affinity is applied to leases when they enter the state
860 \'free\' from \'expired\' or \'released\'. In this case also, leases will not
861 be moved from free to backup if the secondary already has more than its
862 share.
863 .PP
864 The second pass is only entered into if the first pass fails to reduce
865 the lts underneath the total number of free state leases multiplied by
866 the \fBmax-lease-ownership\fR percentage. In this pass, the oldest
867 leases are given over to the peer without second thought about the Load
868 Balance Algorithm, and this continues until the lts falls under this
869 value. In this way, the local server will also happily keep a small
870 percentage of the leases that would normally load balance to itself.
871 .PP
872 So, the \fBmax-lease-misbalance\fR value acts as a behavioural gate.
873 Smaller values will cause more leases to transition states to balance
874 the pools over time, higher values will decrease the amount of change
875 (but may lead to pool starvation if there's a run on leases).
876 .PP
877 The \fBmax-lease-ownership\fR value permits a small (percentage) skew
878 in the lease balance of a percentage of the total number of free state
879 leases.
880 .PP
881 Finally, the \fBmin-balance\fR and \fBmax-balance\fR make certain that a
882 scheduled rebalance event happens within a reasonable timeframe (not
883 to be thrown off by, for example, a 7 year old free lease).
884 .PP
885 Plausible values for the percentages lie between 0 and 100, inclusive, but
886 values over 50 are indistinguishable from one another (once lts exceeds
887 50% of the free state leases, one server must therefore have 100% of the
888 leases in its respective free state). It is recommended to select
889 a \fBmax-lease-ownership\fR value that is lower than the value selected
890 for the \fBmax-lease-misbalance\fR value. \fBmax-lease-ownership\fR
891 defaults to 10, and \fBmax-lease-misbalance\fR defaults to 15.
892 .PP
893 Plausible values for the \fBmin-balance\fR and \fBmax-balance\fR times also
894 range from 0 to (2^32)-1 (or the limit of your local time_t value), but
895 default to values 60 and 3600 respectively (to place balance events between
896 1 minute and 1 hour).
897 .RE
898 .SH CLIENT CLASSING
899 Clients can be separated into classes, and treated differently
900 depending on what class they are in. This separation can be done
901 either with a conditional statement, or with a match statement within
902 the class declaration. It is possible to specify a limit on the
903 total number of clients within a particular class or subclass that may
904 hold leases at one time, and it is possible to specify automatic
905 subclassing based on the contents of the client packet.
906 .PP
907 Classing support for DHCPv6 clients was addded in 4.3.0. It follows
908 the same rules as for DHCPv4 except that support for billing classes
909 has not been added yet.
910 .PP
911 To add clients to classes based on conditional evaluation, you can
912 specify a matching expression in the class statement:
913 .PP
914 .nf
915 class "ras-clients" {
916 match if substring (option dhcp-client-identifier, 1, 3) = "RAS";
917 }
918 .fi
919 .PP
920 Note that whether you use matching expressions or add statements (or
921 both) to classify clients, you must always write a class declaration
922 for any class that you use. If there will be no match statement and
923 no in-scope statements for a class, the declaration should look like
924 this:
925 .PP
926 .nf
927 class "ras-clients" {
928 }
929 .fi
930 .SH SUBCLASSES
931 .PP
932 In addition to classes, it is possible to declare subclasses. A
933 subclass is a class with the same name as a regular class, but with a
934 specific submatch expression which is hashed for quick matching.
935 This is essentially a speed hack - the main difference between five
936 classes with match expressions and one class with five subclasses is
937 that it will be quicker to find the subclasses. Subclasses work as
938 follows:
939 .PP
940 .nf
941 class "allocation-class-1" {
942 match pick-first-value (option dhcp-client-identifier, hardware);
943 }
944
945 class "allocation-class-2" {
946 match pick-first-value (option dhcp-client-identifier, hardware);
947 }
948
949 subclass "allocation-class-1" 1:8:0:2b:4c:39:ad;
950 subclass "allocation-class-2" 1:8:0:2b:a9:cc:e3;
951 subclass "allocation-class-1" 1:0:0:c4:aa:29:44;
952
953 subnet 10.0.0.0 netmask 255.255.255.0 {
954 pool {
955 allow members of "allocation-class-1";
956 range 10.0.0.11 10.0.0.50;
957 }
958 pool {
959 allow members of "allocation-class-2";
960 range 10.0.0.51 10.0.0.100;
961 }
962 }
963 .fi
964 .PP
965 The data following the class name in the subclass declaration is a
966 constant value to use in matching the match expression for the class.
967 When class matching is done, the server will evaluate the match
968 expression and then look the result up in the hash table. If it
969 finds a match, the client is considered a member of both the class and
970 the subclass.
971 .PP
972 Subclasses can be declared with or without scope. In the above
973 example, the sole purpose of the subclass is to allow some clients
974 access to one address pool, while other clients are given access to
975 the other pool, so these subclasses are declared without scopes. If
976 part of the purpose of the subclass were to define different parameter
977 values for some clients, you might want to declare some subclasses
978 with scopes.
979 .PP
980 In the above example, if you had a single client that needed some
981 configuration parameters, while most didn't, you might write the
982 following subclass declaration for that client:
983 .PP
984 .nf
985 subclass "allocation-class-2" 1:08:00:2b:a1:11:31 {
986 option root-path "samsara:/var/diskless/alphapc";
987 filename "/tftpboot/netbsd.alphapc-diskless";
988 }
989 .fi
990 .PP
991 In this example, we've used subclassing as a way to control address
992 allocation on a per-client basis. However, it's also possible to use
993 subclassing in ways that are not specific to clients - for example, to
994 use the value of the vendor-class-identifier option to determine what
995 values to send in the vendor-encapsulated-options option. An example
996 of this is shown under the VENDOR ENCAPSULATED OPTIONS head in the
997 .B dhcp-options(5)
998 manual page.
999 .SH PER-CLASS LIMITS ON DYNAMIC ADDRESS ALLOCATION
1000 .PP
1001 You may specify a limit to the number of clients in a class that can
1002 be assigned leases. The effect of this will be to make it difficult
1003 for a new client in a class to get an address. Once a class with
1004 such a limit has reached its limit, the only way a new client in that
1005 class can get a lease is for an existing client to relinquish its
1006 lease, either by letting it expire, or by sending a DHCPRELEASE
1007 packet. Classes with lease limits are specified as follows:
1008 .PP
1009 .nf
1010 class "limited-1" {
1011 lease limit 4;
1012 }
1013 .fi
1014 .PP
1015 This will produce a class in which a maximum of four members may hold
1016 a lease at one time.
1017 .SH SPAWNING CLASSES
1018 .PP
1019 It is possible to declare a
1020 .I spawning class\fR.
1021 A spawning class is a class that automatically produces subclasses
1022 based on what the client sends. The reason that spawning classes
1023 were created was to make it possible to create lease-limited classes
1024 on the fly. The envisioned application is a cable-modem environment
1025 where the ISP wishes to provide clients at a particular site with more
1026 than one IP address, but does not wish to provide such clients with
1027 their own subnet, nor give them an unlimited number of IP addresses
1028 from the network segment to which they are connected.
1029 .PP
1030 Many cable modem head-end systems can be configured to add a Relay
1031 Agent Information option to DHCP packets when relaying them to the
1032 DHCP server. These systems typically add a circuit ID or remote ID
1033 option that uniquely identifies the customer site. To take advantage
1034 of this, you can write a class declaration as follows:
1035 .PP
1036 .nf
1037 class "customer" {
1038 spawn with option agent.circuit-id;
1039 lease limit 4;
1040 }
1041 .fi
1042 .PP
1043 Now whenever a request comes in from a customer site, the circuit ID
1044 option will be checked against the class\'s hash table. If a subclass
1045 is found that matches the circuit ID, the client will be classified in
1046 that subclass and treated accordingly. If no subclass is found
1047 matching the circuit ID, a new one will be created and logged in the
1048 .B dhcpd.leases
1049 file, and the client will be classified in this new class. Once the
1050 client has been classified, it will be treated according to the rules
1051 of the class, including, in this case, being subject to the per-site
1052 limit of four leases.
1053 .PP
1054 The use of the subclass spawning mechanism is not restricted to relay
1055 agent options - this particular example is given only because it is a
1056 fairly straightforward one.
1057 .SH COMBINING MATCH, MATCH IF AND SPAWN WITH
1058 .PP
1059 In some cases, it may be useful to use one expression to assign a
1060 client to a particular class, and a second expression to put it into a
1061 subclass of that class. This can be done by combining the \fBmatch
1062 if\fR and \fBspawn with\fR statements, or the \fBmatch if\fR and
1063 \fBmatch\fR statements. For example:
1064 .PP
1065 .nf
1066 class "jr-cable-modems" {
1067 match if option dhcp-vendor-identifier = "jrcm";
1068 spawn with option agent.circuit-id;
1069 lease limit 4;
1070 }
1071
1072 class "dv-dsl-modems" {
1073 match if option dhcp-vendor-identifier = "dvdsl";
1074 spawn with option agent.circuit-id;
1075 lease limit 16;
1076 }
1077 .fi
1078 .PP
1079 This allows you to have two classes that both have the same \fBspawn
1080 with\fR expression without getting the clients in the two classes
1081 confused with each other.
1082 .SH DYNAMIC DNS UPDATES
1083 .PP
1084 The DHCP server has the ability to dynamically update the Domain Name
1085 System. Within the configuration files, you can define how you want
1086 the Domain Name System to be updated. These updates are RFC 2136
1087 compliant so any DNS server supporting RFC 2136 should be able to
1088 accept updates from the DHCP server.
1089 .PP
1090 There are two DNS schemes implemented. The interim option is
1091 based on draft revisions of the DDNS documents while the standard
1092 option is based on the RFCs for DHCP-DNS interaction and DHCIDs.
1093 A third option, ad-hoc, was deprecated and has now been removed
1094 from the code base. The DHCP server must be configured to use
1095 one of the two currently-supported methods, or not to do DNS updates.
1096 .PP
1097 New installations should use the standard option. Older
1098 installations may want to continue using the interim option for
1099 backwards compatibility with the DNS database until the database
1100 can be updated. This can be done with the
1101 .I ddns-update-style
1102 configuration parameter.
1103 .SH THE DNS UPDATE SCHEME
1104 the interim and standard DNS update schemes operate mostly according
1105 to work from the IETF. The interim version was based on the drafts
1106 in progress at the time while the standard is based on the completed
1107 RFCs. The standard RFCs are:
1108 .PP
1109 .nf
1110 .ce 3
1111 RFC 4701 (updated by RF5494)
1112 RFC 4702
1113 RFC 4703
1114 .fi
1115 .PP
1116 And the corresponding drafts were:
1117 .PP
1118 .nf
1119 .ce 3
1120 draft-ietf-dnsext-dhcid-rr-??.txt
1121 draft-ietf-dhc-fqdn-option-??.txt
1122 draft-ietf-dhc-ddns-resolution-??.txt
1123 .fi
1124 .PP
1125 The basic framework for the two schemes is similar with the main
1126 material difference being that a DHCID RR is used in the standard
1127 version while the interim versions uses a TXT RR. The format
1128 of the TXT record bears a resemblance to the DHCID RR but it is not
1129 equivalent (MD5 vs SHA2, field length differences etc).
1130 .PP
1131 In these two schemes the DHCP server does not necessarily
1132 always update both the A and the PTR records. The FQDN option
1133 includes a flag which, when sent by the client, indicates that the
1134 client wishes to update its own A record. In that case, the server
1135 can be configured either to honor the client\'s intentions or ignore
1136 them. This is done with the statement \fIallow client-updates;\fR or
1137 the statement \fIignore client-updates;\fR. By default, client
1138 updates are allowed.
1139 .PP
1140 If the server is configured to allow client updates, then if the
1141 client sends a fully-qualified domain name in the FQDN option, the
1142 server will use that name the client sent in the FQDN option to update
1143 the PTR record. For example, let us say that the client is a visitor
1144 from the "radish.org" domain, whose hostname is "jschmoe". The
1145 server is for the "example.org" domain. The DHCP client indicates in
1146 the FQDN option that its FQDN is "jschmoe.radish.org.". It also
1147 indicates that it wants to update its own A record. The DHCP server
1148 therefore does not attempt to set up an A record for the client, but
1149 does set up a PTR record for the IP address that it assigns the
1150 client, pointing at jschmoe.radish.org. Once the DHCP client has an
1151 IP address, it can update its own A record, assuming that the
1152 "radish.org" DNS server will allow it to do so.
1153 .PP
1154 If the server is configured not to allow client updates, or if the
1155 client doesn\'t want to do its own update, the server will simply
1156 choose a name for the client. By default, the server will choose
1157 from the following three values:
1158 .PP
1159 1. \fBfqdn\fR option (if present)
1160 2. hostname option (if present)
1161 3. Configured hostname option (if defined).
1162 .PP
1163 If these defaults for choosing the host name are not appropriate
1164 you can write your own statement to set the ddns-hostname variable
1165 as you wish. If none of the above are found the server will use
1166 the host declaration name (if one) and use-host-decl-names is on.
1167 .PP
1168 It will use its own domain name for the client. It will then update
1169 both the A and PTR record, using the name that it chose for the client.
1170 If the client sends a fully-qualified domain name in the \fBfqdn\fR option,
1171 the server uses only the leftmost part of the domain name - in the example
1172 above, "jschmoe" instead of "jschmoe.radish.org".
1173 .PP
1174 Further, if the \fIignore client-updates;\fR directive is used, then
1175 the server will in addition send a response in the DHCP packet, using
1176 the FQDN Option, that implies to the client that it should perform its
1177 own updates if it chooses to do so. With \fIdeny client-updates;\fR, a
1178 response is sent which indicates the client may not perform updates.
1179 .PP
1180 Both the standard and interim options also include a method to
1181 allow more than one DHCP server to update the DNS database without
1182 accidentally deleting A records that shouldn\'t be deleted nor failing
1183 to add A records that should be added. For the standard option the
1184 method works as follows:
1185 .PP
1186 When the DHCP server issues a client a new lease, it creates a text
1187 string that is an SHA hash over the DHCP client\'s identification (see
1188 RFCs 4701 & 4702 for details). The update attempts to add an A
1189 record with the name the server chose and a DHCID record containing the
1190 hashed identifier string (hashid). If this update succeeds, the
1191 server is done.
1192 .PP
1193 If the update fails because the A record already exists, then the DHCP
1194 server attempts to add the A record with the prerequisite that there
1195 must be a DHCID record in the same name as the new A record, and that
1196 DHCID record\'s contents must be equal to hashid. If this update
1197 succeeds, then the client has its A record and PTR record. If it
1198 fails, then the name the client has been assigned (or requested) is in
1199 use, and can\'t be used by the client. At this point the DHCP server
1200 gives up trying to do a DNS update for the client until the client
1201 chooses a new name.
1202 .PP
1203 The server also does not update very aggressively. Because each
1204 DNS update involves a round trip to the DNS server, there is a cost
1205 associated with doing updates even if they do not actually modify
1206 the DNS database. So the DHCP server tracks whether or not it has
1207 updated the record in the past (this information is stored on the
1208 lease) and does not attempt to update records that it
1209 thinks it has already updated.
1210 .PP
1211 This can lead to cases where the DHCP server adds a record, and then
1212 the record is deleted through some other mechanism, but the server
1213 never again updates the DNS because it thinks the data is already
1214 there. In this case the data can be removed from the lease through
1215 operator intervention, and once this has been done, the DNS will be
1216 updated the next time the client renews.
1217 .PP
1218 The interim DNS update scheme was written before the RFCs were finalized
1219 and does not quite follow them. The RFCs call for a new DHCID RRtype
1220 while the interim DNS update scheme uses a TXT record. In addition
1221 the ddns-resolution draft called for the DHCP server to put a DHCID RR
1222 on the PTR record, but the \fIinterim\fR update method does not do this.
1223 In the final RFC this requirement was relaxed such that a server may
1224 add a DHCID RR to the PTR record.
1225 .PP
1226 .SH DYNAMIC DNS UPDATE SECURITY
1227 .PP
1228 When you set your DNS server up to allow updates from the DHCP server,
1229 you may be exposing it to unauthorized updates. To avoid this, you
1230 should use TSIG signatures - a method of cryptographically signing
1231 updates using a shared secret key. As long as you protect the
1232 secrecy of this key, your updates should also be secure. Note,
1233 however, that the DHCP protocol itself provides no security, and that
1234 clients can therefore provide information to the DHCP server which the
1235 DHCP server will then use in its updates, with the constraints
1236 described previously.
1237 .PP
1238 The DNS server must be configured to allow updates for any zone that
1239 the DHCP server will be updating. For example, let us say that
1240 clients in the sneedville.edu domain will be assigned addresses on the
1241 10.10.17.0/24 subnet. In that case, you will need a key declaration
1242 for the TSIG key you will be using, and also two zone declarations -
1243 one for the zone containing A records that will be updates and one for
1244 the zone containing PTR records - for ISC BIND, something like this:
1245 .PP
1246 .nf
1247 key DHCP_UPDATER {
1248 algorithm HMAC-MD5.SIG-ALG.REG.INT;
1249 secret pRP5FapFoJ95JEL06sv4PQ==;
1250 };
1251
1252 zone "example.org" {
1253 type master;
1254 file "example.org.db";
1255 allow-update { key DHCP_UPDATER; };
1256 };
1257
1258 zone "17.10.10.in-addr.arpa" {
1259 type master;
1260 file "10.10.17.db";
1261 allow-update { key DHCP_UPDATER; };
1262 };
1263 .fi
1264 .PP
1265 You will also have to configure your DHCP server to do updates to
1266 these zones. To do so, you need to add something like this to your
1267 dhcpd.conf file:
1268 .PP
1269 .nf
1270 key DHCP_UPDATER {
1271 algorithm HMAC-MD5.SIG-ALG.REG.INT;
1272 secret pRP5FapFoJ95JEL06sv4PQ==;
1273 };
1274
1275 zone EXAMPLE.ORG. {
1276 primary 127.0.0.1;
1277 key DHCP_UPDATER;
1278 }
1279
1280 zone 17.127.10.in-addr.arpa. {
1281 primary 127.0.0.1;
1282 key DHCP_UPDATER;
1283 }
1284 .fi
1285 .PP
1286 The \fIprimary\fR statement specifies the IP address of the name
1287 server whose zone information is to be updated. In addition to
1288 the \fIprimary\fR statement there are also the \fIprimary6\fR ,
1289 \fIsecondary\fR and \fIsecondary6\fR statements. The \fIprimary6\fR
1290 statement specifies an IPv6 address for the name server. The
1291 secondaries provide for additional addresses for name servers
1292 to be used if the primary does not respond. The number of name
1293 servers the DDNS code will attempt to use before giving up
1294 is limited and is currently set to three.
1295 .PP
1296 Note that the zone declarations have to correspond to authority
1297 records in your name server - in the above example, there must be an
1298 SOA record for "example.org." and for "17.10.10.in-addr.arpa.". For
1299 example, if there were a subdomain "foo.example.org" with no separate
1300 SOA, you could not write a zone declaration for "foo.example.org."
1301 Also keep in mind that zone names in your DHCP configuration should end in a
1302 "."; this is the preferred syntax. If you do not end your zone name in a
1303 ".", the DHCP server will figure it out. Also note that in the DHCP
1304 configuration, zone names are not encapsulated in quotes where there are in
1305 the DNS configuration.
1306 .PP
1307 You should choose your own secret key, of course. The ISC BIND 9
1308 distribution comes with a program for generating secret keys called
1309 dnssec-keygen. If you are using BIND 9\'s
1310 dnssec-keygen, the above key would be created as follows:
1311 .PP
1312 .nf
1313 dnssec-keygen -a HMAC-MD5 -b 128 -n USER DHCP_UPDATER
1314 .fi
1315 .PP
1316 The key name, algorithm, and secret must match that being used by the DNS
1317 server. The DHCP server currently supports the following algorithms:
1318 .nf
1319
1320 HMAC-MD5
1321 HMAC-SHA1
1322 HMAC-SHA224
1323 HMAC-SHA256
1324 HMAC-SHA384
1325 HMAC-SHA512
1326 .fi
1327 .PP
1328 You may wish to enable logging of DNS updates on your DNS server.
1329 To do so, you might write a logging statement like the following:
1330 .PP
1331 .nf
1332 logging {
1333 channel update_debug {
1334 file "/var/log/update-debug.log";
1335 severity debug 3;
1336 print-category yes;
1337 print-severity yes;
1338 print-time yes;
1339 };
1340 channel security_info {
1341 file "/var/log/named-auth.info";
1342 severity info;
1343 print-category yes;
1344 print-severity yes;
1345 print-time yes;
1346 };
1347
1348 category update { update_debug; };
1349 category security { security_info; };
1350 };
1351 .fi
1352 .PP
1353 You must create the /var/log/named-auth.info and
1354 /var/log/update-debug.log files before starting the name server. For
1355 more information on configuring ISC BIND, consult the documentation
1356 that accompanies it.
1357 .SH REFERENCE: EVENTS
1358 .PP
1359 There are three kinds of events that can happen regarding a lease, and
1360 it is possible to declare statements that occur when any of these
1361 events happen. These events are the commit event, when the server
1362 has made a commitment of a certain lease to a client, the release
1363 event, when the client has released the server from its commitment,
1364 and the expiry event, when the commitment expires.
1365 .PP
1366 To declare a set of statements to execute when an event happens, you
1367 must use the \fBon\fR statement, followed by the name of the event,
1368 followed by a series of statements to execute when the event happens,
1369 enclosed in braces.
1370 .SH REFERENCE: DECLARATIONS
1371 .PP
1372 .B The
1373 .I include
1374 .B statement
1375 .PP
1376 .nf
1377 \fBinclude\fR \fI"filename"\fR\fB;\fR
1378 .fi
1379 .PP
1380 The \fIinclude\fR statement is used to read in a named file, and process
1381 the contents of that file as though it were entered in place of the
1382 include statement.
1383 .PP
1384 .B The
1385 .I shared-network
1386 .B statement
1387 .PP
1388 .nf
1389 \fBshared-network\fR \fIname\fR \fB{\fR
1390 [ \fIparameters\fR ]
1391 [ \fIdeclarations\fR ]
1392 \fB}\fR
1393 .fi
1394 .PP
1395 The \fIshared-network\fR statement is used to inform the DHCP server
1396 that some IP subnets actually share the same physical network. Any
1397 subnets in a shared network should be declared within a
1398 \fIshared-network\fR statement. Parameters specified in the
1399 \fIshared-network\fR statement will be used when booting clients on
1400 those subnets unless parameters provided at the subnet or host level
1401 override them. If any subnet in a shared network has addresses
1402 available for dynamic allocation, those addresses are collected into a
1403 common pool for that shared network and assigned to clients as needed.
1404 There is no way to distinguish on which subnet of a shared network a
1405 client should boot.
1406 .PP
1407 .I Name
1408 should be the name of the shared network. This name is used when
1409 printing debugging messages, so it should be descriptive for the
1410 shared network. The name may have the syntax of a valid domain name
1411 (although it will never be used as such), or it may be any arbitrary
1412 name, enclosed in quotes.
1413 .PP
1414 .B The
1415 .I subnet
1416 .B statement
1417 .PP
1418 .nf
1419 \fBsubnet\fR \fIsubnet-number\fR \fBnetmask\fR \fInetmask\fR \fB{\fR
1420 [ \fIparameters\fR ]
1421 [ \fIdeclarations\fR ]
1422 \fB}\fR
1423 .fi
1424 .PP
1425 The \fIsubnet\fR statement is used to provide dhcpd with enough
1426 information to tell whether or not an IP address is on that subnet.
1427 It may also be used to provide subnet-specific parameters and to
1428 specify what addresses may be dynamically allocated to clients booting
1429 on that subnet. Such addresses are specified using the \fIrange\fR
1430 declaration.
1431 .PP
1432 The
1433 .I subnet-number
1434 should be an IP address or domain name which resolves to the subnet
1435 number of the subnet being described. The
1436 .I netmask
1437 should be an IP address or domain name which resolves to the subnet mask
1438 of the subnet being described. The subnet number, together with the
1439 netmask, are sufficient to determine whether any given IP address is
1440 on the specified subnet.
1441 .PP
1442 Although a netmask must be given with every subnet declaration, it is
1443 recommended that if there is any variance in subnet masks at a site, a
1444 subnet-mask option statement be used in each subnet declaration to set
1445 the desired subnet mask, since any subnet-mask option statement will
1446 override the subnet mask declared in the subnet statement.
1447 .PP
1448 .B The
1449 .I subnet6
1450 .B statement
1451 .PP
1452 .nf
1453 \fBsubnet6\fR \fIsubnet6-number\fR \fB{\fR
1454 [ \fIparameters\fR ]
1455 [ \fIdeclarations\fR ]
1456 \fB}\fR
1457 .fi
1458 .PP
1459 The \fIsubnet6\fR statement is used to provide dhcpd with enough
1460 information to tell whether or not an IPv6 address is on that subnet6.
1461 It may also be used to provide subnet-specific parameters and to
1462 specify what addresses may be dynamically allocated to clients booting
1463 on that subnet.
1464 .PP
1465 The
1466 .I subnet6-number
1467 should be an IPv6 network identifier, specified as ip6-address/bits.
1468 .PP
1469 .B The
1470 .I range
1471 .B statement
1472 .PP
1473 .nf
1474 .B range\fR [ \fBdynamic-bootp\fR ] \fIlow-address\fR [ \fIhigh-address\fR]\fB;\fR
1475 .fi
1476 .PP
1477 For any subnet on which addresses will be assigned dynamically, there
1478 must be at least one \fIrange\fR statement. The range statement
1479 gives the lowest and highest IP addresses in a range. All IP
1480 addresses in the range should be in the subnet in which the
1481 \fIrange\fR statement is declared. The \fIdynamic-bootp\fR flag may
1482 be specified if addresses in the specified range may be dynamically
1483 assigned to BOOTP clients as well as DHCP clients. When specifying a
1484 single address, \fIhigh-address\fR can be omitted.
1485 .PP
1486 .B The
1487 .I range6
1488 .B statement
1489 .PP
1490 .nf
1491 .B range6\fR \fIlow-address\fR \fIhigh-address\fR\fB;\fR
1492 .B range6\fR \fIsubnet6-number\fR\fB;\fR
1493 .B range6\fR \fIsubnet6-number\fR \fBtemporary\fR\fB;\fR
1494 .B range6\fR \fIaddress\fR \fBtemporary\fR\fB;\fR
1495 .fi
1496 .PP
1497 For any IPv6 subnet6 on which addresses will be assigned dynamically, there
1498 must be at least one \fIrange6\fR statement. The \fIrange6\fR statement
1499 can either be the lowest and highest IPv6 addresses in a \fIrange6\fR, or
1500 use CIDR notation, specified as ip6-address/bits. All IP addresses
1501 in the \fIrange6\fR should be in the subnet6 in which the
1502 \fIrange6\fR statement is declared.
1503 .PP
1504 The \fItemporary\fR variant makes the prefix (by default on 64 bits) available
1505 for temporary (RFC 4941) addresses. A new address per prefix in the shared
1506 network is computed at each request with an IA_TA option. Release and Confirm
1507 ignores temporary addresses.
1508 .PP
1509 Any IPv6 addresses given to hosts with \fIfixed-address6\fR are excluded
1510 from the \fIrange6\fR, as are IPv6 addresses on the server itself.
1511 .PP
1512 .PP
1513 .B The
1514 .I prefix6
1515 .B statement
1516 .PP
1517 .nf
1518 .B prefix6\fR \fIlow-address\fR \fIhigh-address\fR \fB/\fR \fIbits\fR\fB;\fR
1519 .fi
1520 .PP
1521 The \fIprefix6\fR is the \fIrange6\fR equivalent for Prefix Delegation
1522 (RFC 3633). Prefixes of \fIbits\fR length are assigned between
1523 \fIlow-address\fR and \fIhigh-address\fR.
1524 .PP
1525 Any IPv6 prefixes given to static entries (hosts) with \fIfixed-prefix6\fR
1526 are excluded from the \fIprefix6\fR.
1527 .PP
1528 This statement is currently global but it should have a shared-network scope.
1529 .PP
1530 .B The
1531 .I host
1532 .B statement
1533 .PP
1534 .nf
1535 \fBhost\fR \fIhostname\fR {
1536 [ \fIparameters\fR ]
1537 [ \fIdeclarations\fR ]
1538 \fB}\fR
1539 .fi
1540 .PP
1541 The
1542 .B host
1543 declaration provides a way for the DHCP server to identify a DHCP or
1544 BOOTP client. This allows the server to provide configuration
1545 information including fixed addresses or, in DHCPv6, fixed prefixes
1546 for a specific client.
1547 .PP
1548 If it is desirable to be able to boot a DHCP or BOOTP client on more than one
1549 subnet with fixed v4 addresses, more than one address may be specified in the
1550 .I fixed-address
1551 declaration, or more than one
1552 .B host
1553 statement may be specified matching the same client.
1554 .PP
1555 The
1556 .I fixed-address6
1557 delcaration is used for v6 addresses. At this time it only works with a single
1558 address. For multiple addresses specify multiple
1559 .B host
1560 statements.
1561 .PP
1562 If client-specific boot parameters must change based on the network
1563 to which the client is attached, then multiple
1564 .B host
1565 declarations should be used. The
1566 .B host
1567 declarations will only match a client if one of their
1568 .I fixed-address
1569 statements is viable on the subnet (or shared network) where the client is
1570 attached. Conversely, for a
1571 .B host
1572 declaration to match a client being allocated a dynamic address, it must not
1573 have any
1574 .I fixed-address
1575 statements. You may therefore need a mixture of
1576 .B host
1577 declarations for any given client...some having
1578 .I fixed-address
1579 statements, others without.
1580 .PP
1581 .I hostname
1582 should be a name identifying the host. If a \fIhostname\fR option is
1583 not specified for the host, \fIhostname\fR is used.
1584 .PP
1585 \fIHost\fR declarations are matched to actual DHCP or BOOTP clients
1586 by matching the \fRdhcp-client-identifier\fR option specified in the
1587 \fIhost\fR declaration to the one supplied by the client, or, if the
1588 \fIhost\fR declaration or the client does not provide a
1589 \fRdhcp-client-identifier\fR option, by matching the \fIhardware\fR
1590 parameter in the \fIhost\fR declaration to the network hardware
1591 address supplied by the client. BOOTP clients do not normally
1592 provide a \fIdhcp-client-identifier\fR, so the hardware address must
1593 be used for all clients that may boot using the BOOTP protocol.
1594 .PP
1595 DHCPv6 servers can use the \fIhost-identifier option\fR parameter in
1596 the \fIhost\fR declaration, and specify any option with a fixed value
1597 to identify hosts.
1598 .PP
1599 Please be aware that
1600 .B only
1601 the \fIdhcp-client-identifier\fR option and the hardware address can be
1602 used to match a host declaration, or the \fIhost-identifier option\fR
1603 parameter for DHCPv6 servers. For example, it is not possible to
1604 match a host declaration to a \fIhost-name\fR option. This is
1605 because the host-name option cannot be guaranteed to be unique for any
1606 given client, whereas both the hardware address and
1607 \fIdhcp-client-identifier\fR option are at least theoretically
1608 guaranteed to be unique to a given client.
1609 .PP
1610 .B The
1611 .I group
1612 .B statement
1613 .PP
1614 .nf
1615 \fBgroup\fR {
1616 [ \fIparameters\fR ]
1617 [ \fIdeclarations\fR ]
1618 \fB}\fR
1619 .fi
1620 .PP
1621 The group statement is used simply to apply one or more parameters to
1622 a group of declarations. It can be used to group hosts, shared
1623 networks, subnets, or even other groups.
1624 .SH REFERENCE: ALLOW AND DENY
1625 The
1626 .I allow
1627 and
1628 .I deny
1629 statements can be used to control the response of the DHCP server to
1630 various sorts of requests. The allow and deny keywords actually have
1631 different meanings depending on the context. In a pool context, these
1632 keywords can be used to set up access lists for address allocation
1633 pools. In other contexts, the keywords simply control general server
1634 behavior with respect to clients based on scope. In a non-pool
1635 context, the
1636 .I ignore
1637 keyword can be used in place of the
1638 .I deny
1639 keyword to prevent logging of denied requests.
1640 .PP
1641 .SH ALLOW DENY AND IGNORE IN SCOPE
1642 The following usages of allow and deny will work in any scope,
1643 although it is not recommended that they be used in pool
1644 declarations.
1645 .PP
1646 .B The
1647 .I unknown-clients
1648 .B keyword
1649 .PP
1650 \fBallow unknown-clients;\fR
1651 \fBdeny unknown-clients;\fR
1652 \fBignore unknown-clients;\fR
1653 .PP
1654 The \fBunknown-clients\fR flag is used to tell dhcpd whether
1655 or not to dynamically assign addresses to unknown clients. Dynamic
1656 address assignment to unknown clients is \fBallow\fRed by default.
1657 An unknown client is simply a client that has no host declaration.
1658 .PP
1659 The use of this option is now \fIdeprecated\fR. If you are trying to
1660 restrict access on your network to known clients, you should use \fBdeny
1661 unknown-clients;\fR inside of your address pool, as described under the
1662 heading ALLOW AND DENY WITHIN POOL DECLARATIONS.
1663 .PP
1664 .B The
1665 .I bootp
1666 .B keyword
1667 .PP
1668 \fBallow bootp;\fR
1669 \fBdeny bootp;\fR
1670 \fBignore bootp;\fR
1671 .PP
1672 The \fBbootp\fR flag is used to tell dhcpd whether
1673 or not to respond to bootp queries. Bootp queries are \fBallow\fRed
1674 by default.
1675 .PP
1676 .B The
1677 .I booting
1678 .B keyword
1679 .PP
1680 \fBallow booting;\fR
1681 \fBdeny booting;\fR
1682 \fBignore booting;\fR
1683 .PP
1684 The \fBbooting\fR flag is used to tell dhcpd whether or not to respond
1685 to queries from a particular client. This keyword only has meaning
1686 when it appears in a host declaration. By default, booting is
1687 \fBallow\fRed, but if it is disabled for a particular client, then
1688 that client will not be able to get an address from the DHCP server.
1689 .PP
1690 .B The
1691 .I duplicates
1692 .B keyword
1693 .PP
1694 \fBallow duplicates;\fR
1695 \fBdeny duplicates;\fR
1696 .PP
1697 Host declarations can match client messages based on the DHCP Client
1698 Identifier option or based on the client's network hardware type and
1699 MAC address. If the MAC address is used, the host declaration will
1700 match any client with that MAC address - even clients with different
1701 client identifiers. This doesn't normally happen, but is possible
1702 when one computer has more than one operating system installed on it -
1703 for example, Microsoft Windows and NetBSD or Linux.
1704 .PP
1705 The \fBduplicates\fR flag tells the DHCP server that if a request is
1706 received from a client that matches the MAC address of a host
1707 declaration, any other leases matching that MAC address should be
1708 discarded by the server, even if the UID is not the same. This is a
1709 violation of the DHCP protocol, but can prevent clients whose client
1710 identifiers change regularly from holding many leases at the same time.
1711 By default, duplicates are \fBallow\fRed.
1712 .PP
1713 .B The
1714 .I declines
1715 .B keyword
1716 .PP
1717 \fBallow declines;\fR
1718 \fBdeny declines;\fR
1719 \fBignore declines;\fR
1720 .PP
1721 The DHCPDECLINE message is used by DHCP clients to indicate that the
1722 lease the server has offered is not valid. When the server receives
1723 a DHCPDECLINE for a particular address, it normally abandons that
1724 address, assuming that some unauthorized system is using it.
1725 Unfortunately, a malicious or buggy client can, using DHCPDECLINE
1726 messages, completely exhaust the DHCP server's allocation pool. The
1727 server will eventually reclaim these leases, but not while the client
1728 is running through the pool. This may cause serious thrashing in the DNS,
1729 and it will also cause the DHCP server to forget old DHCP client address
1730 allocations.
1731 .PP
1732 The \fBdeclines\fR flag tells the DHCP server whether or not to honor
1733 DHCPDECLINE messages. If it is set to \fBdeny\fR or \fBignore\fR in
1734 a particular scope, the DHCP server will not respond to DHCPDECLINE
1735 messages.
1736 .PP
1737 The \fBdeclines\fR flag is only supported by DHCPv4 servers. Given the large
1738 IPv6 address space and the internal limits imposed by the server's
1739 address generation mechanism we don't think it is necessary for DHCPv6
1740 servers at this time.
1741 .PP
1742 Currently, abandoned IPv6 addresses are reclaimed in one of two ways:
1743 a) Client renews a specific address:
1744 If a client using a given DUID submits a DHCP REQUEST containing
1745 the last address abandoned by that DUID, the address will be
1746 reassigned to that client.
1747
1748 b) Upon the second restart following an address abandonment. When
1749 an address is abandoned it is both recorded as such in the lease
1750 file and retained as abandoned in server memory until the server
1751 is restarted. Upon restart, the server will process the lease file
1752 and all addresses whose last known state is abandoned will be
1753 retained as such in memory but not rewritten to the lease file.
1754 This means that a subsequent restart of the server will not see the
1755 abandoned addresses in the lease file and therefore have no record
1756 of them as abandoned in memory and as such perceive them as free
1757 for assignment.
1758 .PP
1759 The total number addresses in a pool, available for a given DUID value,
1760 is internally limited by the server's address generation mechanism. If
1761 through mistaken configuration, multiple clients are using the same
1762 DUID they will competing for the same addresses causing the server to reach
1763 this internal limit rather quickly. The internal limit isolates this type
1764 of activity such that address range is not exhausted for other DUID values.
1765 The appearance of the following error log, can be an indication of this
1766 condition:
1767
1768 "Best match for DUID <XX> is an abandoned address, This may be a
1769 result of multiple clients attempting to use this DUID"
1770
1771 where <XX> is an actual DUID value depicted as colon separated
1772 string of bytes in hexadecimal values.
1773 .PP
1774 .B The
1775 .I client-updates
1776 .B keyword
1777 .PP
1778 \fBallow client-updates;\fR
1779 \fBdeny client-updates;\fR
1780 .PP
1781 The \fBclient-updates\fR flag tells the DHCP server whether or not to
1782 honor the client's intention to do its own update of its A record. See
1783 the documentation under the heading THE DNS UPDATE SCHEME for details.
1784 .PP
1785 .B The
1786 .I leasequery
1787 .B keyword
1788 .PP
1789 \fBallow leasequery;\fR
1790 \fBdeny leasequery;\fR
1791 .PP
1792 The \fBleasequery\fR flag tells the DHCP server whether or not to
1793 answer DHCPLEASEQUERY packets. The answer to a DHCPLEASEQUERY packet
1794 includes information about a specific lease, such as when it was
1795 issued and when it will expire. By default, the server will not
1796 respond to these packets.
1797 .SH ALLOW AND DENY WITHIN POOL DECLARATIONS
1798 .PP
1799 The uses of the allow and deny keywords shown in the previous section
1800 work pretty much the same way whether the client is sending a
1801 DHCPDISCOVER or a DHCPREQUEST message - an address will be allocated
1802 to the client (either the old address it's requesting, or a new
1803 address) and then that address will be tested to see if it's okay to
1804 let the client have it. If the client requested it, and it's not
1805 okay, the server will send a DHCPNAK message. Otherwise, the server
1806 will simply not respond to the client. If it is okay to give the
1807 address to the client, the server will send a DHCPACK message.
1808 .PP
1809 The primary motivation behind pool declarations is to have address
1810 allocation pools whose allocation policies are different. A client
1811 may be denied access to one pool, but allowed access to another pool
1812 on the same network segment. In order for this to work, access
1813 control has to be done during address allocation, not after address
1814 allocation is done.
1815 .PP
1816 When a DHCPREQUEST message is processed, address allocation simply
1817 consists of looking up the address the client is requesting and seeing
1818 if it's still available for the client. If it is, then the DHCP
1819 server checks both the address pool permit lists and the relevant
1820 in-scope allow and deny statements to see if it's okay to give the
1821 lease to the client. In the case of a DHCPDISCOVER message, the
1822 allocation process is done as described previously in the ADDRESS
1823 ALLOCATION section.
1824 .PP
1825 When declaring permit lists for address allocation pools, the
1826 following syntaxes are recognized following the allow or deny keywords:
1827 .PP
1828 \fBknown-clients;\fR
1829 .PP
1830 If specified, this statement either allows or prevents allocation from
1831 this pool to any client that has a host declaration (i.e., is known).
1832 A client is known if it has a host declaration in \fIany\fR scope, not
1833 just the current scope.
1834 .PP
1835 \fBunknown-clients;\fR
1836 .PP
1837 If specified, this statement either allows or prevents allocation from
1838 this pool to any client that has no host declaration (i.e., is not
1839 known).
1840 .PP
1841 \fBmembers of "\fRclass\fB";\fR
1842 .PP
1843 If specified, this statement either allows or prevents allocation from
1844 this pool to any client that is a member of the named class.
1845 .PP
1846 \fBdynamic bootp clients;\fR
1847 .PP
1848 If specified, this statement either allows or prevents allocation from
1849 this pool to any bootp client.
1850 .PP
1851 \fBauthenticated clients;\fR
1852 .PP
1853 If specified, this statement either allows or prevents allocation from
1854 this pool to any client that has been authenticated using the DHCP
1855 authentication protocol. This is not yet supported.
1856 .PP
1857 \fBunauthenticated clients;\fR
1858 .PP
1859 If specified, this statement either allows or prevents allocation from
1860 this pool to any client that has not been authenticated using the DHCP
1861 authentication protocol. This is not yet supported.
1862 .PP
1863 \fBall clients;\fR
1864 .PP
1865 If specified, this statement either allows or prevents allocation from
1866 this pool to all clients. This can be used when you want to write a
1867 pool declaration for some reason, but hold it in reserve, or when you
1868 want to renumber your network quickly, and thus want the server to
1869 force all clients that have been allocated addresses from this pool to
1870 obtain new addresses immediately when they next renew.
1871 .PP
1872 \fBafter \fItime\fR\fB;\fR
1873 .PP
1874 If specified, this statement either allows or prevents allocation from
1875 this pool after a given date. This can be used when you want to move
1876 clients from one pool to another. The server adjusts the regular lease
1877 time so that the latest expiry time is at the given time+min-lease-time.
1878 A short min-lease-time enforces a step change, whereas a longer
1879 min-lease-time allows for a gradual change.
1880 \fItime\fR is either second since epoch, or a UTC time string e.g.
1881 4 2007/08/24 09:14:32 or a string with time zone offset in seconds
1882 e.g. 4 2007/08/24 11:14:32 -7200
1883 .SH REFERENCE: PARAMETERS
1884 The
1885 .I adaptive-lease-time-threshold
1886 statement
1887 .RS 0.25i
1888 .PP
1889 .B adaptive-lease-time-threshold \fIpercentage\fR\fB;\fR
1890 .PP
1891 When the number of allocated leases within a pool rises above
1892 the \fIpercentage\fR given in this statement, the DHCP server decreases
1893 the lease length for new clients within this pool to \fImin-lease-time\fR
1894 seconds. Clients renewing an already valid (long) leases get at least the
1895 remaining time from the current lease. Since the leases expire faster,
1896 the server may either recover more quickly or avoid pool exhaustion
1897 entirely. Once the number of allocated leases drop below the threshold,
1898 the server reverts back to normal lease times. Valid percentages are
1899 between 1 and 99.
1900 .RE
1901 .PP
1902 The
1903 .I always-broadcast
1904 statement
1905 .RS 0.25i
1906 .PP
1907 .B always-broadcast \fIflag\fR\fB;\fR
1908 .PP
1909 The DHCP and BOOTP protocols both require DHCP and BOOTP clients to
1910 set the broadcast bit in the flags field of the BOOTP message header.
1911 Unfortunately, some DHCP and BOOTP clients do not do this, and
1912 therefore may not receive responses from the DHCP server. The DHCP
1913 server can be made to always broadcast its responses to clients by
1914 setting this flag to \'on\' for the relevant scope; relevant scopes would be
1915 inside a conditional statement, as a parameter for a class, or as a parameter
1916 for a host declaration. To avoid creating excess broadcast traffic on your
1917 network, we recommend that you restrict the use of this option to as few
1918 clients as possible. For example, the Microsoft DHCP client is known not
1919 to have this problem, as are the OpenTransport and ISC DHCP clients.
1920 .RE
1921 .PP
1922 The
1923 .I always-reply-rfc1048
1924 statement
1925 .RS 0.25i
1926 .PP
1927 .B always-reply-rfc1048 \fIflag\fR\fB;\fR
1928 .PP
1929 Some BOOTP clients expect RFC1048-style responses, but do not follow
1930 RFC1048 when sending their requests. You can tell that a client is
1931 having this problem if it is not getting the options you have
1932 configured for it and if you see in the server log the message
1933 "(non-rfc1048)" printed with each BOOTREQUEST that is logged.
1934 .PP
1935 If you want to send rfc1048 options to such a client, you can set the
1936 .B always-reply-rfc1048
1937 option in that client's host declaration, and the DHCP server will
1938 respond with an RFC-1048-style vendor options field. This flag can
1939 be set in any scope, and will affect all clients covered by that
1940 scope.
1941 .RE
1942 .PP
1943 The
1944 .I authoritative
1945 statement
1946 .RS 0.25i
1947 .PP
1948 .B authoritative;
1949 .PP
1950 .B not authoritative;
1951 .PP
1952 The DHCP server will normally assume that the configuration
1953 information about a given network segment is not known to be correct
1954 and is not authoritative. This is so that if a naive user installs a
1955 DHCP server not fully understanding how to configure it, it does not
1956 send spurious DHCPNAK messages to clients that have obtained addresses
1957 from a legitimate DHCP server on the network.
1958 .PP
1959 Network administrators setting up authoritative DHCP servers for their
1960 networks should always write \fBauthoritative;\fR at the top of their
1961 configuration file to indicate that the DHCP server \fIshould\fR send
1962 DHCPNAK messages to misconfigured clients. If this is not done,
1963 clients will be unable to get a correct IP address after changing
1964 subnets until their old lease has expired, which could take quite a
1965 long time.
1966 .PP
1967 Usually, writing \fBauthoritative;\fR at the top level of the file
1968 should be sufficient. However, if a DHCP server is to be set up so
1969 that it is aware of some networks for which it is authoritative and
1970 some networks for which it is not, it may be more appropriate to
1971 declare authority on a per-network-segment basis.
1972 .PP
1973 Note that the most specific scope for which the concept of authority
1974 makes any sense is the physical network segment - either a
1975 shared-network statement or a subnet statement that is not contained
1976 within a shared-network statement. It is not meaningful to specify
1977 that the server is authoritative for some subnets within a shared
1978 network, but not authoritative for others, nor is it meaningful to
1979 specify that the server is authoritative for some host declarations
1980 and not others.
1981 .RE
1982 .PP
1983 The \fIboot-unknown-clients\fR statement
1984 .RS 0.25i
1985 .PP
1986 .B boot-unknown-clients \fIflag\fB;\fR
1987 .PP
1988 If the \fIboot-unknown-clients\fR statement is present and has a value
1989 of \fIfalse\fR or \fIoff\fR, then clients for which there is no
1990 .I host
1991 declaration will not be allowed to obtain IP addresses. If this
1992 statement is not present or has a value of \fItrue\fR or \fIon\fR,
1993 then clients without host declarations will be allowed to obtain IP
1994 addresses, as long as those addresses are not restricted by
1995 .I allow
1996 and \fIdeny\fR statements within their \fIpool\fR declarations.
1997 .RE
1998 .PP
1999 The \fIdb-time-format\fR statement
2000 .RS 0.25i
2001 .PP
2002 .B db-time-format \fR[ \fIdefault\fR | \fIlocal\fR ] \fB;\fR
2003 .PP
2004 The DHCP server software outputs several timestamps when writing leases to
2005 persistent storage. This configuration parameter selects one of two output
2006 formats. The \fIdefault\fR format prints the day, date, and time in UTC,
2007 while the \fIlocal\fR format prints the system seconds-since-epoch, and
2008 helpfully provides the day and time in the system timezone in a comment.
2009 The time formats are described in detail in the dhcpd.leases(5) manpage.
2010 .RE
2011 .PP
2012 The \fIddns-hostname\fR statement
2013 .RS 0.25i
2014 .PP
2015 .B ddns-hostname \fIname\fB;\fR
2016 .PP
2017 The \fIname\fR parameter should be the hostname that will be used in
2018 setting up the client's A and PTR records. If no \fIddns-hostname\fR is
2019 specified in scope, then the server will derive the hostname
2020 automatically, using an algorithm that varies for each of the
2021 different update methods.
2022 .RE
2023 .PP
2024 The \fIddns-domainname\fR statement
2025 .RS 0.25i
2026 .PP
2027 .B ddns-domainname \fIname\fB;\fR
2028 .PP
2029 The \fIname\fR parameter should be the domain name that will be
2030 appended to the client's hostname to form a fully-qualified
2031 domain-name (FQDN).
2032 .RE
2033 .PP
2034 The \fddns-local-address4\fR and \fddns-local-address6\fR statements
2035 .RS 0.25i
2036 .PP
2037 .B ddns-local-address4 \fIaddress\fB;\fR
2038 .PP
2039 .B ddns-local-address6 \fIaddress\fB;\fR
2040 .PP
2041 The \fIaddress\fR parameter should be the local IPv4 or IPv6 address
2042 the server should use as the from address when sending DDNS update
2043 requests.
2044 .RE
2045 .PP
2046 The \fIddns-rev-domainname\fR statement
2047 .RS 0.25i
2048 .PP
2049 .B ddns-rev-domainname \fIname\fB;\fR
2050 .PP
2051 The \fIname\fR parameter should be the domain name that will be
2052 appended to the client's reversed IP address to produce a name for use
2053 in the client's PTR record. By default, this is "in-addr.arpa.", but
2054 the default can be overridden here.
2055 .PP
2056 The reversed IP address to which this domain name is appended is
2057 always the IP address of the client, in dotted quad notation, reversed
2058 - for example, if the IP address assigned to the client is
2059 10.17.92.74, then the reversed IP address is 74.92.17.10. So a
2060 client with that IP address would, by default, be given a PTR record
2061 of 10.17.92.74.in-addr.arpa.
2062 .RE
2063 .PP
2064 The \fIddns-update-style\fR parameter
2065 .RS 0.25i
2066 .PP
2067 .B ddns-update-style \fIstyle\fB;\fR
2068 .PP
2069 The
2070 .I style
2071 parameter must be one of \fBstandard\fR, \fBinterim\fR or \fBnone\fR.
2072 The \fIddns-update-style\fR statement is only meaningful in the outer
2073 scope - it is evaluated once after reading the dhcpd.conf file, rather
2074 than each time a client is assigned an IP address, so there is no way
2075 to use different DNS update styles for different clients. The default
2076 is \fBnone\fR.
2077 .RE
2078 .PP
2079 .B The
2080 .I ddns-updates
2081 .B statement
2082 .RS 0.25i
2083 .PP
2084 \fBddns-updates \fIflag\fR\fB;\fR
2085 .PP
2086 The \fIddns-updates\fR parameter controls whether or not the server will
2087 attempt to do a DNS update when a lease is confirmed. Set this to \fIoff\fR
2088 if the server should not attempt to do updates within a certain scope.
2089 The \fIddns-updates\fR parameter is on by default. To disable DNS
2090 updates in all scopes, it is preferable to use the
2091 \fIddns-update-style\fR statement, setting the style to \fInone\fR.
2092 .RE
2093 .PP
2094 The
2095 .I default-lease-time
2096 statement
2097 .RS 0.25i
2098 .PP
2099 .B default-lease-time \fItime\fR\fB;\fR
2100 .PP
2101 .I Time
2102 should be the length in seconds that will be assigned to a lease if
2103 the client requesting the lease does not ask for a specific expiration
2104 time. This is used for both DHCPv4 and DHCPv6 leases (it is also known
2105 as the "valid lifetime" in DHCPv6).
2106 The default is 43200 seconds.
2107 .RE
2108 .PP
2109 The
2110 .I delayed-ack
2111 and
2112 .I max-ack-delay
2113 statements
2114 .RS 0.25i
2115 .PP
2116 .B delayed-ack \fIcount\fR\fB;\fR
2117 .PP
2118 .B max-ack-delay \fImicroseconds\fR\fB;\fR
2119 .PP
2120 .I Count
2121 should be an integer value from zero to 2^16-1, and defaults to 28. The
2122 count represents how many DHCPv4 replies maximum will be queued pending
2123 transmission until after a database commit event. If this number is
2124 reached, a database commit event (commonly resulting in fsync() and
2125 representing a performance penalty) will be made, and the reply packets
2126 will be transmitted in a batch afterwards. This preserves the RFC2131
2127 direction that "stable storage" be updated prior to replying to clients.
2128 Should the DHCPv4 sockets "go dry" (select() returns immediately with no
2129 read sockets), the commit is made and any queued packets are transmitted.
2130 .PP
2131 Similarly, \fImicroseconds\fR indicates how many microseconds are permitted
2132 to pass inbetween queuing a packet pending an fsync, and performing the
2133 fsync. Valid values range from 0 to 2^32-1, and defaults to 250,000 (1/4 of
2134 a second).
2135 .PP
2136 Please note that as delayed-ack is currently experimental, the delayed-ack
2137 feature is not compiled in by default, but must be enabled at compile time
2138 with \'./configure --enable-delayed-ack\'.
2139 .RE
2140 .PP
2141 The
2142 .I dhcp-cache-threshold
2143 statement
2144 .RS 0.25i
2145 .PP
2146 .B dhcp-cache-threshold \fIpercentage\fB;\fR
2147 .PP
2148 The \fIdhcp-cache-threshold\fR statement takes one integer parameter
2149 with allowed values between 0 and 100. The default value is 25 (25% of
2150 the lease time). This parameter expresses the percentage of the total
2151 lease time, measured from the beginning, during which a
2152 client's attempt to renew its lease will result in getting
2153 the already assigned lease, rather than an extended lease.
2154 .PP
2155 Clients that attempt renewal frequently can cause the server to
2156 update and write the database frequently resulting in a performance
2157 impact on the server. The \fIdhcp-cache-threshold\fR
2158 statement instructs the DHCP server to avoid updating leases too
2159 frequently thus avoiding this behavior. Instead the server assigns the
2160 same lease (i.e. reuses it) with no modifications except for CLTT (Client Last
2161 Transmission Time) which does not require disk operations. This
2162 feature applies to IPv4 only.
2163 .PP
2164 When an existing lease is matched to a renewing client, it will be reused
2165 if all of the following conditions are true:
2166 .nf
2167 1. The dhcp-cache-threshold is larger than zero
2168 2. The current lease is active
2169 3. The percentage of the lease time that has elapsed is less than
2170 dhcp-cache-threshold
2171 4. The client information provided in the renewal does not alter
2172 any of the following:
2173 a. DNS information and DNS updates are enabled
2174 b. Billing class to which the lease is associated
2175 .fi
2176 .RE
2177 .PP
2178 The
2179 .I do-forward-updates
2180 statement
2181 .RS 0.25i
2182 .PP
2183 .B do-forward-updates \fIflag\fB;\fR
2184 .PP
2185 The \fIdo-forward-updates\fR statement instructs the DHCP server as
2186 to whether it should attempt to update a DHCP client\'s A record
2187 when the client acquires or renews a lease. This statement has no
2188 effect unless DNS updates are enabled. Forward updates are enabled
2189 by default. If this statement is used to disable forward updates,
2190 the DHCP server will never attempt to update the client\'s A record,
2191 and will only ever attempt to update the client\'s PTR record if the
2192 client supplies an FQDN that should be placed in the PTR record using
2193 the \fBfqdn\fR option. If forward updates are enabled, the DHCP server
2194 will still honor the setting of the \fBclient-updates\fR flag.
2195 .RE
2196 .PP
2197 The
2198 .I dont-use-fsync
2199 statement
2200 .RS 0.25i
2201 .PP
2202 .B dont-use-fsync \fIflag\fB;\fR
2203 .PP
2204 The \fIdont-use-fsync\fR statement instructs the DHCP server if
2205 it should call fsync() when writing leases to the lease file. By
2206 default and if the flag is set to false the server \fBwill\fR call
2207 fsync(). Suppressing the call to fsync() may increase the performance
2208 of the server but it also adds a risk that a lease will not be
2209 properly written to the disk after it has been issued to a client
2210 and before the server stops. This can lead to duplicate leases
2211 being issued to different clients. Using this option is \fBnot
2212 recommended\FR.
2213 .RE
2214 .PP
2215 The
2216 .I dynamic-bootp-lease-cutoff
2217 statement
2218 .RS 0.25i
2219 .PP
2220 .B dynamic-bootp-lease-cutoff \fIdate\fB;\fR
2221 .PP
2222 The \fIdynamic-bootp-lease-cutoff\fR statement sets the ending time
2223 for all leases assigned dynamically to BOOTP clients. Because BOOTP
2224 clients do not have any way of renewing leases, and don't know that
2225 their leases could expire, by default dhcpd assigns infinite leases
2226 to all BOOTP clients. However, it may make sense in some situations
2227 to set a cutoff date for all BOOTP leases - for example, the end of a
2228 school term, or the time at night when a facility is closed and all
2229 machines are required to be powered off.
2230 .PP
2231 .I Date
2232 should be the date on which all assigned BOOTP leases will end. The
2233 date is specified in the form:
2234 .PP
2235 .ce 1
2236 W YYYY/MM/DD HH:MM:SS
2237 .PP
2238 W is the day of the week expressed as a number
2239 from zero (Sunday) to six (Saturday). YYYY is the year, including the
2240 century. MM is the month expressed as a number from 1 to 12. DD is
2241 the day of the month, counting from 1. HH is the hour, from zero to
2242 23. MM is the minute and SS is the second. The time is always in
2243 Coordinated Universal Time (UTC), not local time.
2244 .RE
2245 .PP
2246 The
2247 .I dynamic-bootp-lease-length
2248 statement
2249 .RS 0.25i
2250 .PP
2251 .B dynamic-bootp-lease-length\fR \fIlength\fR\fB;\fR
2252 .PP
2253 The \fIdynamic-bootp-lease-length\fR statement is used to set the
2254 length of leases dynamically assigned to BOOTP clients. At some
2255 sites, it may be possible to assume that a lease is no longer in
2256 use if its holder has not used BOOTP or DHCP to get its address within
2257 a certain time period. The period is specified in \fIlength\fR as a
2258 number of seconds. If a client reboots using BOOTP during the
2259 timeout period, the lease duration is reset to \fIlength\fR, so a
2260 BOOTP client that boots frequently enough will never lose its lease.
2261 Needless to say, this parameter should be adjusted with extreme
2262 caution.
2263 .RE
2264 .PP
2265 The
2266 .I echo-client-id
2267 statement
2268 .RS 0.25i
2269 .PP
2270 .B echo-client-id\fR \fIflag\fR\fB;\fR
2271 .PP
2272 The \fIecho-client-id\fR statement is used to enable or disable RFC 6842
2273 compliant behavior. If the echo-client-id statement is present and has a
2274 value of true or on, and a DHCP DISCOVER or REQUEST is received which contains
2275 the client identifier option (Option code 61), the server will copy the option
2276 into its response (DHCP ACK or NAK) per RFC 6842. In other words if the
2277 client sends the option it will receive it back. By default, this flag is off
2278 and client identifiers will not echoed back to the client.
2279 .RE
2280 .PP
2281 The
2282 .I filename
2283 statement
2284 .RS 0.25i
2285 .PP
2286 .B filename\fR \fB"\fR\fIfilename\fR\fB";\fR
2287 .PP
2288 The \fIfilename\fR statement can be used to specify the name of the
2289 initial boot file which is to be loaded by a client. The
2290 .I filename
2291 should be a filename recognizable to whatever file transfer protocol
2292 the client can be expected to use to load the file.
2293 .RE
2294 .PP
2295 The
2296 .I fixed-address
2297 declaration
2298 .RS 0.25i
2299 .PP
2300 .B fixed-address address\fR [\fB,\fR \fIaddress\fR ... ]\fB;\fR
2301 .PP
2302 The \fIfixed-address\fR declaration is used to assign one or more fixed
2303 IP addresses to a client. It should only appear in a \fIhost\fR
2304 declaration. If more than one address is supplied, then when the
2305 client boots, it will be assigned the address that corresponds to the
2306 network on which it is booting. If none of the addresses in the
2307 \fIfixed-address\fR statement are valid for the network to which the client
2308 is connected, that client will not match the \fIhost\fR declaration
2309 containing that \fIfixed-address\fR declaration. Each \fIaddress\fR
2310 in the \fIfixed-address\fR declaration should be either an IP address or
2311 a domain name that resolves to one or more IP addresses.
2312 .RE
2313 .PP
2314 The
2315 .I fixed-address6
2316 declaration
2317 .RS 0.25i
2318 .PP
2319 .B fixed-address6 ip6-address\fR ;\fR
2320 .PP
2321 The \fIfixed-address6\fR declaration is used to assign a fixed
2322 IPv6 addresses to a client. It should only appear in a \fIhost\fR
2323 declaration.
2324 .RE
2325 .PP
2326 The
2327 .I fixed-prefix6
2328 declaration
2329 .RS 0.25i
2330 .PP
2331 .B fixed-prefix6\fR \fIlow-address\fR \fB/\fR \fIbits\fR\fB;\fR
2332 .PP
2333 The \fIfixed-prefix6\fR declaration is used to assign a fixed
2334 IPv6 prefix to a client. It should only appear in a \fIhost\fR
2335 declaration, but multiple \fIfixed-prefix6\fR statements may appear
2336 in a single \fIhost\fR declaration.
2337 .PP
2338 The \fIlow-address\fR specifies the start of the prefix and the \fIbits\fR
2339 specifies the size of the prefix in bits.
2340 .PP
2341 If there are multiple prefixes for a given host entry the server will
2342 choose one that matches the requested prefix size or, if none match,
2343 the first one.
2344 .PP
2345 If there are multiple \fIhost\fR delcarations the server will try to
2346 choose a declaration where the \fIfixed-address6\fR matches the client's
2347 subnet. If none match it will choose one that doesn't have a \fIfixed-address6\fR
2348 statement.
2349 .PP
2350 Note Well: Unlike the fixed address the fixed prefix does not need to match
2351 a subnet in order to be served. This allows you to provide a prefix to
2352 a client that is outside of the subnet on which the client makes the request
2353 to the the server.
2354 .RE
2355 .PP
2356 The
2357 .I get-lease-hostnames
2358 statement
2359 .RS 0.25i
2360 .PP
2361 .B get-lease-hostnames\fR \fIflag\fR\fB;\fR
2362 .PP
2363 The \fIget-lease-hostnames\fR statement is used to tell dhcpd whether
2364 or not to look up the domain name corresponding to the IP address of
2365 each address in the lease pool and use that address for the DHCP
2366 \fIhostname\fR option. If \fIflag\fR is true, then this lookup is
2367 done for all addresses in the current scope. By default, or if
2368 \fIflag\fR is false, no lookups are done.
2369 .RE
2370 .PP
2371 The
2372 .I hardware
2373 statement
2374 .RS 0.25i
2375 .PP
2376 .B hardware \fIhardware-type hardware-address\fB;\fR
2377 .PP
2378 In order for a BOOTP client to be recognized, its network hardware
2379 address must be declared using a \fIhardware\fR clause in the
2380 .I host
2381 statement.
2382 .I hardware-type
2383 must be the name of a physical hardware interface type. Currently,
2384 only the
2385 .B ethernet
2386 and
2387 .B token-ring
2388 types are recognized, although support for a
2389 .B fddi
2390 hardware type (and others) would also be desirable.
2391 The
2392 .I hardware-address
2393 should be a set of hexadecimal octets (numbers from 0 through ff)
2394 separated by colons. The \fIhardware\fR statement may also be used
2395 for DHCP clients.
2396 .RE
2397 .PP
2398 The
2399 .I host-identifier option
2400 statement
2401 .RS 0.25i
2402 .PP
2403 .B host-identifier option \fIoption-name option-data\fB;\fR
2404 .PP
2405 or
2406 .PP
2407 .B host-identifier v6relopt \fInumber option-name option-data\fB;\fR
2408 .PP
2409 This identifies a DHCPv6 client in a
2410 .I host
2411 statement.
2412 .I option-name
2413 is any option, and
2414 .I option-data
2415 is the value for the option that the client will send. The
2416 .I option-data
2417 must be a constant value. In the v6relopts case the additional number
2418 is the relay to examine for the specified option name and value. The
2419 values are the same as for the v6relay option. 0 is a no-op, 1 is the
2420 relay closest to the client, 2 the next one in and so on. Values that
2421 are larger than the maximum number of relays (currently 32) indicate the
2422 relay closest to the server independent of number.
2423 .RE
2424 .PP
2425 The
2426 .I ignore-client-uids
2427 statement
2428 .RS 0.25i
2429 .PP
2430 .B ignore-client-uids \fIflag\fB;\fR
2431 .PP
2432 If the \fIignore-client-uids\fR statement is present and has a value of
2433 \fItrue\fR or \fIon\fR, the UID for clients will not be recorded.
2434 If this statement is not present or has a value of \fIfalse\fR or
2435 \fIoff\fR, then client UIDs will be recorded.
2436 .RE
2437 .PP
2438 The
2439 .I infinite-is-reserved
2440 statement
2441 .RS 0.25i
2442 .PP
2443 .B infinite-is-reserved \fIflag\fB;\fR
2444 .PP
2445 ISC DHCP now supports \'reserved\' leases. See the section on RESERVED LEASES
2446 below. If this \fIflag\fR is on, the server will automatically reserve leases
2447 allocated to clients which requested an infinite (0xffffffff) lease-time.
2448 .PP
2449 The default is off.
2450 .RE
2451 .PP
2452 The
2453 .I lease-file-name
2454 statement
2455 .RS 0.25i
2456 .PP
2457 .B lease-file-name \fIname\fB;\fR
2458 .PP
2459 .I Name
2460 should be the name of the DHCP server's lease file. By default, this
2461 is DBDIR/dhcpd.leases. This statement \fBmust\fR appear in the outer
2462 scope of the configuration file - if it appears in some other scope,
2463 it will have no effect. Furthermore, it has no effect if overridden
2464 by the
2465 .B -lf
2466 flag or the
2467 .B PATH_DHCPD_DB
2468 environment variable.
2469 .RE
2470 .PP
2471 The
2472 .I limit-addrs-per-ia
2473 statement
2474 .RS 0.25i
2475 .PP
2476 .B limit-addrs-per-ia \fInumber\fB;\fR
2477 .PP
2478 By default, the DHCPv6 server will limit clients to one IAADDR per IA
2479 option, meaning one address. If you wish to permit clients to hang onto
2480 multiple addresses at a time, configure a larger \fInumber\fR here.
2481 .PP
2482 Note that there is no present method to configure the server to forcibly
2483 configure the client with one IP address per each subnet on a shared network.
2484 This is left to future work.
2485 .RE
2486 .PP
2487 The
2488 .I dhcpv6-lease-file-name
2489 statement
2490 .RS 0.25i
2491 .PP
2492 .B dhcpv6-lease-file-name \fIname\fB;\fR
2493 .PP
2494 .I Name
2495 is the name of the lease file to use if and only if the server is running
2496 in DHCPv6 mode. By default, this is DBDIR/dhcpd6.leases. This statement,
2497 like
2498 .I lease-file-name,
2499 \fBmust\fR appear in the outer scope of the configuration file. It
2500 has no effect if overridden by the
2501 .B -lf
2502 flag or the
2503 .B PATH_DHCPD6_DB
2504 environment variable. If
2505 .I dhcpv6-lease-file-name
2506 is not specified, but
2507 .I lease-file-name
2508 is, the latter value will be used.
2509 .RE
2510 .PP
2511 The
2512 .I local-port
2513 statement
2514 .RS 0.25i
2515 .PP
2516 .B local-port \fIport\fB;\fR
2517 .PP
2518 This statement causes the DHCP server to listen for DHCP requests on
2519 the UDP port specified in \fIport\fR, rather than on port 67.
2520 .RE
2521 .PP
2522 The
2523 .I local-address
2524 statement
2525 .RS 0.25i
2526 .PP
2527 .B local-address \fIaddress\fB;\fR
2528 .PP
2529 This statement causes the DHCP server to listen for DHCP requests sent
2530 to the specified \fIaddress\fR, rather than requests sent to all addresses.
2531 Since serving directly attached DHCP clients implies that the server must
2532 respond to requests sent to the all-ones IP address, this option cannot be
2533 used if clients are on directly attached networks; it is only realistically
2534 useful for a server whose only clients are reached via unicasts, such as via
2535 DHCP relay agents.
2536 .PP
2537 Note: This statement is only effective if the server was compiled using
2538 the USE_SOCKETS #define statement, which is default on a small number of
2539 operating systems, and must be explicitly chosen at compile-time for all
2540 others. You can be sure if your server is compiled with USE_SOCKETS if
2541 you see lines of this format at startup:
2542 .PP
2543 Listening on Socket/eth0
2544 .PP
2545 Note also that since this bind()s all DHCP sockets to the specified
2546 address, that only one address may be supported in a daemon at a given
2547 time.
2548 .RE
2549 .PP
2550 The
2551 .I log-facility
2552 statement
2553 .RS 0.25i
2554 .PP
2555 .B log-facility \fIfacility\fB;\fR
2556 .PP
2557 This statement causes the DHCP server to do all of its logging on the
2558 specified log facility once the dhcpd.conf file has been read. By
2559 default the DHCP server logs to the daemon facility. Possible log
2560 facilities include auth, authpriv, cron, daemon, ftp, kern, lpr, mail,
2561 mark, news, ntp, security, syslog, user, uucp, and local0 through
2562 local7. Not all of these facilities are available on all systems,
2563 and there may be other facilities available on other systems.
2564 .PP
2565 In addition to setting this value, you may need to modify your
2566 .I syslog.conf
2567 file to configure logging of the DHCP server. For example, you might
2568 add a line like this:
2569 .PP
2570 .nf
2571 local7.debug /var/log/dhcpd.log
2572 .fi
2573 .PP
2574 The syntax of the \fIsyslog.conf\fR file may be different on some
2575 operating systems - consult the \fIsyslog.conf\fR manual page to be
2576 sure. To get syslog to start logging to the new file, you must first
2577 create the file with correct ownership and permissions (usually, the
2578 same owner and permissions of your /var/log/messages or
2579 /usr/adm/messages file should be fine) and send a SIGHUP to syslogd.
2580 Some systems support log rollover using a shell script or program
2581 called newsyslog or logrotate, and you may be able to configure this
2582 as well so that your log file doesn't grow uncontrollably.
2583 .PP
2584 Because the \fIlog-facility\fR setting is controlled by the dhcpd.conf
2585 file, log messages printed while parsing the dhcpd.conf file or before
2586 parsing it are logged to the default log facility. To prevent this,
2587 see the README file included with this distribution, which describes
2588 BUG: where is that mentioned in README?
2589 how to change the default log facility. When this parameter is used,
2590 the DHCP server prints its startup message a second time after parsing
2591 the configuration file, so that the log will be as complete as
2592 possible.
2593 .RE
2594 .PP
2595 The
2596 .I log-threshold-high
2597 and
2598 .I log-threshold-low
2599 statements
2600 .RS 0.25i
2601 .PP
2602 .B log-threshold-high \fIpercentage\fB;\fR
2603 .PP
2604 .B log-threshold-low \fIpercentage\fB;\fR
2605 .PP
2606 The \fIlog-threshold-low\fR and \fIlog-threshold-high\fR statements
2607 are used to control when a message is output about pool usage. The
2608 value for both of them is the percentage of the pool in use. If the
2609 high threshold is 0 or has not been specified, no messages will be
2610 produced. If a high threshold is given, a message is output once the
2611 pool usage passes that level. After that, no more messages will be
2612 output until the pool usage falls below the low threshold. If the low
2613 threshold is not given, it default to a value of zero.
2614 .PP
2615 A special case occurs when the low threshold is set to be higer than
2616 the high threshold. In this case, a message will be generated each time
2617 a lease is acknowledged when the pool usage is above the high threshold.
2618 .PP
2619 Note that threshold logging will be automatically disabled for shared
2620 subnets whose total number of addresses is larger than (2^64)-1. The server
2621 will emit a log statement at startup when threshold logging is disabled as
2622 shown below:
2623
2624 "Threshold logging disabled for shared subnet of ranges: <addresses>"
2625
2626 This is likely to have no practical runtime effect as CPUs are unlikely
2627 to support a server actually reaching such a large number of leases.
2628 .RE
2629 .PP
2630 The
2631 .I max-lease-time
2632 statement
2633 .RS 0.25i
2634 .PP
2635 .B max-lease-time \fItime\fR\fB;\fR
2636 .PP
2637 .I Time
2638 should be the maximum length in seconds that will be assigned to a
2639 lease.
2640 If not defined, the default maximum lease time is 86400.
2641 The only exception to this is that Dynamic BOOTP lease
2642 lengths, which are not specified by the client, are not limited by
2643 this maximum.
2644 .RE
2645 .PP
2646 The
2647 .I min-lease-time
2648 statement
2649 .RS 0.25i
2650 .PP
2651 .B min-lease-time \fItime\fR\fB;\fR
2652 .PP
2653 .I Time
2654 should be the minimum length in seconds that will be assigned to a
2655 lease.
2656 The default is the minimum of 300 seconds or
2657 \fBmax-lease-time\fR.
2658 .RE
2659 .PP
2660 The
2661 .I min-secs
2662 statement
2663 .RS 0.25i
2664 .PP
2665 .B min-secs \fIseconds\fR\fB;\fR
2666 .PP
2667 .I Seconds
2668 should be the minimum number of seconds since a client began trying to
2669 acquire a new lease before the DHCP server will respond to its request.
2670 The number of seconds is based on what the client reports, and the maximum
2671 value that the client can report is 255 seconds. Generally, setting this
2672 to one will result in the DHCP server not responding to the client's first
2673 request, but always responding to its second request.
2674 .PP
2675 This can be used
2676 to set up a secondary DHCP server which never offers an address to a client
2677 until the primary server has been given a chance to do so. If the primary
2678 server is down, the client will bind to the secondary server, but otherwise
2679 clients should always bind to the primary. Note that this does not, by
2680 itself, permit a primary server and a secondary server to share a pool of
2681 dynamically-allocatable addresses.
2682 .RE
2683 .PP
2684 The
2685 .I next-server
2686 statement
2687 .RS 0.25i
2688 .PP
2689 .B next-server\fR \fIserver-name\fR\fB;\fR
2690 .PP
2691 The \fInext-server\fR statement is used to specify the host address of
2692 the server from which the initial boot file (specified in the
2693 \fIfilename\fR statement) is to be loaded. \fIServer-name\fR should
2694 be a numeric IP address or a domain name.
2695 .RE
2696 .PP
2697 The
2698 .I omapi-port
2699 statement
2700 .RS 0.25i
2701 .PP
2702 .B omapi-port\fR \fIport\fR\fB;\fR
2703 .PP
2704 The \fIomapi-port\fR statement causes the DHCP server to listen for
2705 OMAPI connections on the specified port. This statement is required
2706 to enable the OMAPI protocol, which is used to examine and modify the
2707 state of the DHCP server as it is running.
2708 .RE
2709 .PP
2710 The
2711 .I one-lease-per-client
2712 statement
2713 .RS 0.25i
2714 .PP
2715 .B one-lease-per-client \fIflag\fR\fB;\fR
2716 .PP
2717 If this flag is enabled, whenever a client sends a DHCPREQUEST for a
2718 particular lease, the server will automatically free any other leases
2719 the client holds. This presumes that when the client sends a
2720 DHCPREQUEST, it has forgotten any lease not mentioned in the
2721 DHCPREQUEST - i.e., the client has only a single network interface
2722 .I and
2723 it does not remember leases it's holding on networks to which it is
2724 not currently attached. Neither of these assumptions are guaranteed
2725 or provable, so we urge caution in the use of this statement.
2726 .RE
2727 .PP
2728 The
2729 .I pid-file-name
2730 statement
2731 .RS 0.25i
2732 .PP
2733 .B pid-file-name
2734 .I name\fR\fB;\fR
2735 .PP
2736 .I Name
2737 should be the name of the DHCP server's process ID file. This is the
2738 file in which the DHCP server's process ID is stored when the server
2739 starts. By default, this is RUNDIR/dhcpd.pid. Like the
2740 .I lease-file-name
2741 statement, this statement must appear in the outer scope
2742 of the configuration file. It has no effect if overridden by the
2743 .B -pf
2744 flag or the
2745 .B PATH_DHCPD_PID
2746 environment variable.
2747 .PP
2748 The
2749 .I dhcpv6-pid-file-name
2750 statement
2751 .RS 0.25i
2752 .PP
2753 .B dhcpv6-pid-file-name \fIname\fB;\fR
2754 .PP
2755 .I Name
2756 is the name of the pid file to use if and only if the server is running
2757 in DHCPv6 mode. By default, this is DBDIR/dhcpd6.pid. This statement,
2758 like
2759 .I pid-file-name,
2760 \fBmust\fR appear in the outer scope of the configuration file. It
2761 has no effect if overridden by the
2762 .B -pf
2763 flag or the
2764 .B PATH_DHCPD6_PID
2765 environment variable. If
2766 .I dhcpv6-pid-file-name
2767 is not specified, but
2768 .I pid-file-name
2769 is, the latter value will be used.
2770 .RE
2771 .PP
2772 The
2773 .I ping-check
2774 statement
2775 .RS 0.25i
2776 .PP
2777 .B ping-check
2778 .I flag\fR\fB;\fR
2779 .PP
2780 When the DHCP server is considering dynamically allocating an IP
2781 address to a client, it first sends an ICMP Echo request (a \fIping\fR)
2782 to the address being assigned. It waits for a second, and if no
2783 ICMP Echo response has been heard, it assigns the address. If a
2784 response \fIis\fR heard, the lease is abandoned, and the server does
2785 not respond to the client.
2786 .PP
2787 This \fIping check\fR introduces a default one-second delay in responding
2788 to DHCPDISCOVER messages, which can be a problem for some clients. The
2789 default delay of one second may be configured using the ping-timeout
2790 parameter. The ping-check configuration parameter can be used to control
2791 checking - if its value is false, no ping check is done.
2792 .RE
2793 .PP
2794 The
2795 .I ping-timeout
2796 statement
2797 .RS 0.25i
2798 .PP
2799 .B ping-timeout
2800 .I seconds\fR\fB;\fR
2801 .PP
2802 If the DHCP server determined it should send an ICMP echo request (a
2803 \fIping\fR) because the ping-check statement is true, ping-timeout allows
2804 you to configure how many seconds the DHCP server should wait for an
2805 ICMP Echo response to be heard, if no ICMP Echo response has been received
2806 before the timeout expires, it assigns the address. If a response \fIis\fR
2807 heard, the lease is abandoned, and the server does not respond to the client.
2808 If no value is set, ping-timeout defaults to 1 second.
2809 .RE
2810 .PP
2811 The
2812 .I preferred-lifetime
2813 statement
2814 .RS 0.25i
2815 .PP
2816 .B preferred-lifetime
2817 .I seconds\fR\fB;\fR
2818 .PP
2819 IPv6 addresses have \'valid\' and \'preferred\' lifetimes. The valid lifetime
2820 determines at what point at lease might be said to have expired, and is no
2821 longer useable. A preferred lifetime is an advisory condition to help
2822 applications move off of the address and onto currently valid addresses
2823 (should there still be any open TCP sockets or similar).
2824 .PP
2825 The preferred lifetime defaults to the renew+rebind timers, or 3/4 the
2826 default lease time if none were specified.
2827 .RE
2828 .PP
2829 The
2830 .I prefix-length-mode
2831 statement
2832 .RS 0.25i
2833 .PP
2834 .B prefix-length-mode
2835 .I mode\fR\fB;\fR
2836 .PP
2837 According to RFC 3633, DHCPv6 clients may specify preferences when soliciting
2838 prefixes by including an IA_PD Prefix option within the IA_PD option. Among
2839 the preferences that may be conveyed is the "prefix-length". When non-zero it
2840 indicates a client's desired length for offered prefixes. The RFC states that
2841 servers "MAY choose to use the information...to select prefix(es)" but does
2842 not specify any particular rules for doing so. The prefix-length-mode statement
2843 can be used to set the prefix selection rules employed by the server,
2844 when clients send a non-zero prefix-length value. The mode parameter must
2845 be one of \fBignore\fR, \fBprefer\fR, \fBexact\fR, \fBminimum\fR, or
2846 \fBmaximum\fR where:
2847 .PP
2848 1. ignore - The requested length is ignored. The server will offer the first
2849 available prefix.
2850 .PP
2851 2. prefer - The server will offer the first available prefix with the same
2852 length as the requested length. If none are found then it will offer the
2853 first available prefix of any length.
2854 .PP
2855 3. exact - The server will offer the first available prefix with the same
2856 length as the requested length. If none are found, it will return a status
2857 indicating no prefixes available. This is the default behavior.
2858 .PP
2859 4. minimum - The server will offer the first available prefix with the same
2860 length as the requested length. If none are found, it will return the first
2861 available prefix whose length is greater than (e.g. longer than), the
2862 requested value. If none of those are found, it will return a status
2863 indicating no prefixes available. For example, if client requests a length
2864 of /60, and the server has available prefixes of lengths /56 and /64, it will
2865 offer prefix of length /64.
2866 .PP
2867 5. maximum - The server will offer the first available prefix with the same
2868 length as the requested length. If none are found, it will return the first
2869 available prefix whose length is less than (e.g. shorter than), the
2870 requested value. If none of those are found, it will return a status
2871 indicating no prefixes available. For example, if client requests a length
2872 of /60, and the server has available prefixes of lengths /56 and /64, it will
2873 offer a prefix of length /56.
2874 .PP
2875 In general "first available" is determined by the order in which pools are
2876 defined in the server's configuration. For example, if a subnet is defined
2877 with three prefix pools A,B, and C:
2878 .PP
2879 .nf
2880 subnet 3000::/64 {
2881 # pool A
2882 pool6 {
2883 :
2884 }
2885 # pool B
2886 pool6 {
2887 :
2888 }
2889 # pool C
2890 pool6 {
2891 :
2892 }
2893 }
2894 .fi
2895 .PP
2896 then the pools will be checked in the order A, B, C. For modes \fBprefer\fR,
2897 \fBminimum\fR, and \fBmaximum\fR this may mean checking the pools in that order
2898 twice. A first pass through is made looking for an available prefix of exactly
2899 the preferred length. If none are found, then a second pass is performed
2900 starting with pool A but with appropriately adjusted length criteria.
2901 .RE
2902 .PP
2903 The
2904 .I remote-port
2905 statement
2906 .RS 0.25i
2907 .PP
2908 .B remote-port \fIport\fB;\fR
2909 .PP
2910 This statement causes the DHCP server to transmit DHCP responses to DHCP
2911 clients upon the UDP port specified in \fIport\fR, rather than on port 68.
2912 In the event that the UDP response is transmitted to a DHCP Relay, the
2913 server generally uses the \fBlocal-port\fR configuration value. Should the
2914 DHCP Relay happen to be addressed as 127.0.0.1, however, the DHCP Server
2915 transmits its response to the \fBremote-port\fR configuration value. This
2916 is generally only useful for testing purposes, and this configuration value
2917 should generally not be used.
2918 .RE
2919 .PP
2920 The
2921 .I server-identifier
2922 statement
2923 .RS 0.25i
2924 .PP
2925 .B server-identifier \fIhostname\fR\fB;\fR
2926 .PP
2927 The server-identifier statement can be used to define the value that
2928 is sent in the DHCP Server Identifier option for a given scope. The
2929 value specified \fBmust\fR be an IP address for the DHCP server, and
2930 must be reachable by all clients served by a particular scope.
2931 .PP
2932 The use of the server-identifier statement is not recommended - the only
2933 reason to use it is to force a value other than the default value to be
2934 sent on occasions where the default value would be incorrect. The default
2935 value is the first IP address associated with the physical network interface
2936 on which the request arrived.
2937 .PP
2938 The usual case where the
2939 \fIserver-identifier\fR statement needs to be sent is when a physical
2940 interface has more than one IP address, and the one being sent by default
2941 isn't appropriate for some or all clients served by that interface.
2942 Another common case is when an alias is defined for the purpose of
2943 having a consistent IP address for the DHCP server, and it is desired
2944 that the clients use this IP address when contacting the server.
2945 .PP
2946 Supplying a value for the dhcp-server-identifier option is equivalent
2947 to using the server-identifier statement.
2948 .RE
2949 .PP
2950 The
2951 .I server-id-check
2952 statement
2953 .RS 0.25i
2954 .PP
2955 .B server-id-check \fIflag\fR\fB;\fR
2956 .PP
2957 The server-id-check statement is used to control whether or not a server,
2958 participating in failover, verifies that the value of the
2959 dhcp-server-identifier option in received DHCP REQUESTs match the server's
2960 id before processing the request. Server id checking is disabled by default.
2961 Setting this flag enables id checking and thereafter the server will only
2962 process requests that match. Note the flag setting should be consistent
2963 between failover partners.
2964 .PP
2965 Unless overridden by use of the server-identifier statement, the value the
2966 server uses as its id will be the first IP address associated with the
2967 physical network interface on which the request arrived.
2968 .PP
2969 In order to reduce runtime overhead the server only checks for a server id
2970 option in the global and subnet scopes. Complicated configurations
2971 may result in different server ids for this check and when the server id for
2972 a reply packet is determined, which would prohibit the server from responding.
2973 .PP
2974 The primary use for this option is when a client broadcasts a request
2975 but requires that the response come from a specific failover peer.
2976 An example of this would be when a client reboots while its lease is still
2977 active - in this case both servers will normally respond. Most of the
2978 time the client won't check the server id and can use either of the responses.
2979 However if the client does check the server id it may reject the response
2980 if it came from the wrong peer. If the timing is such that the "wrong"
2981 peer responds first most of the time the client may not get an address for
2982 some time.
2983 .PP
2984 Care should be taken before enabling this option.
2985 .PP
2986 .RE
2987 .PP
2988 The
2989 .I server-duid
2990 statement
2991 .RS 0.25i
2992 .PP
2993 .B server-duid \fILLT\fR [ \fIhardware-type\fR \fItimestamp\fR \fIhardware-address\fR ] \fB;\fR
2994
2995 .B server-duid \fIEN\fR \fIenterprise-number\fR \fIenterprise-identifier\fR \fB;\fR
2996
2997 .B server-duid \fILL\fR [ \fIhardware-type\fR \fIhardware-address\fR ] \fB;\fR
2998 .PP
2999 The server-duid statement configures the server DUID. You may pick either
3000 LLT (link local address plus time), EN (enterprise), or LL (link local).
3001 .PP
3002 If you choose LLT or LL, you may specify the exact contents of the DUID.
3003 Otherwise the server will generate a DUID of the specified type.
3004 .PP
3005 If you choose EN, you must include the enterprise number and the
3006 enterprise-identifier.
3007 .PP
3008 If there is a server-duid statement in the lease file it will take precedence
3009 over the server-duid statement from the config file and a
3010 dhcp6.server-id option in the config file will override both.
3011 .PP
3012 The default server-duid type is LLT.
3013 .RE
3014 .PP
3015 The
3016 .I server-name
3017 statement
3018 .RS 0.25i
3019 .PP
3020 .B server-name "\fIname\fB";\fR
3021 .PP
3022 The \fIserver-name\fR statement can be used to inform the client of
3023 the name of the server from which it is booting. \fIName\fR should
3024 be the name that will be provided to the client.
3025 .RE
3026 .PP
3027 The
3028 .I site-option-space
3029 statement
3030 .RS 0.25i
3031 .PP
3032 .B site-option-space "\fIname\fB";\fR
3033 .PP
3034 The \fIsite-option-space\fR statement can be used to determine from
3035 what option space site-local options will be taken. This can be used
3036 in much the same way as the \fIvendor-option-space\fR statement.
3037 Site-local options in DHCP are those options whose numeric codes are
3038 greater than 224. These options are intended for site-specific
3039 uses, but are frequently used by vendors of embedded hardware that
3040 contains DHCP clients. Because site-specific options are allocated
3041 on an ad hoc basis, it is quite possible that one vendor's DHCP client
3042 might use the same option code that another vendor's client uses, for
3043 different purposes. The \fIsite-option-space\fR option can be used
3044 to assign a different set of site-specific options for each such
3045 vendor, using conditional evaluation (see \fBdhcp-eval (5)\fR for
3046 details).
3047 .RE
3048 .PP
3049 The
3050 .I stash-agent-options
3051 statement
3052 .RS 0.25i
3053 .PP
3054 .B stash-agent-options \fIflag\fB;\fR
3055 .PP
3056 If the \fIstash-agent-options\fR parameter is true for a given client,
3057 the server will record the relay agent information options sent during
3058 the client's initial DHCPREQUEST message when the client was in the
3059 SELECTING state and behave as if those options are included in all
3060 subsequent DHCPREQUEST messages sent in the RENEWING state. This
3061 works around a problem with relay agent information options, which is
3062 that they usually not appear in DHCPREQUEST messages sent by the
3063 client in the RENEWING state, because such messages are unicast
3064 directly to the server and not sent through a relay agent.
3065 .RE
3066 .PP
3067 The
3068 .I update-conflict-detection
3069 statement
3070 .RS 0.25i
3071 .PP
3072 .B update-conflict-detection \fIflag\fB;\fR
3073 .PP
3074 If the \fIupdate-conflict-detection\fR parameter is true, the server will
3075 perform standard DHCID multiple-client, one-name conflict detection. If
3076 the parameter has been set false, the server will skip this check and
3077 instead simply tear down any previous bindings to install the new
3078 binding without question. The default is true.
3079 .RE
3080 .PP
3081 The
3082 .I update-optimization
3083 statement
3084 .RS 0.25i
3085 .PP
3086 .B update-optimization \fIflag\fB;\fR
3087 .PP
3088 If the \fIupdate-optimization\fR parameter is false for a given client,
3089 the server will attempt a DNS update for that client each time the
3090 client renews its lease, rather than only attempting an update when it
3091 appears to be necessary. This will allow the DNS to heal from
3092 database inconsistencies more easily, but the cost is that the DHCP
3093 server must do many more DNS updates. We recommend leaving this option
3094 enabled, which is the default. If this parameter is not specified,
3095 or is true, the DHCP server
3096 will only update when the client information changes, the client gets a
3097 different lease, or the client's lease expires.
3098 .RE
3099 .PP
3100 The
3101 .I update-static-leases
3102 statement
3103 .RS 0.25i
3104 .PP
3105 .B update-static-leases \fIflag\fB;\fR
3106 .PP
3107 The \fIupdate-static-leases\fR flag, if enabled, causes the DHCP
3108 server to do DNS updates for clients even if those clients are being
3109 assigned their IP address using a \fIfixed-address\fR statement - that
3110 is, the client is being given a static assignment. It is not
3111 recommended because the DHCP server has no way to tell that the update
3112 has been done, and therefore will not delete the record when it is not
3113 in use. Also, the server must attempt the update each time the
3114 client renews its lease, which could have a significant performance
3115 impact in environments that place heavy demands on the DHCP server.
3116 .RE
3117 .PP
3118 The
3119 .I use-host-decl-names
3120 statement
3121 .RS 0.25i
3122 .PP
3123 .B use-host-decl-names \fIflag\fB;\fR
3124 .PP
3125 If the \fIuse-host-decl-names\fR parameter is true in a given scope,
3126 then for every host declaration within that scope, the name provided
3127 for the host declaration will be supplied to the client as its
3128 hostname. So, for example,
3129 .PP
3130 .nf
3131 group {
3132 use-host-decl-names on;
3133
3134 host joe {
3135 hardware ethernet 08:00:2b:4c:29:32;
3136 fixed-address joe.fugue.com;
3137 }
3138 }
3139
3140 is equivalent to
3141
3142 host joe {
3143 hardware ethernet 08:00:2b:4c:29:32;
3144 fixed-address joe.fugue.com;
3145 option host-name "joe";
3146 }
3147 .fi
3148 .PP
3149 Additionally, enabling use-host-decl-names instructs the server to use
3150 the host declaration name in the the forward DNS name, if no other values
3151 are available. This value selection process is discussed in more detail
3152 under DNS updates.
3153 .PP
3154 An \fIoption host-name\fR statement within a host declaration will
3155 override the use of the name in the host declaration.
3156 .PP
3157 It should be noted here that most DHCP clients completely ignore the
3158 host-name option sent by the DHCP server, and there is no way to
3159 configure them not to do this. So you generally have a choice of
3160 either not having any hostname to client IP address mapping that the
3161 client will recognize, or doing DNS updates. It is beyond
3162 the scope of this document to describe how to make this
3163 determination.
3164 .RE
3165 .PP
3166 The
3167 .I use-lease-addr-for-default-route
3168 statement
3169 .RS 0.25i
3170 .PP
3171 .B use-lease-addr-for-default-route \fIflag\fR\fB;\fR
3172 .PP
3173 If the \fIuse-lease-addr-for-default-route\fR parameter is true in a
3174 given scope, then instead of sending the value specified in the
3175 routers option (or sending no value at all), the IP address of the
3176 lease being assigned is sent to the client. This supposedly causes
3177 Win95 machines to ARP for all IP addresses, which can be helpful if
3178 your router is configured for proxy ARP. The use of this feature is
3179 not recommended, because it won't work for many DHCP clients.
3180 .RE
3181 .PP
3182 The
3183 .I vendor-option-space
3184 statement
3185 .RS 0.25i
3186 .PP
3187 .B vendor-option-space \fIstring\fR\fB;\fR
3188 .PP
3189 The \fIvendor-option-space\fR parameter determines from what option
3190 space vendor options are taken. The use of this configuration
3191 parameter is illustrated in the \fBdhcp-options(5)\fR manual page, in
3192 the \fIVENDOR ENCAPSULATED OPTIONS\fR section.
3193 .RE
3194 .SH SETTING PARAMETER VALUES USING EXPRESSIONS
3195 Sometimes it's helpful to be able to set the value of a DHCP server
3196 parameter based on some value that the client has sent. To do this,
3197 you can use expression evaluation. The
3198 .B dhcp-eval(5)
3199 manual page describes how to write expressions. To assign the result
3200 of an evaluation to an option, define the option as follows:
3201 .nf
3202 .sp 1
3203 \fImy-parameter \fB= \fIexpression \fB;\fR
3204 .fi
3205 .PP
3206 For example:
3207 .nf
3208 .sp 1
3209 ddns-hostname = binary-to-ascii (16, 8, "-",
3210 substring (hardware, 1, 6));
3211 .fi
3212 .RE
3213 .SH RESERVED LEASES
3214 It's often useful to allocate a single address to a single client, in
3215 approximate perpetuity. Host statements with \fBfixed-address\fR clauses
3216 exist to a certain extent to serve this purpose, but because host statements
3217 are intended to approximate \'static configuration\', they suffer from not
3218 being referenced in a littany of other Server Services, such as dynamic DNS,
3219 failover, \'on events\' and so forth.
3220 .PP
3221 If a standard dynamic lease, as from any range statement, is marked
3222 \'reserved\', then the server will only allocate this lease to the client it
3223 is identified by (be that by client identifier or hardware address).
3224 .PP
3225 In practice, this means that the lease follows the normal state engine, enters
3226 ACTIVE state when the client is bound to it, expires, or is released, and any
3227 events or services that would normally be supplied during these events are
3228 processed normally, as with any other dynamic lease. The only difference
3229 is that failover servers treat reserved leases as special when they enter
3230 the FREE or BACKUP states - each server applies the lease into the state it
3231 may allocate from - and the leases are not placed on the queue for allocation
3232 to other clients. Instead they may only be \'found\' by client identity. The
3233 result is that the lease is only offered to the returning client.
3234 .PP
3235 Care should probably be taken to ensure that the client only has one lease
3236 within a given subnet that it is identified by.
3237 .PP
3238 Leases may be set \'reserved\' either through OMAPI, or through the
3239 \'infinite-is-reserved\' configuration option (if this is applicable to your
3240 environment and mixture of clients).
3241 .PP
3242 It should also be noted that leases marked \'reserved\' are effectively treated
3243 the same as leases marked \'bootp\'.
3244 .RE
3245 .SH REFERENCE: OPTION STATEMENTS
3246 DHCP option statements are documented in the
3247 .B dhcp-options(5)
3248 manual page.
3249 .SH REFERENCE: EXPRESSIONS
3250 Expressions used in DHCP option statements and elsewhere are
3251 documented in the
3252 .B dhcp-eval(5)
3253 manual page.
3254 .SH SEE ALSO
3255 dhcpd(8), dhcpd.leases(5), dhcp-options(5), dhcp-eval(5), RFC2132, RFC2131.
3256 .SH AUTHOR
3257 .B dhcpd.conf(5)
3258 is maintained by ISC.
3259 Information about Internet Systems Consortium can be found at
3260 .B https://www.isc.org.