1 .\" $OpenBSD: src/sbin/dhclient/dhclient.conf.5,v 1.24 2012/10/27 23:08:53 krw Exp $
3 .\" Copyright (c) 1997 The Internet Software Consortium.
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
15 .\" 3. Neither the name of The Internet Software Consortium nor the names
16 .\" of its contributors may be used to endorse or promote products derived
17 .\" from this software without specific prior written permission.
19 .\" THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
20 .\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21 .\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 .\" DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
24 .\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
27 .\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 .\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" This software has been written for the Internet Software Consortium
34 .\" by Ted Lemon <mellon@fugue.com> in cooperation with Vixie
35 .\" Enterprises. To learn more about the Internet Software Consortium,
36 .\" see ``http://www.isc.org/isc''. To learn more about Vixie
37 .\" Enterprises, see ``http://www.vix.com''.
44 .Nd DHCP client configuration file
48 file contains configuration information for
53 file is a free-form ASCII text file.
54 It is parsed by the recursive-descent parser built into
56 The file may contain extra tabs and newlines for formatting purposes.
57 Keywords in the file are case-insensitive.
58 Comments may be placed anywhere within the file (except within quotes).
59 Comments begin with the
61 character and end at the end of the line.
65 file can be used to configure the behaviour of the client in a wide variety
66 of ways: protocol timing, information requested from the server, information
67 required of the server, defaults to use if the server does not provide
68 certain information, values with which to override information provided by
69 the server, or values to prepend or append to information provided by the
71 The configuration file can also be preinitialized with addresses to
72 use on networks that don't have DHCP servers.
74 The timing behaviour of the client need not be configured by the user.
75 If no timing configuration is provided by the user, a fairly
76 reasonable timing behaviour will be used by default \- one which
77 results in fairly timely updates without placing an inordinate load on
80 The following statements can be used to adjust the timing behaviour of
81 the DHCP client if required, however:
83 .It Ic timeout Ar time ;
86 statement determines the amount of time that must pass between the
87 time that the client begins to try to determine its address and the
88 time that it decides that it's not going to be able to contact a server.
89 By default, this timeout is sixty seconds.
90 After the timeout has passed, if there are any static leases defined in the
91 configuration file, or any leases remaining in the lease database that
92 have not yet expired, the client will loop through these leases
93 attempting to validate them, and if it finds one that appears to be
94 valid, it will use that lease's address.
95 If there are no valid static leases or unexpired leases in the lease database,
96 the client will restart the protocol after the defined retry interval.
97 .It Ic retry Ar time ;
100 statement determines the time that must pass after the client has
101 determined that there is no DHCP server present before it tries again
102 to contact a DHCP server.
103 By default, this is five minutes.
104 .It Ic select-timeout Ar time ;
105 It is possible (some might say desirable) for there to be more than
106 one DHCP server serving any given network.
107 In this case, it is possible that a client may be sent more than one offer
108 in response to its initial lease discovery message.
109 It may be that one of these offers is preferable to the other
110 (e.g., one offer may have the address the client previously used,
111 and the other may not).
115 is the time after the client sends its first lease discovery request
116 at which it stops waiting for offers from servers, assuming that it
117 has received at least one such offer.
118 If no offers have been received by the time the
120 has expired, the client will accept the first offer that arrives.
124 is zero seconds \- that is, the client will take the first offer it sees.
125 .It Ic reboot Ar time ;
126 When the client is restarted, it first tries to reacquire the last
128 This is called the INIT-REBOOT state.
129 If it is still attached to the same network it was attached to when it last
130 ran, this is the quickest way to get started.
133 statement sets the time that must elapse after the client first tries
134 to reacquire its old address before it gives up and tries to discover
136 By default, the reboot timeout is ten seconds.
137 .It Ic backoff-cutoff Ar time ;
138 The client uses an exponential backoff algorithm with some randomness,
139 so that if many clients try to configure themselves at the same time,
140 they will not make their requests in lockstep.
143 statement determines the maximum amount of time that the client is
145 It defaults to fifteen seconds.
146 .It Ic initial-interval Ar time ;
149 statement sets the amount of time between the first attempt to reach a
150 server and the second attempt to reach a server.
151 Each time a message is sent, the interval between messages is incremented by
152 twice the current interval multiplied by a random number between zero and one.
153 If it is greater than the backoff-cutoff amount, it is set to that
155 It defaults to three seconds.
156 .It Ic link-timeout Ar time ;
159 statement sets the amount of time to wait for an interface link before timing
161 The default value is ten seconds.
162 The value zero requests that
163 dhclient not wait for a link state change before timing out.
165 .Sh LEASE REQUIREMENTS AND REQUESTS
166 The DHCP protocol allows the client to request that the server send it
167 specific information, and not send it other information that it is not
169 The protocol also allows the client to reject offers from servers if they
170 don't contain information the client needs, or if the information provided
173 There is a variety of data contained in offers that DHCP servers send
175 The data that can be specifically requested is what are called
177 DHCP Options are defined in
180 .It Ic ignore Op Ar option
183 statement causes the client to discard values provided by the server for
184 the specified options.
185 Only the option names should be specified in the ignore statement \- not
187 .It Ic request Op Ar option , ... ;
190 statement causes the client to request that any server responding to the
191 client send the client its values for the specified options.
192 Only option names should be specified in the request statement \- not
196 statement has any effect, overriding any previous
199 .It Ic require Op Ar option , ... ;
202 statement lists options that must be sent in order for an offer to be accepted.
203 Offers that do not contain all the listed options will be ignored.
204 Only option names should be specified in the require statement \- not
208 statement has any effect, overriding any previous
211 .It Ic send Ar option option-value ;
214 statement causes the client to send the specified option and value
216 Options that are always sent in the DHCP protocol should not be specified
218 One use for this statement is to send information to the server
219 that will allow it to differentiate between this client and other
220 clients or kinds of clients.
223 Options in the lease can be modified before being passed to the client
224 configuration script,
225 .Xr dhclient-script 8 .
227 The default client configuration script
228 processes only options 1 (subnet
229 mask), 3 (routers), 6 (domain name servers), 15 (domain-name).
230 Use of option modifiers on other options will have no effect unless
231 .Xr dhclient-script 8
232 the client configuration script is modified.
234 Several option modifiers are available.
236 .It Ic default Ar option option-value ;
241 if no value is supplied by the server.
242 .It Ic supersede Ar option option-value ;
247 regardless of the value supplied by the server.
248 .It Ic prepend Ar option option-value ;
253 and then use the value supplied by the server.
255 can only be used for options which allow more than one value to be given.
256 The restriction is not enforced \- if violated, the results are unpredictable.
257 .It Ic append Ar option option-value ;
262 after first using the value supplied by the server.
264 can only be used for options which allow more than one value to be given.
265 The restriction is not enforced \- if violated, the results are unpredictable.
267 .Sh LEASE DECLARATIONS
268 The lease declaration:
270 .D1 Ic lease No { Ar lease-declaration ; ... ; No }
272 The DHCP client may decide after some period of time (see
273 .Sx PROTOCOL TIMING )
274 that it is not going to succeed in contacting a server.
275 At that time, it consults its own database of old leases and tests each one
276 that has not yet timed out by pinging the listed router for that lease to
277 see if that lease could work.
278 It is possible to define one or more
280 leases in the client configuration file for networks where there is no DHCP
281 or BOOTP service, so that the client can still automatically configure its
283 This is done with the
287 NOTE: the lease statement is also used in the
288 .Pa /var/db/dhclient.leases. Ns Aq Ar IFNAME
289 file in order to record leases that have been received from DHCP servers.
290 Some of the syntax for leases as described below is only needed in the
291 .Pa /var/db/dhclient.leases. Ns Aq Ar IFNAME
293 Such syntax is documented here for completeness.
295 A lease statement consists of the lease keyword, followed by a left
296 curly brace, followed by one or more lease declaration statements,
297 followed by a right curly brace.
298 The following lease declarations are possible:
300 .Bl -tag -width Ds -compact
304 statement is used to indicate that the lease was acquired using the
305 BOOTP protocol rather than the DHCP protocol.
306 It is never necessary to specify this in the client configuration file.
307 The client uses this syntax in its lease database file.
309 .It Ic interface Qq Ar string ;
312 lease statement is used to indicate the interface on which the lease is valid.
313 If set, this lease will only be tried on a particular interface.
314 When the client receives a lease from a server, it always records the
315 interface number on which it received that lease.
316 If predefined leases are specified in the
318 file, the interface should also be specified, although this is not required.
320 .It Ic fixed-address Ar ip-address ;
323 statement is used to set the IP address of a particular lease.
324 This is required for all lease statements.
325 The IP address must be specified as a dotted quad (e.g., 12.34.56.78).
327 .It Ic filename Qq Ar string ;
330 statement specifies the name of the boot filename to use.
331 This is not used by the standard client, but is included for completeness.
333 .It Ic server-name Qq Ar string ;
336 statement specifies the name of the boot server name to use.
337 This is not used by the standard client, but is included for completeness.
339 .It Ic option Ar option option-value ;
342 statement is used to specify the value of an option supplied by the server,
343 or, in the case of predefined leases declared in
345 the value that the user wishes the client to use if the
346 predefined lease is used.
348 .It Ic renew Ar date ;
349 .It Ic rebind Ar date ;
350 .It Ic expire Ar date ;
353 statement defines the time at which the DHCP client should begin trying to
354 contact its server to renew a lease that it is using.
357 statement defines the time at which the DHCP client should begin to try to
360 DHCP server in order to renew its lease.
363 statement defines the time at which the DHCP client must stop using a lease
364 if it has not been able to contact a server in order to renew it.
367 These declarations are automatically set in leases acquired by the
368 DHCP client, but must also be configured in predefined leases \- a
369 predefined lease whose expiry time has passed will not be used by the
372 Dates are specified as follows:
374 .D1 <weekday> <year>/<month>/<day> <hour>:<minute>:<second>
376 The weekday is present to make it easy for a human to tell when a
377 lease expires \- it's specified as a number from zero to six, with zero
379 When declaring a predefined lease, it can always be specified as zero.
380 The year is specified with the century, so it should generally be four
381 digits except for really long leases.
382 The month is specified as a number starting with 1 for January.
383 The day of the month is likewise specified starting with 1.
384 The hour is a number between 0 and 23,
385 the minute a number between 0 and 59,
386 and the second also a number between 0 and 59.
387 .Sh OTHER DECLARATIONS
389 .It Ic reject Ar ip-address ;
392 statement causes the DHCP client to reject offers from servers who use
393 the specified address as a server identifier.
394 This can be used to avoid being configured by rogue or misconfigured DHCP
395 servers, although it should be a last resort \- better to track down
396 the bad DHCP server and fix it.
397 .It Ic interface Qo Ar name Qc No { Ar declaration ; ... ; No }
398 A client with more than one network interface may require different
399 behaviour depending on which interface is being configured.
400 All timing parameters and declarations other than lease
401 declarations can be enclosed in an interface declaration, and those
402 parameters will then be used only for the interface that matches the
404 Interfaces for which there is no interface declaration will use the
405 parameters declared outside of any interface declaration,
406 or the default settings.
407 .It Ic script Ar \&"script-name\&" ;
410 statement is used to specify the pathname of the client configuration
412 This script is used by the DHCP client to set each interface's initial
413 configuration prior to requesting an address, to test the address once it
414 has been offered, and to set the interface's final configuration once a
415 lease has been acquired.
416 If no lease is acquired, the script is used to test predefined leases, if
417 any, and also called once if no valid lease can be identified.
418 For more information, see
419 .Xr dhclient.leases 5 .
422 The following configuration file is used on a laptop
423 which has one interface, ep0 (a 3Com 3C589C).
424 Booting intervals have been shortened somewhat from the default, because
425 the client is known to spend most of its time on networks with little DHCP
427 The laptop does roam to multiple networks.
428 .Bd -literal -offset indent
434 reject 192.33.137.209;
437 send host-name "andare.fugue.com";
438 send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
439 send dhcp-lease-time 3600;
440 supersede domain-name "fugue.com rc.vix.com home.vix.com";
441 prepend domain-name-servers 127.0.0.1;
442 request subnet-mask, broadcast-address, time-offset, routers,
443 classless-routes, domain-name, domain-name-servers,
445 require subnet-mask, domain-name-servers;
446 script "/etc/dhclient-script";
450 This is a very complicated
452 file \- in general, yours should be much simpler.
453 In many cases, it's sufficient to just create an empty
455 file \- the defaults are usually fine.
457 .Xr dhclient.leases 5 ,
459 .Xr dhcpd.conf 5 Pq Pa net/isc-dhcp42-server ,
461 .Xr dhclient-script 8 ,
462 .Xr dhcpd 8 Pq Pa net/isc-dhcp42-server
468 .%T Dynamic Host Configuration Protocol
476 .%T DHCP Options and BOOTP Vendor Extensions
482 .An Ted Lemon Aq Mt mellon@vix.com
483 under a contract with Vixie Labs.
485 The current implementation was reworked by
486 .An Henning Brauer Aq Mt henning@openbsd.org .