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