]> git.ipfire.org Git - thirdparty/dhcp.git/blob - client/dhclient.conf.5
d973d11b6b9f5cf4499eb112d43a8a5aa117688d
[thirdparty/dhcp.git] / client / dhclient.conf.5
1 .\" $Id: dhclient.conf.5,v 1.34 2012/01/24 22:23:39 sar Exp $
2 .\"
3 .\" Copyright (c) 2004-2017 by Internet Systems Consortium, Inc. ("ISC")
4 .\" Copyright (c) 1996-2003 by Internet Software Consortium
5 .\"
6 .\" This Source Code Form is subject to the terms of the Mozilla Public
7 .\" License, v. 2.0. If a copy of the MPL was not distributed with this
8 .\" file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 .\"
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
16 .\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .\"
18 .\" Internet Systems Consortium, Inc.
19 .\" PO Box 360
20 .\" Newmarket, NH 03857 USA
21 .\" <info@isc.org>
22 .\" https://www.isc.org/
23 .\"
24 .\" Support and other services are available for ISC products - see
25 .\" https://www.isc.org for more information or to learn more about ISC.
26 .\"
27 .TH dhclient.conf 5
28 .SH NAME
29 dhclient.conf - DHCP client configuration file
30 .SH DESCRIPTION
31 The dhclient.conf file contains configuration information for
32 .IR dhclient,
33 the Internet Systems Consortium DHCP Client.
34 .PP
35 The dhclient.conf file is a free-form ASCII text file. It is parsed by
36 the recursive-descent parser built into dhclient. The file may contain
37 extra tabs and newlines for formatting purposes. Keywords in the file
38 are case-insensitive. Comments may be placed anywhere within the
39 file (except within quotes). Comments begin with the # character and
40 end at the end of the line.
41 .PP
42 The dhclient.conf file can be used to configure the behaviour of the
43 client in a wide variety of ways: protocol timing, information
44 requested from the server, information required of the server,
45 defaults to use if the server does not provide certain information,
46 values with which to override information provided by the server, or
47 values to prepend or append to information provided by the server.
48 The configuration file can also be preinitialized with addresses to
49 use on networks that don't have DHCP servers.
50 .SH PROTOCOL TIMING
51 The timing behaviour of the client need not be configured by the user.
52 If no timing configuration is provided by the user, a fairly
53 reasonable timing behaviour will be used by default - one which
54 results in fairly timely updates without placing an inordinate load on
55 the server.
56 .PP
57 If required the following statements can be used to adjust the timing
58 behaviour of the DHCPv4 client. The DHCPv6 protocol provides values
59 to use and they are not currently configurable.
60 .PP
61 .I The
62 .B timeout
63 .I statement
64 .PP
65 \fBtimeout \fItime\fR\fB;\fR
66 .PP
67 The
68 .I timeout
69 statement determines the amount of time that must pass between the
70 time that the client begins to try to determine its address and the
71 time that it decides that it's not going to be able to contact a
72 server. By default, this timeout is sixty seconds. After the
73 timeout has passed, if there are any static leases defined in the
74 configuration file, or any leases remaining in the lease database that
75 have not yet expired, the client will loop through these leases
76 attempting to validate them, and if it finds one that appears to be
77 valid, it will use that lease's address. If there are no valid
78 static leases or unexpired leases in the lease database, the client
79 will restart the protocol after the defined retry interval.
80 .PP
81 .I The
82 .B retry
83 .I statement
84 .PP
85 \fBretry \fItime\fR\fB;\fR
86 .PP
87 The
88 .I retry
89 statement determines the time that must pass after the client has
90 determined that there is no DHCP server present before it tries again
91 to contact a DHCP server. By default, this is five minutes.
92 .PP
93 .I The
94 .B select-timeout
95 .I statement
96 .PP
97 \fBselect-timeout \fItime\fR\fB;\fR
98 .PP
99 It is possible (some might say desirable) for there to be more than
100 one DHCP server serving any given network. In this case, it is
101 possible that a client may be sent more than one offer in response to
102 its initial lease discovery message. It may be that one of these
103 offers is preferable to the other (e.g., one offer may have the
104 address the client previously used, and the other may not).
105 .PP
106 The
107 .I select-timeout
108 is the time after the client sends its first lease discovery request
109 at which it stops waiting for offers from servers, assuming that it
110 has received at least one such offer. If no offers have been
111 received by the time the
112 .I select-timeout
113 has expired, the client will accept the first offer that arrives.
114 .PP
115 By default, the select-timeout is zero seconds - that is, the client
116 will take the first offer it sees.
117 .PP
118 .I The
119 .B reboot
120 .I statement
121 .PP
122 \fBreboot \fItime\fR\fB;\fR
123 .PP
124 When the client is restarted, it first tries to reacquire the last
125 address it had. This is called the INIT-REBOOT state. If it is
126 still attached to the same network it was attached to when it last
127 ran, this is the quickest way to get started. The
128 .I reboot
129 statement sets the time that must elapse after the client first tries
130 to reacquire its old address before it gives up and tries to discover
131 a new address. By default, the reboot timeout is ten seconds.
132 .PP
133 .I The
134 .B backoff-cutoff
135 .I statement
136 .PP
137 \fBbackoff-cutoff \fItime\fR\fB;\fR
138 .PP
139 The client uses an exponential backoff algorithm with some randomness,
140 so that if many clients try to configure themselves at the same time,
141 they will not make their requests in lockstep. The
142 .I backoff-cutoff
143 statement determines the maximum amount of time that the client is
144 allowed to back off, the actual value will be evaluated randomly between
145 1/2 to 1 1/2 times the \fItime\fR specified. It defaults to fifteen
146 seconds.
147 .PP
148 .I The
149 .B initial-interval
150 .I statement
151 .PP
152 \fBinitial-interval \fItime\fR\fB;\fR
153 .PP
154 The
155 .I initial-interval
156 statement sets the amount of time between the first attempt to reach a
157 server and the second attempt to reach a server. Each time a message
158 is sent, the interval between messages is incremented by twice the
159 current interval multiplied by a random number between zero and one.
160 If it is greater than the backoff-cutoff amount, it is set to that
161 amount. It defaults to ten seconds.
162 .PP
163 .I The initial-delay
164 .I statement
165 .PP
166 \fBinitial-delay \fItime\fR\fB;\fR
167 .PP
168 .I initial-delay
169 parameter sets the maximum time client can wait after start before
170 commencing first transmission.
171 According to RFC2131 Section 4.4.1, client should wait a random time between
172 startup and the actual first transmission. Previous versions of ISC DHCP
173 client used to wait random time up to 5 seconds, but that was unwanted
174 due to impact on startup time. As such, new versions have the default
175 initial delay set to 0. To restore old behavior, please set initial-delay
176 to 5.
177 .SH DHCPv6 LEASE SELECTION
178 In the DHCPv6 protocol the client will wait a small amount of time to
179 allow ADVERTISE messages from multiple servers to arrive. It will then
180 need to choose from all of the messages that may have arrived before
181 proceeding to making a request of the selected server.
182
183 The first selection criteria is the set of options and addresses
184 in the message. Messages that don't include an option specified
185 as required will be given a score of 0 and not used. If the
186 \fI-R\fR option is given on the command line then messages that
187 don't include the correct number of bindings (IA-NA, IA-TA or
188 IA-PD) will be discarded.
189
190 The next criteria is the preference value from the message. With
191 the highest preference value being used even if leases with better
192 addresses or options are available.
193
194 Finally the lease is scored and the lease with the highest score
195 is selected. A lease's score is based on the number of bindings,
196 number of addresses and number of options it contains:
197 .nf
198 bindings * X + addresses * Y + options
199 .fi
200 By default X = 10000 and Y = 100, this will cause the client to
201 select a lease with more bindings over a lease with less bindings
202 but more addresses. The weightings were changed as part of
203 implementing RFC 7550. Previously they were X = 50 and Y = 100
204 meaning more addresses were preferred over more bindings. If
205 you wish to continue using the old style you may do so by editing
206 the file includes/site.h and uncommenting the define for
207 USE_ORIGINAL_CLIENT_LEASE_WEIGHTS.
208 .SH LEASE REQUIREMENTS AND REQUESTS
209 The DHCP protocol allows the client to request that the server send it
210 specific information, and not send it other information that it is not
211 prepared to accept. The protocol also allows the client to reject
212 offers from servers if they don't contain information the client
213 needs, or if the information provided is not satisfactory.
214 .PP
215 There is a variety of data contained in offers that DHCP servers send
216 to DHCP clients. The data that can be specifically requested is what
217 are called \fIDHCP Options\fR. DHCP Options are defined in
218 \fBdhcp-options(5)\fR.
219 .PP
220 .I The
221 .B request
222 .I statement
223 .PP
224 \fB[ also ] request [ [ \fIoption-space\fR . ] \fIoption\fR ] [\fB,\fI ... ]\fB;\fR
225 .PP
226 The request statement causes the client to request that any server
227 responding to the client send the client its values for the specified
228 options. Only the option names should be specified in the request
229 statement - not option parameters. By default, the DHCPv4 client
230 requests the subnet-mask, broadcast-address, time-offset, routers,
231 domain-name, domain-name-servers and host-name options while the DHCPv6
232 client requests the dhcp6 name-servers and domain-search options. Note
233 that if you enter a \'request\' statement, you over-ride these defaults
234 and these options will not be requested.
235 .PP
236 In some cases, it may be desirable to send no parameter request list
237 at all. To do this, simply write the request statement but specify
238 no parameters:
239 .PP
240 .nf
241 request;
242 .fi
243 .PP
244 In most cases, it is desirable to simply add one option to the request
245 list which is of interest to the client in question. In this case, it
246 is best to \'also request\' the additional options:
247 .PP
248 .nf
249 also request domain-search, dhcp6.sip-servers-addresses;
250 .fi
251 .PP
252 .I The
253 .B require
254 .I statement
255 .PP
256 \fB[ also ] require [ [ \fIoption-space\fR . ] \fIoption\fR ] [\fB,\fI ... ]\fB;\fR
257 .PP
258 The require statement lists options that must be sent in order for an
259 offer to be accepted. Offers that do not contain all the listed
260 options will be ignored. There is no default require list.
261 .PP
262 .nf
263 require name-servers;
264
265 interface eth0 {
266 also require domain-search;
267 }
268 .fi
269 .PP
270 .I The
271 .B send
272 .I statement
273 .PP
274 \fBsend [ \fIoption declaration\fR ] \fB;\fR
275 .PP
276 The send statement causes the client to send the specified option to
277 the server with the specified value. This is a full option
278 declaration as described in \fBdhcp-options(5)\fR. Options that are
279 always sent in the DHCP protocol should not be specified here, except
280 that the client can specify a requested \fBdhcp-lease-time\fR option other
281 than the default requested lease time, which is two hours. The other
282 obvious use for this statement is to send information to the server
283 that will allow it to differentiate between this client and other
284 clients or kinds of clients.
285 .SH DYNAMIC DNS
286 The client now has some very limited support for doing DNS updates
287 when a lease is acquired. This is prototypical, and probably doesn't
288 do what you want. It also only works if you happen to have control
289 over your DNS server, which isn't very likely.
290 .PP
291 Note that everything in this section is true whether you are using DHCPv4
292 or DHCPv6. The exact same syntax is used for both.
293 .PP
294 To make it work, you have to declare a key and zone as in the DHCP
295 server (see \fBdhcpd.conf\fR(5) for details). You also need to
296 configure the \fIfqdn\fR option on the client, as follows:
297 .PP
298 .nf
299 send fqdn.fqdn "grosse.example.com.";
300 send fqdn.encoded on;
301 send fqdn.server-update off;
302 also request fqdn, dhcp6.fqdn;
303 .fi
304 .PP
305 The \fIfqdn.fqdn\fR option \fBMUST\fR be a fully-qualified domain
306 name. You \fBMUST\fR define a zone statement for the zone to be
307 updated. The \fIfqdn.encoded\fR option may need to be set to
308 \fIon\fR or \fIoff\fR, depending on the DHCP server you are using.
309 .PP
310 .I The
311 .B do-forward-updates
312 .I statement
313 .PP
314 \fBdo-forward-updates [ \fIflag\fR ] \fB;\fR
315 .PP
316 If you want to do DNS updates in the DHCP client
317 script (see \fBdhclient-script(8)\fR) rather than having the
318 DHCP client do the update directly (for example, if you want to
319 use SIG(0) authentication, which is not supported directly by the
320 DHCP client, you can instruct the client not to do the update using
321 the \fBdo-forward-updates\fR statement. \fIFlag\fR should be \fBtrue\fR
322 if you want the DHCP client to do the update, and \fBfalse\fR if
323 you don't want the DHCP client to do the update. By default, the DHCP
324 client will do the DNS update.
325 .SH OPTION MODIFIERS
326 In some cases, a client may receive option data from the server which
327 is not really appropriate for that client, or may not receive
328 information that it needs, and for which a useful default value
329 exists. It may also receive information which is useful, but which
330 needs to be supplemented with local information. To handle these
331 needs, several option modifiers are available.
332 .PP
333 .I The
334 .B default
335 .I statement
336 .PP
337 \fBdefault [ \fIoption declaration\fR ] \fB;\fR
338 .PP
339 If for some option the client should use the value supplied by
340 the server, but needs to use some default value if no value was supplied
341 by the server, these values can be defined in the
342 .B default
343 statement.
344 .PP
345 .I The
346 .B supersede
347 .I statement
348 .PP
349 \fBsupersede [ \fIoption declaration\fR ] \fB;\fR
350 .PP
351 If for some option the client should always use a locally-configured
352 value or values rather than whatever is supplied by the server, these
353 values can be defined in the
354 .B supersede
355 statement.
356 .PP
357 .I The
358 .B prepend
359 .I statement
360 .PP
361 \fBprepend [ \fIoption declaration\fR ] \fB;\fR
362 .PP
363 If for some set of options the client should use a value you
364 supply, and then use the values supplied by
365 the server, if any, these values can be defined in the
366 .B prepend
367 statement. The
368 .B prepend
369 statement can only be used for options which
370 allow more than one value to be given. This restriction is not
371 enforced - if you ignore it, the behaviour will be unpredictable.
372 .PP
373 .I The
374 .B append
375 .I statement
376 .PP
377 \fBappend [ \fIoption declaration\fR ] \fB;\fR
378 .PP
379 If for some set of options the client should first use the values
380 supplied by the server, if any, and then use values you supply, these
381 values can be defined in the
382 .B append
383 statement. The
384 .B append
385 statement can only be used for options which
386 allow more than one value to be given. This restriction is not
387 enforced - if you ignore it, the behaviour will be unpredictable.
388 .SH LEASE DECLARATIONS
389 .PP
390 .I The
391 .B lease
392 .I declaration
393 .PP
394 \fBlease {\fR \fIlease-declaration\fR [ ... \fIlease-declaration ] \fB}\fR
395 .PP
396 The DHCP client may decide after some period of time (see \fBPROTOCOL
397 TIMING\fR) that it is not going to succeed in contacting a
398 server. At that time, it consults its own database of old leases and
399 tests each one that has not yet timed out by pinging the listed router
400 for that lease to see if that lease could work. It is possible to
401 define one or more \fIfixed\fR leases in the client configuration file
402 for networks where there is no DHCP or BOOTP service, so that the
403 client can still automatically configure its address. This is done
404 with the
405 .B lease
406 statement.
407 .PP
408 NOTE: the lease statement is also used in the dhclient.leases file in
409 order to record leases that have been received from DHCP servers.
410 Some of the syntax for leases as described below is only needed in the
411 dhclient.leases file. Such syntax is documented here for
412 completeness.
413 .PP
414 A lease statement consists of the lease keyword, followed by a left
415 curly brace, followed by one or more lease declaration statements,
416 followed by a right curly brace. The following lease declarations
417 are possible:
418 .PP
419 \fBbootp;\fR
420 .PP
421 The
422 .B bootp
423 statement is used to indicate that the lease was acquired using the
424 BOOTP protocol rather than the DHCP protocol. It is never necessary
425 to specify this in the client configuration file. The client uses
426 this syntax in its lease database file.
427 .PP
428 \fBinterface\fR \fB"\fR\fIstring\fR\fB";\fR
429 .PP
430 The
431 .B interface
432 lease statement is used to indicate the interface on which the lease
433 is valid. If set, this lease will only be tried on a particular
434 interface. When the client receives a lease from a server, it always
435 records the interface number on which it received that lease.
436 If predefined leases are specified in the dhclient.conf file, the
437 interface should also be specified, although this is not required.
438 .PP
439 \fBfixed-address\fR \fIip-address\fR\fB;\fR
440 .PP
441 The
442 .B fixed-address
443 statement is used to set the ip address of a particular lease. This
444 is required for all lease statements. The IP address must be
445 specified as a dotted quad (e.g., 12.34.56.78).
446 .PP
447 \fBfilename "\fR\fIstring\fR\fB";\fR
448 .PP
449 The
450 .B filename
451 statement specifies the name of the boot filename to use. This is
452 not used by the standard client configuration script, but is included
453 for completeness.
454 .PP
455 \fBserver-name "\fR\fIstring\fR\fB";\fR
456 .PP
457 The
458 .B server-name
459 statement specifies the name of the boot server name to use. This is
460 also not used by the standard client configuration script.
461 .PP
462 \fBoption\fR \fIoption-declaration\fR\fB;\fR
463 .PP
464 The
465 .B option
466 statement is used to specify the value of an option supplied by the
467 server, or, in the case of predefined leases declared in
468 dhclient.conf, the value that the user wishes the client configuration
469 script to use if the predefined lease is used.
470 .PP
471 \fBscript "\fIscript-name\fB";\fR
472 .PP
473 The
474 .B script
475 statement is used to specify the pathname of the dhcp client
476 configuration script. This script is used by the dhcp client to set
477 each interface's initial configuration prior to requesting an address,
478 to test the address once it has been offered, and to set the
479 interface's final configuration once a lease has been acquired. If
480 no lease is acquired, the script is used to test predefined leases, if
481 any, and also called once if no valid lease can be identified. For
482 more information, see
483 .B dhclient-script(8).
484 .PP
485 \fBvendor option space "\fIname\fB";\fR
486 .PP
487 The
488 .B vendor option space
489 statement is used to specify which option space should be used for
490 decoding the vendor-encapsulate-options option if one is received.
491 The \fIdhcp-vendor-identifier\fR can be used to request a specific
492 class of vendor options from the server. See
493 .B dhcp-options(5)
494 for details.
495 .PP
496 \fBmedium "\fImedia setup\fB";\fR
497 .PP
498 The
499 .B medium
500 statement can be used on systems where network interfaces cannot
501 automatically determine the type of network to which they are
502 connected. The media setup string is a system-dependent parameter
503 which is passed to the dhcp client configuration script when
504 initializing the interface. On Unix and Unix-like systems, the
505 argument is passed on the ifconfig command line when configuring the
506 interface.
507 .PP
508 The dhcp client automatically declares this parameter if it uses a
509 media type (see the
510 .B media
511 statement) when configuring the interface in order to obtain a lease.
512 This statement should be used in predefined leases only if the network
513 interface requires media type configuration.
514 .PP
515 \fBrenew\fR \fIdate\fB;\fR
516 .PP
517 \fBrebind\fR \fIdate\fB;\fR
518 .PP
519 \fBexpire\fR \fIdate\fB;\fR
520 .PP
521 The \fBrenew\fR statement defines the time at which the dhcp client
522 should begin trying to contact its server to renew a lease that it is
523 using. The \fBrebind\fR statement defines the time at which the dhcp
524 client should begin to try to contact \fIany\fR dhcp server in order
525 to renew its lease. The \fBexpire\fR statement defines the time at
526 which the dhcp client must stop using a lease if it has not been able
527 to contact a server in order to renew it.
528 .PP
529 These declarations are automatically set in leases acquired by the
530 DHCP client, but must also be configured in predefined leases - a
531 predefined lease whose expiry time has passed will not be used by the
532 DHCP client.
533 .PP
534 Dates are specified in one of two ways. The software will output times in
535 these two formats depending on if the \fBdb-time-format\fR configuration
536 parameter has been set to \fIdefault\fR or \fIlocal\fR.
537 .PP
538 If it is set to \fIdefault\fR, then \fIdate\fR values appear as follows:
539 .PP
540 \fI<weekday> <year>\fB/\fI<month>\fB/\fI<day>
541 <hour>\fB:\fI<minute>\fB:\fI<second>\fR
542 .PP
543 The weekday is present to make it easy for a human to tell when a
544 lease expires - it's specified as a number from zero to six, with zero
545 being Sunday. When declaring a predefined lease, it can always be
546 specified as zero. The year is specified with the century, so it
547 should generally be four digits except for really long leases. The
548 month is specified as a number starting with 1 for January. The day
549 of the month is likewise specified starting with 1. The hour is a
550 number between 0 and 23, the minute a number between 0 and 59, and the
551 second also a number between 0 and 59.
552 .PP
553 If the \fBdb-time-format\fR configuration was set to \fIlocal\fR, then
554 the \fIdate\fR values appear as follows:
555 .PP
556 \fBepoch\fR \fI<seconds-since-epoch>\fR\fB; #\fR \fI<day-name> <month-name>
557 <day-number> <hours>\fR\fB:\fR\fI<minutes>\fR\fB:\fR\fI<seconds> <year>\fR
558 .PP
559 The \fIseconds-since-epoch\fR is as according to the system's local clock (often
560 referred to as "unix time"). The \fB#\fR symbol supplies a comment that
561 describes what actual time this is as according to the system's configured
562 timezone, at the time the value was written. It is provided only for human
563 inspection, the epoch time is the only recommended value for machine
564 inspection.
565 .PP
566 Note that when defining a static lease, one may use either time format one
567 wishes, and need not include the comment or values after it.
568 .PP
569 If the time is infinite in duration, then the \fIdate\fR is \fBnever\fR
570 instead of an actual date.
571 .SH ALIAS DECLARATIONS
572 \fBalias { \fI declarations ... \fB}\fR
573 .PP
574 Some DHCP clients running TCP/IP roaming protocols may require that in
575 addition to the lease they may acquire via DHCP, their interface also
576 be configured with a predefined IP alias so that they can have a
577 permanent IP address even while roaming. The Internet Systems
578 Consortium DHCP client doesn't support roaming with fixed addresses
579 directly, but in order to facilitate such experimentation, the dhcp
580 client can be set up to configure an IP alias using the
581 .B alias
582 declaration.
583 .PP
584 The alias declaration resembles a lease declaration, except that
585 options other than the subnet-mask option are ignored by the standard
586 client configuration script, and expiry times are ignored. A typical
587 alias declaration includes an interface declaration, a fixed-address
588 declaration for the IP alias address, and a subnet-mask option
589 declaration. A medium statement should never be included in an alias
590 declaration.
591 .SH OTHER DECLARATIONS
592 \fBdb-time-format\fR [ \fIdefault\fR | \fIlocal\fR ] \fB;\fR
593 .PP
594 The \fBdb-time-format\fR option determines which of two output methods are
595 used for printing times in leases files. The \fIdefault\fR format provides
596 day-and-time in UTC, whereas \fIlocal\fR uses a seconds-since-epoch to store
597 the time value, and helpfully places a local timezone time in a comment on
598 the same line. The formats are described in detail in this manpage, within
599 the LEASE DECLARATIONS section.
600 .PP
601 The
602 .I lease-id-format
603 parameter
604 .RS 0.25i
605 .PP
606 .B lease-id-format \fIformat\fB;\fR
607 .PP
608 The \fIformat\fR parameter must be either \fBoctal\fR or \fBhex\fR.
609 This parameter governs the format used to write certain values to lease
610 files. With the default format, octal, values are written as quoted strings in
611 which non-printable characters are represented as octal escapes -
612 a backslash character followed by three octal digits. When the hex format
613 is specified, values are written as an unquoted series of hexadecimal digit
614 pairs, separated by colons.
615
616 Currently, the values written out based on lease-id-format are the default-duid
617 and the IAID value (DHCPv6 only). The client automatically reads the values
618 in either format. Note that when the format is octal, rather than as an octal
619 string, IAID is output as hex if it contains no printable characters or as a
620 string if contains only printable characters. This is done to maintain backward
621 compatibility.
622 .PP
623 \fBreject \fIcidr-ip-address\fR [\fB,\fR \fI...\fB \fIcidr-ip-address\fR ] \fB;\fR
624 .PP
625 The
626 .B reject
627 statement causes the DHCP client to reject offers from
628 servers whose server identifier matches any of the specified hosts or
629 subnets. This can be used to avoid being configured by rogue or
630 misconfigured dhcp servers, although it should be a last resort -
631 better to track down the bad DHCP server and fix it.
632 .PP
633 The \fIcidr-ip-address\fR configuration type is of the
634 form \fIip-address\fR[\fB/\fIprefixlen\fR], where \fIip-address\fR is a
635 dotted quad IP address, and \fRprefixlen\fR is the CIDR prefix length of
636 the subnet, counting the number of significant bits in the netmask starting
637 from the leftmost end. Example configuration syntax:
638 .PP
639 .I \fIreject\fR 192.168.0.0\fB/\fR16\fB,\fR 10.0.0.5\fB;\fR
640 .PP
641 The above example would cause offers from any server identifier in the
642 entire RFC 1918 "Class C" network 192.168.0.0/16, or the specific
643 single address 10.0.0.5, to be rejected.
644 .PP
645 \fBinterface "\fIname\fB" { \fIdeclarations ... \fB }
646 .PP
647 A client with more than one network interface may require different
648 behaviour depending on which interface is being configured. All
649 timing parameters and declarations other than lease and alias
650 declarations can be enclosed in an interface declaration, and those
651 parameters will then be used only for the interface that matches the
652 specified name. Interfaces for which there is no interface
653 declaration will use the parameters declared outside of any interface
654 declaration, or the default settings.
655 .PP
656 .B Note well:
657 ISC dhclient only maintains one list of interfaces, which is either
658 determined at startup from command line arguments, or otherwise is
659 autodetected. If you supplied the list of interfaces on the command
660 line, this configuration clause will add the named interface to the
661 list in such a way that will cause it to be configured by DHCP. Which
662 may not be the result you had intended. This is an undesirable side
663 effect that will be addressed in a future release.
664 .PP
665 \fBpseudo "\fIname\fR" "\fIreal-name\fB" { \fIdeclarations ... \fB }
666 .PP
667 Under some circumstances it can be useful to declare a pseudo-interface
668 and have the DHCP client acquire a configuration for that interface.
669 Each interface that the DHCP client is supporting normally has a DHCP
670 client state machine running on it to acquire and maintain its lease.
671 A pseudo-interface is just another state machine running on the
672 interface named \fIreal-name\fR, with its own lease and its own
673 state. If you use this feature, you must provide a client identifier
674 for both the pseudo-interface and the actual interface, and the two
675 identifiers must be different. You must also provide a separate
676 client script for the pseudo-interface to do what you want with the IP
677 address. For example:
678 .PP
679 .nf
680 interface "ep0" {
681 send dhcp-client-identifier "my-client-ep0";
682 }
683 pseudo "secondary" "ep0" {
684 send dhcp-client-identifier "my-client-ep0-secondary";
685 script "/etc/dhclient-secondary";
686 }
687 .fi
688 .PP
689 The client script for the pseudo-interface should not configure the
690 interface up or down - essentially, all it needs to handle are the
691 states where a lease has been acquired or renewed, and the states
692 where a lease has expired. See \fBdhclient-script(8)\fR for more
693 information.
694 .PP
695 \fBmedia "\fImedia setup\fB"\fI [ \fB, "\fImedia setup\fB", \fI... ]\fB;\fR
696 .PP
697 The
698 .B media
699 statement defines one or more media configuration parameters which may
700 be tried while attempting to acquire an IP address. The dhcp client
701 will cycle through each media setup string on the list, configuring
702 the interface using that setup and attempting to boot, and then trying
703 the next one. This can be used for network interfaces which aren't
704 capable of sensing the media type unaided - whichever media type
705 succeeds in getting a request to the server and hearing the reply is
706 probably right (no guarantees).
707 .PP
708 The media setup is only used for the initial phase of address
709 acquisition (the DHCPDISCOVER and DHCPOFFER packets). Once an
710 address has been acquired, the dhcp client will record it in its lease
711 database and will record the media type used to acquire the address.
712 Whenever the client tries to renew the lease, it will use that same
713 media type. The lease must expire before the client will go back to
714 cycling through media types.
715 .PP
716 \fBhardware\fR \fIlink-type mac-address\fR\fB;\fR
717 .PP
718 The
719 .B hardware
720 statement defines the hardware MAC address to use for this interface,
721 for DHCP servers or relays to direct their replies. dhclient will determine
722 the interface's MAC address automatically, so use of this parameter
723 is not recommended. The \fIlink-type\fR corresponds to the interface's
724 link layer type (example: \'ethernet\'), while the \fImac-address\fR is
725 a string of colon-separated hexadecimal values for octets.
726 .PP
727 \fBanycast-mac\fR \fIlink-type mac-address\fR\fB;\fR
728 .PP
729 The
730 .B anycast-mac
731 statement over-rides the all-ones broadcast MAC address dhclient will use
732 when it is transmitting packets to the all-ones limited broadcast IPv4
733 address. This configuration parameter is useful to reduce the number of
734 broadcast packets transmitted by DHCP clients, but is only useful if you
735 know the DHCP service(s) anycast MAC address prior to configuring your
736 client. The \fIlink-type\fR and \fImac-address\fR parameters are configured
737 in a similar manner to the \fBhardware\fR statement.
738 .PP
739 .SH SAMPLE
740 The following configuration file was used on a laptop running NetBSD
741 1.3, though the domains have been modified.
742 The laptop has an IP alias of 192.5.5.213, and has one
743 interface, ep0 (a 3com 3C589C). Booting intervals have been
744 shortened somewhat from the default, because the client is known to
745 spend most of its time on networks with little DHCP activity. The
746 laptop does roam to multiple networks.
747
748 .nf
749
750 timeout 60;
751 retry 60;
752 reboot 10;
753 select-timeout 5;
754 initial-interval 2;
755 reject 192.33.137.209;
756
757 interface "ep0" {
758 send host-name "andare.example.com";
759 hardware ethernet 00:a0:24:ab:fb:9c;
760 send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
761 send dhcp-lease-time 3600;
762 supersede domain-search "example.com", "rc.isc.org", "home.isc.org";
763 prepend domain-name-servers 127.0.0.1;
764 request subnet-mask, broadcast-address, time-offset, routers,
765 domain-name, domain-name-servers, host-name;
766 require subnet-mask, domain-name-servers;
767 script "CLIENTBINDIR/dhclient-script";
768 media "media 10baseT/UTP", "media 10base2/BNC";
769 }
770
771 alias {
772 interface "ep0";
773 fixed-address 192.5.5.213;
774 option subnet-mask 255.255.255.255;
775 }
776 .fi
777 This is a very complicated dhclient.conf file - in general, yours
778 should be much simpler. In many cases, it's sufficient to just
779 create an empty dhclient.conf file - the defaults are usually fine.
780 .SH SEE ALSO
781 dhcp-options(5), dhcp-eval(5), dhclient.leases(5), dhcpd(8), dhcpd.conf(5),
782 RFC2132, RFC2131.
783 .SH AUTHOR
784 .B dhclient(8)
785 Information about Internet Systems Consortium can be found at
786 .B https://www.isc.org.