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.\" 41*f93497feSConrad Meyer.Dd May 31, 2018 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. 230*f93497feSConrad Meyer.Pp 231*f93497feSConrad MeyerSome options values have special meaning: 232*f93497feSConrad Meyer.Bl -tag -width indent 233*f93497feSConrad Meyer.It Ar interface-mtu 234*f93497feSConrad MeyerAny server-supplied interface MTU is ignored by the client if a 235*f93497feSConrad Meyer.Ic supersede 236*f93497feSConrad Meyerzero value is configured. 237*f93497feSConrad Meyer.El 23847c08596SBrooks Davis.It Xo 23947c08596SBrooks Davis.Ic prepend No { Op Ar option declaration 24047c08596SBrooks Davis.Oo , Ar ... option declaration Oc } 24147c08596SBrooks Davis.Xc 24247c08596SBrooks DavisIf for some set of options the client should use a value you supply, 24347c08596SBrooks Davisand then use the values supplied by the server, if any, 24447c08596SBrooks Davisthese values can be defined in the 24547c08596SBrooks Davis.Ic prepend 24647c08596SBrooks Davisstatement. 24747c08596SBrooks DavisThe 24847c08596SBrooks Davis.Ic prepend 24947c08596SBrooks Davisstatement can only be used for options which allow more than one value to 25047c08596SBrooks Davisbe given. 2519a7feaa1SRuslan ErmilovThis restriction is not enforced - if violated, the results are unpredictable. 25247c08596SBrooks Davis.It Xo 25347c08596SBrooks Davis.Ic append No { Op Ar option declaration 25447c08596SBrooks Davis.Oo , Ar ... option declaration Oc } 25547c08596SBrooks Davis.Xc 25647c08596SBrooks DavisIf for some set of options the client should first use the values 25747c08596SBrooks Davissupplied by the server, if any, and then use values you supply, these 25847c08596SBrooks Davisvalues can be defined in the 25947c08596SBrooks Davis.Ic append 26047c08596SBrooks Davisstatement. 26147c08596SBrooks DavisThe 26247c08596SBrooks Davis.Ic append 26347c08596SBrooks Davisstatement can only be used for options which allow more than one value to 26447c08596SBrooks Davisbe given. 2659a7feaa1SRuslan ErmilovThis restriction is not enforced - if you ignore it, 26647c08596SBrooks Davisthe behaviour will be unpredictable. 26747c08596SBrooks Davis.El 26847c08596SBrooks Davis.Sh LEASE DECLARATIONS 26947c08596SBrooks DavisThe lease declaration: 27047c08596SBrooks Davis.Pp 2719a7feaa1SRuslan Ermilov.D1 Ic lease No { Ar lease-declaration Oo Ar ... lease-declaration Oc } 27247c08596SBrooks Davis.Pp 27347c08596SBrooks DavisThe DHCP client may decide after some period of time (see 27447c08596SBrooks Davis.Sx PROTOCOL TIMING ) 27547c08596SBrooks Davisthat it is not going to succeed in contacting a server. 27647c08596SBrooks DavisAt that time, it consults its own database of old leases and tests each one 27747c08596SBrooks Davisthat has not yet timed out by pinging the listed router for that lease to 27847c08596SBrooks Davissee if that lease could work. 27947c08596SBrooks DavisIt is possible to define one or more 28047c08596SBrooks Davis.Em fixed 28147c08596SBrooks Davisleases in the client configuration file for networks where there is no DHCP 28247c08596SBrooks Davisor BOOTP service, so that the client can still automatically configure its 28347c08596SBrooks Davisaddress. 28447c08596SBrooks DavisThis is done with the 28547c08596SBrooks Davis.Ic lease 28647c08596SBrooks Davisstatement. 28747c08596SBrooks Davis.Pp 28847c08596SBrooks DavisNOTE: the lease statement is also used in the 28947c08596SBrooks Davis.Pa dhclient.leases 29047c08596SBrooks Davisfile in order to record leases that have been received from DHCP servers. 29147c08596SBrooks DavisSome of the syntax for leases as described below is only needed in the 29247c08596SBrooks Davis.Pa dhclient.leases 29347c08596SBrooks Davisfile. 29447c08596SBrooks DavisSuch syntax is documented here for completeness. 29547c08596SBrooks Davis.Pp 2969a7feaa1SRuslan ErmilovA lease statement consists of the 2979a7feaa1SRuslan Ermilov.Ic lease 2989a7feaa1SRuslan Ermilovkeyword, followed by a left 29947c08596SBrooks Daviscurly brace, followed by one or more lease declaration statements, 30047c08596SBrooks Davisfollowed by a right curly brace. 30147c08596SBrooks DavisThe following lease declarations are possible: 3029a7feaa1SRuslan Ermilov.Bl -tag -width indent 30347c08596SBrooks Davis.It Ic bootp ; 30447c08596SBrooks DavisThe 30547c08596SBrooks Davis.Ic bootp 30647c08596SBrooks Davisstatement is used to indicate that the lease was acquired using the 30747c08596SBrooks DavisBOOTP protocol rather than the DHCP protocol. 30847c08596SBrooks DavisIt is never necessary to specify this in the client configuration file. 30947c08596SBrooks DavisThe client uses this syntax in its lease database file. 3109a7feaa1SRuslan Ermilov.It Ic interface Qq Ar string ; 31147c08596SBrooks DavisThe 31247c08596SBrooks Davis.Ic interface 31347c08596SBrooks Davislease statement is used to indicate the interface on which the lease is valid. 31447c08596SBrooks DavisIf set, this lease will only be tried on a particular interface. 31547c08596SBrooks DavisWhen the client receives a lease from a server, it always records the 31647c08596SBrooks Davisinterface number on which it received that lease. 31747c08596SBrooks DavisIf predefined leases are specified in the 31847c08596SBrooks Davis.Nm 31947c08596SBrooks Davisfile, the interface should also be specified, although this is not required. 32047c08596SBrooks Davis.It Ic fixed-address Ar ip-address ; 32147c08596SBrooks DavisThe 32247c08596SBrooks Davis.Ic fixed-address 32347c08596SBrooks Davisstatement is used to set the IP address of a particular lease. 32447c08596SBrooks DavisThis is required for all lease statements. 3259a7feaa1SRuslan ErmilovThe IP address must be specified as a dotted quad (e.g., 3269a7feaa1SRuslan Ermilov.Li 12.34.56.78 ) . 3279a7feaa1SRuslan Ermilov.It Ic filename Qq Ar string ; 32847c08596SBrooks DavisThe 32947c08596SBrooks Davis.Ic filename 33047c08596SBrooks Davisstatement specifies the name of the boot filename to use. 33147c08596SBrooks DavisThis is not used by the standard client configuration script, but is 33247c08596SBrooks Davisincluded for completeness. 3339a7feaa1SRuslan Ermilov.It Ic server-name Qq Ar string ; 33447c08596SBrooks DavisThe 33547c08596SBrooks Davis.Ic server-name 33647c08596SBrooks Davisstatement specifies the name of the boot server name to use. 33747c08596SBrooks DavisThis is also not used by the standard client configuration script. 33847c08596SBrooks Davis.It Ic option Ar option-declaration ; 33947c08596SBrooks DavisThe 34047c08596SBrooks Davis.Ic option 34147c08596SBrooks Davisstatement is used to specify the value of an option supplied by the server, 34247c08596SBrooks Davisor, in the case of predefined leases declared in 3439a7feaa1SRuslan Ermilov.Nm , 34447c08596SBrooks Davisthe value that the user wishes the client configuration script to use if the 34547c08596SBrooks Davispredefined lease is used. 3469a7feaa1SRuslan Ermilov.It Ic script Qq Ar script-name ; 34747c08596SBrooks DavisThe 34847c08596SBrooks Davis.Ic script 34947c08596SBrooks Davisstatement is used to specify the pathname of the DHCP client configuration 35047c08596SBrooks Davisscript. 35147c08596SBrooks DavisThis script is used by the DHCP client to set each interface's initial 35247c08596SBrooks Davisconfiguration prior to requesting an address, to test the address once it 35347c08596SBrooks Davishas been offered, and to set the interface's final configuration once a 35447c08596SBrooks Davislease has been acquired. 35547c08596SBrooks DavisIf no lease is acquired, the script is used to test predefined leases, if 35647c08596SBrooks Davisany, and also called once if no valid lease can be identified. 35747c08596SBrooks DavisFor more information, see 35847c08596SBrooks Davis.Xr dhclient.leases 5 . 3599a7feaa1SRuslan Ermilov.It Ic medium Qq Ar "media setup" ; 36047c08596SBrooks DavisThe 36147c08596SBrooks Davis.Ic medium 36247c08596SBrooks Davisstatement can be used on systems where network interfaces cannot 36347c08596SBrooks Davisautomatically determine the type of network to which they are connected. 3649a7feaa1SRuslan ErmilovThe 3659a7feaa1SRuslan Ermilov.Ar "media setup" 3669a7feaa1SRuslan Ermilovstring is a system-dependent parameter which is passed 36747c08596SBrooks Davisto the DHCP client configuration script when initializing the interface. 36847c08596SBrooks DavisOn 36947c08596SBrooks Davis.Ux 3709a7feaa1SRuslan Ermilovand 3719a7feaa1SRuslan Ermilov.Ux Ns -like 3729a7feaa1SRuslan Ermilovsystems, the argument is passed on the 3739a7feaa1SRuslan Ermilov.Xr ifconfig 8 3749a7feaa1SRuslan Ermilovcommand line 37547c08596SBrooks Daviswhen configuring the interface. 37647c08596SBrooks Davis.Pp 37747c08596SBrooks DavisThe DHCP client automatically declares this parameter if it used a 37847c08596SBrooks Davismedia type (see the 37947c08596SBrooks Davis.Ic media 38047c08596SBrooks Davisstatement) when configuring the interface in order to obtain a lease. 38147c08596SBrooks DavisThis statement should be used in predefined leases only if the network 38247c08596SBrooks Davisinterface requires media type configuration. 38347c08596SBrooks Davis.It Ic renew Ar date ; 38447c08596SBrooks Davis.It Ic rebind Ar date ; 38547c08596SBrooks Davis.It Ic expire Ar date ; 38647c08596SBrooks DavisThe 38747c08596SBrooks Davis.Ic renew 38847c08596SBrooks Davisstatement defines the time at which the DHCP client should begin trying to 38947c08596SBrooks Daviscontact its server to renew a lease that it is using. 39047c08596SBrooks DavisThe 39147c08596SBrooks Davis.Ic rebind 39247c08596SBrooks Davisstatement defines the time at which the DHCP client should begin to try to 39347c08596SBrooks Daviscontact 39447c08596SBrooks Davis.Em any 39547c08596SBrooks DavisDHCP server in order to renew its lease. 39647c08596SBrooks DavisThe 39747c08596SBrooks Davis.Ic expire 39847c08596SBrooks Davisstatement defines the time at which the DHCP client must stop using a lease 39947c08596SBrooks Davisif it has not been able to contact a server in order to renew it. 40047c08596SBrooks Davis.El 40147c08596SBrooks Davis.Pp 40247c08596SBrooks DavisThese declarations are automatically set in leases acquired by the 4039a7feaa1SRuslan ErmilovDHCP client, but must also be configured in predefined leases - a 40447c08596SBrooks Davispredefined lease whose expiry time has passed will not be used by the 40547c08596SBrooks DavisDHCP client. 40647c08596SBrooks Davis.Pp 40747c08596SBrooks DavisDates are specified as follows: 4089a7feaa1SRuslan Ermilov.Bd -ragged -offset indent 4099a7feaa1SRuslan Ermilov.Ar <weekday> 41047c08596SBrooks Davis.Sm off 41147c08596SBrooks Davis.Ar <year> No / Ar <month> No / Ar <day> 41247c08596SBrooks Davis.Ar <hour> : <minute> : <second> 41347c08596SBrooks Davis.Sm on 4149a7feaa1SRuslan Ermilov.Ed 41547c08596SBrooks Davis.Pp 41647c08596SBrooks DavisThe weekday is present to make it easy for a human to tell when a 4179a7feaa1SRuslan Ermilovlease expires - it is specified as a number from zero to six, with zero 41847c08596SBrooks Davisbeing Sunday. 41947c08596SBrooks DavisWhen declaring a predefined lease, it can always be specified as zero. 42047c08596SBrooks DavisThe year is specified with the century, so it should generally be four 42147c08596SBrooks Davisdigits except for really long leases. 42247c08596SBrooks DavisThe month is specified as a number starting with 1 for January. 42347c08596SBrooks DavisThe day of the month is likewise specified starting with 1. 42447c08596SBrooks DavisThe hour is a number between 0 and 23, 42547c08596SBrooks Davisthe minute a number between 0 and 59, 42647c08596SBrooks Davisand the second also a number between 0 and 59. 42747c08596SBrooks Davis.Sh ALIAS DECLARATIONS 42847c08596SBrooks Davis.Ic alias No { Ar declarations ... No } 42947c08596SBrooks Davis.Pp 43047c08596SBrooks DavisSome DHCP clients running TCP/IP roaming protocols may require that in 43147c08596SBrooks Davisaddition to the lease they may acquire via DHCP, their interface also 43247c08596SBrooks Davisbe configured with a predefined IP alias so that they can have a 43347c08596SBrooks Davispermanent IP address even while roaming. 4349a7feaa1SRuslan ErmilovThe Internet Software Consortium DHCP client does not support roaming with 43547c08596SBrooks Davisfixed addresses directly, but in order to facilitate such experimentation, 43647c08596SBrooks Davisthe DHCP client can be set up to configure an IP alias using the 43747c08596SBrooks Davis.Ic alias 43847c08596SBrooks Davisdeclaration. 43947c08596SBrooks Davis.Pp 44047c08596SBrooks DavisThe 44147c08596SBrooks Davis.Ic alias 44247c08596SBrooks Davisdeclaration resembles a lease declaration, except that options other than 44347c08596SBrooks Davisthe subnet-mask option are ignored by the standard client configuration 44447c08596SBrooks Davisscript, and expiry times are ignored. 44547c08596SBrooks DavisA typical alias declaration includes an interface declaration, a fixed-address 44647c08596SBrooks Davisdeclaration for the IP alias address, and a subnet-mask option declaration. 44747c08596SBrooks DavisA medium statement should never be included in an alias declaration. 44847c08596SBrooks Davis.Sh OTHER DECLARATIONS 4499a7feaa1SRuslan Ermilov.Bl -tag -width indent 45047c08596SBrooks Davis.It Ic reject Ar ip-address ; 45147c08596SBrooks DavisThe 45247c08596SBrooks Davis.Ic reject 45347c08596SBrooks Davisstatement causes the DHCP client to reject offers from servers who use 45447c08596SBrooks Davisthe specified address as a server identifier. 45547c08596SBrooks DavisThis can be used to avoid being configured by rogue or misconfigured DHCP 4569a7feaa1SRuslan Ermilovservers, although it should be a last resort - better to track down 45747c08596SBrooks Davisthe bad DHCP server and fix it. 4589a7feaa1SRuslan Ermilov.It Ic interface Qo Ar name Qc { Ar declarations ... No } 45947c08596SBrooks DavisA client with more than one network interface may require different 46047c08596SBrooks Davisbehaviour depending on which interface is being configured. 46147c08596SBrooks DavisAll timing parameters and declarations other than lease and alias 46247c08596SBrooks Davisdeclarations can be enclosed in an interface declaration, and those 46347c08596SBrooks Davisparameters will then be used only for the interface that matches the 46447c08596SBrooks Davisspecified name. 46547c08596SBrooks DavisInterfaces for which there is no interface declaration will use the 46647c08596SBrooks Davisparameters declared outside of any interface declaration, 46747c08596SBrooks Davisor the default settings. 4689a7feaa1SRuslan Ermilov.It Ic media Qo Ar "media setup" Qc Oo , Qo Ar "media setup" Qc , Ar ... Oc ; 46947c08596SBrooks DavisThe 47047c08596SBrooks Davis.Ic media 47147c08596SBrooks Davisstatement defines one or more media configuration parameters which may 47247c08596SBrooks Davisbe tried while attempting to acquire an IP address. 47347c08596SBrooks DavisThe DHCP client will cycle through each media setup string on the list, 47447c08596SBrooks Davisconfiguring the interface using that setup and attempting to boot, 47547c08596SBrooks Davisand then trying the next one. 4769a7feaa1SRuslan ErmilovThis can be used for network interfaces which are not capable of sensing 4779a7feaa1SRuslan Ermilovthe media type unaided - whichever media type succeeds in getting a request 47847c08596SBrooks Davisto the server and hearing the reply is probably right (no guarantees). 47947c08596SBrooks Davis.Pp 48047c08596SBrooks DavisThe media setup is only used for the initial phase of address 48147c08596SBrooks Davisacquisition (the DHCPDISCOVER and DHCPOFFER packets). 48247c08596SBrooks DavisOnce an address has been acquired, the DHCP client will record it in its 48347c08596SBrooks Davislease database and will record the media type used to acquire the address. 48447c08596SBrooks DavisWhenever the client tries to renew the lease, it will use that same media type. 48547c08596SBrooks DavisThe lease must expire before the client will go back to cycling through media 48647c08596SBrooks Davistypes. 48747c08596SBrooks Davis.El 48847c08596SBrooks Davis.Sh EXAMPLES 48947c08596SBrooks DavisThe following configuration file is used on a laptop 4909a7feaa1SRuslan Ermilovwhich has an IP alias of 4919a7feaa1SRuslan Ermilov.Li 192.5.5.213 , 4929a7feaa1SRuslan Ermilovand has one interface, 4939a7feaa1SRuslan Ermilov.Li ep0 4949a7feaa1SRuslan Ermilov(a 3Com 3C589C). 49547c08596SBrooks DavisBooting intervals have been shortened somewhat from the default, because 49647c08596SBrooks Davisthe client is known to spend most of its time on networks with little DHCP 49747c08596SBrooks Davisactivity. 49847c08596SBrooks DavisThe laptop does roam to multiple networks. 49947c08596SBrooks Davis.Bd -literal -offset indent 50047c08596SBrooks Davistimeout 60; 50147c08596SBrooks Davisretry 60; 50247c08596SBrooks Davisreboot 10; 50347c08596SBrooks Davisselect-timeout 5; 50447c08596SBrooks Davisinitial-interval 2; 50547c08596SBrooks Davisreject 192.33.137.209; 50647c08596SBrooks Davis 50747c08596SBrooks Davisinterface "ep0" { 50847c08596SBrooks Davis send host-name "andare.fugue.com"; 50947c08596SBrooks Davis send dhcp-client-identifier 1:0:a0:24:ab:fb:9c; 51047c08596SBrooks Davis send dhcp-lease-time 3600; 51147c08596SBrooks Davis supersede domain-name "fugue.com rc.vix.com home.vix.com"; 51247c08596SBrooks Davis prepend domain-name-servers 127.0.0.1; 51347c08596SBrooks Davis request subnet-mask, broadcast-address, time-offset, routers, 51447c08596SBrooks Davis domain-name, domain-name-servers, host-name; 51547c08596SBrooks Davis require subnet-mask, domain-name-servers; 51647c08596SBrooks Davis script "/etc/dhclient-script"; 51747c08596SBrooks Davis media "media 10baseT/UTP", "media 10base2/BNC"; 51847c08596SBrooks Davis} 51947c08596SBrooks Davis 52047c08596SBrooks Davisalias { 52147c08596SBrooks Davis interface "ep0"; 52247c08596SBrooks Davis fixed-address 192.5.5.213; 52347c08596SBrooks Davis option subnet-mask 255.255.255.255; 52447c08596SBrooks Davis} 52547c08596SBrooks Davis.Ed 52647c08596SBrooks Davis.Pp 52747c08596SBrooks DavisThis is a very complicated 52847c08596SBrooks Davis.Nm 5299a7feaa1SRuslan Ermilovfile - in general, yours should be much simpler. 5309a7feaa1SRuslan ErmilovIn many cases, it is sufficient to just create an empty 53147c08596SBrooks Davis.Nm 5329a7feaa1SRuslan Ermilovfile - the defaults are usually fine. 53347c08596SBrooks Davis.Sh SEE ALSO 53447c08596SBrooks Davis.Xr dhclient.leases 5 , 5359a7feaa1SRuslan Ermilov.Xr dhcp-options 5 , 536c09eb466SJoel Dahl.Xr dhcpd.conf 5 , 53747c08596SBrooks Davis.Xr dhclient 8 , 53847c08596SBrooks Davis.Xr dhcpd 8 5399a7feaa1SRuslan Ermilov.Rs 5409a7feaa1SRuslan Ermilov.%R "RFC 2132, RFC 2131" 5419a7feaa1SRuslan Ermilov.Re 54247c08596SBrooks Davis.Sh AUTHORS 5439a7feaa1SRuslan Ermilov.An -nosplit 5449a7feaa1SRuslan ErmilovThe 54547c08596SBrooks Davis.Xr dhclient 8 5469a7feaa1SRuslan Ermilovutility 54747c08596SBrooks Daviswas written by 548bd0891ceSBaptiste Daroussin.An Ted Lemon Aq Mt mellon@vix.com 54947c08596SBrooks Davisunder a contract with Vixie Labs. 55047c08596SBrooks Davis.Pp 55147c08596SBrooks DavisThe current implementation was reworked by 552bd0891ceSBaptiste Daroussin.An Henning Brauer Aq Mt henning@openbsd.org . 553