1dhclient.conf(5) File Formats Manual dhclient.conf(5)
2
3
4
6 dhclient.conf - DHCP client configuration file
7
9 The dhclient.conf file contains configuration information for dhclient,
10 the Internet Systems Consortium DHCP Client.
11
12 The dhclient.conf file is a free-form ASCII text file. It is parsed by
13 the recursive-descent parser built into dhclient. The file may contain
14 extra tabs and newlines for formatting purposes. Keywords in the file
15 are case-insensitive. Comments may be placed anywhere within the file
16 (except within quotes). Comments begin with the # character and end at
17 the end of the line.
18
19 The dhclient.conf file can be used to configure the behaviour of the
20 client in a wide variety of ways: protocol timing, information
21 requested from the server, information required of the server, defaults
22 to use if the server does not provide certain information, values with
23 which to override information provided by the server, or values to
24 prepend or append to information provided by the server. The configu‐
25 ration file can also be preinitialized with addresses to use on net‐
26 works that don't have DHCP servers.
27
29 The timing behaviour of the client need not be configured by the user.
30 If no timing configuration is provided by the user, a fairly reasonable
31 timing behaviour will be used by default - one which results in fairly
32 timely updates without placing an inordinate load on the server.
33
34 The following statements can be used to adjust the timing behaviour of
35 the DHCP client if required, however:
36
37 The timeout statement
38
39 timeout time ;
40
41 The timeout statement determines the amount of time that must pass
42 between the time that the client begins to try to determine its address
43 and the time that it decides that it's not going to be able to contact
44 a server. By default, this timeout is sixty seconds. After the time‐
45 out has passed, if there are any static leases defined in the configu‐
46 ration file, or any leases remaining in the lease database that have
47 not yet expired, the client will loop through these leases attempting
48 to validate them, and if it finds one that appears to be valid, it will
49 use that lease's address. If there are no valid static leases or unex‐
50 pired leases in the lease database, the client will restart the proto‐
51 col after the defined retry interval.
52
53 The retry statement
54
55 retry time;
56
57 The retry statement determines the time that must pass after the client
58 has determined that there is no DHCP server present before it tries
59 again to contact a DHCP server. By default, this is five minutes.
60
61 The select-timeout statement
62
63 select-timeout time;
64
65 It is possible (some might say desirable) for there to be more than one
66 DHCP server serving any given network. In this case, it is possible
67 that a client may be sent more than one offer in response to its ini‐
68 tial lease discovery message. It may be that one of these offers is
69 preferable to the other (e.g., one offer may have the address the
70 client previously used, and the other may not).
71
72 The select-timeout is the time after the client sends its first lease
73 discovery request at which it stops waiting for offers from servers,
74 assuming that it has received at least one such offer. If no offers
75 have been received by the time the select-timeout has expired, the
76 client will accept the first offer that arrives.
77
78 By default, the select-timeout is zero seconds - that is, the client
79 will take the first offer it sees.
80
81 The reboot statement
82
83 reboot time;
84
85 When the client is restarted, it first tries to reacquire the last
86 address it had. This is called the INIT-REBOOT state. If it is still
87 attached to the same network it was attached to when it last ran, this
88 is the quickest way to get started. The reboot statement sets the time
89 that must elapse after the client first tries to reacquire its old
90 address before it gives up and tries to discover a new address. By
91 default, the reboot timeout is ten seconds.
92
93 The backoff-cutoff statement
94
95 backoff-cutoff time;
96
97 The client uses an exponential backoff algorithm with some randomness,
98 so that if many clients try to configure themselves at the same time,
99 they will not make their requests in lockstep. The backoff-cutoff
100 statement determines the maximum amount of time that the client is
101 allowed to back off, the actual value will be evaluated randomly
102 between 1/2 to 1 1/2 times the time specified. It defaults to fifteen
103 seconds.
104
105 The initial-interval statement
106
107 initial-interval time;
108
109 The initial-interval statement sets the amount of time between the
110 first attempt to reach a server and the second attempt to reach a
111 server. Each time a message is sent, the interval between messages is
112 incremented by twice the current interval multiplied by a random number
113 between zero and one. If it is greater than the backoff-cutoff amount,
114 it is set to that amount. It defaults to ten seconds.
115
116 The initial-delay statement
117
118 initial-delay time;
119
120 initial-delay parameter sets the maximum time client can wait after
121 start before commencing first transmission. According to RFC2131 Sec‐
122 tion 4.4.1, client should wait a random time between startup and the
123 actual first transmission. Previous versions of ISC DHCP client used to
124 wait random time up to 5 seconds, but that was unwanted due to impact
125 on startup time. As such, new versions have the default initial delay
126 set to 0. To restore old behavior, please set initial-delay to 5.
127
129 The DHCP protocol allows the client to request that the server send it
130 specific information, and not send it other information that it is not
131 prepared to accept. The protocol also allows the client to reject
132 offers from servers if they don't contain information the client needs,
133 or if the information provided is not satisfactory.
134
135 There is a variety of data contained in offers that DHCP servers send
136 to DHCP clients. The data that can be specifically requested is what
137 are called DHCP Options. DHCP Options are defined in
138 dhcp-options(5).
139
140 The request statement
141
142 [ also ] request [ [ option-space . ] option ] [, ... ];
143
144 The request statement causes the client to request that any server
145 responding to the client send the client its values for the specified
146 options. Only the option names should be specified in the request
147 statement - not option parameters. By default, the DHCPv4 client
148 requests the subnet-mask, broadcast-address, time-offset, routers,
149 domain-search, domain-name, domain-name-servers, host-name, nis-domain,
150 nis-servers, ntp-servers and interface-mtu options while the DHCPv6
151 client requests the dhcp6 name-servers and domain-search options. Note
152 that if you enter a ´request´ statement, you over-ride these defaults
153 and these options will not be requested.
154
155 In some cases, it may be desirable to send no parameter request list at
156 all. To do this, simply write the request statement but specify no
157 parameters:
158
159 request;
160
161 In most cases, it is desirable to simply add one option to the request
162 list which is of interest to the client in question. In this case, it
163 is best to ´also request´ the additional options:
164
165 also request domain-search, dhcp6.sip-servers-addresses;
166
167 The require statement
168
169 [ also ] require [ [ option-space . ] option ] [, ... ];
170
171 The require statement lists options that must be sent in order for an
172 offer to be accepted. Offers that do not contain all the listed
173 options will be ignored. There is no default require list.
174
175 require name-servers;
176
177 interface eth0 {
178 also require domain-search;
179 }
180
181 The
182 send
183 statement
184
185 send { [ option declaration ]
186 [, ... option declaration ]}
187
188 The send statement causes the client to send the specified options to
189 the server with the specified values. These are full option
190 declarations as described in dhcp-options(5). Options that are
191 always sent in the DHCP protocol should not be specified here, except
192 that the client can specify a requested dhcp-lease-time option other
193 than the default requested lease time, which is two hours. The other
194 obvious use for this statement is to send information to the server
195 that will allow it to differentiate between this client and other
196 clients or kinds of clients.
197
199 The client now has some very limited support for doing DNS updates when
200 a lease is acquired. This is prototypical, and probably doesn't do
201 what you want. It also only works if you happen to have control over
202 your DNS server, which isn't very likely.
203
204 Note that everything in this section is true whether you are using
205 DHCPv4 or DHCPv6. The exact same syntax is used for both.
206
207 To make it work, you have to declare a key and zone as in the DHCP
208 server (see dhcpd.conf(5) for details). You also need to configure the
209 fqdn option on the client, as follows:
210
211 send fqdn.fqdn "grosse.fugue.com.";
212 send fqdn.encoded on;
213 send fqdn.server-update off;
214 also request fqdn, dhcp6.fqdn;
215
216 The fqdn.fqdn option MUST be a fully-qualified domain name. You MUST
217 define a zone statement for the zone to be updated. The fqdn.encoded
218 option may need to be set to on or off, depending on the DHCP server
219 you are using.
220
221 The do-forward-updates statement
222
223 do-forward-updates [ flag ] ;
224
225 If you want to do DNS updates in the DHCP client script (see dhclient-
226 script(8)) rather than having the DHCP client do the update directly
227 (for example, if you want to use SIG(0) authentication, which is not
228 supported directly by the DHCP client, you can instruct the client not
229 to do the update using the do-forward-updates statement. Flag should
230 be true if you want the DHCP client to do the update, and false if you
231 don't want the DHCP client to do the update. By default, the DHCP
232 client will do the DNS update.
233
235 In some cases, a client may receive option data from the server which
236 is not really appropriate for that client, or may not receive informa‐
237 tion that it needs, and for which a useful default value exists. It
238 may also receive information which is useful, but which needs to be
239 supplemented with local information. To handle these needs, several
240 option modifiers are available.
241
242 The default statement
243
244 default [ option declaration ] ;
245
246 If for some option the client should use the value supplied by the
247 server, but needs to use some default value if no value was supplied by
248 the server, these values can be defined in the default statement.
249
250 The supersede statement
251
252 supersede [ option declaration ] ;
253
254 If for some option the client should always use a locally-configured
255 value or values rather than whatever is supplied by the server, these
256 values can be defined in the supersede statement.
257
258 The prepend statement
259
260 prepend [ option declaration ] ;
261
262 If for some set of options the client should use a value you supply,
263 and then use the values supplied by the server, if any, these values
264 can be defined in the prepend statement. The prepend statement can
265 only be used for options which allow more than one value to be given.
266 This restriction is not enforced - if you ignore it, the behaviour will
267 be unpredictable.
268
269 The append statement
270
271 append [ option declaration ] ;
272
273 If for some set of options the client should first use the values sup‐
274 plied by the server, if any, and then use values you supply, these val‐
275 ues can be defined in the append statement. The append statement can
276 only be used for options which allow more than one value to be given.
277 This restriction is not enforced - if you ignore it, the behaviour will
278 be unpredictable.
279
281 The lease declaration
282
283 lease { lease-declaration [ ... lease-declaration ] }
284
285 The DHCP client may decide after some period of time (see PROTOCOL TIM‐
286 ING) that it is not going to succeed in contacting a server. At that
287 time, it consults its own database of old leases and tests each one
288 that has not yet timed out by pinging the listed router for that lease
289 to see if that lease could work. It is possible to define one or more
290 fixed leases in the client configuration file for networks where there
291 is no DHCP or BOOTP service, so that the client can still automatically
292 configure its address. This is done with the lease statement.
293
294 NOTE: the lease statement is also used in the dhclient.leases file in
295 order to record leases that have been received from DHCP servers. Some
296 of the syntax for leases as described below is only needed in the
297 dhclient.leases file. Such syntax is documented here for completeness.
298
299 A lease statement consists of the lease keyword, followed by a left
300 curly brace, followed by one or more lease declaration statements, fol‐
301 lowed by a right curly brace. The following lease declarations are
302 possible:
303
304 bootp;
305
306 The bootp statement is used to indicate that the lease was acquired
307 using the BOOTP protocol rather than the DHCP protocol. It is never
308 necessary to specify this in the client configuration file. The client
309 uses this syntax in its lease database file.
310
311 interface "string";
312
313 The interface lease statement is used to indicate the interface on
314 which the lease is valid. If set, this lease will only be tried on a
315 particular interface. When the client receives a lease from a server,
316 it always records the interface number on which it received that lease.
317 If predefined leases are specified in the dhclient.conf file, the
318 interface should also be specified, although this is not required.
319
320 fixed-address ip-address;
321
322 The fixed-address statement is used to set the ip address of a particu‐
323 lar lease. This is required for all lease statements. The IP address
324 must be specified as a dotted quad (e.g., 12.34.56.78).
325
326 filename "string";
327
328 The filename statement specifies the name of the boot filename to use.
329 This is not used by the standard client configuration script, but is
330 included for completeness.
331
332 server-name "string";
333
334 The server-name statement specifies the name of the boot server name to
335 use. This is also not used by the standard client configuration
336 script.
337
338 option option-declaration;
339
340 The option statement is used to specify the value of an option supplied
341 by the server, or, in the case of predefined leases declared in
342 dhclient.conf, the value that the user wishes the client configuration
343 script to use if the predefined lease is used.
344
345 script "script-name";
346
347 The script statement is used to specify the pathname of the dhcp client
348 configuration script. This script is used by the dhcp client to set
349 each interface's initial configuration prior to requesting an address,
350 to test the address once it has been offered, and to set the inter‐
351 face's final configuration once a lease has been acquired. If no lease
352 is acquired, the script is used to test predefined leases, if any, and
353 also called once if no valid lease can be identified. For more infor‐
354 mation, see dhclient-script(8).
355
356 vendor option space "name";
357
358 The vendor option space statement is used to specify which option space
359 should be used for decoding the vendor-encapsulate-options option if
360 one is received. The dhcp-vendor-identifier can be used to request a
361 specific class of vendor options from the server. See dhcp-options(5)
362 for details.
363
364 medium "media setup";
365
366 The medium statement can be used on systems where network interfaces
367 cannot automatically determine the type of network to which they are
368 connected. The media setup string is a system-dependent parameter
369 which is passed to the dhcp client configuration script when initializ‐
370 ing the interface. On Unix and Unix-like systems, the argument is
371 passed on the ifconfig command line when configuring the interface.
372
373 The dhcp client automatically declares this parameter if it uses a
374 media type (see the media statement) when configuring the interface in
375 order to obtain a lease. This statement should be used in predefined
376 leases only if the network interface requires media type configuration.
377
378 renew date;
379
380 rebind date;
381
382 expire date;
383
384 The renew statement defines the time at which the dhcp client should
385 begin trying to contact its server to renew a lease that it is using.
386 The rebind statement defines the time at which the dhcp client should
387 begin to try to contact any dhcp server in order to renew its lease.
388 The expire statement defines the time at which the dhcp client must
389 stop using a lease if it has not been able to contact a server in order
390 to renew it.
391
392 These declarations are automatically set in leases acquired by the DHCP
393 client, but must also be configured in predefined leases - a predefined
394 lease whose expiry time has passed will not be used by the DHCP client.
395
396 Dates are specified in one of two ways. The software will output times
397 in these two formats depending on if the db-time-format configuration
398 parameter has been set to default or local.
399
400 If it is set to default, then date values appear as follows:
401
402 <weekday> <year>/<month>/<day> <hour>:<minute>:<second>
403
404 The weekday is present to make it easy for a human to tell when a lease
405 expires - it's specified as a number from zero to six, with zero being
406 Sunday. When declaring a predefined lease, it can always be specified
407 as zero. The year is specified with the century, so it should gener‐
408 ally be four digits except for really long leases. The month is speci‐
409 fied as a number starting with 1 for January. The day of the month is
410 likewise specified starting with 1. The hour is a number between 0 and
411 23, the minute a number between 0 and 59, and the second also a number
412 between 0 and 59.
413
414 If the db-time-format configuration was set to local, then the date
415 values appear as follows:
416
417 epoch <seconds-since-epoch>; # <day-name> <month-name> <day-number>
418 <hours>:<minutes>:<seconds> <year>
419
420 The seconds-since-epoch is as according to the system's local clock
421 (often referred to as "unix time"). The # symbol supplies a comment
422 that describes what actual time this is as according to the system's
423 configured timezone, at the time the value was written. It is provided
424 only for human inspection, the epoch time is the only recommended value
425 for machine inspection.
426
427 Note that when defining a static lease, one may use either time format
428 one wishes, and need not include the comment or values after it.
429
430 If the time is infinite in duration, then the date is never instead of
431 an actual date.
432
434 alias { declarations ... }
435
436 Some DHCP clients running TCP/IP roaming protocols may require that in
437 addition to the lease they may acquire via DHCP, their interface also
438 be configured with a predefined IP alias so that they can have a perma‐
439 nent IP address even while roaming. The Internet Systems Consortium
440 DHCP client doesn't support roaming with fixed addresses directly, but
441 in order to facilitate such experimentation, the dhcp client can be set
442 up to configure an IP alias using the alias declaration.
443
444 The alias declaration resembles a lease declaration, except that
445 options other than the subnet-mask option are ignored by the standard
446 client configuration script, and expiry times are ignored. A typical
447 alias declaration includes an interface declaration, a fixed-address
448 declaration for the IP alias address, and a subnet-mask option declara‐
449 tion. A medium statement should never be included in an alias declara‐
450 tion.
451
453 db-time-format [ default | local ] ;
454
455 The db-time-format option determines which of two output methods are
456 used for printing times in leases files. The default format provides
457 day-and-time in UTC, whereas local uses a seconds-since-epoch to store
458 the time value, and helpfully places a local timezone time in a comment
459 on the same line. The formats are described in detail in this manpage,
460 whithin the LEASE DECLARATIONS section.
461
462 reject cidr-ip-address [, ... cidr-ip-address ] ;
463
464 The reject statement causes the DHCP client to reject offers from
465 servers whose server identifier matches any of the specified hosts or
466 subnets. This can be used to avoid being configured by rogue or mis‐
467 configured dhcp servers, although it should be a last resort - better
468 to track down the bad DHCP server and fix it.
469
470 The cidr-ip-address configuration type is of the form ip-address[/pre‐
471 fixlen], where ip-address is a dotted quad IP address, and prefixlen is
472 the CIDR prefix length of the subnet, counting the number of signifi‐
473 cant bits in the netmask starting from the leftmost end. Example con‐
474 figuration syntax:
475
476 reject 192.168.0.0/16, 10.0.0.5;
477
478 The above example would cause offers from any server identifier in the
479 entire RFC 1918 "Class C" network 192.168.0.0/16, or the specific sin‐
480 gle address 10.0.0.5, to be rejected.
481
482 interface "name" { declarations ... }
483
484 A client with more than one network interface may require different be‐
485 haviour depending on which interface is being configured. All timing
486 parameters and declarations other than lease and alias declarations can
487 be enclosed in an interface declaration, and those parameters will then
488 be used only for the interface that matches the specified name. Inter‐
489 faces for which there is no interface declaration will use the parame‐
490 ters declared outside of any interface declaration, or the default set‐
491 tings.
492
493 Note well: ISC dhclient only maintains one list of interfaces, which is
494 either determined at startup from command line arguments, or otherwise
495 is autodetected. If you supplied the list of interfaces on the command
496 line, this configuration clause will add the named interface to the
497 list in such a way that will cause it to be configured by DHCP. Which
498 may not be the result you had intended. This is an undesirable side
499 effect that will be addressed in a future release.
500
501 pseudo "name" "real-name" { declarations ... }
502
503 Under some circumstances it can be useful to declare a pseudo-interface
504 and have the DHCP client acquire a configuration for that interface.
505 Each interface that the DHCP client is supporting normally has a DHCP
506 client state machine running on it to acquire and maintain its lease.
507 A pseudo-interface is just another state machine running on the inter‐
508 face named real-name, with its own lease and its own state. If you use
509 this feature, you must provide a client identifier for both the pseudo-
510 interface and the actual interface, and the two identifiers must be
511 different. You must also provide a separate client script for the
512 pseudo-interface to do what you want with the IP address. For example:
513
514 interface "ep0" {
515 send dhcp-client-identifier "my-client-ep0";
516 }
517 pseudo "secondary" "ep0" {
518 send dhcp-client-identifier "my-client-ep0-secondary";
519 script "/etc/dhclient-secondary";
520 }
521
522 The client script for the pseudo-interface should not configure the
523 interface up or down - essentially, all it needs to handle are the
524 states where a lease has been acquired or renewed, and the states where
525 a lease has expired. See dhclient-script(8) for more information.
526
527 media "media setup" [ , "media setup", ... ];
528
529 The media statement defines one or more media configuration parameters
530 which may be tried while attempting to acquire an IP address. The dhcp
531 client will cycle through each media setup string on the list, config‐
532 uring the interface using that setup and attempting to boot, and then
533 trying the next one. This can be used for network interfaces which
534 aren't capable of sensing the media type unaided - whichever media type
535 succeeds in getting a request to the server and hearing the reply is
536 probably right (no guarantees).
537
538 The media setup is only used for the initial phase of address acquisi‐
539 tion (the DHCPDISCOVER and DHCPOFFER packets). Once an address has
540 been acquired, the dhcp client will record it in its lease database and
541 will record the media type used to acquire the address. Whenever the
542 client tries to renew the lease, it will use that same media type. The
543 lease must expire before the client will go back to cycling through
544 media types.
545
546 hardware link-type mac-address;
547
548 The hardware statement defines the hardware MAC address to use for this
549 interface, for DHCP servers or relays to direct their replies.
550 dhclient will determine the interface's MAC address automatically, so
551 use of this parameter is not recommended. The link-type corresponds to
552 the interface's link layer type (example: ´ethernet´), while the mac-
553 address is a string of colon-separated hexadecimal values for octets.
554
555 anycast-mac link-type mac-address;
556
557 The anycast-mac statement over-rides the all-ones broadcast MAC address
558 dhclient will use when it is transmitting packets to the all-ones lim‐
559 ited broadcast IPv4 address. This configuration parameter is useful to
560 reduce the number of broadcast packets transmitted by DHCP clients, but
561 is only useful if you know the DHCP service(s) anycast MAC address
562 prior to configuring your client. The link-type and mac-address param‐
563 eters are configured in a similar manner to the hardware statement.
564
565 bootp-broadcast-always;
566
567 The bootp-broadcast-always statement instructs dhclient to always set
568 the bootp broadcast flag in request packets, so that servers will
569 always broadcast replies. This is equivalent to supplying the dhclient
570 -B argument, and has the same effect as specifying 'always-broadcast'
571 in the server's dhcpd.conf. This option is provided as an extension to
572 enable dhclient to work on IBM s390 Linux guests.
573
575 The following configuration file is used on a laptop running NetBSD
576 1.3. The laptop has an IP alias of 192.5.5.213, and has one interface,
577 ep0 (a 3com 3C589C). Booting intervals have been shortened somewhat
578 from the default, because the client is known to spend most of its time
579 on networks with little DHCP activity. The laptop does roam to multi‐
580 ple networks.
581
582
583 timeout 60;
584 retry 60;
585 reboot 10;
586 select-timeout 5;
587 initial-interval 2;
588 reject 192.33.137.209;
589
590 interface "ep0" {
591 send host-name "andare.fugue.com";
592 hardware ethernet 00:a0:24:ab:fb:9c;
593 send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
594 send dhcp-lease-time 3600;
595 supersede domain-search "fugue.com", "rc.vix.com", "home.vix.com";
596 prepend domain-name-servers 127.0.0.1;
597 request subnet-mask, broadcast-address, time-offset, routers,
598 domain-search, domain-name, domain-name-servers, host-name;
599 require subnet-mask, domain-name-servers;
600 script "/usr/sbin/dhclient-script";
601 media "media 10baseT/UTP", "media 10base2/BNC";
602 }
603
604 alias {
605 interface "ep0";
606 fixed-address 192.5.5.213;
607 option subnet-mask 255.255.255.255;
608 }
609 This is a very complicated dhclient.conf file - in general, yours
610 should be much simpler. In many cases, it's sufficient to just create
611 an empty dhclient.conf file - the defaults are usually fine.
612
614 dhcp-options(5), dhcp-eval(5), dhclient.leases(5), dhcpd(8),
615 dhcpd.conf(5), RFC2132, RFC2131.
616
618 dhclient(8) was written by Ted Lemon under a contract with Vixie Labs.
619 Funding for this project was provided by Internet Systems Consortium.
620 Information about Internet Systems Consortium can be found at
621 https://www.isc.org.
622
623
624
625 dhclient.conf(5)