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