OSDN Git Service

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