- Hide the following characters '(', ')', '{', '}' inside of #defines
[dragonfly.git] / contrib / dhcp-3.0 / client / dhclient.8
1 .\"     dhclient.8
2 .\"
3 .\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
4 .\" Copyright (c) 1996-2003 by Internet Software Consortium
5 .\"
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.
9 .\"
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.
17 .\"
18 .\"   Internet Systems Consortium, Inc.
19 .\"   950 Charter Street
20 .\"   Redwood City, CA 94063
21 .\"   <info@isc.org>
22 .\"   http://www.isc.org/
23 .\"
24 .\" $Id: dhclient.8,v 1.12.2.9 2004/09/29 23:01:46 dhankins Exp $
25 .\"
26 .TH dhclient 8
27 .SH NAME
28 dhclient - Dynamic Host Configuration Protocol Client
29 .SH SYNOPSIS
30 .B dhclient
31 [
32 .B -p
33 .I port
34 ]
35 [
36 .B -d
37 ]
38 [
39 .B -q
40 ]
41 [
42 .B -1
43 ]
44 [
45 .B -r
46 ]
47 [
48 .B -lf
49 .I lease-file
50 ]
51 [
52 .B -pf
53 .I pid-file
54 ]
55 [
56 .B -cf
57 .I config-file
58 ]
59 [
60 .B -sf
61 .I script-file
62 ]
63 [
64 .B -s
65 server
66 ]
67 [
68 .B -g
69 relay
70 ]
71 [
72 .B -n
73 ]
74 [
75 .B -nw
76 ]
77 [
78 .B -w
79 ]
80 [
81 .I if0
82 [
83 .I ...ifN
84 ]
85 ]
86 .SH DESCRIPTION
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.
91 .SH OPERATION
92 .PP
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
100 so on.
101 .PP
102 On startup, dhclient reads the
103 .IR dhclient.conf
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
107 protocol.
108 .PP
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.
114 .PP
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
120 .IR dhclient.leases~
121 until the next time dhclient rewrites the database.
122 .PP
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
128 becomes available.
129 .PP
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.
135 .PP
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.
141 .SH COMMAND LINE
142 .PP
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.
148 .PP
149 It is also possible to specify interfaces by name in the
150 .B dhclient.conf(5)
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
154 interfaces.
155 .PP
156 If the DHCP client should listen and transmit on a port other than the
157 standard (port 68), the
158 .B -p
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.
164 .PP
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 
170 .B -s
171 flag, followed by the IP address or domain name of the destination.
172 .PP
173 For testing purposes, the giaddr field of all packets that the client
174 sends can be set using the
175 .B -g
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.
178 .PP
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
182 process, the
183 .B -d
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
186 systems.
187 .PP
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
191 .B syslog (3)
192 facility.   The
193 .B -q
194 flag prevents any messages other than errors from being printed to the
195 standard error descriptor.
196 .PP
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.
200 The
201 .B -r
202 flag explicitly releases the current lease, and once the lease has been
203 released, the client exits.
204 .PP
205 The
206 .B -1
207 flag cause dhclient to try once to get a lease.  If it fails, dhclient exits
208 with exit code two.
209 .PP
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
219 .B -cf,
220 .B -lf,
221 .B -pf
222 and
223 .B -sf
224 flags, respectively, followed by the name of the file.   This can be
225 particularly useful if, for example,
226 .B DBDIR
227 or
228 .B RUNDIR
229 has not yet been mounted when the DHCP client is started.
230 .PP
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
235 .B -w
236 flag can be used to cause the client not to exit when it doesn't find
237 any such interfaces.   The
238 .B omshell (8)
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.
242 .PP
243 The DHCP client can be directed not to attempt to configure any interfaces
244 using the
245 .B -n
246 flag.   This is most likely to be useful in combination with the
247 .B -w
248 flag.
249 .PP
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
252 supplying the
253 .B -nw
254 flag.
255 .SH CONFIGURATION
256 The syntax of the dhclient.conf(5) file is discussed separately.
257 .SH OMAPI
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. 
263 .PP
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.
282 .PP
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.
287 .PP
288 .SH FILES
289 .B CLIENTBINDIR/dhclient-script,
290 .B ETCDIR/dhclient.conf, DBDIR/dhclient.leases, RUNDIR/dhclient.pid,
291 .B DBDIR/dhclient.leases~.
292 .SH SEE ALSO
293 dhcpd(8), dhcrelay(8), dhclient-script(8), dhclient.conf(5),
294 dhclient.leases(5).
295 .SH AUTHOR
296 .B dhclient(8)
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,
300 see
301 .B http://www.isc.org
302 To learn more about Vixie
303 Enterprises, see
304 .B http://www.vix.com.
305 .PP
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
308 Stanford.
309 .PP
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
318 purpose.
319 .PP