]> git.ipfire.org Git - thirdparty/dhcp.git/blame - client/dhclient.conf.5
Fix compilation errors introduced in the last set of checkins.
[thirdparty/dhcp.git] / client / dhclient.conf.5
CommitLineData
0e7affc7
TL
1.\" dhclient.conf.5
2.\"
f39b6e00
TL
3.\" Copyright (c) 1996-1999 Internet Software Consortium.
4.\" Use is subject to license terms which appear in the file named
5.\" ISC-LICENSE that should have accompanied this file when you
6.\" received it. If a file named ISC-LICENSE did not accompany this
7.\" file, or you are not sure the one you have is correct, you may
8.\" obtain an applicable copy of the license at:
0e7affc7 9.\"
f39b6e00 10.\" http://www.isc.org/isc-license-1.0.html.
0e7affc7 11.\"
f39b6e00
TL
12.\" This file is part of the ISC DHCP distribution. The documentation
13.\" associated with this file is listed in the file DOCUMENTATION,
14.\" included in the top-level directory of this release.
0e7affc7 15.\"
f39b6e00
TL
16.\" Support and other services are available for ISC products - see
17.\" http://www.isc.org for more information.
e7ec0fa1 18.TH dhclient.conf 5
0e7affc7
TL
19.SH NAME
20dhclient.conf - DHCP client configuration file
21.SH DESCRIPTION
22The dhclient.conf file contains configuration information for
23.IR dhclient,
24the Internet Software Consortium DHCP Client.
25.PP
26The dhclient.conf file is a free-form ASCII text file. It is parsed by
27the recursive-descent parser built into dhclient. The file may contain
28extra tabs and newlines for formatting purposes. Keywords in the file
29are case-insensitive. Comments may be placed anywhere within the
30file (except within quotes). Comments begin with the # character and
31end at the end of the line.
32.PP
e7ec0fa1
TL
33The dhclient.conf file can be used to configure the behaviour of the
34client in a wide variety of ways: protocol timing, information
35requested from the server, information required of the server,
36defaults to use if the server does not provide certain information,
37values with which to override information provided by the server, or
38values to prepend or append to information provided by the server.
39The configuration file can also be preinitialized with addresses to
40use on networks that don't have DHCP servers.
41.SH PROTOCOL TIMING
42The timing behaviour of the client need not be configured by the user.
43If no timing configuration is provided by the user, a fairly
44reasonable timing behaviour will be used by default - one which
45results in fairly timely updates without placing an inordinate load on
46the server.
47.PP
48The following statements can be used to adjust the timing behaviour of
49the DHCP client if required, however:
50.PP
51.I The
52.B timeout
53.I statement
54.PP
55.B timeout
56.I time
57.B ;
58.PP
59The
60.I timeout
61statement determines the amount of time that must pass between the
62time that the client begins to try to determine its address and the
63time that it decides that it's not going to be able to contact a
64server. By default, this timeout is sixty seconds. After the
65timeout has passed, if there are any static leases defined in the
66configuration file, or any leases remaining in the lease database that
67have not yet expired, the client will loop through these leases
68attempting to validate them, and if it finds one that appears to be
69valid, it will use that lease's address. If there are no valid
70static leases or unexpired leases in the lease database, the client
71will restart the protocol after the defined retry interval.
72.PP
73.I The
74.B retry
75.I statement
76.PP
77 \fBretry \fItime\fR\fB;\fR
78.PP
79The
80.I retry
81statement determines the time that must pass after the client has
82determined that there is no DHCP server present before it tries again
83to contact a DHCP server. By default, this is five minutes.
84.PP
85.I The
86.B select-timeout
87.I statement
88.PP
89 \fBselect-timeout \fItime\fR\fB;\fR
90.PP
91It is possible (some might say desirable) for there to be more than
e97b2a17 92one DHCP server serving any given network. In this case, it is
e7ec0fa1
TL
93possible that a client may be sent more than one offer in response to
94its initial lease discovery message. It may be that one of these
95offers is preferable to the other (e.g., one offer may have the
96address the client previously used, and the other may not).
97.PP
98The
99.I select-timeout
100is the time after the client sends its first lease discovery request
101at which it stops waiting for offers from servers, assuming that it
102has received at least one such offer. If no offers have been
103received by the time the
104.I select-timeout
105has expired, the client will accept the first offer that arrives.
106.PP
e97b2a17
TL
107By default, the select-timeout is zero seconds - that is, the client
108will take the first offer it sees.
109.PP
e7ec0fa1
TL
110.I The
111.B reboot
112.I statement
113.PP
114 \fBreboot \fItime\fR\fB;\fR
115.PP
116When the client is restarted, it first tries to reacquire the last
117address it had. This is called the INIT-REBOOT state. If it is
118still attached to the same network it was attached to when it last
119ran, this is the quickest way to get started. The
120.I reboot
121statement sets the time that must elapse after the client first tries
122to reacquire its old address before it gives up and tries to discover
e97b2a17 123a new address. By default, the reboot timeout is ten seconds.
e7ec0fa1
TL
124.PP
125.I The
126.B backoff-cutoff
127.I statement
128.PP
129 \fBbackoff-cutoff \fItime\fR\fB;\fR
130.PP
131The client uses an exponential backoff algorithm with some randomness,
132so that if many clients try to configure themselves at the same time,
133they will not make their requests in lockstep. The
134.I backoff-cutoff
135statement determines the maximum amount of time that the client is
136allowed to back off. It defaults to two minutes.
137.PP
138.I The
139.B initial-interval
140.I statement
141.PP
142 \fBinitial-interval \fItime\fR\fB;\fR
143.PP
144The
145.I initial-interval
146statement sets the amount of time between the first attempt to reach a
e97b2a17
TL
147server and the second attempt to reach a server. Each time a message
148is sent, the interval between messages is incremented by twice the
149current interval multiplied by a random number between zero and one.
150If it is greater than the backoff-cutoff amount, it is set to that
151amount. It defaults to ten seconds.
e7ec0fa1
TL
152.SH LEASE REQUIREMENTS AND REQUESTS
153The DHCP protocol allows the client to request that the server send it
154specific information, and not send it other information that it is not
155prepared to accept. The protocol also allows the client to reject
156offers from servers if they don't contain information the client
157needs, or if the information provided is not satisfactory.
158.PP
159There is a variety of data contained in offers that DHCP servers send
160to DHCP clients. The data that can be specifically requested is what
161are called \fIDHCP Options\fR. DHCP Options are defined in
162 \fBdhcp-options(5)\fR.
163.PP
164.I The
165.B request
166.I statement
167.PP
e97b2a17 168 \fBrequest [ \fIoption\fR ] [\fB,\fI ... \fIoption\fR ]\fB;\fR
e7ec0fa1
TL
169.PP
170The request statement causes the client to request that any server
171responding to the client send the client its values for the specified
172options. Only the option names should be specified in the request
afa9d40b
TL
173statement - not option parameters. By default, the DHCP server
174requests the subnet-mask, broadcast-address, time-offset, routers,
175domain-name, domain-name-servers and host-name options.
176.PP
177In some cases, it may be desirable to send no parameter request list
178at all. To do this, simply write the request statement but specify
179no parameters:
180.PP
181.nf
182 request;
183.fi
e7ec0fa1
TL
184.PP
185.I The
186.B require
187.I statement
188.PP
e97b2a17 189 \fBrequire [ \fIoption\fR ] [\fB,\fI ... \fIoption ]\fB;\fR
e7ec0fa1 190.PP
e97b2a17
TL
191The require statement lists options that must be sent in order for an
192offer to be accepted. Offers that do not contain all the listed
193options will be ignored.
e7ec0fa1
TL
194.PP
195.I The
196.B send
197.I statement
198.PP
199 \fBsend { [ \fIoption declaration\fR ]
200[\fB,\fI ... \fIoption declaration\fR ]\fB}\fR
201.PP
202The send statement causes the client to send the specified options to
e97b2a17
TL
203the server with the specified values. These are full option
204declarations as described in \fBdhcp-options(5)\fR. Options that are
205always sent in the DHCP protocol should not be specified here, except
206that the client can specify a \fBrequested-lease-time\fR option other
207than the default requested lease time, which is two hours. The other
e7ec0fa1
TL
208obvious use for this statement is to send information to the server
209that will allow it to differentiate between this client and other
210clients or kinds of clients.
211.SH OPTION MODIFIERS
212In some cases, a client may receive option data from the server which
213is not really appropriate for that client, or may not receive
214information that it needs, and for which a useful default value
215exists. It may also receive information which is useful, but which
216needs to be supplemented with local information. To handle these
217needs, several option modifiers are available.
218.PP
219.I The
220.B default
221.I statement
222.PP
d4b26e01 223 \fBdefault [ \fIoption declaration\fR ] \fB;\fR
e7ec0fa1 224.PP
d4b26e01 225If for some option the client should use the value supplied by
e7ec0fa1
TL
226the server, but needs to use some default value if no value was supplied
227by the server, these values can be defined in the
228.B default
229statement.
230.PP
231.I The
232.B supersede
233.I statement
234.PP
d4b26e01 235 \fBsupersede [ \fIoption declaration\fR ] \fB;\fR
e7ec0fa1 236.PP
d4b26e01
TL
237If for some option the client should always use a locally-configured
238value or values rather than whatever is supplied by the server, these
239values can be defined in the
e7ec0fa1
TL
240.B supersede
241statement.
242.PP
243.I The
244.B prepend
245.I statement
246.PP
d4b26e01 247 \fBprepend [ \fIoption declaration\fR ] \fB;\fR
e7ec0fa1 248.PP
ea2ee1fd
TL
249If for some set of options the client should use a value you
250supply, and then use the values supplied by
251the server, if any, these values can be defined in the
e7ec0fa1
TL
252.B prepend
253statement. The
254.B prepend
255statement can only be used for options which
ea2ee1fd
TL
256allow more than one value to be given. This restriction is not
257enforced - if you ignore it, the behaviour will be unpredictable.
e7ec0fa1
TL
258.PP
259.I The
260.B append
261.I statement
262.PP
d4b26e01 263 \fBappend [ \fIoption declaration\fR ] \fB;\fR
e7ec0fa1 264.PP
ea2ee1fd
TL
265If for some set of options the client should first use the values
266supplied by the server, if any, and then use values you supply, these
267values can be defined in the
e7ec0fa1
TL
268.B append
269statement. The
270.B append
271statement can only be used for options which
ea2ee1fd
TL
272allow more than one value to be given. This restriction is not
273enforced - if you ignore it, the behaviour will be unpredictable.
e7ec0fa1
TL
274.SH LEASE DECLARATIONS
275.PP
276.I The
277.B lease
278.I declaration
279.PP
280 \fBlease {\fR \fIlease-declaration\fR [ ... \fIlease-declaration ] \fB}\fR
281.PP
282The DHCP client may decide after some period of time (see \fBPROTOCOL
283TIMING\fR) decide that it is not going to succeed in contacting a
284server. At that time, it consults its own database of old leases and
285tests each one that has not yet timed out by pinging the listed router
286for that lease to see if that lease could work. It is possible to
287define one or more \fIfixed\fR leases in the client configuration file
288for networks where there is no DHCP or BOOTP service, so that the
289client can still automatically configure its address. This is done
290with the
291.B lease
292statement.
293.PP
294NOTE: the lease statement is also used in the dhclient.leases file in
295order to record leases that have been received from DHCP servers.
296Some of the syntax for leases as described below is only needed in the
297dhclient.leases file. Such syntax is documented here for
298completeness.
299.PP
300A lease statement consists of the lease keyword, followed by a left
301curly brace, followed by one or more lease declaration statements,
302followed by a right curly brace. The following lease declarations
303are possible:
304.PP
305 \fBbootp;\fR
306.PP
307The
308.B bootp
309statement is used to indicate that the lease was acquired using the
310BOOTP protocol rather than the DHCP protocol. It is never necessary
311to specify this in the client configuration file. The client uses
312this syntax in its lease database file.
313.PP
314 \fBinterface\fR \fB"\fR\fIstring\fR\fB";\fR
315.PP
316The
317.B interface
318lease statement is used to indicate the interface on which the lease
319is valid. If set, this lease will only be tried on a particular
320interface. When the client receives a lease from a server, it always
321records the interface number on which it received that lease.
322If predefined leases are specified in the dhclient.conf file, the
323interface should also be specified, although this is not required.
324.PP
325 \fBfixed-address\fR \fIip-address\fR\fB;\fR
326.PP
327The
328.B fixed-address
329statement is used to set the ip address of a particular lease. This
330is required for all lease statements. The IP address must be
331specified as a dotted quad (e.g., 12.34.56.78).
332.PP
333 \fBfilename "\fR\fIstring\fR\fB";\fR
334.PP
335The
336.B filename
337statement specifies the name of the boot filename to use. This is
338not used by the standard client configuration script, but is included
339for completeness.
340.PP
341 \fBserver-name "\fR\fIstring\fR\fB";\fR
342.PP
343The
344.B server-name
345statement specifies the name of the boot server name to use. This is
346also not used by the standard client configuration script.
347.PP
348 \fBoption\fR \fIoption-declaration\fR\fB;\fR
349.PP
350The
351.B option
352statement is used to specify the value of an option supplied by the
353server, or, in the case of predefined leases declared in
354dhclient.conf, the value that the user wishes the client configuration
355script to use if the predefined lease is used.
356.PP
357 \fBscript "\fIscript-name\fB";\fR
358.PP
359The
360.B script
361statement is used to specify the pathname of the dhcp client
362configuration script. This script is used by the dhcp client to set
363each interface's initial configuration prior to requesting an address,
364to test the address once it has been offered, and to set the
365interface's final configuration once a lease has been acquired. If
366no lease is acquired, the script is used to test predefined leases, if
367any, and also called once if no valid lease can be identified. For
368more information, see
4bd8800e 369.B dhclient-script(8).
e7ec0fa1
TL
370.PP
371 \fBmedium "\fImedia setup\fB";\fR
372.PP
373The
374.B medium
375statement can be used on systems where network interfaces cannot
376automatically determine the type of network to which they are
377connected. The media setup string is a system-dependent parameter
378which is passed to the dhcp client configuration script when
379initializing the interface. On Unix and Unix-like systems, the
380argument is passed on the ifconfig command line when configuring te
381interface.
382.PP
383The dhcp client automatically declares this parameter if it used a
384media type (see the
385.B media
386statement) when configuring the interface in order to obtain a lease.
387This statement should be used in predefined leases only if the network
388interface requires media type configuration.
389.PP
390 \fBrenew\fR \fIdate\fB;\fR
391.PP
392 \fBrebind\fR \fIdate\fB;\fR
393.PP
394 \fBexpire\fR \fIdate\fB;\fR
395.PP
396The \fBrenew\fR statement defines the time at which the dhcp client
397should begin trying to contact its server to renew a lease that it is
398using. The \fBrebind\fR statement defines the time at which the dhcp
399client should begin to try to contact \fIany\fR dhcp server in order
400to renew its lease. The \fBexpire\fR statement defines the time at
401which the dhcp client must stop using a lease if it has not been able
402to contact a server in order to renew it.
403.PP
404These declarations are automatically set in leases acquired by the
405DHCP client, but must also be configured in predefined leases - a
406predefined lease whose expiry time has passed will not be used by the
407DHCP client.
408.PP
409Dates are specified as follows:
410.PP
411 \fI<weekday> <year>\fB/\fI<month>\fB/\fI<day>
412<hour>\fB:\fI<minute>\fB:\fI<second>\fR
413.PP
414The weekday is present to make it easy for a human to tell when a
415lease expires - it's specified as a number from zero to six, with zero
416being Sunday. When declaring a predefined lease, it can always be
417specified as zero. The year is specified with the century, so it
418should generally be four digits except for really long leases. The
419month is specified as a number starting with 1 for January. The day
420of the month is likewise specified starting with 1. The hour is a
4f138ec5
TL
421number between 0 and 23, the minute a number between 0 and 59, and the
422second also a number between 0 and 59.
e7ec0fa1
TL
423.SH ALIAS DECLARATIONS
424 \fBalias { \fI declarations ... \fB}\fR
425.PP
426Some DHCP clients running TCP/IP roaming protocols may require that in
427addition to the lease they may acquire via DHCP, their interface also
428be configured with a predefined IP alias so that they can have a
429permanent IP address even while roaming. The Internet Software
430Consortium DHCP client doesn't support roaming with fixed addresses
431directly, but in order to facilitate such experimentation, the dhcp
432client can be set up to configure an IP alias using the
433.B alias
434declaration.
435.PP
436The alias declaration resembles a lease declaration, except that
437options other than the subnet-mask option are ignored by the standard
438client configuration script, and expiry times are ignored. A typical
439alias declaration includes an interface declaration, a fixed-address
440declaration for the IP alias address, and a subnet-mask option
441declaration. A medium statement should never be included in an alias
442declaration.
443.SH OTHER DECLARATIONS
444 \fBreject \fIip-address\fB;\fR
445.PP
446The reject statement causes the DHCP client to reject offers from
447servers who use the specified address as a server identifier. This
448can be used to avoid being configured by rogue or misconfigured dhcp
449servers, although it should be a last resort - better to track down
450the bad DHCP server and fix it.
451.PP
452 \fBinterface "\fIname\fB" { \fIdeclarations ... \fB }
453.PP
454A client with more than one network interface may require different
455behaviour depending on which interface is being configured. All
456timing parameters and declarations other than lease and alias
457declarations can be enclosed in an interface declaration, and those
458parameters will then be used only for the interface that matches the
459specified name. Interfaces for which there is no interface
460declaration will use the parameters declared outside of any interface
461declaration, or the default settings.
a645ee2d
TL
462.PP
463 \fBpseudo "\fIname\fR" "\fIreal-name\fB" { \fIdeclarations ... \fB }
464.PP
465Under some circumstances it can be useful to declare a pseudo-interface
466and have the DHCP client acquire a configuration for that interface.
467Each interface that the DHCP client is supporting normally has a DHCP
468client state machine running on it to acquire and maintain its lease.
469A pseudo-interface is just another state machine running on the
470interface named \fIreal-name\fR, with its own lease and its own
471state. If you use this feature, you must provide a client identifier
472for both the pseudo-interface and the actual interface, and the two
473identifiers must be different. You must also provide a seperate
474client script for the pseudo-interface to do what you want with the IP
475address. For example:
476.PP
477.nf
478 interface "ep0" {
479 send dhcp-client-identifier "my-client-ep0";
480 }
481 pseudo "secondary" "ep0" {
482 send dhcp-client-identifier "my-client-ep0-secondary";
483 script "/etc/dhclient-secondary";
484 }
485.fi
486.PP
487The client script for the pseudo-interface should not configure the
488interface up or down - essentially, all it needs to handle are the
489states where a lease has been acquired or renewed, and the states
490where a lease has expired. See \fBdhclient-script(8)\fR for more
491information.
e7ec0fa1
TL
492.PP
493 \fBmedia "\fImedia setup\fB"\fI [ \fB, "\fImedia setup\fB", \fI... ]\fB;\fR
494.PP
495The
496.B media
497statement defines one or more media configuration parameters which may
498be tried while attempting to acquire an IP address. The dhcp client
499will cycle through each media setup string on the list, configuring
500the interface using that setup and attempting to boot, and then trying
501the next one. This can be used for network interfaces which aren't
502capable of sensing the media type unaided - whichever media type
503succeeds in getting a request to the server and hearing the reply is
504probably right (no guarantees).
505.PP
506The media setup is only used for the initial phase of address
507acquisition (the DHCPDISCOVER and DHCPOFFER packtes). Once an
508address has been acquired, the dhcp client will record it in its lease
509database and will record the media type used to acquire the address.
510Whenever the client tries to renew the lease, it will use that same
511media type. The lease must expire before the client will go back to
512cycling through media types.
513.SH SAMPLE
514The following configuration file is used on a laptop running NetBSD
5151.3. The laptop has an IP alias of 192.5.5.213, and has one
516interface, ep0 (a 3com 3C589C). Booting intervals have been
517shortened somewhat from the default, because the client is known to
518spend most of its time on networks with little DHCP activity. The
519laptop does roam to multiple networks.
520
521.nf
522
523timeout 60;
524retry 60;
525reboot 10;
526select-timeout 5;
527initial-interval 2;
528reject 192.33.137.209;
529
530interface "ep0" {
531 send host-name "andare.fugue.com";
532 send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
533 send dhcp-lease-time 3600;
534 supersede domain-name "fugue.com rc.vix.com home.vix.com";
535 prepend domain-name-servers 127.0.0.1;
536 request subnet-mask, broadcast-address, time-offset, routers,
537 domain-name, domain-name-servers, host-name;
538 require subnet-mask, domain-name-servers;
539 script "/etc/dhclient-script";
540 media "media 10baseT/UTP", "media 10base2/BNC";
541}
542
543alias {
544 interface "ep0";
545 fixed-address 192.5.5.213;
546 option subnet-mask 255.255.255.255;
547}
548.fi
549This is a very complicated dhclient.conf file - in general, yours
550should be much simpler. In many cases, it's sufficient to just
551create an empty dhclient.conf file - the defaults are usually fine.
0e7affc7 552.SH SEE ALSO
e97b2a17 553dhcp-options(5), dhclient.leases(5), dhcpd(8), dhcpd.conf(5), RFC2132,
e7ec0fa1 554RFC2131.
0e7affc7
TL
555.SH AUTHOR
556.B dhclient(8)
557was written by Ted Lemon <mellon@vix.com>
558under a contract with Vixie Labs. Funding
f39b6e00 559for this project was provided by the Internet Software Consortium.
0e7affc7
TL
560Information about the Internet Software Consortium can be found at
561.B http://www.isc.org/isc.