xref: /freebsd/sbin/dhclient/dhclient.conf.5 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
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.\"
39*461ccb55SRob Norris.Dd March 17, 2023
4047c08596SBrooks Davis.Dt DHCLIENT.CONF 5
4147c08596SBrooks Davis.Os
4247c08596SBrooks Davis.Sh NAME
4347c08596SBrooks Davis.Nm dhclient.conf
4447c08596SBrooks Davis.Nd DHCP client configuration file
4547c08596SBrooks Davis.Sh DESCRIPTION
4647c08596SBrooks DavisThe
4747c08596SBrooks Davis.Nm
4847c08596SBrooks Davisfile contains configuration information for
4947c08596SBrooks Davis.Xr dhclient 8 ,
5047c08596SBrooks Davisthe Internet Software Consortium DHCP Client.
5147c08596SBrooks Davis.Pp
5247c08596SBrooks DavisThe
5347c08596SBrooks Davis.Nm
5447c08596SBrooks Davisfile is a free-form ASCII text file.
5547c08596SBrooks DavisIt is parsed by the recursive-descent parser built into
5647c08596SBrooks Davis.Xr dhclient 8 .
5747c08596SBrooks DavisThe file may contain extra tabs and newlines for formatting purposes.
5847c08596SBrooks DavisKeywords in the file are case-insensitive.
5947c08596SBrooks DavisComments may be placed anywhere within the file (except within quotes).
6047c08596SBrooks DavisComments begin with the
619a7feaa1SRuslan Ermilov.Ql #
6247c08596SBrooks Davischaracter and end at the end of the line.
6347c08596SBrooks Davis.Pp
6447c08596SBrooks DavisThe
6547c08596SBrooks Davis.Nm
6647c08596SBrooks Davisfile can be used to configure the behaviour of the client in a wide variety
6747c08596SBrooks Davisof ways: protocol timing, information requested from the server, information
6847c08596SBrooks Davisrequired of the server, defaults to use if the server does not provide
6947c08596SBrooks Daviscertain information, values with which to override information provided by
7047c08596SBrooks Davisthe server, or values to prepend or append to information provided by the
7147c08596SBrooks Davisserver.
7247c08596SBrooks DavisThe configuration file can also be preinitialized with addresses to
739a7feaa1SRuslan Ermilovuse on networks that do not have DHCP servers.
7447c08596SBrooks Davis.Sh PROTOCOL TIMING
7547c08596SBrooks DavisThe timing behaviour of the client need not be configured by the user.
7647c08596SBrooks DavisIf no timing configuration is provided by the user, a fairly
779a7feaa1SRuslan Ermilovreasonable timing behaviour will be used by default - one which
7847c08596SBrooks Davisresults in fairly timely updates without placing an inordinate load on
7947c08596SBrooks Davisthe server.
8047c08596SBrooks Davis.Pp
8147c08596SBrooks DavisThe following statements can be used to adjust the timing behaviour of
8247c08596SBrooks Davisthe DHCP client if required, however:
839a7feaa1SRuslan Ermilov.Bl -tag -width indent
8447c08596SBrooks Davis.It Ic timeout Ar time ;
8547c08596SBrooks DavisThe
8647c08596SBrooks Davis.Ic timeout
8747c08596SBrooks Davisstatement determines the amount of time that must pass between the
8847c08596SBrooks Davistime that the client begins to try to determine its address and the
899a7feaa1SRuslan Ermilovtime that it decides that it is not going to be able to contact a server.
9047c08596SBrooks DavisBy default, this timeout is sixty seconds.
9147c08596SBrooks DavisAfter the timeout has passed, if there are any static leases defined in the
9247c08596SBrooks Davisconfiguration file, or any leases remaining in the lease database that
9347c08596SBrooks Davishave not yet expired, the client will loop through these leases
9447c08596SBrooks Davisattempting to validate them, and if it finds one that appears to be
9547c08596SBrooks Davisvalid, it will use that lease's address.
9647c08596SBrooks DavisIf there are no valid static leases or unexpired leases in the lease database,
9747c08596SBrooks Davisthe client will restart the protocol after the defined retry interval.
9847c08596SBrooks Davis.It Ic retry Ar time ;
9947c08596SBrooks DavisThe
10047c08596SBrooks Davis.Ic retry
10147c08596SBrooks Davisstatement determines the time that must pass after the client has
10247c08596SBrooks Davisdetermined that there is no DHCP server present before it tries again
10347c08596SBrooks Davisto contact a DHCP server.
10447c08596SBrooks DavisBy default, this is five minutes.
10547c08596SBrooks Davis.It Ic select-timeout Ar time ;
10647c08596SBrooks DavisIt is possible (some might say desirable) for there to be more than
10747c08596SBrooks Davisone DHCP server serving any given network.
10847c08596SBrooks DavisIn this case, it is possible that a client may be sent more than one offer
10947c08596SBrooks Davisin response to its initial lease discovery message.
11047c08596SBrooks DavisIt may be that one of these offers is preferable to the other
11147c08596SBrooks Davis(e.g., one offer may have the address the client previously used,
11247c08596SBrooks Davisand the other may not).
11347c08596SBrooks Davis.Pp
11447c08596SBrooks DavisThe
11547c08596SBrooks Davis.Ic select-timeout
11647c08596SBrooks Davisis the time after the client sends its first lease discovery request
11747c08596SBrooks Davisat which it stops waiting for offers from servers, assuming that it
11847c08596SBrooks Davishas received at least one such offer.
11947c08596SBrooks DavisIf no offers have been received by the time the
12047c08596SBrooks Davis.Ic select-timeout
12147c08596SBrooks Davishas expired, the client will accept the first offer that arrives.
12247c08596SBrooks Davis.Pp
12347c08596SBrooks DavisBy default, the
12447c08596SBrooks Davis.Ic select-timeout
1259a7feaa1SRuslan Ermilovis zero seconds - that is, the client will take the first offer it sees.
12647c08596SBrooks Davis.It Ic reboot Ar time ;
12747c08596SBrooks DavisWhen the client is restarted, it first tries to reacquire the last
12847c08596SBrooks Davisaddress it had.
12947c08596SBrooks DavisThis is called the INIT-REBOOT state.
13047c08596SBrooks DavisIf it is still attached to the same network it was attached to when it last
13147c08596SBrooks Davisran, this is the quickest way to get started.
13247c08596SBrooks DavisThe
13347c08596SBrooks Davis.Ic reboot
13447c08596SBrooks Davisstatement sets the time that must elapse after the client first tries
13547c08596SBrooks Davisto reacquire its old address before it gives up and tries to discover
13647c08596SBrooks Davisa new address.
13747c08596SBrooks DavisBy default, the reboot timeout is ten seconds.
13847c08596SBrooks Davis.It Ic backoff-cutoff Ar time ;
13947c08596SBrooks DavisThe client uses an exponential backoff algorithm with some randomness,
14047c08596SBrooks Davisso that if many clients try to configure themselves at the same time,
14147c08596SBrooks Davisthey will not make their requests in lockstep.
14247c08596SBrooks DavisThe
14347c08596SBrooks Davis.Ic backoff-cutoff
14447c08596SBrooks Davisstatement determines the maximum amount of time that the client is
14547c08596SBrooks Davisallowed to back off.
14647c08596SBrooks DavisIt defaults to two minutes.
14747c08596SBrooks Davis.It Ic initial-interval Ar time ;
14847c08596SBrooks DavisThe
14947c08596SBrooks Davis.Ic initial-interval
15047c08596SBrooks Davisstatement sets the amount of time between the first attempt to reach a
15147c08596SBrooks Davisserver and the second attempt to reach a server.
15247c08596SBrooks DavisEach time a message is sent, the interval between messages is incremented by
15347c08596SBrooks Davistwice the current interval multiplied by a random number between zero and one.
1549a7feaa1SRuslan ErmilovIf it is greater than the
1559a7feaa1SRuslan Ermilov.Ic backoff-cutoff
1569a7feaa1SRuslan Ermilovamount, it is set to that
15747c08596SBrooks Davisamount.
15847c08596SBrooks DavisIt defaults to ten seconds.
15947c08596SBrooks Davis.El
16047c08596SBrooks Davis.Sh LEASE REQUIREMENTS AND REQUESTS
16147c08596SBrooks DavisThe DHCP protocol allows the client to request that the server send it
16247c08596SBrooks Davisspecific information, and not send it other information that it is not
16347c08596SBrooks Davisprepared to accept.
16447c08596SBrooks DavisThe protocol also allows the client to reject offers from servers if they
1659a7feaa1SRuslan Ermilovdo not contain information the client needs, or if the information provided
16647c08596SBrooks Davisis not satisfactory.
16747c08596SBrooks Davis.Pp
16847c08596SBrooks DavisThere is a variety of data contained in offers that DHCP servers send
16947c08596SBrooks Davisto DHCP clients.
17047c08596SBrooks DavisThe data that can be specifically requested is what are called
17147c08596SBrooks Davis.Em DHCP Options .
17247c08596SBrooks DavisDHCP Options are defined in
17347c08596SBrooks Davis.Xr dhcp-options 5 .
1749a7feaa1SRuslan Ermilov.Bl -tag -width indent
1759a7feaa1SRuslan Ermilov.It Ic request Oo Ar option Oc Oo , Ar ... option Oc ;
17647c08596SBrooks DavisThe
17747c08596SBrooks Davis.Ic request
17847c08596SBrooks Davisstatement causes the client to request that any server responding to the
17947c08596SBrooks Davisclient send the client its values for the specified options.
1809a7feaa1SRuslan ErmilovOnly the option names should be specified in the request statement - not
18147c08596SBrooks Davisoption parameters.
1829a7feaa1SRuslan Ermilov.It Ic require Oo Ar option Oc Oo , Ar ... option Oc ;
18347c08596SBrooks DavisThe
18447c08596SBrooks Davis.Ic require
18547c08596SBrooks Davisstatement lists options that must be sent in order for an offer to be accepted.
18647c08596SBrooks DavisOffers that do not contain all the listed options will be ignored.
1879a7feaa1SRuslan Ermilov.It Ic send No { Oo Ar option declaration Oc Oo , Ar ... option declaration Oc }
18847c08596SBrooks DavisThe
18947c08596SBrooks Davis.Ic send
19047c08596SBrooks Davisstatement causes the client to send the specified options to the server with
19147c08596SBrooks Davisthe specified values.
19247c08596SBrooks DavisThese are full option declarations as described in
19347c08596SBrooks Davis.Xr dhcp-options 5 .
19447c08596SBrooks DavisOptions that are always sent in the DHCP protocol should not be specified
19547c08596SBrooks Davishere, except that the client can specify a
19647c08596SBrooks Davis.Ar dhcp-lease-time
19747c08596SBrooks Davisoption other than the default requested lease time, which is two hours.
19847c08596SBrooks DavisThe other obvious use for this statement is to send information to the server
19947c08596SBrooks Davisthat will allow it to differentiate between this client and other
20047c08596SBrooks Davisclients or kinds of clients.
201*461ccb55SRob Norris.It Ic ignore Oo Ar option Oc Oo , Ar ... option Oc ;
202*461ccb55SRob NorrisThe
203*461ccb55SRob Norris.Ic ignore
204*461ccb55SRob Norrisstatement causes the client to disregard the specified options in any offer
205*461ccb55SRob Norrisreceived, as though the server had never sent them at all.
20647c08596SBrooks Davis.El
20747c08596SBrooks Davis.Sh OPTION MODIFIERS
20847c08596SBrooks DavisIn some cases, a client may receive option data from the server which
20947c08596SBrooks Davisis not really appropriate for that client, or may not receive
21047c08596SBrooks Davisinformation that it needs, and for which a useful default value exists.
21147c08596SBrooks DavisIt may also receive information which is useful, but which needs to be
21247c08596SBrooks Davissupplemented with local information.
21347c08596SBrooks DavisTo handle these needs, several option modifiers are available.
2149a7feaa1SRuslan Ermilov.Bl -tag -width indent
21547c08596SBrooks Davis.It Xo
21647c08596SBrooks Davis.Ic default No { Op Ar option declaration
21747c08596SBrooks Davis.Oo , Ar ... option declaration Oc }
21847c08596SBrooks Davis.Xc
21947c08596SBrooks DavisIf for some set of options the client should use the value supplied by
22047c08596SBrooks Davisthe server, but needs to use some default value if no value was supplied
22147c08596SBrooks Davisby the server, these values can be defined in the
22247c08596SBrooks Davis.Ic default
22347c08596SBrooks Davisstatement.
22447c08596SBrooks Davis.It Xo
22547c08596SBrooks Davis.Ic supersede No { Op Ar option declaration
22647c08596SBrooks Davis.Oo , Ar ... option declaration Oc }
22747c08596SBrooks Davis.Xc
22847c08596SBrooks DavisIf for some set of options the client should always use its own value
22947c08596SBrooks Davisrather than any value supplied by the server, these values can be defined
23047c08596SBrooks Davisin the
23147c08596SBrooks Davis.Ic supersede
23247c08596SBrooks Davisstatement.
233f93497feSConrad Meyer.Pp
234f93497feSConrad MeyerSome options values have special meaning:
235f93497feSConrad Meyer.Bl -tag -width indent
236f93497feSConrad Meyer.It Ar interface-mtu
237f93497feSConrad MeyerAny server-supplied interface MTU is ignored by the client if a
238f93497feSConrad Meyer.Ic supersede
239f93497feSConrad Meyerzero value is configured.
240f93497feSConrad Meyer.El
24147c08596SBrooks Davis.It Xo
24247c08596SBrooks Davis.Ic prepend No { Op Ar option declaration
24347c08596SBrooks Davis.Oo , Ar ... option declaration Oc }
24447c08596SBrooks Davis.Xc
24547c08596SBrooks DavisIf for some set of options the client should use a value you supply,
24647c08596SBrooks Davisand then use the values supplied by the server, if any,
24747c08596SBrooks Davisthese values can be defined in the
24847c08596SBrooks Davis.Ic prepend
24947c08596SBrooks Davisstatement.
25047c08596SBrooks DavisThe
25147c08596SBrooks Davis.Ic prepend
25247c08596SBrooks Davisstatement can only be used for options which allow more than one value to
25347c08596SBrooks Davisbe given.
2549a7feaa1SRuslan ErmilovThis restriction is not enforced - if violated, the results are unpredictable.
25547c08596SBrooks Davis.It Xo
25647c08596SBrooks Davis.Ic append No { Op Ar option declaration
25747c08596SBrooks Davis.Oo , Ar ... option declaration Oc }
25847c08596SBrooks Davis.Xc
25947c08596SBrooks DavisIf for some set of options the client should first use the values
26047c08596SBrooks Davissupplied by the server, if any, and then use values you supply, these
26147c08596SBrooks Davisvalues can be defined in the
26247c08596SBrooks Davis.Ic append
26347c08596SBrooks Davisstatement.
26447c08596SBrooks DavisThe
26547c08596SBrooks Davis.Ic append
26647c08596SBrooks Davisstatement can only be used for options which allow more than one value to
26747c08596SBrooks Davisbe given.
2689a7feaa1SRuslan ErmilovThis restriction is not enforced - if you ignore it,
26947c08596SBrooks Davisthe behaviour will be unpredictable.
27047c08596SBrooks Davis.El
27147c08596SBrooks Davis.Sh LEASE DECLARATIONS
27247c08596SBrooks DavisThe lease declaration:
27347c08596SBrooks Davis.Pp
2749a7feaa1SRuslan Ermilov.D1 Ic lease No { Ar lease-declaration Oo Ar ... lease-declaration Oc }
27547c08596SBrooks Davis.Pp
27647c08596SBrooks DavisThe DHCP client may decide after some period of time (see
27747c08596SBrooks Davis.Sx PROTOCOL TIMING )
27847c08596SBrooks Davisthat it is not going to succeed in contacting a server.
27947c08596SBrooks DavisAt that time, it consults its own database of old leases and tests each one
28047c08596SBrooks Davisthat has not yet timed out by pinging the listed router for that lease to
28147c08596SBrooks Davissee if that lease could work.
28247c08596SBrooks DavisIt is possible to define one or more
28347c08596SBrooks Davis.Em fixed
28447c08596SBrooks Davisleases in the client configuration file for networks where there is no DHCP
28547c08596SBrooks Davisor BOOTP service, so that the client can still automatically configure its
28647c08596SBrooks Davisaddress.
28747c08596SBrooks DavisThis is done with the
28847c08596SBrooks Davis.Ic lease
28947c08596SBrooks Davisstatement.
29047c08596SBrooks Davis.Pp
29147c08596SBrooks DavisNOTE: the lease statement is also used in the
29247c08596SBrooks Davis.Pa dhclient.leases
29347c08596SBrooks Davisfile in order to record leases that have been received from DHCP servers.
29447c08596SBrooks DavisSome of the syntax for leases as described below is only needed in the
29547c08596SBrooks Davis.Pa dhclient.leases
29647c08596SBrooks Davisfile.
29747c08596SBrooks DavisSuch syntax is documented here for completeness.
29847c08596SBrooks Davis.Pp
2999a7feaa1SRuslan ErmilovA lease statement consists of the
3009a7feaa1SRuslan Ermilov.Ic lease
3019a7feaa1SRuslan Ermilovkeyword, followed by a left
30247c08596SBrooks Daviscurly brace, followed by one or more lease declaration statements,
30347c08596SBrooks Davisfollowed by a right curly brace.
30447c08596SBrooks DavisThe following lease declarations are possible:
3059a7feaa1SRuslan Ermilov.Bl -tag -width indent
30647c08596SBrooks Davis.It Ic bootp ;
30747c08596SBrooks DavisThe
30847c08596SBrooks Davis.Ic bootp
30947c08596SBrooks Davisstatement is used to indicate that the lease was acquired using the
31047c08596SBrooks DavisBOOTP protocol rather than the DHCP protocol.
31147c08596SBrooks DavisIt is never necessary to specify this in the client configuration file.
31247c08596SBrooks DavisThe client uses this syntax in its lease database file.
3139a7feaa1SRuslan Ermilov.It Ic interface Qq Ar string ;
31447c08596SBrooks DavisThe
31547c08596SBrooks Davis.Ic interface
31647c08596SBrooks Davislease statement is used to indicate the interface on which the lease is valid.
31747c08596SBrooks DavisIf set, this lease will only be tried on a particular interface.
31847c08596SBrooks DavisWhen the client receives a lease from a server, it always records the
31947c08596SBrooks Davisinterface number on which it received that lease.
32047c08596SBrooks DavisIf predefined leases are specified in the
32147c08596SBrooks Davis.Nm
32247c08596SBrooks Davisfile, the interface should also be specified, although this is not required.
32347c08596SBrooks Davis.It Ic fixed-address Ar ip-address ;
32447c08596SBrooks DavisThe
32547c08596SBrooks Davis.Ic fixed-address
32647c08596SBrooks Davisstatement is used to set the IP address of a particular lease.
32747c08596SBrooks DavisThis is required for all lease statements.
3289a7feaa1SRuslan ErmilovThe IP address must be specified as a dotted quad (e.g.,
3299a7feaa1SRuslan Ermilov.Li 12.34.56.78 ) .
3309a7feaa1SRuslan Ermilov.It Ic filename Qq Ar string ;
33147c08596SBrooks DavisThe
33247c08596SBrooks Davis.Ic filename
33347c08596SBrooks Davisstatement specifies the name of the boot filename to use.
33447c08596SBrooks DavisThis is not used by the standard client configuration script, but is
33547c08596SBrooks Davisincluded for completeness.
3369a7feaa1SRuslan Ermilov.It Ic server-name Qq Ar string ;
33747c08596SBrooks DavisThe
33847c08596SBrooks Davis.Ic server-name
33947c08596SBrooks Davisstatement specifies the name of the boot server name to use.
34047c08596SBrooks DavisThis is also not used by the standard client configuration script.
34147c08596SBrooks Davis.It Ic option Ar option-declaration ;
34247c08596SBrooks DavisThe
34347c08596SBrooks Davis.Ic option
34447c08596SBrooks Davisstatement is used to specify the value of an option supplied by the server,
34547c08596SBrooks Davisor, in the case of predefined leases declared in
3469a7feaa1SRuslan Ermilov.Nm ,
34747c08596SBrooks Davisthe value that the user wishes the client configuration script to use if the
34847c08596SBrooks Davispredefined lease is used.
3499a7feaa1SRuslan Ermilov.It Ic script Qq Ar script-name ;
35047c08596SBrooks DavisThe
35147c08596SBrooks Davis.Ic script
35247c08596SBrooks Davisstatement is used to specify the pathname of the DHCP client configuration
35347c08596SBrooks Davisscript.
35447c08596SBrooks DavisThis script is used by the DHCP client to set each interface's initial
35547c08596SBrooks Davisconfiguration prior to requesting an address, to test the address once it
35647c08596SBrooks Davishas been offered, and to set the interface's final configuration once a
35747c08596SBrooks Davislease has been acquired.
35847c08596SBrooks DavisIf no lease is acquired, the script is used to test predefined leases, if
35947c08596SBrooks Davisany, and also called once if no valid lease can be identified.
36047c08596SBrooks DavisFor more information, see
36147c08596SBrooks Davis.Xr dhclient.leases 5 .
3629a7feaa1SRuslan Ermilov.It Ic medium Qq Ar "media setup" ;
36347c08596SBrooks DavisThe
36447c08596SBrooks Davis.Ic medium
36547c08596SBrooks Davisstatement can be used on systems where network interfaces cannot
36647c08596SBrooks Davisautomatically determine the type of network to which they are connected.
3679a7feaa1SRuslan ErmilovThe
3689a7feaa1SRuslan Ermilov.Ar "media setup"
3699a7feaa1SRuslan Ermilovstring is a system-dependent parameter which is passed
37047c08596SBrooks Davisto the DHCP client configuration script when initializing the interface.
37147c08596SBrooks DavisOn
37247c08596SBrooks Davis.Ux
3739a7feaa1SRuslan Ermilovand
3749a7feaa1SRuslan Ermilov.Ux Ns -like
3759a7feaa1SRuslan Ermilovsystems, the argument is passed on the
3769a7feaa1SRuslan Ermilov.Xr ifconfig 8
3779a7feaa1SRuslan Ermilovcommand line
37847c08596SBrooks Daviswhen configuring the interface.
37947c08596SBrooks Davis.Pp
38047c08596SBrooks DavisThe DHCP client automatically declares this parameter if it used a
38147c08596SBrooks Davismedia type (see the
38247c08596SBrooks Davis.Ic media
38347c08596SBrooks Davisstatement) when configuring the interface in order to obtain a lease.
38447c08596SBrooks DavisThis statement should be used in predefined leases only if the network
38547c08596SBrooks Davisinterface requires media type configuration.
38647c08596SBrooks Davis.It Ic renew Ar date ;
38747c08596SBrooks Davis.It Ic rebind Ar date ;
38847c08596SBrooks Davis.It Ic expire Ar date ;
38947c08596SBrooks DavisThe
39047c08596SBrooks Davis.Ic renew
39147c08596SBrooks Davisstatement defines the time at which the DHCP client should begin trying to
39247c08596SBrooks Daviscontact its server to renew a lease that it is using.
39347c08596SBrooks DavisThe
39447c08596SBrooks Davis.Ic rebind
39547c08596SBrooks Davisstatement defines the time at which the DHCP client should begin to try to
39647c08596SBrooks Daviscontact
39747c08596SBrooks Davis.Em any
39847c08596SBrooks DavisDHCP server in order to renew its lease.
39947c08596SBrooks DavisThe
40047c08596SBrooks Davis.Ic expire
40147c08596SBrooks Davisstatement defines the time at which the DHCP client must stop using a lease
40247c08596SBrooks Davisif it has not been able to contact a server in order to renew it.
40347c08596SBrooks Davis.El
40447c08596SBrooks Davis.Pp
40547c08596SBrooks DavisThese declarations are automatically set in leases acquired by the
4069a7feaa1SRuslan ErmilovDHCP client, but must also be configured in predefined leases - a
40747c08596SBrooks Davispredefined lease whose expiry time has passed will not be used by the
40847c08596SBrooks DavisDHCP client.
40947c08596SBrooks Davis.Pp
41047c08596SBrooks DavisDates are specified as follows:
4119a7feaa1SRuslan Ermilov.Bd -ragged -offset indent
4129a7feaa1SRuslan Ermilov.Ar <weekday>
41347c08596SBrooks Davis.Sm off
41447c08596SBrooks Davis.Ar <year> No / Ar <month> No / Ar <day>
41547c08596SBrooks Davis.Ar <hour> : <minute> : <second>
41647c08596SBrooks Davis.Sm on
4179a7feaa1SRuslan Ermilov.Ed
41847c08596SBrooks Davis.Pp
41947c08596SBrooks DavisThe weekday is present to make it easy for a human to tell when a
4209a7feaa1SRuslan Ermilovlease expires - it is specified as a number from zero to six, with zero
42147c08596SBrooks Davisbeing Sunday.
42247c08596SBrooks DavisWhen declaring a predefined lease, it can always be specified as zero.
42347c08596SBrooks DavisThe year is specified with the century, so it should generally be four
42447c08596SBrooks Davisdigits except for really long leases.
42547c08596SBrooks DavisThe month is specified as a number starting with 1 for January.
42647c08596SBrooks DavisThe day of the month is likewise specified starting with 1.
42747c08596SBrooks DavisThe hour is a number between 0 and 23,
42847c08596SBrooks Davisthe minute a number between 0 and 59,
42947c08596SBrooks Davisand the second also a number between 0 and 59.
43047c08596SBrooks Davis.Sh ALIAS DECLARATIONS
43147c08596SBrooks Davis.Ic alias No { Ar declarations ... No }
43247c08596SBrooks Davis.Pp
43347c08596SBrooks DavisSome DHCP clients running TCP/IP roaming protocols may require that in
43447c08596SBrooks Davisaddition to the lease they may acquire via DHCP, their interface also
43547c08596SBrooks Davisbe configured with a predefined IP alias so that they can have a
43647c08596SBrooks Davispermanent IP address even while roaming.
4379a7feaa1SRuslan ErmilovThe Internet Software Consortium DHCP client does not support roaming with
43847c08596SBrooks Davisfixed addresses directly, but in order to facilitate such experimentation,
43947c08596SBrooks Davisthe DHCP client can be set up to configure an IP alias using the
44047c08596SBrooks Davis.Ic alias
44147c08596SBrooks Davisdeclaration.
44247c08596SBrooks Davis.Pp
44347c08596SBrooks DavisThe
44447c08596SBrooks Davis.Ic alias
44547c08596SBrooks Davisdeclaration resembles a lease declaration, except that options other than
44647c08596SBrooks Davisthe subnet-mask option are ignored by the standard client configuration
44747c08596SBrooks Davisscript, and expiry times are ignored.
44847c08596SBrooks DavisA typical alias declaration includes an interface declaration, a fixed-address
44947c08596SBrooks Davisdeclaration for the IP alias address, and a subnet-mask option declaration.
45047c08596SBrooks DavisA medium statement should never be included in an alias declaration.
45147c08596SBrooks Davis.Sh OTHER DECLARATIONS
4529a7feaa1SRuslan Ermilov.Bl -tag -width indent
45347c08596SBrooks Davis.It Ic reject Ar ip-address ;
45447c08596SBrooks DavisThe
45547c08596SBrooks Davis.Ic reject
45647c08596SBrooks Davisstatement causes the DHCP client to reject offers from servers who use
45747c08596SBrooks Davisthe specified address as a server identifier.
45847c08596SBrooks DavisThis can be used to avoid being configured by rogue or misconfigured DHCP
4599a7feaa1SRuslan Ermilovservers, although it should be a last resort - better to track down
46047c08596SBrooks Davisthe bad DHCP server and fix it.
4619a7feaa1SRuslan Ermilov.It Ic interface Qo Ar name Qc { Ar declarations ... No }
46247c08596SBrooks DavisA client with more than one network interface may require different
46347c08596SBrooks Davisbehaviour depending on which interface is being configured.
46447c08596SBrooks DavisAll timing parameters and declarations other than lease and alias
46547c08596SBrooks Davisdeclarations can be enclosed in an interface declaration, and those
46647c08596SBrooks Davisparameters will then be used only for the interface that matches the
46747c08596SBrooks Davisspecified name.
46847c08596SBrooks DavisInterfaces for which there is no interface declaration will use the
46947c08596SBrooks Davisparameters declared outside of any interface declaration,
47047c08596SBrooks Davisor the default settings.
4719a7feaa1SRuslan Ermilov.It Ic media Qo Ar "media setup" Qc Oo , Qo Ar "media setup" Qc , Ar ... Oc ;
47247c08596SBrooks DavisThe
47347c08596SBrooks Davis.Ic media
47447c08596SBrooks Davisstatement defines one or more media configuration parameters which may
47547c08596SBrooks Davisbe tried while attempting to acquire an IP address.
47647c08596SBrooks DavisThe DHCP client will cycle through each media setup string on the list,
47747c08596SBrooks Davisconfiguring the interface using that setup and attempting to boot,
47847c08596SBrooks Davisand then trying the next one.
4799a7feaa1SRuslan ErmilovThis can be used for network interfaces which are not capable of sensing
4809a7feaa1SRuslan Ermilovthe media type unaided - whichever media type succeeds in getting a request
48147c08596SBrooks Davisto the server and hearing the reply is probably right (no guarantees).
48247c08596SBrooks Davis.Pp
48347c08596SBrooks DavisThe media setup is only used for the initial phase of address
48447c08596SBrooks Davisacquisition (the DHCPDISCOVER and DHCPOFFER packets).
48547c08596SBrooks DavisOnce an address has been acquired, the DHCP client will record it in its
48647c08596SBrooks Davislease database and will record the media type used to acquire the address.
48747c08596SBrooks DavisWhenever the client tries to renew the lease, it will use that same media type.
48847c08596SBrooks DavisThe lease must expire before the client will go back to cycling through media
48947c08596SBrooks Davistypes.
4901e7fe2fbSLuiz Otavio O Souza.It Ic vlan-pcp Ar code ;
4911e7fe2fbSLuiz Otavio O SouzaThe
4921e7fe2fbSLuiz Otavio O Souza.Ic vlan-pcp
4931e7fe2fbSLuiz Otavio O Souzastatement sets the PCP (Priority Code Point) value for the VLAN header.
4941e7fe2fbSLuiz Otavio O SouzaThis requires the
4951e7fe2fbSLuiz Otavio O Souza.Va net.link.vlan.mtag_pcp
4961e7fe2fbSLuiz Otavio O Souzasysctl to be set to 1.
49747c08596SBrooks Davis.El
49847c08596SBrooks Davis.Sh EXAMPLES
49947c08596SBrooks DavisThe following configuration file is used on a laptop
5009a7feaa1SRuslan Ermilovwhich has an IP alias of
5019a7feaa1SRuslan Ermilov.Li 192.5.5.213 ,
5029a7feaa1SRuslan Ermilovand has one interface,
5039a7feaa1SRuslan Ermilov.Li ep0
5049a7feaa1SRuslan Ermilov(a 3Com 3C589C).
50547c08596SBrooks DavisBooting intervals have been shortened somewhat from the default, because
50647c08596SBrooks Davisthe client is known to spend most of its time on networks with little DHCP
50747c08596SBrooks Davisactivity.
50847c08596SBrooks DavisThe laptop does roam to multiple networks.
50947c08596SBrooks Davis.Bd -literal -offset indent
51047c08596SBrooks Davistimeout 60;
51147c08596SBrooks Davisretry 60;
51247c08596SBrooks Davisreboot 10;
51347c08596SBrooks Davisselect-timeout 5;
51447c08596SBrooks Davisinitial-interval 2;
51547c08596SBrooks Davisreject 192.33.137.209;
51647c08596SBrooks Davis
51747c08596SBrooks Davisinterface "ep0" {
51847c08596SBrooks Davis    send host-name "andare.fugue.com";
51947c08596SBrooks Davis    send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
52047c08596SBrooks Davis    send dhcp-lease-time 3600;
52147c08596SBrooks Davis    supersede domain-name "fugue.com rc.vix.com home.vix.com";
52247c08596SBrooks Davis    prepend domain-name-servers 127.0.0.1;
52347c08596SBrooks Davis    request subnet-mask, broadcast-address, time-offset, routers,
52447c08596SBrooks Davis	    domain-name, domain-name-servers, host-name;
52547c08596SBrooks Davis    require subnet-mask, domain-name-servers;
52647c08596SBrooks Davis    script "/etc/dhclient-script";
52747c08596SBrooks Davis    media "media 10baseT/UTP", "media 10base2/BNC";
52847c08596SBrooks Davis}
52947c08596SBrooks Davis
53047c08596SBrooks Davisalias {
53147c08596SBrooks Davis  interface "ep0";
53247c08596SBrooks Davis  fixed-address 192.5.5.213;
53347c08596SBrooks Davis  option subnet-mask 255.255.255.255;
53447c08596SBrooks Davis}
53547c08596SBrooks Davis.Ed
53647c08596SBrooks Davis.Pp
53747c08596SBrooks DavisThis is a very complicated
53847c08596SBrooks Davis.Nm
5399a7feaa1SRuslan Ermilovfile - in general, yours should be much simpler.
5409a7feaa1SRuslan ErmilovIn many cases, it is sufficient to just create an empty
54147c08596SBrooks Davis.Nm
5429a7feaa1SRuslan Ermilovfile - the defaults are usually fine.
54347c08596SBrooks Davis.Sh SEE ALSO
54447c08596SBrooks Davis.Xr dhclient.leases 5 ,
5459a7feaa1SRuslan Ermilov.Xr dhcp-options 5 ,
546c09eb466SJoel Dahl.Xr dhcpd.conf 5 ,
54747c08596SBrooks Davis.Xr dhclient 8 ,
54847c08596SBrooks Davis.Xr dhcpd 8
5499a7feaa1SRuslan Ermilov.Rs
5509a7feaa1SRuslan Ermilov.%R "RFC 2132, RFC 2131"
5519a7feaa1SRuslan Ermilov.Re
55247c08596SBrooks Davis.Sh AUTHORS
5539a7feaa1SRuslan Ermilov.An -nosplit
5549a7feaa1SRuslan ErmilovThe
55547c08596SBrooks Davis.Xr dhclient 8
5569a7feaa1SRuslan Ermilovutility
55747c08596SBrooks Daviswas written by
558bd0891ceSBaptiste Daroussin.An Ted Lemon Aq Mt mellon@vix.com
55947c08596SBrooks Davisunder a contract with Vixie Labs.
56047c08596SBrooks Davis.Pp
56147c08596SBrooks DavisThe current implementation was reworked by
562bd0891ceSBaptiste Daroussin.An Henning Brauer Aq Mt henning@openbsd.org .
563