Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / isc-dhcp / client / dhclient.8
1 .\"     dhclient.8
2 .\"
3 .\" Copyright (c) 1996-2002 Internet Software Consortium.
4 .\" Use is subject to license terms which appear in the file named
5 .\" ISC-LICENSE that should have accompanied this file when you
6 .\" received it.   If a file named ISC-LICENSE did not accompany this
7 .\" file, or you are not sure the one you have is correct, you may
8 .\" obtain an applicable copy of the license at:
9 .\"
10 .\"             http://www.isc.org/isc-license-1.0.html. 
11 .\"
12 .\" This file is part of the ISC DHCP distribution.   The documentation
13 .\" associated with this file is listed in the file DOCUMENTATION,
14 .\" included in the top-level directory of this release.
15 .\"
16 .\" Support and other services are available for ISC products - see
17 .\" http://www.isc.org for more information.
18 .\"
19 .\" $Id: dhclient.8,v 1.12.2.7 2002/11/17 02:25:43 dhankins Exp $
20 .\"
21 .\" Portions copyright (c) 2000 David E. O'Brien.
22 .\" All rights reserved.
23 .\" $FreeBSD: src/contrib/isc-dhcp/client/dhclient.8,v 1.8.2.4 2003/03/02 16:42:37 murray Exp $
24 .\"
25 .TH dhclient 8
26 .SH NAME
27 dhclient - Dynamic Host Configuration Protocol Client
28 .SH SYNOPSIS
29 .B dhclient
30 [
31 .B -p
32 .I port
33 ]
34 [
35 .B -D
36 ]
37 [
38 .B -d
39 ]
40 [
41 .B -q
42 ]
43 [
44 .B -1
45 ]
46 [
47 .B -r
48 ]
49 [
50 .B -lf
51 .I lease-file
52 ]
53 [
54 .B -pf
55 .I pid-file
56 ]
57 [
58 .B -cf
59 .I config-file
60 ]
61 [
62 .B -sf
63 .I script-file
64 ]
65 [
66 .B -s
67 server
68 ]
69 [
70 .B -g
71 relay
72 ]
73 [
74 .B -n
75 ]
76 [
77 .B -nw
78 ]
79 [
80 .B -w
81 ]
82 [
83 .I if0
84 [
85 .I ...ifN
86 ]
87 ]
88 .SH DESCRIPTION
89 The Internet Software Consortium DHCP Client, dhclient, provides a
90 means for configuring one or more network interfaces using the Dynamic
91 Host Configuration Protocol, BOOTP protocol, or if these protocols
92 fail, by statically assigning an address.
93 .SH OPERATION
94 .PP
95 The DHCP protocol allows a host to contact a central server which
96 maintains a list of IP addresses which may be assigned on one or more
97 subnets.   A DHCP client may request an address from this pool, and
98 then use it on a temporary basis for communication on network.   The
99 DHCP protocol also provides a mechanism whereby a client can learn
100 important details about the network to which it is attached, such as
101 the location of a default router, the location of a name server, and
102 so on.
103 .PP
104 On startup, dhclient reads the
105 .IR dhclient.conf
106 for configuration instructions.   It then gets a list of all the
107 network interfaces that are configured in the current system.   For
108 each interface, it attempts to configure the interface using the DHCP
109 protocol.
110 .PP
111 In order to keep track of leases across system reboots and server
112 restarts, dhclient keeps a list of leases it has been assigned in the
113 dhclient.leases(5) file.   On startup, after reading the dhclient.conf
114 file, dhclient reads the dhclient.leases file to refresh its memory
115 about what leases it has been assigned.
116 .PP
117 When a new lease is acquired, it is appended to the end of the
118 dhclient.leases file.   In order to prevent the file from becoming
119 arbitrarily large, from time to time dhclient creates a new
120 dhclient.leases file from its in-core lease database.  The old version
121 of the dhclient.leases file is retained under the name
122 .IR dhclient.leases~
123 until the next time dhclient rewrites the database.
124 .PP
125 Old leases are kept around in case the DHCP server is unavailable when
126 dhclient is first invoked (generally during the initial system boot
127 process).   In that event, old leases from the dhclient.leases file
128 which have not yet expired are tested, and if they are determined to
129 be valid, they are used until either they expire or the DHCP server
130 becomes available.
131 .PP
132 A mobile host which may sometimes need to access a network on which no
133 DHCP server exists may be preloaded with a lease for a fixed
134 address on that network.   When all attempts to contact a DHCP server
135 have failed, dhclient will try to validate the static lease, and if it
136 succeeds, will use that lease until it is restarted.
137 .PP
138 A mobile host may also travel to some networks on which DHCP is not
139 available but BOOTP is.   In that case, it may be advantageous to
140 arrange with the network administrator for an entry on the BOOTP
141 database, so that the host can boot quickly on that network rather
142 than cycling through the list of old leases.
143 .SH COMMAND LINE
144 .PP
145 The names of the network interfaces that dhclient should attempt to
146 configure may be specified on the command line.  If no interface names
147 are specified on the command line dhclient will normally identify all
148 network interfaces, eliminating non-broadcast interfaces if
149 possible, and attempt to configure each interface.
150 .PP
151 It is also possible to specify interfaces by name in the
152 .B dhclient.conf(5)
153 file.   If interfaces are specified in this way, then the client will
154 only configure interfaces that are either specified in the
155 configuration file or on the command line, and will ignore all other
156 interfaces.
157 .PP
158 The
159 .B -D
160 flag causes
161 .B dhclient
162 to save the script it creates for use in conjunction with
163 .B dhclient-script
164 in 
165 .IR /tmp.
166 .PP
167 If the DHCP client should listen and transmit on a port other than the
168 standard (port 68), the
169 .B -p
170 flag may used.  It should be followed by the udp port number that
171 dhclient should use.  This is mostly useful for debugging purposes.
172 If a different port is specified for the client to listen on and
173 transmit on, the client will also use a different destination port -
174 one greater than the specified destination port.
175 .PP
176 The DHCP client normally transmits any protocol messages it sends
177 before acquiring an IP address to, 255.255.255.255, the IP limited
178 broadcast address.   For debugging purposes, it may be useful to have
179 the server transmit these messages to some other address.   This can
180 be specified with the 
181 .B -s
182 flag, followed by the IP address or domain name of the destination.
183 .PP
184 For testing purposes, the giaddr field of all packets that the client
185 sends can be set using the
186 .B -g
187 flag, followed by the IP address to send.   This is only useful for testing,
188 and should not be expected to work in any consistent or useful way.
189 .PP
190 The DHCP client will normally run in the foreground until it has
191 configured an interface, and then will revert to running in the
192 background.   To run force dhclient to always run as a foreground
193 process, the
194 .B -d
195 flag should be specified.  This is useful when running the client
196 under a debugger, or when running it out of inittab on System V
197 systems.
198 .PP
199 The client normally prints a startup message and displays the
200 protocol sequence to the standard error descriptor until it has
201 acquired an address, and then only logs messages using the
202 .B syslog (3)
203 facility.   The
204 .B -q
205 flag prevents any messages other than errors from being printed to the
206 standard error descriptor.
207 .PP
208 The client normally doesn't release the current lease as it is not
209 required by the DHCP protocol.  Some cable ISPs require their clients
210 to notify the server if they wish to release an assigned IP address.
211 The
212 .B -r
213 flag explicitly releases the current lease, and once the lease has been
214 released, the client exits.
215 .PP
216 The
217 .B -1
218 flag cause dhclient to try once to get a lease.  If it fails, dhclient exits
219 with exit code two.
220 .PP
221 The DHCP client normally gets its configuration information from
222 .B ETCDIR/dhclient.conf,
223 its lease database from
224 .B DBDIR/dhclient.leases,
225 stores its process ID in a file called
226 .B RUNDIR/dhclient.pid,
227 and configures the network interface using
228 .B CLIENTBINDIR/dhclient-script
229 To specify different names and/or locations for these files, use the
230 .B -cf,
231 .B -lf,
232 .B -pf
233 and
234 .B -sf
235 flags, respectively, followed by the name of the file.   This can be
236 particularly useful if, for example,
237 .B DBDIR
238 or
239 .B RUNDIR
240 has not yet been mounted when the DHCP client is started.
241 .PP
242 The DHCP client normally exits if it isn't able to identify any
243 network interfaces to configure.   On laptop computers and other
244 computers with hot-swappable I/O buses, it is possible that a
245 broadcast interface may be added after system startup.   The
246 .B -w
247 flag can be used to cause the client not to exit when it doesn't find
248 any such interfaces.   The
249 .B omshell (8)
250 program can then be used to notify the client when a network interface
251 has been added or removed, so that the client can attempt to configure an IP
252 address on that interface.
253 .PP
254 The DHCP client can be directed not to attempt to configure any interfaces
255 using the
256 .B -n
257 flag.   This is most likely to be useful in combination with the
258 .B -w
259 flag.
260 .PP
261 The client can also be instructed to become a daemon immediately, rather
262 than waiting until it has acquired an IP address.   This can be done by
263 supplying the
264 .B -nw
265 flag.
266 .SH CONFIGURATION
267 The syntax of the dhclient.conf(5) file is discussed separately.
268 .SH OMAPI
269 The DHCP client provides some ability to control it while it is
270 running, without stopping it.  This capability is provided using OMAPI,
271 an API for manipulating remote objects.  OMAPI clients connect to the
272 client using TCP/IP, authenticate, and can then examine the client's
273 current status and make changes to it. 
274 .PP
275 Rather than implementing the underlying OMAPI protocol directly, user
276 programs should use the dhcpctl API or OMAPI itself.   Dhcpctl is a
277 wrapper that handles some of the housekeeping chores that OMAPI does
278 not do automatically.   Dhcpctl and OMAPI are documented in \fBdhcpctl(3)\fR
279 and \fBomapi(3)\fR.   Most things you'd want to do with the client can
280 be done directly using the \fBomshell(1)\fR command, rather than
281 having to write a special program.
282 .SH THE CONTROL OBJECT
283 The control object allows you to shut the client down, releasing all
284 leases that it holds and deleting any DNS records it may have added.
285 It also allows you to pause the client - this unconfigures any
286 interfaces the client is using.   You can then restart it, which
287 causes it to reconfigure those interfaces.   You would normally pause
288 the client prior to going into hibernation or sleep on a laptop
289 computer.   You would then resume it after the power comes back.
290 This allows PC cards to be shut down while the computer is hibernating
291 or sleeping, and then reinitialized to their previous state once the
292 computer comes out of hibernation or sleep.
293 .PP
294 The control object has one attribute - the state attribute.   To shut
295 the client down, set its state attribute to 2.   It will automatically
296 do a DHCPRELEASE.   To pause it, set its state attribute to 3.   To
297 resume it, set its state attribute to 4.
298 .PP
299 .SH FILES
300 .B CLIENTBINDIR/dhclient-script,
301 .B ETCDIR/dhclient.conf, DBDIR/dhclient.leases, RUNDIR/dhclient.pid,
302 .B DBDIR/dhclient.leases~.
303 .SH SEE ALSO
304 dhclient.conf(5), dhclient.leases(5), dhclient-script(8).
305 .SH AUTHOR
306 .B dhclient(8)
307 has been written for the Internet Software Consortium
308 by Ted Lemon in cooperation with Vixie
309 Enterprises.  To learn more about the Internet Software Consortium,
310 see
311 .B http://www.isc.org
312 To learn more about Vixie
313 Enterprises, see
314 .B http://www.vix.com.
315 .PP
316 This client was substantially modified and enhanced by Elliot Poger
317 for use on Linux while he was working on the MosquitoNet project at
318 Stanford.
319 .PP
320 The current version owes much to Elliot's Linux enhancements, but
321 was substantially reorganized and partially rewritten by Ted Lemon
322 so as to use the same networking framework that the Internet Software
323 Consortium DHCP server uses.   Much system-specific configuration code
324 was moved into a shell script so that as support for more operating
325 systems is added, it will not be necessary to port and maintain
326 system-specific configuration code to these operating systems - instead,
327 the shell script can invoke the native tools to accomplish the same
328 purpose.
329 .PP