]>
Commit | Line | Data |
---|---|---|
9ff636a5 | 1 | .\" Copyright (c) 2006-2014 Roy Marples |
ba9dfb7a RM |
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 | .\" | |
94bec972 | 25 | .Dd April 28, 2014 |
0b4a1931 | 26 | .Dt DHCPCD.CONF 5 |
918338f2 | 27 | .Os |
ba9dfb7a RM |
28 | .Sh NAME |
29 | .Nm dhcpcd.conf | |
443c8695 | 30 | .Nd dhcpcd configuration file |
ba9dfb7a RM |
31 | .Sh DESCRIPTION |
32 | Although | |
33 | .Nm dhcpcd | |
34 | can do everything from the command line, there are cases where it's just easier | |
cf42802e RM |
35 | to do it once in a configuration file. |
36 | Most of the options found in | |
ba9dfb7a | 37 | .Xr dhcpcd 8 |
cf42802e RM |
38 | can be used here. |
39 | The first word on the line is the option and the rest of the line is the value. | |
40 | Leading and trailing whitespace for the option and value are trimmed. | |
41 | You can escape characters in the value using the \\ character. | |
967194ef RM |
42 | .Pp |
43 | Blank lines and lines starting with # are ignored. | |
ba9dfb7a RM |
44 | .Pp |
45 | Here's a list of available options: | |
46 | .Bl -tag -width indent | |
ba97e494 RM |
47 | .It Ic allowinterfaces Ar pattern |
48 | When discovering interfaces, the interface name must match | |
49 | .Ar pattern | |
50 | which is a space or comma separated list of patterns passed to | |
51 | .Xr fnmatch 3 . | |
52 | If the same interface is matched in | |
53 | .Ic denyinterfaces | |
54 | then it is still denied. | |
55 | .It Ic denyinterfaces Ar pattern | |
56 | When discovering interfaces, the interface name must not match | |
57 | .Ar pattern | |
58 | which is a space or comma separated list of patterns passed to | |
59 | .Xr fnmatch 3 . | |
6f767217 RM |
60 | .It Ic arping Ar address Op address |
61 | .Nm dhcpcd | |
ff021b0b | 62 | will arping each address in order before attempting DHCP. |
6f767217 RM |
63 | If an address is found, we will select the replying hardware address as the |
64 | profile, otherwise the ip address. | |
65 | Example: | |
66 | .Pp | |
67 | .D1 interface bge0 | |
68 | .D1 arping 192.168.0.1 | |
69 | .Pp | |
70 | .D1 profile 192.168.0.1 | |
71 | .D1 static ip_address=192.168.0.10/24 | |
c73ed171 RM |
72 | .It Ic authprotocol Ar protocol Ar algorithm Ar rdm |
73 | Authenticate DHCP messages. | |
74 | See the Supported Protocols section. | |
75 | .It Ic authtoken Ar secretid Ar realm Ar expire Ar key | |
76 | Define a shared key for use in authentication. | |
77 | .Ar realm can be "" to for use with the | |
78 | .Ar delayed | |
79 | prptocol. | |
80 | .Ar expire | |
81 | is the date the token expires and should be formatted "yyy-mm-dd HH:MM". | |
82 | You can use the keyword | |
83 | .Ar forever | |
84 | or | |
85 | .Ar 0 | |
86 | which means the token never expires. | |
bac03ede RM |
87 | .It Ic background |
88 | Background immediately. | |
89 | This is useful for startup scripts which don't disable link messages for | |
90 | carrier status. | |
6f767217 | 91 | .It Ic blacklist Ar address Ns Op /cidr |
ce6b39df | 92 | Ignores all packets from |
6f767217 | 93 | .Ar address Ns Op /cidr . |
bf80d526 RM |
94 | .It Ic whitelist Ar address Ns Op /cidr |
95 | Only accept packets from | |
96 | .Ar address Ns Op /cidr . | |
97 | .Ic blacklist | |
98 | is ignored if | |
99 | .Ic whitelist | |
100 | is set. | |
900b3da4 RM |
101 | .It Ic broadcast |
102 | Instructs the DHCP server to broadcast replies back to the client. | |
103 | Normally this is only set for non Ethernet interfaces, | |
104 | such as FireWire and InfiniBand. | |
105 | In most cases, | |
106 | .Nm dhcpcd | |
107 | will set this automatically. | |
a3099289 RM |
108 | .It Ic debug |
109 | Echo debug messages to the stderr and syslog. | |
413652c1 RM |
110 | .It Ic dev Ar value |
111 | Load the | |
112 | .Ar value | |
113 | .Pa /dev | |
114 | management module. | |
115 | .Nm dhcpcd | |
116 | will load the first one found to work, if any. | |
6bfd88f1 RM |
117 | .It Ic env Ar value |
118 | Push | |
119 | .Ar value | |
120 | to the environment for use in | |
121 | .Xr dhcpcd-run-hooks 8 . | |
122 | For example, you can force the hostname hook to always set the hostname with | |
123 | .Ic env | |
124 | .Va force_hostname=YES . | |
77961e7b RM |
125 | .Pp |
126 | If the hostname is set, will be will set to the FQDN if possible as per | |
127 | RFC 4702 section 3.1. | |
128 | If the FQDN option is missing, | |
129 | .Nm dhcpcd | |
130 | will still try and set a FQDN from the hostname and domain options for | |
131 | consistency. | |
132 | To override this, set | |
133 | .Ic env | |
134 | .Va hostname_fqdn=[YES|NO|SERVER] . | |
135 | A value of server means just what the server says, don't manipulate it. | |
136 | This could lead to an inconsistent hostname on a DHCPv4 and DHCPv6 network | |
137 | where the DHCPv4 hostname is short and the DHCPv6 has an FQDN. | |
138 | DHCPv6 has no hostname option. | |
d2616b08 | 139 | .It Ic clientid Ar string |
c989b023 RM |
140 | Send the |
141 | .Ar clientid . | |
d2616b08 | 142 | If the string is of the format 01:02:03 then it is encoded as hex. |
3faba9e6 RM |
143 | For interfaces whose hardware address is longer than 8 bytes, or if the |
144 | .Ar clientid | |
145 | is an empty string then | |
146 | .Nm dhcpcd | |
147 | sends a default | |
148 | .Ar clientid | |
149 | of the hardware family and the hardware address. | |
d2616b08 RM |
150 | .It Ic duid |
151 | Generate an | |
152 | .Rs | |
153 | .%T "RFC 4361" | |
154 | .Re | |
ebc9d360 | 155 | compliant DHCP Unique Identifier. |
7e068c85 RM |
156 | If persistent storage is available then a DUID-LLT (link local address + time) |
157 | is generated, otherwise DUID-LL is generated (link local address). | |
ebc9d360 RM |
158 | This, plus the IAID will be used as the |
159 | .Ic clientid . | |
7e068c85 | 160 | The DUID-LLT generated will be held in |
d2616b08 RM |
161 | .Pa @SYSCONFDIR@/dhcpcd.duid |
162 | and should not be copied to other hosts. | |
ebc9d360 RM |
163 | .It Ic iaid Ar iaid |
164 | Set the Interface Association Identifier to | |
165 | .Ar iaid . | |
9ff636a5 RM |
166 | This option must be used in an |
167 | .Ic interface | |
168 | block. | |
6f66c6c9 RM |
169 | This defaults to the last 4 bytes of the hardware address assigned to the |
170 | interface. | |
171 | Each instance of this should be unique within the scope of the client and | |
172 | .Nm dhcpcd | |
173 | warns if a conflict is detected. | |
174 | If there is a conflict, it is only a problem if the conflicted IAIDs are | |
175 | used on the same network. | |
94bec972 RM |
176 | .It Ic dhcp |
177 | Enable DHCP on the interface, on by default. | |
178 | .It Ic dhcp6 | |
179 | Enable DHCPv6 on the interface, on by default. | |
180 | .It Ic ipv4 | |
181 | Enable IPv4 on the interface, on by default. | |
182 | .It Ic ipv6 | |
183 | Enable IPv6 on the interface, on by default. | |
15fc1181 RM |
184 | .It Ic persistent |
185 | .Nm dhcpcd | |
186 | normally de-configures the interface and configuration when it exits. | |
187 | Sometimes, this isn't desirable if, for example, you have root mounted over | |
a544b76a RM |
188 | NFS or SSH clients connect to this host and they need to be notified of |
189 | the host shutting down. | |
15fc1181 | 190 | You can use this option to stop this from happening. |
ff021b0b RM |
191 | .It Ic fallback Ar profile |
192 | Fallback to using this profile if DHCP fails. | |
193 | This allows you to configure a static profile instead of using ZeroConf. | |
ba9dfb7a | 194 | .It Ic hostname Ar name |
35d02ae6 | 195 | Sends |
ff021b0b | 196 | .Ar hostname |
35d02ae6 RM |
197 | to the DHCP server so it can be registered in DNS. |
198 | If | |
35ff0dbb | 199 | .Ar hostname |
35d02ae6 RM |
200 | is an empty string then the current system hostname is sent. |
201 | If | |
202 | .Ar hostname | |
203 | is a FQDN (ie, contains a .) then it will be encoded as such. | |
d6a18654 RM |
204 | .It Ic hostname_short |
205 | Sends the short hostname to the DHCP server instead of the FQDN. | |
206 | This is useful because DHCP servers will not register the FQDN in their | |
207 | DNS if the domain part does not match theirs. | |
77961e7b RM |
208 | .Pp |
209 | Also, see the | |
210 | .Ic env | |
211 | option above to control how the hostname is set on the host. | |
22ea2b0d | 212 | .It Ic ia_na Op Ar iaid |
00ababe4 RM |
213 | Request a DHCPv6 Normal Address for |
214 | .Ar iaid . | |
00ababe4 | 215 | .Ar iaid |
ebc9d360 RM |
216 | defaults to the |
217 | .Ic iaid | |
218 | option as described above. | |
219 | You can request more than one ia_na by specifying a unique | |
220 | .Ar iaid | |
221 | for each one. | |
22ea2b0d | 222 | .It Ic ia_ta Op Ar iaid |
00ababe4 RM |
223 | Request a DHCPv6 Temporary Address for |
224 | .Ar iaid . | |
ebc9d360 RM |
225 | You can request more than one ia_ta by specifying a unique |
226 | .Ar iaid | |
227 | for each one. | |
5985c4e2 | 228 | .It Ic ia_pd Op Ar iaid Op Ar interface Op / Ar sla_id Op / Ar prefix_len |
00ababe4 RM |
229 | Request a DHCPv6 Delegated Prefix for |
230 | .Ar iaid . | |
9ff636a5 RM |
231 | This option must be used in an |
232 | .Ic interface | |
233 | block. | |
94a79cea RM |
234 | Unless a |
235 | .Ar sla_id | |
236 | of 0 is assigned, a reject route is installed for the Delegated Prefix to | |
237 | stop unallocated addresses being resolved upstream. | |
22ea2b0d RM |
238 | If no |
239 | .Ar interface | |
94a79cea | 240 | is given then we will assign a prefix to every other interface with a |
22ea2b0d | 241 | .Ar sla_id |
94a79cea | 242 | equivalent to the interface index assigned by the OS. |
22ea2b0d | 243 | Otherwise addresses are only assigned for each |
00ababe4 RM |
244 | .Ar interface |
245 | and | |
9ff636a5 | 246 | .Ar sla_id . |
94a79cea | 247 | Each assigned address will have a suffix of 1. |
9ff636a5 | 248 | You cannot assign a prefix to the requesting interface. |
2fae05d0 RM |
249 | .Nm dhcpcd |
250 | has to be running for all the interfaces it is delegating to. | |
00ababe4 | 251 | A default |
367f7b11 | 252 | .Ar prefix_len |
94a79cea RM |
253 | of 64 is assumed, unless the maximum |
254 | .Ar sla_id | |
255 | does not fit. | |
256 | In this case | |
257 | .Ar prefix_len | |
258 | is increased to the highest multiple of 8 that can accomodate the | |
259 | .Ar sla_id . | |
367f7b11 RM |
260 | .Ar sla_id |
261 | is an integer and is added to the prefix which must fit inside | |
262 | .Ar prefix_len | |
263 | less the length of the delegated prefix. | |
94a79cea | 264 | .Ar sla_id can be 0 only if the Delegated Prefix is assigned to one interface. |
22ea2b0d RM |
265 | You can specify multiple |
266 | .Ar interface / | |
267 | .Ar sla_id / | |
268 | .Ar prefix_len | |
269 | per | |
270 | .Ic ia_pd , | |
271 | space separated. | |
00ababe4 RM |
272 | IPv6RS should be disabled globally when requesting a Prefix Delegation like so: |
273 | .Pp | |
94bec972 RM |
274 | .D1 # Global settings, disable IPv4 and IPv6RS |
275 | .D1 noipv4 | |
00ababe4 | 276 | .D1 noipv6rs |
2fae05d0 RM |
277 | .D1 # Don't touch eth3 at all |
278 | .D1 denyinterfaces eth3 | |
00ababe4 RM |
279 | .Pp |
280 | .D1 interface eth0 | |
94a79cea | 281 | .D1 ia_pd 1 eth1/1 eth2/2 |
2fae05d0 | 282 | .Pp |
94bec972 | 283 | .D1 # Enable automatic address configuration for eth1 |
2fae05d0 RM |
284 | .D1 # eth1 still gets a delegated prefix |
285 | .D1 interface eth1 | |
94bec972 RM |
286 | .D1 ipv4 |
287 | .D1 ipv6rs | |
d7555c12 RM |
288 | .It Ic ipv4only |
289 | Only configure IPv4. | |
290 | .It Ic ipv6only | |
291 | Only confgiure IPv6. | |
cc3c3560 RM |
292 | .It Ic fqdn Op disable | ptr | both |
293 | ptr just asks the DHCP server to update the PTR | |
35ff0dbb | 294 | record of the host in DNS whereas both also updates the A record. |
cc3c3560 RM |
295 | disable will disable the FQDN option. |
296 | The default is both. | |
1b3bc477 RM |
297 | .Nm dhcpcd |
298 | itself never does any DNS updates. | |
e837a670 RM |
299 | .Nm dhcpcd |
300 | encodes the FQDN hostname as specified in | |
301 | .Li RFC1035 . | |
3adc5520 | 302 | .It Ic interface Ar interface |
012fd5d3 RM |
303 | Subsequent options are only parsed for this |
304 | .Ar interface . | |
61dd6cf9 RM |
305 | .It Ic ipv6ra_fork |
306 | By default, when | |
307 | .Nm dhcpcd | |
308 | receives an IPv6 RA, | |
309 | .Nm dhcpcd | |
310 | will only fork to the background if the RA contains at least one unexpired | |
e2c4a256 | 311 | RDNSS option and a valid prefix or no DHCPv6 instruction. |
61dd6cf9 RM |
312 | Set this option so to make |
313 | .Nm dhcpcd | |
314 | always fork on an RA. | |
d7555c12 | 315 | .It Ic ipv6ra_own |
eebe9a18 RM |
316 | Disables kernel IPv6 Router Advertisment processing so dhcpcd can manage |
317 | addresses and routes. | |
a521cdce | 318 | This does not work reliably on any BSD system, probably due to kernel issues. |
d7555c12 | 319 | .It Ic ipv6ra_own_default |
eebe9a18 RM |
320 | Each time dhcpcd receives an IPv6 Router Adveristment, dhcpcd will manage |
321 | the default route only. | |
322 | This allows dhcpcd to prefer an interface for outbound traffic based on metric | |
323 | and/or user selection rather than the kernel. | |
a521cdce | 324 | This does work reliably on BSD systems. |
d7555c12 | 325 | .It Ic ipv6rs |
eebe9a18 RM |
326 | Enables IPv6 Router Advertisment solicitation. |
327 | This is on by default, but is documented here in the case where it is disabled | |
328 | globally but needs to be enabled for one interface. | |
ba9dfb7a RM |
329 | .It Ic leasetime Ar seconds |
330 | Request a leasetime of | |
331 | .Ar seconds . | |
065125d4 RM |
332 | .It Ic metric Ar metric |
333 | Metrics are used to prefer an interface over another one, lowest wins. | |
334 | .Nm dhcpcd | |
87b266d2 | 335 | will supply a default metric of 200 + |
065125d4 RM |
336 | .Xr if_nametoindex 3 . |
337 | An extra 100 will be added for wireless interfaces. | |
7dab081f RM |
338 | .It Ic noalias |
339 | IPv4 addresses added will overwrite a pre-existing address instead of working | |
340 | alongside. | |
ba9dfb7a | 341 | .It Ic noarp |
cf42802e RM |
342 | Don't send any ARP requests. |
343 | This also disables IPv4LL. | |
c73ed171 RM |
344 | .It Ic noauthrequired |
345 | Don't require authentication even though we requested it. | |
413652c1 RM |
346 | .It Ic nodev |
347 | Don't load | |
348 | .Pa /dev | |
349 | management modules. | |
d4154ba7 RM |
350 | .It Ic nodhcp |
351 | Don't start DHCP or listen to DHCP messages. | |
352 | This is only useful when allowing IPv4LL. | |
353 | .It Ic nodhcp6 | |
354 | Don't start DHCPv6 or listen to DHCPv6 messages. | |
355 | Normally DHCPv6 is started by a RA instruction or configuration. | |
ba9dfb7a RM |
356 | .It Ic nogateway |
357 | Don't install any default routes. | |
37156a6b RM |
358 | .It Ic nohook Ar script |
359 | Don't run this hook script. | |
8276da82 RM |
360 | Matches full name, or prefixed with 2 numbers optionally ending with |
361 | .Pa .sh . | |
fc7ee231 RM |
362 | .Pp |
363 | So to stop | |
364 | .Nm dhcpcd | |
365 | from touching your DNS or MTU settings you would do:- | |
366 | .D1 nohook resolv.conf, mtu | |
bb8051bf RM |
367 | .It Ic noipv4 |
368 | Don't attempt to configure an IPv4 address. | |
ba9dfb7a RM |
369 | .It Ic noipv4ll |
370 | Don't attempt to obtain an IPv4LL address if we failed to get one via DHCP. | |
371 | See | |
372 | .Rs | |
373 | .%T "RFC 3927" | |
374 | .Re | |
bb8051bf RM |
375 | .It Ic noipv6 |
376 | Don't attmept to configure an IPv6 address. | |
91cd7324 | 377 | .It Ic noipv6rs |
4c6a8bec | 378 | Disable solicitation and receipt of IPv6 Router Advertisements. |
a26af491 RM |
379 | .It Ic nolink |
380 | Don't receive link messages about carrier status. | |
381 | You should only set this for buggy interface drivers. | |
cc45fbd7 | 382 | .It Ic option Ar option |
d2616b08 | 383 | Requests the |
cc45fbd7 | 384 | .Ar option |
cf42802e RM |
385 | from the server. |
386 | It can be a variable to be used in | |
ee4e620a | 387 | .Xr dhcpcd-run-hooks 8 |
cf42802e | 388 | or the numerical value. |
b8ffa3cd RM |
389 | You can specify more |
390 | .Ar option Ns s | |
391 | separated by commas, spaces or more | |
392 | .Ic option | |
393 | lines. | |
394 | Prepend dhcp6_ to | |
395 | .Ar option | |
396 | to request a DHCPv6 option. | |
397 | DHCPv4 options are mapped to DHCPv6 where applicable. | |
2063c6f9 RM |
398 | .It Ic nooption Ar option |
399 | Remove the option from the DHCP message. | |
400 | This should only be used when a DHCP server sends a non requested option | |
401 | that should not be processed. | |
1abffd5b RM |
402 | .It Ic destination Ar option |
403 | If | |
404 | .Nm | |
405 | detects an address added to a point to point interface (PPP, TUN, etc) then | |
406 | it will set the listed DHCP options to the destination address of the | |
407 | interface. | |
6f767217 RM |
408 | .It Ic profile Ar name |
409 | Subsequent options are only parsed for this profile | |
410 | .Ar name . | |
1abffd5b | 411 | .It Ic quiet |
87b266d2 | 412 | Suppress any dhcpcd output to the console, except for errors. |
1abffd5b | 413 | .It Ic reboot Ar seconds |
a2a9a498 RM |
414 | Allow |
415 | .Ar reboot | |
901b42de | 416 | seconds before moving to the DISCOVER phase if we have an old lease to use. |
499225e4 | 417 | The default is 5 seconds. |
901b42de | 418 | A setting of 0 seconds causes |
a2a9a498 | 419 | .Nm dhcpcd |
901b42de RM |
420 | to skip the REBOOT phase and go straight into DISCOVER. |
421 | This is desirable for mobile users because if you change from network A to | |
422 | network B and they use the same subnet and the address from network A isn't | |
423 | in use on network B, then the DHCP server will remain silent even if authorative | |
424 | which means | |
425 | .Nm dhcpcd | |
426 | will timeout before moving back to the DISCOVER phase. | |
2662d519 RM |
427 | .It Ic release |
428 | .Nm dhcpcd | |
429 | will release the lease prior to stopping the interface. | |
cc45fbd7 RM |
430 | .It Ic require Ar option |
431 | Requires the | |
432 | .Ar option | |
433 | to be present in all DHCP messages, otherwise the message is ignored. | |
434 | It can be a variable to be used in | |
435 | .Xr dhcpcd-run-hooks 8 | |
436 | or the numerical value. | |
87b266d2 | 437 | You can specify more options separated by commas, spaces or more require lines. |
02d339e3 RM |
438 | To enforce that |
439 | .Nm dhcpcd | |
440 | only responds to DHCP servers and not BOOTP servers, you can | |
441 | .Ic require | |
442 | .Ar dhcp_message_type . | |
0aeb350c RM |
443 | .It Ic script Ar script |
444 | Use | |
445 | .Ar script | |
446 | instead of the default | |
447 | .Pa @SCRIPT@ . | |
c53cf4ef RM |
448 | .It Ic ssid Ar ssid |
449 | Subsequent options are only parsed for this wireless | |
450 | .Ar ssid . | |
91a44b91 RM |
451 | .It Ic static Ar value |
452 | Configures a static | |
453 | .Ar value . | |
454 | If you set | |
455 | .Ic ip_address | |
456 | then | |
457 | .Nm dhcpcd | |
458 | will not attempt to obtain a lease and just use the value for the address with | |
459 | an infinite lease time. | |
460 | .Pp | |
461 | Here is an example which configures a static address, routes and dns. | |
462 | .D1 interface eth0 | |
463 | .D1 static ip_address=192.168.0.10/24 | |
464 | .D1 static routers=192.168.0.1 | |
465 | .D1 static domain_name_servers=192.168.0.1 | |
1abffd5b RM |
466 | .Pp |
467 | Here is an example for PPP which gives the destination a default route. | |
468 | It uses the special destination keyword to insert the destination address | |
469 | into the value. | |
470 | .D1 interface ppp0 | |
471 | .D1 static ip_address= | |
472 | .D1 destination routers | |
d2616b08 | 473 | .It Ic timeout Ar seconds |
b58bf81f RM |
474 | Timeout after |
475 | .Ar seconds , | |
476 | instead of the default 30. | |
d93d7adc RM |
477 | A setting of 0 |
478 | .Ar seconds | |
479 | causes | |
480 | .Nm dhcpcd | |
481 | to wait forever to get a lease. | |
b58bf81f RM |
482 | If |
483 | .Nm dhcpcd | |
484 | is working on a single interface then | |
485 | .Nm dhcpcd | |
486 | will exit when a timeout occurs, otherwise | |
487 | .Nm dhcpcd | |
488 | will fork into the background. | |
489 | If using IPv4LL then | |
490 | .Nm dhcpcd | |
491 | start the IPv4LL process after the timeout and then wait a little longer | |
492 | before really timing out. | |
d2616b08 | 493 | .It Ic userclass Ar string |
1300150e | 494 | Tag the DHCPv4 messages with the userclass. |
cf42802e | 495 | You can specify more than one. |
bac03ede | 496 | .It Ic vendor Ar code , Ns Ar value |
87b266d2 | 497 | Add an encapsulated vendor option. |
757520c5 RM |
498 | .Ar code |
499 | should be between 1 and 254 inclusive. | |
95d6dcfa RM |
500 | To add a raw vendor string, omit |
501 | .Ar code | |
502 | but keep the comma. | |
757520c5 RM |
503 | Examples. |
504 | .Pp | |
505 | Set the vendor option 01 with an IP address. | |
506 | .D1 vendor 01,192.168.0.2 | |
507 | Set the vendor option 02 with a hex code. | |
508 | .D1 vendor 02,01:02:03:04:05 | |
509 | Set the vendor option 03 with an IP address as a string. | |
510 | .D1 vendor 03,\e"192.168.0.2\e" | |
87b266d2 | 511 | Set un-encapsulated vendor option to hello world. |
9cb58952 | 512 | .D1 vendor ,"hello world" |
bac03ede | 513 | .It Ic vendorclassid Ar string |
1300150e RM |
514 | Set the DHCP Vendor Class. |
515 | DHCPv6 has it's own option as shown below. | |
eebe9a18 RM |
516 | The default is |
517 | dhcpcd-<version>:<os>:<machine>:<platform>. | |
518 | For example | |
519 | .D1 dhcpcd-5.5.6:NetBSD-6.99.5:i386:i386 | |
bac03ede | 520 | If not set then none is sent. |
eebe9a18 RM |
521 | Some badly configured DHCP servers reject unknown vendorclassids. |
522 | To work around it, try and impersonate Windows by using the MSFT vendorclassid. | |
7a911e57 | 523 | .It Ic vendclass Ar en Ar data |
1300150e | 524 | Add the DHCPv6 Vendor Indetifying Vendor Class with the IANA assigned Enterprise |
7a911e57 RM |
525 | Number |
526 | .Ar en | |
527 | with the | |
528 | .Ar data . | |
529 | This option can be set more than once to add more data, but the behaviour, | |
530 | as per | |
531 | .Xr RFC 3925 | |
532 | is undefined if the Enterprise Number differs. | |
7013b073 | 533 | .It Ic waitip Op 4 | 6 |
2a07a2af | 534 | Wait for an address to be assigned before forking to the background. |
7013b073 RM |
535 | 4 means wait for an IPv4 address to be assigned. |
536 | 6 means wait for an IPv6 address to be assigned. | |
8b7499fd RM |
537 | If no argument is given, |
538 | .Nm | |
539 | will wait for any address protocol to be assigned. | |
540 | It is possible to wait for more than one address protocol and | |
541 | .Nm | |
542 | will only fork to the background when all waiting conditions are satisfied. | |
4242c9b3 RM |
543 | .It Ic xidhwaddr |
544 | Use the last four bytes of the hardware address as the DHCP xid instead | |
545 | of a randomly generated number. | |
eaa90296 | 546 | .El |
8e7d8c37 RM |
547 | .Ss Defining new options |
548 | DHCP allows for the use of custom options. | |
549 | Each option needs to be started with the | |
550 | .Ic define | |
551 | or | |
552 | .Ic define6 | |
553 | directive. | |
554 | This can optionally be followed by both | |
555 | .Ic embed | |
556 | or | |
557 | .Ic encap | |
558 | options. | |
559 | Both can be specified more than once and | |
560 | .Ic embed | |
561 | must come before | |
562 | .Ic encap . | |
563 | .Bl -tag -width indent | |
564 | .It Ic define Ar code Ar type Ar variable | |
565 | Defines the DHCP option | |
566 | .Ar code | |
567 | of | |
568 | .Ar type | |
569 | with a name of | |
570 | .Ar variable | |
571 | exported to | |
572 | .Xr dhcpcd-run-hooks 8 . | |
573 | .It Ic define6 Ar code Ar type Ar variable | |
574 | Defines the DHCPv6 option | |
575 | .Ar code | |
576 | of | |
577 | .Ar type | |
578 | with a name of | |
579 | .Ar variable | |
580 | exported to | |
581 | .Xr dhcpcd-run-hooks 8 , | |
582 | with a prefix of | |
583 | .Va _dhcp6 . | |
7a911e57 RM |
584 | .It Ic vendopt Ar code Ar type Ar variable |
585 | Defines the Vendor-Identifying Vendor Options. | |
586 | The | |
587 | .Ar code | |
588 | is the IANA Enterprise Number which will unqiuely describe the encapsulated | |
589 | options. | |
590 | .Ar type | |
591 | is normally | |
592 | .Ar encap . | |
593 | .Ar variable | |
594 | names the Vendor option to be exported. | |
8e7d8c37 RM |
595 | .It Ic embed Ar type Ar variable |
596 | Defines an embedded variable within the defined option. | |
597 | The length is determined by the | |
598 | .Ar type . | |
63bdd2c2 RM |
599 | If the |
600 | .Ar variable | |
601 | is not the same as defined in the parent option, | |
602 | it is prefixed with the parent | |
603 | .Ar variable | |
604 | first with an underscore. | |
8e7d8c37 RM |
605 | .It Ic encap Ar code Ar type Ar variable |
606 | Defines an encapsulated variable within the defined option. | |
607 | The length is determined by the | |
608 | .Ar type . | |
63bdd2c2 RM |
609 | If the |
610 | .Ar variable | |
611 | is not the same as defined in the parent option, | |
612 | it is prefixed with the parent | |
613 | .Ar variable | |
614 | first with an underscore. | |
615 | .El | |
616 | .Ss Type prefix | |
617 | These keywords come before the type itself, to describe it more fully. | |
618 | You can use more than one, but they must appear in the order listed below. | |
619 | .Bl -tag -width -indent | |
620 | .It Ic request | |
621 | Requests the option by default without having to be specified in user | |
622 | configuration | |
623 | .It Ic norequest | |
624 | This option cannot be requested, regardless of user configuration | |
03476881 RM |
625 | .It Ic index |
626 | The option can appear more than once and will be indexed. | |
63bdd2c2 RM |
627 | .It Ic array |
628 | The option data is split into a space seperated array, each element being | |
629 | the same type. | |
8e7d8c37 RM |
630 | .El |
631 | .Ss Types to define | |
b21cd906 RM |
632 | The type directly affects the length of data consumed inside the option. |
633 | Any remaining data is normally discarded. | |
634 | Lengths can be specified for string and binhex types, but this is generally | |
635 | with other data embedded afterwards in the same option. | |
8e7d8c37 RM |
636 | .Bl -tag -width indent |
637 | .It Ic ipaddress | |
638 | An IPv4 address, 4 bytes | |
639 | .It Ic ip6address | |
640 | An IPv6 address, 16 bytes | |
b21cd906 | 641 | .It Ic string Op : Ic length |
8e7d8c37 RM |
642 | A shell escaped string (binary data escaped as octal) |
643 | .It Ic byte | |
644 | A byte | |
645 | .It Ic int16 | |
646 | A signed 16bit integer, 2 bytes | |
647 | .It Ic uint16 | |
648 | An unsigned 16bit integer, 2 bytes | |
649 | .It Ic int32 | |
650 | A signed 32bit integer, 4 bytes | |
651 | .It Ic uint32 | |
652 | An unsigned 32bit integer, 4 bytes | |
1cd05a96 RM |
653 | .It Ic flag |
654 | A fixed value (1) to indicate that the option is present, 0 bytes | |
8e7d8c37 RM |
655 | .It Ic domain |
656 | A RFC 3397 encoded string | |
b21cd906 | 657 | .It Ic binhex Op : Ic length |
8e7d8c37 RM |
658 | Binary data expressed as hexadecimal |
659 | .It Ic embed | |
660 | Contains embedded options (implies encap as well) | |
661 | .It Ic encap | |
662 | Contains encapsulated options (implies embed as well) | |
03476881 RM |
663 | .It Ic option |
664 | References an option from the global definition | |
8e7d8c37 RM |
665 | .El |
666 | .Ss Example definition | |
667 | .D1 # DHCP option 81, Fully Qualified Domain Name, RFC4702 | |
63bdd2c2 RM |
668 | .D1 define 81 embed fqdn |
669 | .D1 embed byte flags | |
670 | .D1 embed byte rcode1 | |
671 | .D1 embed byte rcode2 | |
8e7d8c37 RM |
672 | .D1 embed domain fqdn |
673 | .Pp | |
674 | .D1 # DHCP option 125, Vendor Specific Information Option, RFC3925 | |
63bdd2c2 RM |
675 | .D1 define 125 encap vsio |
676 | .D1 embed uint32 enterprise_number | |
8e7d8c37 | 677 | .D1 # Options defined for the enterprise number |
63bdd2c2 | 678 | .D1 encap 1 ipaddress ipaddress |
c73ed171 RM |
679 | .Ss Supported protocols |
680 | .Bl -tag -width -indent | |
681 | .It Ic token | |
682 | Sends and expects the token with the secretid 0 in each message. | |
683 | .It Ic delayedrealm | |
684 | Delayed Authentication. | |
685 | .Nm dhcpcd | |
686 | will send an authentication option with no key or MAC. | |
687 | The server will see this option, and select a key for | |
688 | .Nm , writing the | |
689 | .Ar realm | |
690 | and | |
691 | .Ar secretid | |
692 | in it. | |
693 | .Nm dhcpcd | |
694 | will then look for a non-expired token with a matching realm and secretid. | |
695 | This token is used to authenicate all other messages. | |
696 | .It Ic delayed | |
697 | Same as above, but without a realm. | |
698 | .El | |
699 | .Ss Supported algorithms | |
700 | If none specified, | |
701 | .Ic hmac-md5 | |
702 | is the default. | |
703 | .Bl -tag -width -indent | |
704 | .It Ic hmac-md5 | |
705 | .El | |
706 | .Ss Supported Replay Detection Mechanisms | |
707 | If none specified, | |
708 | .Ic monotonic | |
709 | is the default. | |
cf0840ef RM |
710 | If this is changed from what was previously used, |
711 | or the means of calculating or storing it is broken then the DHCP server | |
712 | will probably have to have its notion of the clients Replay Detection Value | |
713 | reset. | |
c73ed171 | 714 | .Bl -tag -width -indent |
cf0840ef RM |
715 | .It Ic monocounter |
716 | Read the number in the file | |
717 | .Pa @DBDIR@/dhcpcd-rdm.monotonic | |
718 | and add one to it. | |
719 | .It Ic monotime | |
720 | Create a NTP timestamp from the system time. | |
c73ed171 | 721 | .It Ic monotonic |
cf0840ef RM |
722 | Same as |
723 | .Ic monotime . | |
c73ed171 | 724 | .El |
ba9dfb7a | 725 | .Sh SEE ALSO |
0b4a1931 | 726 | .Xr fnmatch 3 , |
065125d4 | 727 | .Xr if_nametoindex 3 , |
0b4a1931 RM |
728 | .Xr dhcpcd 8 , |
729 | .Xr dhcpcd-run-hooks 8 | |
ba9dfb7a | 730 | .Sh AUTHORS |
2cfe8d07 | 731 | .An Roy Marples Aq Mt roy@marples.name |
ba9dfb7a | 732 | .Sh BUGS |
ebc9d360 | 733 | When configuring DHCPv6 you can only select one IA type. |
4d88e2c9 RM |
734 | I can't think of a use case where you would want different types, |
735 | so if you have one then please bring it up for discussion on the | |
736 | .Aq Mt dhcpcd-discuss@marples.name | |
737 | mailing list. | |
ebc9d360 | 738 | .Pp |
fd73ceb1 RM |
739 | Please report them to |
740 | .Lk http://roy.marples.name/projects/dhcpcd |