1 .\" $OpenBSD: src/sbin/dhclient/dhclient.8,v 1.8 2011/03/02 07:44:42 jmc Exp $
3 .\" Copyright (c) 1997 The Internet Software Consortium.
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
15 .\" 3. Neither the name of The Internet Software Consortium nor the names
16 .\" of its contributors may be used to endorse or promote products derived
17 .\" from this software without specific prior written permission.
19 .\" THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
20 .\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21 .\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 .\" DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
24 .\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
27 .\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 .\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" This software has been written for the Internet Software Consortium
34 .\" by Ted Lemon <mellon@fugue.com> in cooperation with Vixie
35 .\" Enterprises. To learn more about the Internet Software Consortium,
36 .\" see ``http://www.isc.org/isc''. To learn more about Vixie
37 .\" Enterprises, see ``http://www.vix.com''.
43 .Nd Dynamic Host Configuration Protocol (DHCP) client
51 The Dynamic Host Configuration Protocol (DHCP) allows hosts on a TCP/IP network
52 to configure one or more network interfaces based on information collected from
54 DHCP is often used, for example, by cable modem and DSL network
55 providers to automate network configuration for their customers.
57 Information typically provided via DHCP includes
58 address and subnet mask for the interface,
60 and domain name server.
64 configure an interface using DHCP
65 (or its predecessor, BOOTP)
70 is run on the command line with the name of the
75 is already running for the interface, the old process will be killed and
76 replaced by the new invocation.
78 The options are as follows:
79 .Bl -tag -width "-p port"
81 Specify an alternate location to
82 .Pa /etc/dhclient.conf
83 for the configuration file.
87 to always run as a foreground process.
90 runs in the foreground until it has configured the interface, and then
91 will revert to running in the background.
93 Specify an alternate location to
94 .Pa /var/db/dhclient.leases. Ns Aq Ar IFNAME
99 to be less verbose on startup.
103 to reject leases with unknown options in them.
104 The default behaviour is to accept such lease offers.
107 stays around permanently and will attempt to reconnect even if
108 the interface does not exist, is down, or goes down.
109 This is the default when interfaces are configured DHCP in
110 .Pa /etc/dhclient.conf
114 on the specified interface.
117 The DHCP protocol allows a host to contact a central server which
118 maintains a list of IP addresses which may be assigned on one or more
120 A DHCP client may request an address from this pool, and
121 then use it on a temporary basis for communication on the network.
122 The DHCP protocol also provides a mechanism whereby a client can learn
123 important details about the network to which it is attached, such as
124 the location of a default router, the location of a name server, and
130 .Pa /etc/dhclient.conf
131 for configuration instructions.
132 It then attempts to configure the network interface
136 In order to keep track of leases across system reboots and server
139 keeps a list of leases it has been assigned in the
140 .Pa /var/db/dhclient.leases. Ns Aq Ar IFNAME
143 represents the network interface of the DHCP client
145 one for each interface.
146 On startup, after reading the
150 reads the leases file to refresh its memory about what leases it has been
153 Old leases are kept around in case the DHCP server is unavailable when
155 is first invoked (generally during the initial system boot
157 In that event, old leases from the
158 .Pa dhclient.leases. Ns Aq Ar IFNAME
159 file which have not yet expired are tested, and if they are determined to
160 be valid, they are used until either they expire or the DHCP server
163 A mobile host which may sometimes need to access a network on which no
164 DHCP server exists may be preloaded with a lease for a fixed
165 address on that network.
166 When all attempts to contact a DHCP server have failed,
168 will try to validate the static lease, and if it
169 succeeds, it will use that lease until it is restarted.
171 A mobile host may also travel to some networks on which DHCP is not
172 available but BOOTP is.
173 In that case, it may be advantageous to
174 arrange with the network administrator for an entry on the BOOTP
175 database, so that the host can boot quickly on that network rather
176 than cycling through the list of old leases.
179 requires at least one
181 file for each broadcast network interface.
184 for more information.
186 .Bl -tag -width "/var/db/dhclient.leases.<IFNAME>XXX" -compact
187 .It Pa /etc/dhclient.conf
188 DHCP client configuration file.
189 .It Pa /var/db/dhclient.leases. Ns Aq Ar IFNAME
190 Database of acquired leases.
191 .It Pa /var/run/dhclient.<IFNAME>.pid
192 Pidfile for running instance.
193 While active, the pidfile is flock()'d by
195 which can be tested by a program using flock() or by a script
198 utility, via a non-blocking lock attempt.
202 .Xr dhclient.conf 5 ,
203 .Xr dhclient.leases 5 ,
204 .Xr dhclient-script 8 ,
206 .Xr dhcpd 8 Pq Pa net/isc-dhcp42-server ,
207 .Xr dhcrelay 8 Pq Pa net/isc-dhcp42-relay
213 .%T Interoperation Between DHCP and BOOTP
220 .%T Dynamic Host Configuration Protocol
228 .%T DHCP Options and BOOTP Vendor Extensions
236 .%T Encoding Long Options in the Dynamic Host Configuration Protocol (DHCPv4)
245 .%T The Classless Static Route Option for Dynamic Host Configuration Protocol (DHCP) version 4
255 .An Ted Lemon Aq Mt mellon@fugue.com
257 .An Elliot Poger Aq Mt elliot@poger.com .
259 The current implementation was reworked by
260 .An Henning Brauer Aq Mt henning@openbsd.org .