3 .\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
4 .\" Copyright (c) 1996-2003 by Internet Software Consortium
6 .\" Permission to use, copy, modify, and distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
16 .\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 .\" Internet Systems Consortium, Inc.
19 .\" 950 Charter Street
20 .\" Redwood City, CA 94063
22 .\" http://www.isc.org/
24 .\" $Id: dhclient.8,v 1.1.1.1 2005/12/07 10:50:31 sonic_amiga Exp $
28 dhclient - Dynamic Host Configuration Protocol Client
87 The Internet Systems Consortium DHCP Client, dhclient, provides a
88 means for configuring one or more network interfaces using the Dynamic
89 Host Configuration Protocol, BOOTP protocol, or if these protocols
90 fail, by statically assigning an address.
93 The DHCP protocol allows a host to contact a central server which
94 maintains a list of IP addresses which may be assigned on one or more
95 subnets. A DHCP client may request an address from this pool, and
96 then use it on a temporary basis for communication on network. The
97 DHCP protocol also provides a mechanism whereby a client can learn
98 important details about the network to which it is attached, such as
99 the location of a default router, the location of a name server, and
102 On startup, dhclient reads the
104 for configuration instructions. It then gets a list of all the
105 network interfaces that are configured in the current system. For
106 each interface, it attempts to configure the interface using the DHCP
109 In order to keep track of leases across system reboots and server
110 restarts, dhclient keeps a list of leases it has been assigned in the
111 dhclient.leases(5) file. On startup, after reading the dhclient.conf
112 file, dhclient reads the dhclient.leases file to refresh its memory
113 about what leases it has been assigned.
115 When a new lease is acquired, it is appended to the end of the
116 dhclient.leases file. In order to prevent the file from becoming
117 arbitrarily large, from time to time dhclient creates a new
118 dhclient.leases file from its in-core lease database. The old version
119 of the dhclient.leases file is retained under the name
121 until the next time dhclient rewrites the database.
123 Old leases are kept around in case the DHCP server is unavailable when
124 dhclient is first invoked (generally during the initial system boot
125 process). In that event, old leases from the dhclient.leases file
126 which have not yet expired are tested, and if they are determined to
127 be valid, they are used until either they expire or the DHCP server
130 A mobile host which may sometimes need to access a network on which no
131 DHCP server exists may be preloaded with a lease for a fixed
132 address on that network. When all attempts to contact a DHCP server
133 have failed, dhclient will try to validate the static lease, and if it
134 succeeds, will use that lease until it is restarted.
136 A mobile host may also travel to some networks on which DHCP is not
137 available but BOOTP is. In that case, it may be advantageous to
138 arrange with the network administrator for an entry on the BOOTP
139 database, so that the host can boot quickly on that network rather
140 than cycling through the list of old leases.
143 The names of the network interfaces that dhclient should attempt to
144 configure may be specified on the command line. If no interface names
145 are specified on the command line dhclient will normally identify all
146 network interfaces, eliminating non-broadcast interfaces if
147 possible, and attempt to configure each interface.
149 It is also possible to specify interfaces by name in the
151 file. If interfaces are specified in this way, then the client will
152 only configure interfaces that are either specified in the
153 configuration file or on the command line, and will ignore all other
156 If the DHCP client should listen and transmit on a port other than the
157 standard (port 68), the
159 flag may used. It should be followed by the udp port number that
160 dhclient should use. This is mostly useful for debugging purposes.
161 If a different port is specified for the client to listen on and
162 transmit on, the client will also use a different destination port -
163 one greater than the specified destination port.
165 The DHCP client normally transmits any protocol messages it sends
166 before acquiring an IP address to, 255.255.255.255, the IP limited
167 broadcast address. For debugging purposes, it may be useful to have
168 the server transmit these messages to some other address. This can
169 be specified with the
171 flag, followed by the IP address or domain name of the destination.
173 For testing purposes, the giaddr field of all packets that the client
174 sends can be set using the
176 flag, followed by the IP address to send. This is only useful for testing,
177 and should not be expected to work in any consistent or useful way.
179 The DHCP client will normally run in the foreground until it has
180 configured an interface, and then will revert to running in the
181 background. To run force dhclient to always run as a foreground
184 flag should be specified. This is useful when running the client
185 under a debugger, or when running it out of inittab on System V
188 The client normally prints a startup message and displays the
189 protocol sequence to the standard error descriptor until it has
190 acquired an address, and then only logs messages using the
194 flag prevents any messages other than errors from being printed to the
195 standard error descriptor.
197 The client normally doesn't release the current lease as it is not
198 required by the DHCP protocol. Some cable ISPs require their clients
199 to notify the server if they wish to release an assigned IP address.
202 flag explicitly releases the current lease, and once the lease has been
203 released, the client exits.
207 flag cause dhclient to try once to get a lease. If it fails, dhclient exits
210 The DHCP client normally gets its configuration information from
211 .B ETCDIR/dhclient.conf,
212 its lease database from
213 .B DBDIR/dhclient.leases,
214 stores its process ID in a file called
215 .B RUNDIR/dhclient.pid,
216 and configures the network interface using
217 .B CLIENTBINDIR/dhclient-script
218 To specify different names and/or locations for these files, use the
224 flags, respectively, followed by the name of the file. This can be
225 particularly useful if, for example,
229 has not yet been mounted when the DHCP client is started.
231 The DHCP client normally exits if it isn't able to identify any
232 network interfaces to configure. On laptop computers and other
233 computers with hot-swappable I/O buses, it is possible that a
234 broadcast interface may be added after system startup. The
236 flag can be used to cause the client not to exit when it doesn't find
237 any such interfaces. The
239 program can then be used to notify the client when a network interface
240 has been added or removed, so that the client can attempt to configure an IP
241 address on that interface.
243 The DHCP client can be directed not to attempt to configure any interfaces
246 flag. This is most likely to be useful in combination with the
250 The client can also be instructed to become a daemon immediately, rather
251 than waiting until it has acquired an IP address. This can be done by
256 The syntax of the dhclient.conf(5) file is discussed separately.
258 The DHCP client provides some ability to control it while it is
259 running, without stopping it. This capability is provided using OMAPI,
260 an API for manipulating remote objects. OMAPI clients connect to the
261 client using TCP/IP, authenticate, and can then examine the client's
262 current status and make changes to it.
264 Rather than implementing the underlying OMAPI protocol directly, user
265 programs should use the dhcpctl API or OMAPI itself. Dhcpctl is a
266 wrapper that handles some of the housekeeping chores that OMAPI does
267 not do automatically. Dhcpctl and OMAPI are documented in \fBdhcpctl(3)\fR
268 and \fBomapi(3)\fR. Most things you'd want to do with the client can
269 be done directly using the \fBomshell(1)\fR command, rather than
270 having to write a special program.
271 .SH THE CONTROL OBJECT
272 The control object allows you to shut the client down, releasing all
273 leases that it holds and deleting any DNS records it may have added.
274 It also allows you to pause the client - this unconfigures any
275 interfaces the client is using. You can then restart it, which
276 causes it to reconfigure those interfaces. You would normally pause
277 the client prior to going into hibernation or sleep on a laptop
278 computer. You would then resume it after the power comes back.
279 This allows PC cards to be shut down while the computer is hibernating
280 or sleeping, and then reinitialized to their previous state once the
281 computer comes out of hibernation or sleep.
283 The control object has one attribute - the state attribute. To shut
284 the client down, set its state attribute to 2. It will automatically
285 do a DHCPRELEASE. To pause it, set its state attribute to 3. To
286 resume it, set its state attribute to 4.
289 .B CLIENTBINDIR/dhclient-script,
290 .B ETCDIR/dhclient.conf, DBDIR/dhclient.leases, RUNDIR/dhclient.pid,
291 .B DBDIR/dhclient.leases~.
293 dhcpd(8), dhcrelay(8), dhclient-script(8), dhclient.conf(5),
297 has been written for Internet Systems Consortium
298 by Ted Lemon in cooperation with Vixie
299 Enterprises. To learn more about Internet Systems Consortium,
301 .B http://www.isc.org
302 To learn more about Vixie
304 .B http://www.vix.com.
306 This client was substantially modified and enhanced by Elliot Poger
307 for use on Linux while he was working on the MosquitoNet project at
310 The current version owes much to Elliot's Linux enhancements, but
311 was substantially reorganized and partially rewritten by Ted Lemon
312 so as to use the same networking framework that the Internet Systems
313 Consortium DHCP server uses. Much system-specific configuration code
314 was moved into a shell script so that as support for more operating
315 systems is added, it will not be necessary to port and maintain
316 system-specific configuration code to these operating systems - instead,
317 the shell script can invoke the native tools to accomplish the same