dhclient - Add -x and -w and adjust rc scripts
[dragonfly.git] / sbin / dhclient / dhclient.8
1 .\" $OpenBSD: src/sbin/dhclient/dhclient.8,v 1.8 2011/03/02 07:44:42 jmc Exp $
2 .\"
3 .\" Copyright (c) 1997 The Internet Software Consortium.
4 .\" All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\"
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.
18 .\"
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
31 .\" SUCH DAMAGE.
32 .\"
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''.
38 .Dd July 23, 2013
39 .Dt DHCLIENT 8
40 .Os
41 .Sh NAME
42 .Nm dhclient
43 .Nd Dynamic Host Configuration Protocol (DHCP) client
44 .Sh SYNOPSIS
45 .Nm
46 .Op Fl dquwx
47 .Op Fl c Ar file
48 .Op Fl l Ar file
49 .Ar interface
50 .Sh DESCRIPTION
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
53 a DHCP server.
54 DHCP is often used, for example, by cable modem and DSL network
55 providers to automate network configuration for their customers.
56 .Pp
57 Information typically provided via DHCP includes
58 address and subnet mask for the interface,
59 default route,
60 and domain name server.
61 .Pp
62 To have
63 .Dx
64 configure an interface using DHCP
65 (or its predecessor, BOOTP)
66 the
67 .Nm
68 utility is used.
69 .Nm
70 is run on the command line with the name of the
71 .Ar interface
72 to be configured.
73 .Pp
74 The options are as follows:
75 .Bl -tag -width "-p port"
76 .It Fl c Ar file
77 Specify an alternate location to
78 .Pa /etc/dhclient.conf
79 for the configuration file.
80 .It Fl d
81 Forces
82 .Nm
83 to always run as a foreground process.
84 By default,
85 .Nm
86 runs in the foreground until it has configured the interface, and then
87 will revert to running in the background.
88 .It Fl l Ar file
89 Specify an alternate location to
90 .Pa /var/db/dhclient.leases. Ns Aq Ar IFNAME
91 for the leases file.
92 .It Fl q
93 Forces
94 .Nm
95 to be less verbose on startup.
96 .It Fl u
97 Forces
98 .Nm
99 to reject leases with unknown options in them.
100 The default behaviour is to accept such lease offers.
101 .It Fl w
102 .Nm
103 stays around permanently and will attempt to reconnect even if
104 the interface does not exist, is down, or goes down.
105 This is the default when interfaces are configured DHCP in
106 .Pa /etc/dhclient.conf
107 .It Fl x
108 Kill any running
109 .Nm
110 on the specified interface.
111 .El
112 .Pp
113 The DHCP protocol allows a host to contact a central server which
114 maintains a list of IP addresses which may be assigned on one or more
115 subnets.
116 A DHCP client may request an address from this pool, and
117 then use it on a temporary basis for communication on the network.
118 The DHCP protocol also provides a mechanism whereby a client can learn
119 important details about the network to which it is attached, such as
120 the location of a default router, the location of a name server, and
121 so on.
122 .Pp
123 On startup,
124 .Nm
125 reads
126 .Pa /etc/dhclient.conf
127 for configuration instructions.
128 It then attempts to configure the network interface
129 .Ar interface
130 with DHCP.
131 .Pp
132 In order to keep track of leases across system reboots and server
133 restarts,
134 .Nm
135 keeps a list of leases it has been assigned in the
136 .Pa /var/db/dhclient.leases. Ns Aq Ar IFNAME
137 file.
138 .Ar IFNAME
139 represents the network interface of the DHCP client
140 .Pq e.g. em0 ,
141 one for each interface.
142 On startup, after reading the
143 .Xr dhclient.conf 5
144 file,
145 .Nm
146 reads the leases file to refresh its memory about what leases it has been
147 assigned.
148 .Pp
149 Old leases are kept around in case the DHCP server is unavailable when
150 .Nm
151 is first invoked (generally during the initial system boot
152 process).
153 In that event, old leases from the
154 .Pa dhclient.leases. Ns Aq Ar IFNAME
155 file which have not yet expired are tested, and if they are determined to
156 be valid, they are used until either they expire or the DHCP server
157 becomes available.
158 .Pp
159 A mobile host which may sometimes need to access a network on which no
160 DHCP server exists may be preloaded with a lease for a fixed
161 address on that network.
162 When all attempts to contact a DHCP server have failed,
163 .Nm
164 will try to validate the static lease, and if it
165 succeeds, it will use that lease until it is restarted.
166 .Pp
167 A mobile host may also travel to some networks on which DHCP is not
168 available but BOOTP is.
169 In that case, it may be advantageous to
170 arrange with the network administrator for an entry on the BOOTP
171 database, so that the host can boot quickly on that network rather
172 than cycling through the list of old leases.
173 .Pp
174 .Nm
175 requires at least one
176 .Pa /dev/bpf*
177 file for each broadcast network interface.
178 See
179 .Xr bpf 4
180 for more information.
181 .Sh FILES
182 .Bl -tag -width "/var/db/dhclient.leases.<IFNAME>XXX" -compact
183 .It Pa /etc/dhclient.conf
184 DHCP client configuration file
185 .It Pa /var/db/dhclient.leases. Ns Aq Ar IFNAME
186 database of acquired leases
187 .El
188 .Sh SEE ALSO
189 .Xr bpf 4 ,
190 .Xr dhclient.conf 5 ,
191 .Xr dhclient.leases 5 ,
192 .Xr dhclient-script 8 ,
193 .Xr dhcp 8 ,
194 .Xr dhcpd 8 Pq Pa net/isc-dhcp42-server ,
195 .Xr dhcrelay 8 Pq Pa net/isc-dhcp42-relay
196 .Sh STANDARDS
197 .Rs
198 .%A R. Droms
199 .%D October 1993
200 .%R RFC 1534
201 .%T Interoperation Between DHCP and BOOTP
202 .Re
203 .Pp
204 .Rs
205 .%A R. Droms
206 .%D March 1997
207 .%R RFC 2131
208 .%T Dynamic Host Configuration Protocol
209 .Re
210 .Pp
211 .Rs
212 .%A S. Alexander
213 .%A R. Droms
214 .%D March 1997
215 .%R RFC 2132
216 .%T DHCP Options and BOOTP Vendor Extensions
217 .Re
218 .Pp
219 .Rs
220 .%A T. Lemon
221 .%A S. Cheshire
222 .%D November 2002
223 .%R RFC 3396
224 .%T Encoding Long Options in the Dynamic Host Configuration Protocol (DHCPv4)
225 .Re
226 .Pp
227 .Rs
228 .%A T. Lemon
229 .%A S. Cheshire
230 .%A B. Volz
231 .%D December 2002
232 .%R RFC 3442
233 .%T The Classless Static Route Option for Dynamic Host Configuration Protocol (DHCP) version 4
234 .Re
235 .Sh HISTORY
236 .Nm
237 was imported into
238 .Dx 2.1 .
239 .Sh AUTHORS
240 .An -nosplit
241 .Nm
242 was written by
243 .An Ted Lemon Aq Mt mellon@fugue.com
244 and
245 .An Elliot Poger Aq Mt elliot@poger.com .
246 .Pp
247 The current implementation was reworked by
248 .An Henning Brauer Aq Mt henning@openbsd.org .