xref: /freebsd/sbin/dhclient/dhclient.conf.5 (revision 9a7feaa13c6948185109d6dad8d123c55d90caa2)
147c08596SBrooks Davis.\"	$OpenBSD: dhclient.conf.5,v 1.5 2004/11/01 23:10:18 henning Exp $
247c08596SBrooks Davis.\"
347c08596SBrooks Davis.\" Copyright (c) 1997 The Internet Software Consortium.
447c08596SBrooks Davis.\" All rights reserved.
547c08596SBrooks Davis.\"
647c08596SBrooks Davis.\" Redistribution and use in source and binary forms, with or without
747c08596SBrooks Davis.\" modification, are permitted provided that the following conditions
847c08596SBrooks Davis.\" are met:
947c08596SBrooks Davis.\"
1047c08596SBrooks Davis.\" 1. Redistributions of source code must retain the above copyright
1147c08596SBrooks Davis.\"    notice, this list of conditions and the following disclaimer.
1247c08596SBrooks Davis.\" 2. Redistributions in binary form must reproduce the above copyright
1347c08596SBrooks Davis.\"    notice, this list of conditions and the following disclaimer in the
1447c08596SBrooks Davis.\"    documentation and/or other materials provided with the distribution.
1547c08596SBrooks Davis.\" 3. Neither the name of The Internet Software Consortium nor the names
1647c08596SBrooks Davis.\"    of its contributors may be used to endorse or promote products derived
1747c08596SBrooks Davis.\"    from this software without specific prior written permission.
1847c08596SBrooks Davis.\"
1947c08596SBrooks Davis.\" THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
2047c08596SBrooks Davis.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
2147c08596SBrooks Davis.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2247c08596SBrooks Davis.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
2347c08596SBrooks Davis.\" DISCLAIMED.  IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
2447c08596SBrooks Davis.\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2547c08596SBrooks Davis.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2647c08596SBrooks Davis.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2747c08596SBrooks Davis.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
2847c08596SBrooks Davis.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2947c08596SBrooks Davis.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
3047c08596SBrooks Davis.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3147c08596SBrooks Davis.\" SUCH DAMAGE.
3247c08596SBrooks Davis.\"
3347c08596SBrooks Davis.\" This software has been written for the Internet Software Consortium
3447c08596SBrooks Davis.\" by Ted Lemon <mellon@fugue.com> in cooperation with Vixie
3547c08596SBrooks Davis.\" Enterprises.  To learn more about the Internet Software Consortium,
3647c08596SBrooks Davis.\" see ``http://www.isc.org/isc''.  To learn more about Vixie
3747c08596SBrooks Davis.\" Enterprises, see ``http://www.vix.com''.
3847c08596SBrooks Davis.\"
399a7feaa1SRuslan Ermilov.\" $FreeBSD$
409a7feaa1SRuslan Ermilov.\"
4147c08596SBrooks Davis.Dd January 1, 1997
4247c08596SBrooks Davis.Dt DHCLIENT.CONF 5
4347c08596SBrooks Davis.Os
4447c08596SBrooks Davis.Sh NAME
4547c08596SBrooks Davis.Nm dhclient.conf
4647c08596SBrooks Davis.Nd DHCP client configuration file
4747c08596SBrooks Davis.Sh DESCRIPTION
4847c08596SBrooks DavisThe
4947c08596SBrooks Davis.Nm
5047c08596SBrooks Davisfile contains configuration information for
5147c08596SBrooks Davis.Xr dhclient 8 ,
5247c08596SBrooks Davisthe Internet Software Consortium DHCP Client.
5347c08596SBrooks Davis.Pp
5447c08596SBrooks DavisThe
5547c08596SBrooks Davis.Nm
5647c08596SBrooks Davisfile is a free-form ASCII text file.
5747c08596SBrooks DavisIt is parsed by the recursive-descent parser built into
5847c08596SBrooks Davis.Xr dhclient 8 .
5947c08596SBrooks DavisThe file may contain extra tabs and newlines for formatting purposes.
6047c08596SBrooks DavisKeywords in the file are case-insensitive.
6147c08596SBrooks DavisComments may be placed anywhere within the file (except within quotes).
6247c08596SBrooks DavisComments begin with the
639a7feaa1SRuslan Ermilov.Ql #
6447c08596SBrooks Davischaracter and end at the end of the line.
6547c08596SBrooks Davis.Pp
6647c08596SBrooks DavisThe
6747c08596SBrooks Davis.Nm
6847c08596SBrooks Davisfile can be used to configure the behaviour of the client in a wide variety
6947c08596SBrooks Davisof ways: protocol timing, information requested from the server, information
7047c08596SBrooks Davisrequired of the server, defaults to use if the server does not provide
7147c08596SBrooks Daviscertain information, values with which to override information provided by
7247c08596SBrooks Davisthe server, or values to prepend or append to information provided by the
7347c08596SBrooks Davisserver.
7447c08596SBrooks DavisThe configuration file can also be preinitialized with addresses to
759a7feaa1SRuslan Ermilovuse on networks that do not have DHCP servers.
7647c08596SBrooks Davis.Sh PROTOCOL TIMING
7747c08596SBrooks DavisThe timing behaviour of the client need not be configured by the user.
7847c08596SBrooks DavisIf no timing configuration is provided by the user, a fairly
799a7feaa1SRuslan Ermilovreasonable timing behaviour will be used by default - one which
8047c08596SBrooks Davisresults in fairly timely updates without placing an inordinate load on
8147c08596SBrooks Davisthe server.
8247c08596SBrooks Davis.Pp
8347c08596SBrooks DavisThe following statements can be used to adjust the timing behaviour of
8447c08596SBrooks Davisthe DHCP client if required, however:
859a7feaa1SRuslan Ermilov.Bl -tag -width indent
8647c08596SBrooks Davis.It Ic timeout Ar time ;
8747c08596SBrooks DavisThe
8847c08596SBrooks Davis.Ic timeout
8947c08596SBrooks Davisstatement determines the amount of time that must pass between the
9047c08596SBrooks Davistime that the client begins to try to determine its address and the
919a7feaa1SRuslan Ermilovtime that it decides that it is not going to be able to contact a server.
9247c08596SBrooks DavisBy default, this timeout is sixty seconds.
9347c08596SBrooks DavisAfter the timeout has passed, if there are any static leases defined in the
9447c08596SBrooks Davisconfiguration file, or any leases remaining in the lease database that
9547c08596SBrooks Davishave not yet expired, the client will loop through these leases
9647c08596SBrooks Davisattempting to validate them, and if it finds one that appears to be
9747c08596SBrooks Davisvalid, it will use that lease's address.
9847c08596SBrooks DavisIf there are no valid static leases or unexpired leases in the lease database,
9947c08596SBrooks Davisthe client will restart the protocol after the defined retry interval.
10047c08596SBrooks Davis.It Ic retry Ar time ;
10147c08596SBrooks DavisThe
10247c08596SBrooks Davis.Ic retry
10347c08596SBrooks Davisstatement determines the time that must pass after the client has
10447c08596SBrooks Davisdetermined that there is no DHCP server present before it tries again
10547c08596SBrooks Davisto contact a DHCP server.
10647c08596SBrooks DavisBy default, this is five minutes.
10747c08596SBrooks Davis.It Ic select-timeout Ar time ;
10847c08596SBrooks DavisIt is possible (some might say desirable) for there to be more than
10947c08596SBrooks Davisone DHCP server serving any given network.
11047c08596SBrooks DavisIn this case, it is possible that a client may be sent more than one offer
11147c08596SBrooks Davisin response to its initial lease discovery message.
11247c08596SBrooks DavisIt may be that one of these offers is preferable to the other
11347c08596SBrooks Davis(e.g., one offer may have the address the client previously used,
11447c08596SBrooks Davisand the other may not).
11547c08596SBrooks Davis.Pp
11647c08596SBrooks DavisThe
11747c08596SBrooks Davis.Ic select-timeout
11847c08596SBrooks Davisis the time after the client sends its first lease discovery request
11947c08596SBrooks Davisat which it stops waiting for offers from servers, assuming that it
12047c08596SBrooks Davishas received at least one such offer.
12147c08596SBrooks DavisIf no offers have been received by the time the
12247c08596SBrooks Davis.Ic select-timeout
12347c08596SBrooks Davishas expired, the client will accept the first offer that arrives.
12447c08596SBrooks Davis.Pp
12547c08596SBrooks DavisBy default, the
12647c08596SBrooks Davis.Ic select-timeout
1279a7feaa1SRuslan Ermilovis zero seconds - that is, the client will take the first offer it sees.
12847c08596SBrooks Davis.It Ic reboot Ar time ;
12947c08596SBrooks DavisWhen the client is restarted, it first tries to reacquire the last
13047c08596SBrooks Davisaddress it had.
13147c08596SBrooks DavisThis is called the INIT-REBOOT state.
13247c08596SBrooks DavisIf it is still attached to the same network it was attached to when it last
13347c08596SBrooks Davisran, this is the quickest way to get started.
13447c08596SBrooks DavisThe
13547c08596SBrooks Davis.Ic reboot
13647c08596SBrooks Davisstatement sets the time that must elapse after the client first tries
13747c08596SBrooks Davisto reacquire its old address before it gives up and tries to discover
13847c08596SBrooks Davisa new address.
13947c08596SBrooks DavisBy default, the reboot timeout is ten seconds.
14047c08596SBrooks Davis.It Ic backoff-cutoff Ar time ;
14147c08596SBrooks DavisThe client uses an exponential backoff algorithm with some randomness,
14247c08596SBrooks Davisso that if many clients try to configure themselves at the same time,
14347c08596SBrooks Davisthey will not make their requests in lockstep.
14447c08596SBrooks DavisThe
14547c08596SBrooks Davis.Ic backoff-cutoff
14647c08596SBrooks Davisstatement determines the maximum amount of time that the client is
14747c08596SBrooks Davisallowed to back off.
14847c08596SBrooks DavisIt defaults to two minutes.
14947c08596SBrooks Davis.It Ic initial-interval Ar time ;
15047c08596SBrooks DavisThe
15147c08596SBrooks Davis.Ic initial-interval
15247c08596SBrooks Davisstatement sets the amount of time between the first attempt to reach a
15347c08596SBrooks Davisserver and the second attempt to reach a server.
15447c08596SBrooks DavisEach time a message is sent, the interval between messages is incremented by
15547c08596SBrooks Davistwice the current interval multiplied by a random number between zero and one.
1569a7feaa1SRuslan ErmilovIf it is greater than the
1579a7feaa1SRuslan Ermilov.Ic backoff-cutoff
1589a7feaa1SRuslan Ermilovamount, it is set to that
15947c08596SBrooks Davisamount.
16047c08596SBrooks DavisIt defaults to ten seconds.
16147c08596SBrooks Davis.El
16247c08596SBrooks Davis.Sh LEASE REQUIREMENTS AND REQUESTS
16347c08596SBrooks DavisThe DHCP protocol allows the client to request that the server send it
16447c08596SBrooks Davisspecific information, and not send it other information that it is not
16547c08596SBrooks Davisprepared to accept.
16647c08596SBrooks DavisThe protocol also allows the client to reject offers from servers if they
1679a7feaa1SRuslan Ermilovdo not contain information the client needs, or if the information provided
16847c08596SBrooks Davisis not satisfactory.
16947c08596SBrooks Davis.Pp
17047c08596SBrooks DavisThere is a variety of data contained in offers that DHCP servers send
17147c08596SBrooks Davisto DHCP clients.
17247c08596SBrooks DavisThe data that can be specifically requested is what are called
17347c08596SBrooks Davis.Em DHCP Options .
17447c08596SBrooks DavisDHCP Options are defined in
17547c08596SBrooks Davis.Xr dhcp-options 5 .
1769a7feaa1SRuslan Ermilov.Bl -tag -width indent
1779a7feaa1SRuslan Ermilov.It Ic request Oo Ar option Oc Oo , Ar ... option Oc ;
17847c08596SBrooks DavisThe
17947c08596SBrooks Davis.Ic request
18047c08596SBrooks Davisstatement causes the client to request that any server responding to the
18147c08596SBrooks Davisclient send the client its values for the specified options.
1829a7feaa1SRuslan ErmilovOnly the option names should be specified in the request statement - not
18347c08596SBrooks Davisoption parameters.
1849a7feaa1SRuslan Ermilov.It Ic require Oo Ar option Oc Oo , Ar ... option Oc ;
18547c08596SBrooks DavisThe
18647c08596SBrooks Davis.Ic require
18747c08596SBrooks Davisstatement lists options that must be sent in order for an offer to be accepted.
18847c08596SBrooks DavisOffers that do not contain all the listed options will be ignored.
1899a7feaa1SRuslan Ermilov.It Ic send No { Oo Ar option declaration Oc Oo , Ar ... option declaration Oc }
19047c08596SBrooks DavisThe
19147c08596SBrooks Davis.Ic send
19247c08596SBrooks Davisstatement causes the client to send the specified options to the server with
19347c08596SBrooks Davisthe specified values.
19447c08596SBrooks DavisThese are full option declarations as described in
19547c08596SBrooks Davis.Xr dhcp-options 5 .
19647c08596SBrooks DavisOptions that are always sent in the DHCP protocol should not be specified
19747c08596SBrooks Davishere, except that the client can specify a
19847c08596SBrooks Davis.Ar dhcp-lease-time
19947c08596SBrooks Davisoption other than the default requested lease time, which is two hours.
20047c08596SBrooks DavisThe other obvious use for this statement is to send information to the server
20147c08596SBrooks Davisthat will allow it to differentiate between this client and other
20247c08596SBrooks Davisclients or kinds of clients.
20347c08596SBrooks Davis.El
20447c08596SBrooks Davis.Sh OPTION MODIFIERS
20547c08596SBrooks DavisIn some cases, a client may receive option data from the server which
20647c08596SBrooks Davisis not really appropriate for that client, or may not receive
20747c08596SBrooks Davisinformation that it needs, and for which a useful default value exists.
20847c08596SBrooks DavisIt may also receive information which is useful, but which needs to be
20947c08596SBrooks Davissupplemented with local information.
21047c08596SBrooks DavisTo handle these needs, several option modifiers are available.
2119a7feaa1SRuslan Ermilov.Bl -tag -width indent
21247c08596SBrooks Davis.It Xo
21347c08596SBrooks Davis.Ic default No { Op Ar option declaration
21447c08596SBrooks Davis.Oo , Ar ... option declaration Oc }
21547c08596SBrooks Davis.Xc
21647c08596SBrooks DavisIf for some set of options the client should use the value supplied by
21747c08596SBrooks Davisthe server, but needs to use some default value if no value was supplied
21847c08596SBrooks Davisby the server, these values can be defined in the
21947c08596SBrooks Davis.Ic default
22047c08596SBrooks Davisstatement.
22147c08596SBrooks Davis.It Xo
22247c08596SBrooks Davis.Ic supersede No { Op Ar option declaration
22347c08596SBrooks Davis.Oo , Ar ... option declaration Oc }
22447c08596SBrooks Davis.Xc
22547c08596SBrooks DavisIf for some set of options the client should always use its own value
22647c08596SBrooks Davisrather than any value supplied by the server, these values can be defined
22747c08596SBrooks Davisin the
22847c08596SBrooks Davis.Ic supersede
22947c08596SBrooks Davisstatement.
23047c08596SBrooks Davis.It Xo
23147c08596SBrooks Davis.Ic prepend No { Op Ar option declaration
23247c08596SBrooks Davis.Oo , Ar ... option declaration Oc }
23347c08596SBrooks Davis.Xc
23447c08596SBrooks DavisIf for some set of options the client should use a value you supply,
23547c08596SBrooks Davisand then use the values supplied by the server, if any,
23647c08596SBrooks Davisthese values can be defined in the
23747c08596SBrooks Davis.Ic prepend
23847c08596SBrooks Davisstatement.
23947c08596SBrooks DavisThe
24047c08596SBrooks Davis.Ic prepend
24147c08596SBrooks Davisstatement can only be used for options which allow more than one value to
24247c08596SBrooks Davisbe given.
2439a7feaa1SRuslan ErmilovThis restriction is not enforced - if violated, the results are unpredictable.
24447c08596SBrooks Davis.It Xo
24547c08596SBrooks Davis.Ic append No { Op Ar option declaration
24647c08596SBrooks Davis.Oo , Ar ... option declaration Oc }
24747c08596SBrooks Davis.Xc
24847c08596SBrooks DavisIf for some set of options the client should first use the values
24947c08596SBrooks Davissupplied by the server, if any, and then use values you supply, these
25047c08596SBrooks Davisvalues can be defined in the
25147c08596SBrooks Davis.Ic append
25247c08596SBrooks Davisstatement.
25347c08596SBrooks DavisThe
25447c08596SBrooks Davis.Ic append
25547c08596SBrooks Davisstatement can only be used for options which allow more than one value to
25647c08596SBrooks Davisbe given.
2579a7feaa1SRuslan ErmilovThis restriction is not enforced - if you ignore it,
25847c08596SBrooks Davisthe behaviour will be unpredictable.
25947c08596SBrooks Davis.El
26047c08596SBrooks Davis.Sh LEASE DECLARATIONS
26147c08596SBrooks DavisThe lease declaration:
26247c08596SBrooks Davis.Pp
2639a7feaa1SRuslan Ermilov.D1 Ic lease No { Ar lease-declaration Oo Ar ... lease-declaration Oc }
26447c08596SBrooks Davis.Pp
26547c08596SBrooks DavisThe DHCP client may decide after some period of time (see
26647c08596SBrooks Davis.Sx PROTOCOL TIMING )
26747c08596SBrooks Davisthat it is not going to succeed in contacting a server.
26847c08596SBrooks DavisAt that time, it consults its own database of old leases and tests each one
26947c08596SBrooks Davisthat has not yet timed out by pinging the listed router for that lease to
27047c08596SBrooks Davissee if that lease could work.
27147c08596SBrooks DavisIt is possible to define one or more
27247c08596SBrooks Davis.Em fixed
27347c08596SBrooks Davisleases in the client configuration file for networks where there is no DHCP
27447c08596SBrooks Davisor BOOTP service, so that the client can still automatically configure its
27547c08596SBrooks Davisaddress.
27647c08596SBrooks DavisThis is done with the
27747c08596SBrooks Davis.Ic lease
27847c08596SBrooks Davisstatement.
27947c08596SBrooks Davis.Pp
28047c08596SBrooks DavisNOTE: the lease statement is also used in the
28147c08596SBrooks Davis.Pa dhclient.leases
28247c08596SBrooks Davisfile in order to record leases that have been received from DHCP servers.
28347c08596SBrooks DavisSome of the syntax for leases as described below is only needed in the
28447c08596SBrooks Davis.Pa dhclient.leases
28547c08596SBrooks Davisfile.
28647c08596SBrooks DavisSuch syntax is documented here for completeness.
28747c08596SBrooks Davis.Pp
2889a7feaa1SRuslan ErmilovA lease statement consists of the
2899a7feaa1SRuslan Ermilov.Ic lease
2909a7feaa1SRuslan Ermilovkeyword, followed by a left
29147c08596SBrooks Daviscurly brace, followed by one or more lease declaration statements,
29247c08596SBrooks Davisfollowed by a right curly brace.
29347c08596SBrooks DavisThe following lease declarations are possible:
2949a7feaa1SRuslan Ermilov.Bl -tag -width indent
29547c08596SBrooks Davis.It Ic bootp ;
29647c08596SBrooks DavisThe
29747c08596SBrooks Davis.Ic bootp
29847c08596SBrooks Davisstatement is used to indicate that the lease was acquired using the
29947c08596SBrooks DavisBOOTP protocol rather than the DHCP protocol.
30047c08596SBrooks DavisIt is never necessary to specify this in the client configuration file.
30147c08596SBrooks DavisThe client uses this syntax in its lease database file.
3029a7feaa1SRuslan Ermilov.It Ic interface Qq Ar string ;
30347c08596SBrooks DavisThe
30447c08596SBrooks Davis.Ic interface
30547c08596SBrooks Davislease statement is used to indicate the interface on which the lease is valid.
30647c08596SBrooks DavisIf set, this lease will only be tried on a particular interface.
30747c08596SBrooks DavisWhen the client receives a lease from a server, it always records the
30847c08596SBrooks Davisinterface number on which it received that lease.
30947c08596SBrooks DavisIf predefined leases are specified in the
31047c08596SBrooks Davis.Nm
31147c08596SBrooks Davisfile, the interface should also be specified, although this is not required.
31247c08596SBrooks Davis.It Ic fixed-address Ar ip-address ;
31347c08596SBrooks DavisThe
31447c08596SBrooks Davis.Ic fixed-address
31547c08596SBrooks Davisstatement is used to set the IP address of a particular lease.
31647c08596SBrooks DavisThis is required for all lease statements.
3179a7feaa1SRuslan ErmilovThe IP address must be specified as a dotted quad (e.g.,
3189a7feaa1SRuslan Ermilov.Li 12.34.56.78 ) .
3199a7feaa1SRuslan Ermilov.It Ic filename Qq Ar string ;
32047c08596SBrooks DavisThe
32147c08596SBrooks Davis.Ic filename
32247c08596SBrooks Davisstatement specifies the name of the boot filename to use.
32347c08596SBrooks DavisThis is not used by the standard client configuration script, but is
32447c08596SBrooks Davisincluded for completeness.
3259a7feaa1SRuslan Ermilov.It Ic server-name Qq Ar string ;
32647c08596SBrooks DavisThe
32747c08596SBrooks Davis.Ic server-name
32847c08596SBrooks Davisstatement specifies the name of the boot server name to use.
32947c08596SBrooks DavisThis is also not used by the standard client configuration script.
33047c08596SBrooks Davis.It Ic option Ar option-declaration ;
33147c08596SBrooks DavisThe
33247c08596SBrooks Davis.Ic option
33347c08596SBrooks Davisstatement is used to specify the value of an option supplied by the server,
33447c08596SBrooks Davisor, in the case of predefined leases declared in
3359a7feaa1SRuslan Ermilov.Nm ,
33647c08596SBrooks Davisthe value that the user wishes the client configuration script to use if the
33747c08596SBrooks Davispredefined lease is used.
3389a7feaa1SRuslan Ermilov.It Ic script Qq Ar script-name ;
33947c08596SBrooks DavisThe
34047c08596SBrooks Davis.Ic script
34147c08596SBrooks Davisstatement is used to specify the pathname of the DHCP client configuration
34247c08596SBrooks Davisscript.
34347c08596SBrooks DavisThis script is used by the DHCP client to set each interface's initial
34447c08596SBrooks Davisconfiguration prior to requesting an address, to test the address once it
34547c08596SBrooks Davishas been offered, and to set the interface's final configuration once a
34647c08596SBrooks Davislease has been acquired.
34747c08596SBrooks DavisIf no lease is acquired, the script is used to test predefined leases, if
34847c08596SBrooks Davisany, and also called once if no valid lease can be identified.
34947c08596SBrooks DavisFor more information, see
35047c08596SBrooks Davis.Xr dhclient.leases 5 .
3519a7feaa1SRuslan Ermilov.It Ic medium Qq Ar "media setup" ;
35247c08596SBrooks DavisThe
35347c08596SBrooks Davis.Ic medium
35447c08596SBrooks Davisstatement can be used on systems where network interfaces cannot
35547c08596SBrooks Davisautomatically determine the type of network to which they are connected.
3569a7feaa1SRuslan ErmilovThe
3579a7feaa1SRuslan Ermilov.Ar "media setup"
3589a7feaa1SRuslan Ermilovstring is a system-dependent parameter which is passed
35947c08596SBrooks Davisto the DHCP client configuration script when initializing the interface.
36047c08596SBrooks DavisOn
36147c08596SBrooks Davis.Ux
3629a7feaa1SRuslan Ermilovand
3639a7feaa1SRuslan Ermilov.Ux Ns -like
3649a7feaa1SRuslan Ermilovsystems, the argument is passed on the
3659a7feaa1SRuslan Ermilov.Xr ifconfig 8
3669a7feaa1SRuslan Ermilovcommand line
36747c08596SBrooks Daviswhen configuring the interface.
36847c08596SBrooks Davis.Pp
36947c08596SBrooks DavisThe DHCP client automatically declares this parameter if it used a
37047c08596SBrooks Davismedia type (see the
37147c08596SBrooks Davis.Ic media
37247c08596SBrooks Davisstatement) when configuring the interface in order to obtain a lease.
37347c08596SBrooks DavisThis statement should be used in predefined leases only if the network
37447c08596SBrooks Davisinterface requires media type configuration.
37547c08596SBrooks Davis.It Ic renew Ar date ;
37647c08596SBrooks Davis.It Ic rebind Ar date ;
37747c08596SBrooks Davis.It Ic expire Ar date ;
37847c08596SBrooks DavisThe
37947c08596SBrooks Davis.Ic renew
38047c08596SBrooks Davisstatement defines the time at which the DHCP client should begin trying to
38147c08596SBrooks Daviscontact its server to renew a lease that it is using.
38247c08596SBrooks DavisThe
38347c08596SBrooks Davis.Ic rebind
38447c08596SBrooks Davisstatement defines the time at which the DHCP client should begin to try to
38547c08596SBrooks Daviscontact
38647c08596SBrooks Davis.Em any
38747c08596SBrooks DavisDHCP server in order to renew its lease.
38847c08596SBrooks DavisThe
38947c08596SBrooks Davis.Ic expire
39047c08596SBrooks Davisstatement defines the time at which the DHCP client must stop using a lease
39147c08596SBrooks Davisif it has not been able to contact a server in order to renew it.
39247c08596SBrooks Davis.El
39347c08596SBrooks Davis.Pp
39447c08596SBrooks DavisThese declarations are automatically set in leases acquired by the
3959a7feaa1SRuslan ErmilovDHCP client, but must also be configured in predefined leases - a
39647c08596SBrooks Davispredefined lease whose expiry time has passed will not be used by the
39747c08596SBrooks DavisDHCP client.
39847c08596SBrooks Davis.Pp
39947c08596SBrooks DavisDates are specified as follows:
4009a7feaa1SRuslan Ermilov.Bd -ragged -offset indent
4019a7feaa1SRuslan Ermilov.Ar <weekday>
40247c08596SBrooks Davis.Sm off
40347c08596SBrooks Davis.Ar <year> No / Ar <month> No / Ar <day>
40447c08596SBrooks Davis.Ar <hour> : <minute> : <second>
40547c08596SBrooks Davis.Sm on
4069a7feaa1SRuslan Ermilov.Ed
40747c08596SBrooks Davis.Pp
40847c08596SBrooks DavisThe weekday is present to make it easy for a human to tell when a
4099a7feaa1SRuslan Ermilovlease expires - it is specified as a number from zero to six, with zero
41047c08596SBrooks Davisbeing Sunday.
41147c08596SBrooks DavisWhen declaring a predefined lease, it can always be specified as zero.
41247c08596SBrooks DavisThe year is specified with the century, so it should generally be four
41347c08596SBrooks Davisdigits except for really long leases.
41447c08596SBrooks DavisThe month is specified as a number starting with 1 for January.
41547c08596SBrooks DavisThe day of the month is likewise specified starting with 1.
41647c08596SBrooks DavisThe hour is a number between 0 and 23,
41747c08596SBrooks Davisthe minute a number between 0 and 59,
41847c08596SBrooks Davisand the second also a number between 0 and 59.
41947c08596SBrooks Davis.Sh ALIAS DECLARATIONS
42047c08596SBrooks Davis.Ic alias No { Ar declarations ... No }
42147c08596SBrooks Davis.Pp
42247c08596SBrooks DavisSome DHCP clients running TCP/IP roaming protocols may require that in
42347c08596SBrooks Davisaddition to the lease they may acquire via DHCP, their interface also
42447c08596SBrooks Davisbe configured with a predefined IP alias so that they can have a
42547c08596SBrooks Davispermanent IP address even while roaming.
4269a7feaa1SRuslan ErmilovThe Internet Software Consortium DHCP client does not support roaming with
42747c08596SBrooks Davisfixed addresses directly, but in order to facilitate such experimentation,
42847c08596SBrooks Davisthe DHCP client can be set up to configure an IP alias using the
42947c08596SBrooks Davis.Ic alias
43047c08596SBrooks Davisdeclaration.
43147c08596SBrooks Davis.Pp
43247c08596SBrooks DavisThe
43347c08596SBrooks Davis.Ic alias
43447c08596SBrooks Davisdeclaration resembles a lease declaration, except that options other than
43547c08596SBrooks Davisthe subnet-mask option are ignored by the standard client configuration
43647c08596SBrooks Davisscript, and expiry times are ignored.
43747c08596SBrooks DavisA typical alias declaration includes an interface declaration, a fixed-address
43847c08596SBrooks Davisdeclaration for the IP alias address, and a subnet-mask option declaration.
43947c08596SBrooks DavisA medium statement should never be included in an alias declaration.
44047c08596SBrooks Davis.Sh OTHER DECLARATIONS
4419a7feaa1SRuslan Ermilov.Bl -tag -width indent
44247c08596SBrooks Davis.It Ic reject Ar ip-address ;
44347c08596SBrooks DavisThe
44447c08596SBrooks Davis.Ic reject
44547c08596SBrooks Davisstatement causes the DHCP client to reject offers from servers who use
44647c08596SBrooks Davisthe specified address as a server identifier.
44747c08596SBrooks DavisThis can be used to avoid being configured by rogue or misconfigured DHCP
4489a7feaa1SRuslan Ermilovservers, although it should be a last resort - better to track down
44947c08596SBrooks Davisthe bad DHCP server and fix it.
4509a7feaa1SRuslan Ermilov.It Ic interface Qo Ar name Qc { Ar declarations ... No }
45147c08596SBrooks DavisA client with more than one network interface may require different
45247c08596SBrooks Davisbehaviour depending on which interface is being configured.
45347c08596SBrooks DavisAll timing parameters and declarations other than lease and alias
45447c08596SBrooks Davisdeclarations can be enclosed in an interface declaration, and those
45547c08596SBrooks Davisparameters will then be used only for the interface that matches the
45647c08596SBrooks Davisspecified name.
45747c08596SBrooks DavisInterfaces for which there is no interface declaration will use the
45847c08596SBrooks Davisparameters declared outside of any interface declaration,
45947c08596SBrooks Davisor the default settings.
4609a7feaa1SRuslan Ermilov.It Ic media Qo Ar "media setup" Qc Oo , Qo Ar "media setup" Qc , Ar ... Oc ;
46147c08596SBrooks DavisThe
46247c08596SBrooks Davis.Ic media
46347c08596SBrooks Davisstatement defines one or more media configuration parameters which may
46447c08596SBrooks Davisbe tried while attempting to acquire an IP address.
46547c08596SBrooks DavisThe DHCP client will cycle through each media setup string on the list,
46647c08596SBrooks Davisconfiguring the interface using that setup and attempting to boot,
46747c08596SBrooks Davisand then trying the next one.
4689a7feaa1SRuslan ErmilovThis can be used for network interfaces which are not capable of sensing
4699a7feaa1SRuslan Ermilovthe media type unaided - whichever media type succeeds in getting a request
47047c08596SBrooks Davisto the server and hearing the reply is probably right (no guarantees).
47147c08596SBrooks Davis.Pp
47247c08596SBrooks DavisThe media setup is only used for the initial phase of address
47347c08596SBrooks Davisacquisition (the DHCPDISCOVER and DHCPOFFER packets).
47447c08596SBrooks DavisOnce an address has been acquired, the DHCP client will record it in its
47547c08596SBrooks Davislease database and will record the media type used to acquire the address.
47647c08596SBrooks DavisWhenever the client tries to renew the lease, it will use that same media type.
47747c08596SBrooks DavisThe lease must expire before the client will go back to cycling through media
47847c08596SBrooks Davistypes.
47947c08596SBrooks Davis.El
48047c08596SBrooks Davis.Sh EXAMPLES
48147c08596SBrooks DavisThe following configuration file is used on a laptop
4829a7feaa1SRuslan Ermilovwhich has an IP alias of
4839a7feaa1SRuslan Ermilov.Li 192.5.5.213 ,
4849a7feaa1SRuslan Ermilovand has one interface,
4859a7feaa1SRuslan Ermilov.Li ep0
4869a7feaa1SRuslan Ermilov(a 3Com 3C589C).
48747c08596SBrooks DavisBooting intervals have been shortened somewhat from the default, because
48847c08596SBrooks Davisthe client is known to spend most of its time on networks with little DHCP
48947c08596SBrooks Davisactivity.
49047c08596SBrooks DavisThe laptop does roam to multiple networks.
49147c08596SBrooks Davis.Bd -literal -offset indent
49247c08596SBrooks Davistimeout 60;
49347c08596SBrooks Davisretry 60;
49447c08596SBrooks Davisreboot 10;
49547c08596SBrooks Davisselect-timeout 5;
49647c08596SBrooks Davisinitial-interval 2;
49747c08596SBrooks Davisreject 192.33.137.209;
49847c08596SBrooks Davis
49947c08596SBrooks Davisinterface "ep0" {
50047c08596SBrooks Davis    send host-name "andare.fugue.com";
50147c08596SBrooks Davis    send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
50247c08596SBrooks Davis    send dhcp-lease-time 3600;
50347c08596SBrooks Davis    supersede domain-name "fugue.com rc.vix.com home.vix.com";
50447c08596SBrooks Davis    prepend domain-name-servers 127.0.0.1;
50547c08596SBrooks Davis    request subnet-mask, broadcast-address, time-offset, routers,
50647c08596SBrooks Davis	    domain-name, domain-name-servers, host-name;
50747c08596SBrooks Davis    require subnet-mask, domain-name-servers;
50847c08596SBrooks Davis    script "/etc/dhclient-script";
50947c08596SBrooks Davis    media "media 10baseT/UTP", "media 10base2/BNC";
51047c08596SBrooks Davis}
51147c08596SBrooks Davis
51247c08596SBrooks Davisalias {
51347c08596SBrooks Davis  interface "ep0";
51447c08596SBrooks Davis  fixed-address 192.5.5.213;
51547c08596SBrooks Davis  option subnet-mask 255.255.255.255;
51647c08596SBrooks Davis}
51747c08596SBrooks Davis.Ed
51847c08596SBrooks Davis.Pp
51947c08596SBrooks DavisThis is a very complicated
52047c08596SBrooks Davis.Nm
5219a7feaa1SRuslan Ermilovfile - in general, yours should be much simpler.
5229a7feaa1SRuslan ErmilovIn many cases, it is sufficient to just create an empty
52347c08596SBrooks Davis.Nm
5249a7feaa1SRuslan Ermilovfile - the defaults are usually fine.
52547c08596SBrooks Davis.Sh SEE ALSO
52647c08596SBrooks Davis.Xr dhclient.leases 5 ,
52747c08596SBrooks Davis.Xr dhcpd.conf 5 ,
5289a7feaa1SRuslan Ermilov.Xr dhcp-options 5 ,
52947c08596SBrooks Davis.Xr dhclient 8 ,
53047c08596SBrooks Davis.Xr dhcpd 8
5319a7feaa1SRuslan Ermilov.Rs
5329a7feaa1SRuslan Ermilov.%R "RFC 2132, RFC 2131"
5339a7feaa1SRuslan Ermilov.Re
53447c08596SBrooks Davis.Sh AUTHORS
5359a7feaa1SRuslan Ermilov.An -nosplit
5369a7feaa1SRuslan ErmilovThe
53747c08596SBrooks Davis.Xr dhclient 8
5389a7feaa1SRuslan Ermilovutility
53947c08596SBrooks Daviswas written by
54047c08596SBrooks Davis.An Ted Lemon Aq mellon@vix.com
54147c08596SBrooks Davisunder a contract with Vixie Labs.
54247c08596SBrooks Davis.Pp
54347c08596SBrooks DavisThe current implementation was reworked by
54447c08596SBrooks Davis.An Henning Brauer Aq henning@openbsd.org .
545