]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - sbin/dhclient/dhclient.8
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / sbin / dhclient / dhclient.8
1 .\" $OpenBSD: dhclient.8,v 1.3 2004/04/09 18:30:15 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 .\"
39 .\" $FreeBSD$
40 .\"
41 .Dd October 13, 2011
42 .Dt DHCLIENT 8
43 .Os
44 .Sh NAME
45 .Nm dhclient
46 .Nd "Dynamic Host Configuration Protocol (DHCP) client"
47 .Sh SYNOPSIS
48 .Nm
49 .Op Fl bdqu
50 .Op Fl c Ar file
51 .Op Fl l Ar file
52 .Op Fl p Ar file
53 .Ar interface
54 .Sh DESCRIPTION
55 The
56 .Nm
57 utility provides a means for configuring network interfaces using DHCP, BOOTP,
58 or if these protocols fail, by statically assigning an address.
59 .Pp
60 The name of the network interface that
61 .Nm
62 should attempt to
63 configure must be specified on the command line.
64 .Pp
65 The options are as follows:
66 .Bl -tag -width ".Fl c Ar file"
67 .It Fl b
68 Forces
69 .Nm
70 to immediately move to the background.
71 .It Fl c Ar file
72 Specify an alternate location,
73 .Ar file ,
74 for the configuration file.
75 .It Fl d
76 Forces
77 .Nm
78 to always run as a foreground process.
79 By default,
80 .Nm
81 runs in the foreground until it has configured the interface, and then
82 will revert to running in the background.
83 .It Fl l Ar file
84 Specify an alternate location,
85 .Ar file ,
86 for the leases file.
87 .It Fl p Ar file
88 Specify an alternate location for the PID file.
89 The default is
90 .Pa /var/run/dhclient. Ns Ar interface Ns Pa .pid .
91 .It Fl q
92 Forces
93 .Nm
94 to be less verbose on startup.
95 .It Fl u
96 Forces
97 .Nm
98 to reject leases with unknown options in them.
99 The default behaviour is to accept such lease offers.
100 .El
101 .Pp
102 The DHCP protocol allows a host to contact a central server which
103 maintains a list of IP addresses which may be assigned on one or more
104 subnets.
105 A DHCP client may request an address from this pool, and
106 then use it on a temporary basis for communication on the network.
107 The DHCP protocol also provides a mechanism whereby a client can learn
108 important details about the network to which it is attached, such as
109 the location of a default router, the location of a name server, and
110 so on.
111 .Pp
112 On startup,
113 .Nm
114 reads
115 .Pa /etc/dhclient.conf
116 for configuration instructions.
117 It then gets a list of all the
118 network interfaces that are configured in the current system.
119 It then attempts to configure each interface with DHCP.
120 .Pp
121 In order to keep track of leases across system reboots and server
122 restarts,
123 .Nm
124 keeps a list of leases it has been assigned in the
125 .Pa /var/db/dhclient.leases. Ns Ar IFNAME
126 file.
127 .Ar IFNAME
128 represents the network interface of the DHCP client
129 (e.g.,
130 .Li em0 ) ,
131 one for each interface.
132 On startup, after reading the
133 .Xr dhclient.conf 5
134 file,
135 .Nm
136 reads the leases file to refresh its memory about what leases it has been
137 assigned.
138 .Pp
139 Old leases are kept around in case the DHCP server is unavailable when
140 .Nm
141 is first invoked (generally during the initial system boot
142 process).
143 In that event, old leases from the
144 .Pa dhclient.leases. Ns Ar IFNAME
145 file which have not yet expired are tested, and if they are determined to
146 be valid, they are used until either they expire or the DHCP server
147 becomes available.
148 .Pp
149 A mobile host which may sometimes need to access a network on which no
150 DHCP server exists may be preloaded with a lease for a fixed
151 address on that network.
152 When all attempts to contact a DHCP server have failed,
153 .Nm
154 will try to validate the static lease, and if it
155 succeeds, it will use that lease until it is restarted.
156 .Pp
157 A mobile host may also travel to some networks on which DHCP is not
158 available but BOOTP is.
159 In that case, it may be advantageous to
160 arrange with the network administrator for an entry on the BOOTP
161 database, so that the host can boot quickly on that network rather
162 than cycling through the list of old leases.
163 .Sh NOTES
164 You must have the Berkeley Packet Filter (BPF) configured in your kernel.
165 The
166 .Nm
167 utility
168 requires at least one
169 .Pa /dev/bpf*
170 device for each broadcast network interface that is attached to your system.
171 See
172 .Xr bpf 4
173 for more information.
174 .Sh FILES
175 .Bl -tag -width ".Pa /var/db/dhclient.leases. Ns Ar IFNAME" -compact
176 .It Pa /etc/dhclient.conf
177 DHCP client configuration file
178 .It Pa /var/db/dhclient.leases. Ns Ar IFNAME
179 database of acquired leases
180 .El
181 .Sh SEE ALSO
182 .Xr dhclient.conf 5 ,
183 .Xr dhclient.leases 5 ,
184 .Xr dhclient-script 8
185 .Sh AUTHORS
186 .An -nosplit
187 The
188 .Nm
189 utility
190 was written by
191 .An Ted Lemon Aq mellon@fugue.com
192 and
193 .An Elliot Poger Aq elliot@poger.com .
194 .Pp
195 The current implementation was reworked by
196 .An Henning Brauer Aq henning@openbsd.org .