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