1 | .\" Copyright (c) 2006-2014 Roy Marples |
---|
2 | .\" All rights reserved |
---|
3 | .\" |
---|
4 | .\" Redistribution and use in source and binary forms, with or without |
---|
5 | .\" modification, are permitted provided that the following conditions |
---|
6 | .\" are met: |
---|
7 | .\" 1. Redistributions of source code must retain the above copyright |
---|
8 | .\" notice, this list of conditions and the following disclaimer. |
---|
9 | .\" 2. Redistributions in binary form must reproduce the above copyright |
---|
10 | .\" notice, this list of conditions and the following disclaimer in the |
---|
11 | .\" documentation and/or other materials provided with the distribution. |
---|
12 | .\" |
---|
13 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
---|
14 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
15 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
16 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
---|
17 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
---|
18 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
---|
19 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
---|
20 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
---|
21 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
---|
22 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
---|
23 | .\" SUCH DAMAGE. |
---|
24 | .\" |
---|
25 | .Dd January 24, 2014 |
---|
26 | .Dt DHCPCD 8 |
---|
27 | .Os |
---|
28 | .Sh NAME |
---|
29 | .Nm dhcpcd |
---|
30 | .Nd a DHCP client |
---|
31 | .Sh SYNOPSIS |
---|
32 | .Nm |
---|
33 | .Op Fl 46ABbDdEGgHJKLpqTV |
---|
34 | .Op Fl C , Fl Fl nohook Ar hook |
---|
35 | .Op Fl c , Fl Fl script Ar script |
---|
36 | .Op Fl e , Fl Fl env Ar value |
---|
37 | .Op Fl F , Fl Fl fqdn Ar FQDN |
---|
38 | .Op Fl f , Fl Fl config Ar file |
---|
39 | .Op Fl h , Fl Fl hostname Ar hostname |
---|
40 | .Op Fl I , Fl Fl clientid Ar clientid |
---|
41 | .Op Fl i , Fl Fl vendorclassid Ar vendorclassid |
---|
42 | .Op Fl l , Fl Fl leasetime Ar seconds |
---|
43 | .Op Fl m , Fl Fl metric Ar metric |
---|
44 | .Op Fl O , Fl Fl nooption Ar option |
---|
45 | .Op Fl o , Fl Fl option Ar option |
---|
46 | .Op Fl Q , Fl Fl require Ar option |
---|
47 | .Op Fl r , Fl Fl request Ar address |
---|
48 | .Op Fl S , Fl Fl static Ar value |
---|
49 | .Op Fl s , Fl Fl inform Ar address Ns Op Ar /cidr |
---|
50 | .Op Fl t , Fl Fl timeout Ar seconds |
---|
51 | .Op Fl u , Fl Fl userclass Ar class |
---|
52 | .Op Fl v , Fl Fl vendor Ar code , Ar value |
---|
53 | .Op Fl W , Fl Fl whitelist Ar address Ns Op Ar /cidr |
---|
54 | .Op Fl w , Fl Fl waitip Op 4 | 6 |
---|
55 | .Op Fl y , Fl Fl reboot Ar seconds |
---|
56 | .Op Fl X , Fl Fl blacklist Ar address Ns Op Ar /cidr |
---|
57 | .Op Fl Z , Fl Fl denyinterfaces Ar pattern |
---|
58 | .Op Fl z , Fl Fl allowinterfaces Ar pattern |
---|
59 | .Op interface |
---|
60 | .Op ... |
---|
61 | .Nm |
---|
62 | .Fl n , Fl Fl rebind |
---|
63 | .Op interface |
---|
64 | .Nm |
---|
65 | .Fl k , Fl Fl release |
---|
66 | .Op interface |
---|
67 | .Nm |
---|
68 | .Fl U, Fl Fl dumplease |
---|
69 | .Ar interface |
---|
70 | .Nm |
---|
71 | .Fl Fl version |
---|
72 | .Nm |
---|
73 | .Fl x , Fl Fl exit |
---|
74 | .Op interface |
---|
75 | .Sh DESCRIPTION |
---|
76 | .Nm |
---|
77 | is an implementation of the DHCP client specified in |
---|
78 | .Li RFC 2131 . |
---|
79 | .Nm |
---|
80 | gets the host information |
---|
81 | .Po |
---|
82 | IP address, routes, etc |
---|
83 | .Pc |
---|
84 | from a DHCP server and configures the network |
---|
85 | .Ar interface |
---|
86 | of the |
---|
87 | machine on which it is running. |
---|
88 | .Nm |
---|
89 | then runs the configuration script which writes DNS information to |
---|
90 | .Xr resolvconf 8 , |
---|
91 | if available, otherwise directly to |
---|
92 | .Pa /etc/resolv.conf . |
---|
93 | If the hostname is currently blank, (null) or localhost, or |
---|
94 | .Va force_hostname |
---|
95 | is YES or TRUE or 1 then |
---|
96 | .Nm |
---|
97 | sets the hostname to the one supplied by the DHCP server. |
---|
98 | .Nm |
---|
99 | then daemonises and waits for the lease renewal time to lapse. |
---|
100 | It will then attempt to renew its lease and reconfigure if the new lease |
---|
101 | changes. |
---|
102 | .Pp |
---|
103 | .Nm |
---|
104 | is also an implementation of the BOOTP client specified in |
---|
105 | .Li RFC 951 . |
---|
106 | .Pp |
---|
107 | .Nm |
---|
108 | is also an implementation of the IPv6 Router Solicitor as specified in |
---|
109 | .Li RFC 4861 |
---|
110 | and |
---|
111 | .Li RFC 6106 . |
---|
112 | .Nm |
---|
113 | can optionally handle address and route management itself, |
---|
114 | and will do so by default if Router Solicitation is disabled in the kernel. |
---|
115 | If |
---|
116 | .Nm |
---|
117 | is managing routes, |
---|
118 | .Nm |
---|
119 | sends Neighbor Solicitions to each advertising router periodically and will |
---|
120 | expire the ones that do not respond. |
---|
121 | .Pp |
---|
122 | .Nm |
---|
123 | is also an implemenation of the DHCPv6 client as specified in |
---|
124 | .Li RFC 3315 . |
---|
125 | By default, |
---|
126 | .Nm |
---|
127 | only starts DHCPv6 when instructed to do so by an IPV6 Router Advertisement. |
---|
128 | If no Identity Association is configured, |
---|
129 | then a Non-temporary Address is requested. |
---|
130 | .Ss Local Link configuration |
---|
131 | If |
---|
132 | .Nm |
---|
133 | failed to obtain a lease, it probes for a valid IPv4LL address |
---|
134 | .Po |
---|
135 | aka ZeroConf, aka APIPA |
---|
136 | .Pc . |
---|
137 | Once obtained it restarts the process of looking for a DHCP server to get a |
---|
138 | proper address. |
---|
139 | .Pp |
---|
140 | When using IPv4LL, |
---|
141 | .Nm |
---|
142 | nearly always succeeds and returns an exit code of 0. |
---|
143 | In the rare case it fails, it normally means that there is a reverse ARP proxy |
---|
144 | installed which always defeats IPv4LL probing. |
---|
145 | To disable this behaviour, you can use the |
---|
146 | .Fl L , Fl Fl noipv4ll |
---|
147 | option. |
---|
148 | .Ss Multiple interfaces |
---|
149 | If a list of interfaces are given on the command line, then |
---|
150 | .Nm |
---|
151 | only works with those interfaces, otherwise |
---|
152 | .Nm |
---|
153 | discovers available Ethernet interfaces. |
---|
154 | If any interface reports a working carrier then |
---|
155 | .Nm |
---|
156 | will try and obtain a lease before forking to the background, |
---|
157 | otherwise it will fork right away. |
---|
158 | This behaviour can be modified with the |
---|
159 | .Fl b , Fl Fl background |
---|
160 | and |
---|
161 | .Fl w , Fl Fl waitip |
---|
162 | options. |
---|
163 | .Pp |
---|
164 | If a single interface is given then |
---|
165 | .Nm |
---|
166 | only works for that interface and runs as a separate instance. |
---|
167 | The |
---|
168 | .Fl w , Fl Fl waitip |
---|
169 | option is enabled in this instance to maintain compatibility with older |
---|
170 | versions. |
---|
171 | .Pp |
---|
172 | Interfaces are preferred by carrier, DHCP lease/IPv4LL and then lowest metric. |
---|
173 | For systems that support route metrics, each route will be tagged with the |
---|
174 | metric, otherwise |
---|
175 | .Nm |
---|
176 | changes the routes to use the interface with the same route and the lowest |
---|
177 | metric. |
---|
178 | See options below for controlling which interfaces we allow and deny through |
---|
179 | the use of patterns. |
---|
180 | .Ss Hooking into events |
---|
181 | .Nm |
---|
182 | runs |
---|
183 | .Pa @SCRIPT@ , |
---|
184 | or the script specified by the |
---|
185 | .Fl c , Fl Fl script |
---|
186 | option. |
---|
187 | This script runs each script found in |
---|
188 | .Pa @HOOKDIR@ |
---|
189 | in a lexical order. |
---|
190 | The default installation supplies the scripts |
---|
191 | .Pa 01-test , |
---|
192 | .Pa 10-mtu , |
---|
193 | .Pa 10-wpa_supplicant , |
---|
194 | .Pa 15-timezone , |
---|
195 | .Pa 20-resolv.conf |
---|
196 | and |
---|
197 | .Pa 30-hostname . |
---|
198 | You can disable each script by using the |
---|
199 | .Fl C , Fl Fl nohook |
---|
200 | option. |
---|
201 | See |
---|
202 | .Xr dhcpcd-run-hooks 8 |
---|
203 | for details on how these scripts work. |
---|
204 | .Nm |
---|
205 | currently ignores the exit code of the script. |
---|
206 | .Ss Fine tuning |
---|
207 | You can fine-tune the behaviour of |
---|
208 | .Nm |
---|
209 | with the following options: |
---|
210 | .Bl -tag -width indent |
---|
211 | .It Fl b , Fl Fl background |
---|
212 | Background immediately. |
---|
213 | This is useful for startup scripts which don't disable link messages for |
---|
214 | carrier status. |
---|
215 | .It Fl c , Fl Fl script Ar script |
---|
216 | Use this |
---|
217 | .Ar script |
---|
218 | instead of the default |
---|
219 | .Pa @SCRIPT@ . |
---|
220 | .It Fl D , Fl Fl duid |
---|
221 | Generate an |
---|
222 | .Li RFC 4361 |
---|
223 | compliant clientid. |
---|
224 | This requires persistent storage and not all DHCP servers work with it so it |
---|
225 | is not enabled by default. |
---|
226 | .Nm |
---|
227 | generates the DUID and stores it in |
---|
228 | .Pa @SYSCONFDIR@/dhcpcd.duid . |
---|
229 | This file should not be copied to other hosts. |
---|
230 | .It Fl d , Fl Fl debug |
---|
231 | Echo debug messages to the stderr and syslog. |
---|
232 | .It Fl E , Fl Fl lastlease |
---|
233 | If |
---|
234 | .Nm |
---|
235 | cannot obtain a lease, then try to use the last lease acquired for the |
---|
236 | interface. |
---|
237 | If the |
---|
238 | .Fl p, Fl Fl persistent |
---|
239 | option is not given then the lease is used if it hasn't expired. |
---|
240 | .It Fl e , Fl Fl env Ar value |
---|
241 | Push |
---|
242 | .Ar value |
---|
243 | to the environment for use in |
---|
244 | .Xr dhcpcd-run-hooks 8 . |
---|
245 | For example, you can force the hostname hook to always set the hostname with |
---|
246 | .Fl e |
---|
247 | .Va force_hostname=YES . |
---|
248 | .It Fl g , Fl Fl reconfigure |
---|
249 | .Nm |
---|
250 | will re-apply IP address, routing and run |
---|
251 | .Xr dhcpcd-run-hooks 8 |
---|
252 | for each interface. |
---|
253 | This is useful so that a 3rd party such as PPP or VPN can change the routing |
---|
254 | table and / or DNS, etc and then instruct |
---|
255 | .Nm |
---|
256 | to put things back afterwards. |
---|
257 | .Nm |
---|
258 | does not read a new configuration when this happens - you should rebind if you |
---|
259 | need that functionality. |
---|
260 | .It Fl F , Fl Fl fqdn Ar fqdn |
---|
261 | Requests that the DHCP server updates DNS using FQDN instead of just a |
---|
262 | hostname. |
---|
263 | Valid values for |
---|
264 | .Ar fqdn |
---|
265 | are disable, none, ptr and both. |
---|
266 | .Nm |
---|
267 | itself never does any DNS updates. |
---|
268 | .Nm |
---|
269 | encodes the FQDN hostname as specified in |
---|
270 | .Li RFC1035 . |
---|
271 | .It Fl f , Fl Fl config Ar file |
---|
272 | Specify a config to load instead of |
---|
273 | .Pa @SYSCONFDIR@/dhcpcd.conf . |
---|
274 | .Nm |
---|
275 | always processes the config file before any command line options. |
---|
276 | .It Fl h , Fl Fl hostname Ar hostname |
---|
277 | Sends |
---|
278 | .Ar hostname |
---|
279 | to the DHCP server so it can be registered in DNS. |
---|
280 | If |
---|
281 | .Ar hostname |
---|
282 | is an empty string then the current system hostname is sent. |
---|
283 | If |
---|
284 | .Ar hostname |
---|
285 | is a FQDN (ie, contains a .) then it will be encoded as such. |
---|
286 | .It Fl I , Fl Fl clientid Ar clientid |
---|
287 | Send the |
---|
288 | .Ar clientid . |
---|
289 | If the string is of the format 01:02:03 then it is encoded as hex. |
---|
290 | For interfaces whose hardware address is longer than 8 bytes, or if the |
---|
291 | .Ar clientid |
---|
292 | is an empty string then |
---|
293 | .Nm |
---|
294 | sends a default |
---|
295 | .Ar clientid |
---|
296 | of the hardware family and the hardware address. |
---|
297 | .It Fl i , Fl Fl vendorclassid Ar vendorclassid |
---|
298 | Override the DHCPv4 |
---|
299 | .Ar vendorclassid |
---|
300 | field sent. |
---|
301 | The default is |
---|
302 | dhcpcd-<version>:<os>:<machine>:<platform>. |
---|
303 | For example |
---|
304 | .D1 dhcpcd-5.5.6:NetBSD-6.99.5:i386:i386 |
---|
305 | If not set then none is sent. |
---|
306 | Some badly configured DHCP servers reject unknown vendorclassids. |
---|
307 | To work around it, try and impersonate Windows by using the MSFT vendorclassid. |
---|
308 | .It Fl k , Fl Fl release Op Ar interface |
---|
309 | This causes an existing |
---|
310 | .Nm |
---|
311 | process running on the |
---|
312 | .Ar interface |
---|
313 | to release its lease and de-configure the |
---|
314 | .Ar interface . |
---|
315 | If no |
---|
316 | .Ar interface |
---|
317 | is specified then this applies to all interfaces. |
---|
318 | If no interfaces are left running, |
---|
319 | .Nm |
---|
320 | will exit. |
---|
321 | .It Fl l , Fl Fl leasetime Ar seconds |
---|
322 | Request a specific lease time in |
---|
323 | .Ar seconds . |
---|
324 | By default |
---|
325 | .Nm |
---|
326 | does not request any lease time and leaves it in the hands of the |
---|
327 | DHCP server. |
---|
328 | .It Fl m , Fl Fl metric Ar metric |
---|
329 | Metrics are used to prefer an interface over another one, lowest wins. |
---|
330 | .Nm |
---|
331 | will supply a default metic of 200 + |
---|
332 | .Xr if_nametoindex 3 . |
---|
333 | An extra 100 will be added for wireless interfaces. |
---|
334 | .It Fl n , Fl Fl rebind Op Ar interface |
---|
335 | Notifies |
---|
336 | .Nm |
---|
337 | to reload its configuration and rebind the specified |
---|
338 | .Ar interface . |
---|
339 | If no interface is specified then this applies to all interfaces. |
---|
340 | If |
---|
341 | .Nm |
---|
342 | is not running, then it starts up as normal. |
---|
343 | This may also cause |
---|
344 | .Xr wpa_supplicant 8 |
---|
345 | to reload its configuration for each interface as well. |
---|
346 | .It Fl o , Fl Fl option Ar option |
---|
347 | Request the DHCP |
---|
348 | .Ar option |
---|
349 | variable for use in |
---|
350 | .Pa @SCRIPT@ . |
---|
351 | .It Fl p , Fl Fl persistent |
---|
352 | .Nm |
---|
353 | normally de-configures the |
---|
354 | .Ar interface |
---|
355 | and configuration when it exits. |
---|
356 | Sometimes, this isn't desirable if, for example, you have root mounted over |
---|
357 | NFS or SSH clients connect to this host and they need to be notified of |
---|
358 | the host shutting down. |
---|
359 | You can use this option to stop this from happening. |
---|
360 | .It Fl r , Fl Fl request Op Ar address |
---|
361 | Request the |
---|
362 | .Ar address |
---|
363 | in the DHCP DISCOVER message. |
---|
364 | There is no guarantee this is the address the DHCP server will actually give. |
---|
365 | If no |
---|
366 | .Ar address |
---|
367 | is given then the first address currently assigned to the |
---|
368 | .Ar interface |
---|
369 | is used. |
---|
370 | .It Fl s , Fl Fl inform Op Ar address Ns Op Ar /cidr |
---|
371 | Behaves like |
---|
372 | .Fl r , Fl Fl request |
---|
373 | as above, but sends a DHCP INFORM instead of DISCOVER/REQUEST. |
---|
374 | This does not get a lease as such, just notifies the DHCP server of the |
---|
375 | .Ar address |
---|
376 | in use. |
---|
377 | You should also include the optional |
---|
378 | .Ar cidr |
---|
379 | network number in case the address is not already configured on the interface. |
---|
380 | .Nm |
---|
381 | remains running and pretends it has an infinite lease. |
---|
382 | .Nm |
---|
383 | will not de-configure the interface when it exits. |
---|
384 | If |
---|
385 | .Nm |
---|
386 | fails to contact a DHCP server then it returns a failure instead of falling |
---|
387 | back on IPv4LL. |
---|
388 | .It Fl S, Fl Fl static Ar value |
---|
389 | Configures a static |
---|
390 | .Ar value . |
---|
391 | If you set |
---|
392 | .Ic ip_address |
---|
393 | then |
---|
394 | .Nm |
---|
395 | will not attempt to obtain a lease and just use the value for the address with |
---|
396 | an infinite lease time. |
---|
397 | .Pp |
---|
398 | Here is an example which configures a static address, routes and dns. |
---|
399 | .D1 dhcpcd -S ip_address=192.168.0.10/24 \e |
---|
400 | .D1 -S routers=192.168.0.1 \e |
---|
401 | .D1 -S domain_name_servers=192.168.0.1 \e |
---|
402 | .D1 eth0 |
---|
403 | .It Fl t , Fl Fl timeout Ar seconds |
---|
404 | Timeout after |
---|
405 | .Ar seconds , |
---|
406 | instead of the default 30. |
---|
407 | A setting of 0 |
---|
408 | .Ar seconds |
---|
409 | causes |
---|
410 | .Nm |
---|
411 | to wait forever to get a lease. |
---|
412 | If |
---|
413 | .Nm |
---|
414 | is working on a single interface then |
---|
415 | .Nm |
---|
416 | will exit when a timeout occurs, otherwise |
---|
417 | .Nm |
---|
418 | will fork into the background. |
---|
419 | If using IPv4LL then |
---|
420 | .Nm |
---|
421 | start the IPv4LL process after the timeout and then wait a little longer |
---|
422 | before really timing out. |
---|
423 | .It Fl u , Fl Fl userclass Ar class |
---|
424 | Tags the DHCPv4 message with the userclass |
---|
425 | .Ar class . |
---|
426 | DHCP servers use this to give members of the class DHCP options other than the |
---|
427 | default, without having to know things like hardware address or hostname. |
---|
428 | .It Fl v , Fl Fl vendor Ar code , Ns Ar value |
---|
429 | Add an encapsulated vendor option. |
---|
430 | .Ar code |
---|
431 | should be between 1 and 254 inclusive. |
---|
432 | To add a raw vendor string, omit |
---|
433 | .Ar code |
---|
434 | but keep the comma. |
---|
435 | Examples. |
---|
436 | .Pp |
---|
437 | Set the vendor option 01 with an IP address. |
---|
438 | .D1 dhcpcd \-v 01,192.168.0.2 eth0 |
---|
439 | Set the vendor option 02 with a hex code. |
---|
440 | .D1 dhcpcd \-v 02,01:02:03:04:05 eth0 |
---|
441 | Set the vendor option 03 with an IP address as a string. |
---|
442 | .D1 dhcpcd \-v 03,\e"192.168.0.2\e" eth0 |
---|
443 | Set un-encapsulated vendor option to hello world. |
---|
444 | .D1 dhcpcd \-v ,"hello world" eth0 |
---|
445 | .It Fl Fl version |
---|
446 | Display both program version and copyright information. |
---|
447 | .Nm |
---|
448 | then exits before doing any configuration. |
---|
449 | .It Fl w , Fl Fl waitip Op 4 | 6 |
---|
450 | Wait for an address to be assigned before forking to the background. |
---|
451 | 4 means wait for an IPv4 address to be assigned. |
---|
452 | 6 means wait for an IPv6 address to be assigned. |
---|
453 | If no argument is given, |
---|
454 | .Nm |
---|
455 | will wait for any address protocol to be assigned. |
---|
456 | It is possible to wait for more than one address protocol and |
---|
457 | .Nm |
---|
458 | will only fork to the background when all waiting conditions are satisfied. |
---|
459 | .It Fl x , Fl Fl exit Op Ar interface |
---|
460 | This will signal an existing |
---|
461 | .Nm |
---|
462 | process running on the |
---|
463 | .Ar interface |
---|
464 | to de-configure the |
---|
465 | .Ar interface |
---|
466 | and exit. |
---|
467 | If no interface is specified, then the above is applied to all interfaces. |
---|
468 | .Nm |
---|
469 | then waits until this process has exited. |
---|
470 | .It Fl y , Fl Fl reboot Ar seconds |
---|
471 | Allow |
---|
472 | .Ar reboot |
---|
473 | seconds before moving to the discover phase if we have an old lease to use. |
---|
474 | The default is 5 seconds. |
---|
475 | A setting of 0 seconds causes |
---|
476 | .Nm |
---|
477 | to skip the reboot phase and go straight into discover. |
---|
478 | .El |
---|
479 | .Ss Restricting behaviour |
---|
480 | .Nm |
---|
481 | will try to do as much as it can by default. |
---|
482 | However, there are sometimes situations where you don't want the things to be |
---|
483 | configured exactly how the the DHCP server wants. |
---|
484 | Here are some options that deal with turning these bits off. |
---|
485 | .Bl -tag -width indent |
---|
486 | .It Fl 4 , Fl Fl ipv4only |
---|
487 | Only configure IPv4. |
---|
488 | .It Fl 6 , Fl Fl ipv6only |
---|
489 | Only confgiure IPv6. |
---|
490 | .It Fl A , Fl Fl noarp |
---|
491 | Don't request or claim the address by ARP. |
---|
492 | This also disables IPv4LL. |
---|
493 | .It Fl B , Fl Fl nobackground |
---|
494 | Don't run in the background when we acquire a lease. |
---|
495 | This is mainly useful for running under the control of another process, such |
---|
496 | as a debugger or a network manager. |
---|
497 | .It Fl C , Fl Fl nohook Ar script |
---|
498 | Don't run this hook script. |
---|
499 | Matches full name, or prefixed with 2 numbers optionally ending with |
---|
500 | .Pa .sh . |
---|
501 | .Pp |
---|
502 | So to stop |
---|
503 | .Nm |
---|
504 | from touching your DNS or MTU settings you would do:- |
---|
505 | .D1 dhcpcd -C resolv.conf -C mtu eth0 |
---|
506 | .It Fl G , Fl Fl nogateway |
---|
507 | Don't set any default routes. |
---|
508 | .It Fl H , Fl Fl xidhwaddr |
---|
509 | Use the last four bytes of the hardware address as the DHCP xid instead |
---|
510 | of a randomly generated number. |
---|
511 | .It Fl J , Fl Fl broadcast |
---|
512 | Instructs the DHCP server to broadcast replies back to the client. |
---|
513 | Normally this is only set for non Ethernet interfaces, |
---|
514 | such as FireWire and InfiniBand. |
---|
515 | In most instances, |
---|
516 | .Nm |
---|
517 | will set this automatically. |
---|
518 | .It Fl K , Fl Fl nolink |
---|
519 | Don't receive link messages for carrier status. |
---|
520 | You should only have to use this with buggy device drivers or running |
---|
521 | .Nm |
---|
522 | through a network manager. |
---|
523 | .It Fl L , Fl Fl noipv4ll |
---|
524 | Don't use IPv4LL (aka APIPA, aka Bonjour, aka ZeroConf). |
---|
525 | .It Fl O , Fl Fl nooption Ar option |
---|
526 | Don't request the specified option. |
---|
527 | If no option given, then don't request any options other than those to |
---|
528 | configure the interface and routing. |
---|
529 | .It Fl Q , Fl Fl require Ar option |
---|
530 | Requires the |
---|
531 | .Ar option |
---|
532 | to be present in all DHCP messages, otherwise the message is ignored. |
---|
533 | To enforce that |
---|
534 | .Nm |
---|
535 | only responds to DHCP servers and not BOOTP servers, you can |
---|
536 | .Fl Q |
---|
537 | .Ar dhcp_message_type . |
---|
538 | .It Fl q , Fl Fl quiet |
---|
539 | Quiet |
---|
540 | .Nm |
---|
541 | on the command line, only warnings and errors will be displayed. |
---|
542 | The messages are still logged though. |
---|
543 | .It Fl T, Fl Fl test |
---|
544 | On receipt of DHCP messages just call |
---|
545 | .Pa @SCRIPT@ |
---|
546 | with the reason of TEST which echos the DHCP variables found in the message |
---|
547 | to the console. |
---|
548 | The interface configuration isn't touched and neither are any configuration |
---|
549 | files. |
---|
550 | To test INFORM the interface needs to be configured with the desired address |
---|
551 | before starting |
---|
552 | .Nm . |
---|
553 | .It Fl U, Fl Fl dumplease Ar interface |
---|
554 | Dumps the last lease for the |
---|
555 | .Ar interface |
---|
556 | to stdout. |
---|
557 | .Ar interface |
---|
558 | could also be a path to a DHCP wire formatted file. |
---|
559 | .It Fl V, Fl Fl variables |
---|
560 | Display a list of option codes and the associated variable for use in |
---|
561 | .Xr dhcpcd-run-hooks 8 . |
---|
562 | Variables are prefixed with new_ and old_ unless the option number is -. |
---|
563 | Variables without an option are part of the DHCP message and cannot be |
---|
564 | directly requested. |
---|
565 | .It Fl W, Fl Fl whitelist Ar address Ns Op /cidr |
---|
566 | Only accept packets from |
---|
567 | .Ar address Ns Op /cidr . |
---|
568 | .Fl X, Fl Fl blacklist |
---|
569 | is ignored if |
---|
570 | .Fl W, Fl Fl whitelist |
---|
571 | is set. |
---|
572 | .It Fl X, Fl Fl blacklist Ar address Ns Op Ar /cidr |
---|
573 | Ignore all packets from |
---|
574 | .Ar address Ns Op Ar /cidr . |
---|
575 | .It Fl Z , Fl Fl denyinterfaces Ar pattern |
---|
576 | When discovering interfaces, the interface name must not match |
---|
577 | .Ar pattern |
---|
578 | which is a space or comma separated list of patterns passed to |
---|
579 | .Xr fnmatch 3 . |
---|
580 | .It Fl z , Fl Fl allowinterfaces Ar pattern |
---|
581 | When discovering interfaces, the interface name must match |
---|
582 | .Ar pattern |
---|
583 | which is a space or comma separated list of patterns passed to |
---|
584 | .Xr fnmatch 3 . |
---|
585 | If the same interface is matched in |
---|
586 | .Fl Z , Fl Fl denyinterfaces |
---|
587 | then it is still denied. |
---|
588 | .It Fl Fl nodev |
---|
589 | Don't load any |
---|
590 | .Pa /dev |
---|
591 | management modules. |
---|
592 | .El |
---|
593 | .Sh 3RDPARTY LINK MANAGEMENT |
---|
594 | Some interfaces require configuration by 3rd parties, such as PPP or VPN. |
---|
595 | When an interface configuration in |
---|
596 | .Nm |
---|
597 | is marked as STATIC or INFORM without an address then |
---|
598 | .Nm |
---|
599 | will monitor the interface until an address is added or removed from it and |
---|
600 | act accordingly. |
---|
601 | For point to point interfaces (like PPP), a default route to its |
---|
602 | destination is automatically added to the configuration. |
---|
603 | If the point to point interface is configured for INFORM, then |
---|
604 | .Nm |
---|
605 | unicasts INFORM to the destination, otherwise it defaults to STATIC. |
---|
606 | .Sh NOTES |
---|
607 | .Nm |
---|
608 | requires a Berkley Packet Filter, or BPF device on BSD based systems and a |
---|
609 | Linux Socket Filter, or LPF device on Linux based systems for all IPv4 |
---|
610 | configuration. |
---|
611 | .Sh FILES |
---|
612 | .Bl -ohang |
---|
613 | .It Pa @SYSCONFDIR@/dhcpcd.conf |
---|
614 | Configuration file for dhcpcd. |
---|
615 | If you always use the same options, put them here. |
---|
616 | .It Pa @SYSCONFDIR@/dhcpcd.duid |
---|
617 | Text file that holds the DUID used to identify the host. |
---|
618 | .It Pa @SCRIPT@ |
---|
619 | Bourne shell script that is run to configure or de-configure an interface. |
---|
620 | .It Pa @LIBDIR@/dhcpcd/dev |
---|
621 | .Pa /dev |
---|
622 | management modules. |
---|
623 | .It Pa @HOOKDIR@ |
---|
624 | A directory containing bourne shell scripts that are run by the above script. |
---|
625 | Each script can be disabled by using the |
---|
626 | .Fl C , Fl Fl nohook |
---|
627 | option described above. |
---|
628 | .It Pa @DBDIR@/dhcpcd\- Ns Ar interface Ns .lease |
---|
629 | The actual DHCP message send by the server. |
---|
630 | We use this when reading the last |
---|
631 | lease and use the files mtime as when it was issued. |
---|
632 | .It Pa @DBDIR@/dhcpcd-rdm.monotonic |
---|
633 | Stores the monotonic counter used in the |
---|
634 | .Ar replay |
---|
635 | field in Authentication Options. |
---|
636 | .It Pa /var/run/dhcpcd.pid |
---|
637 | Stores the PID of |
---|
638 | .Nm |
---|
639 | running on all interfaces. |
---|
640 | .It Pa /var/run/dhcpcd\- Ns Ar interface Ns .pid |
---|
641 | Stores the PID of |
---|
642 | .Nm |
---|
643 | running on the |
---|
644 | .Ar interface . |
---|
645 | .El |
---|
646 | .Sh SEE ALSO |
---|
647 | .Xr fnmatch 3 , |
---|
648 | .Xr if_nametoindex 3 , |
---|
649 | .Xr dhcpcd.conf 5 , |
---|
650 | .Xr resolv.conf 5 , |
---|
651 | .Xr dhcpcd-run-hooks 8 , |
---|
652 | .Xr resolvconf 8 |
---|
653 | .Sh STANDARDS |
---|
654 | RFC\ 951, RFC\ 1534, RFC\ 2104, RFC\ 2131, RFC\ 2132, RFC\ 2855, RFC\ 3004, |
---|
655 | RFC\ 3118, RFC\ 3315, RFC\ 3361, RFC\ 3633, RFC\ 3396, RFC\ 3397, RFC\ 3442, |
---|
656 | RFC\ 3495, RFC\ 3925, RFC\ 3927, RFC\ 4039, RFC\ 4075, RFC\ 4242, RFC\ 4361, |
---|
657 | RFC\ 4390, RFC\ 4702, RFC\ 4074, RFC\ 4861, RFC\ 4833, RFC\ 5227, RFC\ 5942, |
---|
658 | RFC\ 5969, RFC\ 6106. |
---|
659 | .Sh AUTHORS |
---|
660 | .An Roy Marples Aq Mt roy@marples.name |
---|
661 | .Sh BUGS |
---|
662 | Please report them to |
---|
663 | .Lk http://roy.marples.name/projects/dhcpcd |
---|
664 | .Pp |
---|
665 | If authentication is used and the |
---|
666 | .Pa @DBDIR@/dhcpcd-rdm.monotonic |
---|
667 | file is removed or altered then the DHCP server will need it's notion |
---|
668 | of the last replay value |
---|
669 | .Nm |
---|
670 | sent reset. |
---|
671 | We could change this to use a NTP time stamp instead, but it's |
---|
672 | more likely the RTC on this host is broken which would cause the same result. |
---|