]>
Commit | Line | Data |
---|---|---|
f9584c95 | 1 | .\" Copyright (c) 2006-2015 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 | .\" | |
fda2c663 | 25 | .Dd January 29, 2016 |
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. | |
0dc49454 | 74 | See the Supported Authentication Protocols section. |
c73ed171 RM |
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. | |
0dc49454 RM |
87 | For the token protocol, |
88 | .Ar secretid | |
89 | needs to be 0 and | |
90 | .Ar realm | |
91 | needs to be "". | |
92 | If | |
93 | .Nm dhcpcd | |
94 | has the error | |
95 | .D1 dhcp_auth_encode: Invalid argument | |
96 | then it means that | |
97 | .Nm dhcpcd | |
98 | could not find the correct authentication token in your configuration. | |
bac03ede RM |
99 | .It Ic background |
100 | Background immediately. | |
101 | This is useful for startup scripts which don't disable link messages for | |
102 | carrier status. | |
6f767217 | 103 | .It Ic blacklist Ar address Ns Op /cidr |
ce6b39df | 104 | Ignores all packets from |
6f767217 | 105 | .Ar address Ns Op /cidr . |
bf80d526 RM |
106 | .It Ic whitelist Ar address Ns Op /cidr |
107 | Only accept packets from | |
108 | .Ar address Ns Op /cidr . | |
109 | .Ic blacklist | |
110 | is ignored if | |
111 | .Ic whitelist | |
112 | is set. | |
8f924434 RM |
113 | .It Ic bootp |
114 | Be a BOOTP client. | |
115 | Basically, this just doesn't send a DHCP Message Type option and will only | |
116 | interact with a BOOTP server. | |
117 | All other DHCP options still work. | |
900b3da4 RM |
118 | .It Ic broadcast |
119 | Instructs the DHCP server to broadcast replies back to the client. | |
120 | Normally this is only set for non Ethernet interfaces, | |
121 | such as FireWire and InfiniBand. | |
122 | In most cases, | |
123 | .Nm dhcpcd | |
124 | will set this automatically. | |
a93e79c6 RM |
125 | .It Ic controlgroup Ar group |
126 | Sets the group ownership of | |
127 | .Pa @RUNDIR@/dhcpcd.sock | |
128 | so that users other than root can connect to | |
129 | .Nm dhcpcd . | |
a3099289 RM |
130 | .It Ic debug |
131 | Echo debug messages to the stderr and syslog. | |
413652c1 RM |
132 | .It Ic dev Ar value |
133 | Load the | |
134 | .Ar value | |
135 | .Pa /dev | |
136 | management module. | |
137 | .Nm dhcpcd | |
138 | will load the first one found to work, if any. | |
6bfd88f1 RM |
139 | .It Ic env Ar value |
140 | Push | |
141 | .Ar value | |
142 | to the environment for use in | |
143 | .Xr dhcpcd-run-hooks 8 . | |
144 | For example, you can force the hostname hook to always set the hostname with | |
145 | .Ic env | |
146 | .Va force_hostname=YES . | |
bbd250b4 RM |
147 | Or set which driver |
148 | .Xr wpa_supplicant 8 | |
149 | should use with | |
150 | .Ic env | |
151 | .Va wpa_supplicant_driver=nl80211 | |
77961e7b RM |
152 | .Pp |
153 | If the hostname is set, will be will set to the FQDN if possible as per | |
154 | RFC 4702 section 3.1. | |
155 | If the FQDN option is missing, | |
156 | .Nm dhcpcd | |
157 | will still try and set a FQDN from the hostname and domain options for | |
158 | consistency. | |
159 | To override this, set | |
160 | .Ic env | |
161 | .Va hostname_fqdn=[YES|NO|SERVER] . | |
162 | A value of server means just what the server says, don't manipulate it. | |
163 | This could lead to an inconsistent hostname on a DHCPv4 and DHCPv6 network | |
164 | where the DHCPv4 hostname is short and the DHCPv6 has an FQDN. | |
165 | DHCPv6 has no hostname option. | |
d2616b08 | 166 | .It Ic clientid Ar string |
c989b023 RM |
167 | Send the |
168 | .Ar clientid . | |
d2616b08 | 169 | If the string is of the format 01:02:03 then it is encoded as hex. |
3faba9e6 RM |
170 | For interfaces whose hardware address is longer than 8 bytes, or if the |
171 | .Ar clientid | |
172 | is an empty string then | |
173 | .Nm dhcpcd | |
174 | sends a default | |
175 | .Ar clientid | |
176 | of the hardware family and the hardware address. | |
d2616b08 RM |
177 | .It Ic duid |
178 | Generate an | |
179 | .Rs | |
180 | .%T "RFC 4361" | |
181 | .Re | |
ebc9d360 | 182 | compliant DHCP Unique Identifier. |
7e068c85 RM |
183 | If persistent storage is available then a DUID-LLT (link local address + time) |
184 | is generated, otherwise DUID-LL is generated (link local address). | |
ebc9d360 RM |
185 | This, plus the IAID will be used as the |
186 | .Ic clientid . | |
7e068c85 | 187 | The DUID-LLT generated will be held in |
d2616b08 RM |
188 | .Pa @SYSCONFDIR@/dhcpcd.duid |
189 | and should not be copied to other hosts. | |
ebc9d360 RM |
190 | .It Ic iaid Ar iaid |
191 | Set the Interface Association Identifier to | |
192 | .Ar iaid . | |
9ff636a5 RM |
193 | This option must be used in an |
194 | .Ic interface | |
195 | block. | |
6f66c6c9 RM |
196 | This defaults to the last 4 bytes of the hardware address assigned to the |
197 | interface. | |
198 | Each instance of this should be unique within the scope of the client and | |
199 | .Nm dhcpcd | |
200 | warns if a conflict is detected. | |
201 | If there is a conflict, it is only a problem if the conflicted IAIDs are | |
202 | used on the same network. | |
94bec972 RM |
203 | .It Ic dhcp |
204 | Enable DHCP on the interface, on by default. | |
205 | .It Ic dhcp6 | |
206 | Enable DHCPv6 on the interface, on by default. | |
207 | .It Ic ipv4 | |
208 | Enable IPv4 on the interface, on by default. | |
209 | .It Ic ipv6 | |
210 | Enable IPv6 on the interface, on by default. | |
15fc1181 RM |
211 | .It Ic persistent |
212 | .Nm dhcpcd | |
213 | normally de-configures the interface and configuration when it exits. | |
214 | Sometimes, this isn't desirable if, for example, you have root mounted over | |
a544b76a RM |
215 | NFS or SSH clients connect to this host and they need to be notified of |
216 | the host shutting down. | |
15fc1181 | 217 | You can use this option to stop this from happening. |
ff021b0b RM |
218 | .It Ic fallback Ar profile |
219 | Fallback to using this profile if DHCP fails. | |
220 | This allows you to configure a static profile instead of using ZeroConf. | |
ba9dfb7a | 221 | .It Ic hostname Ar name |
35d02ae6 | 222 | Sends |
ff021b0b | 223 | .Ar hostname |
35d02ae6 RM |
224 | to the DHCP server so it can be registered in DNS. |
225 | If | |
35ff0dbb | 226 | .Ar hostname |
35d02ae6 RM |
227 | is an empty string then the current system hostname is sent. |
228 | If | |
229 | .Ar hostname | |
230 | is a FQDN (ie, contains a .) then it will be encoded as such. | |
d6a18654 RM |
231 | .It Ic hostname_short |
232 | Sends the short hostname to the DHCP server instead of the FQDN. | |
233 | This is useful because DHCP servers will not register the FQDN in their | |
234 | DNS if the domain part does not match theirs. | |
77961e7b RM |
235 | .Pp |
236 | Also, see the | |
237 | .Ic env | |
238 | option above to control how the hostname is set on the host. | |
8fe4bf14 | 239 | .It Ic ia_na Op Ar iaid Op / address |
00ababe4 RM |
240 | Request a DHCPv6 Normal Address for |
241 | .Ar iaid . | |
00ababe4 | 242 | .Ar iaid |
ebc9d360 RM |
243 | defaults to the |
244 | .Ic iaid | |
245 | option as described above. | |
246 | You can request more than one ia_na by specifying a unique | |
247 | .Ar iaid | |
248 | for each one. | |
22ea2b0d | 249 | .It Ic ia_ta Op Ar iaid |
00ababe4 RM |
250 | Request a DHCPv6 Temporary Address for |
251 | .Ar iaid . | |
ebc9d360 RM |
252 | You can request more than one ia_ta by specifying a unique |
253 | .Ar iaid | |
254 | for each one. | |
fda2c663 | 255 | .It Ic ia_pd Op Ar iaid Oo / Ar prefix / Ar prefix_len Oc Op Ar interface Op / Ar sla_id Op / Ar prefix_len Op / Ar suffix |
00ababe4 RM |
256 | Request a DHCPv6 Delegated Prefix for |
257 | .Ar iaid . | |
9ff636a5 RM |
258 | This option must be used in an |
259 | .Ic interface | |
260 | block. | |
94a79cea RM |
261 | Unless a |
262 | .Ar sla_id | |
263 | of 0 is assigned, a reject route is installed for the Delegated Prefix to | |
264 | stop unallocated addresses being resolved upstream. | |
b9beb41b RM |
265 | This reject route is in essence SLA 0, thus you need space within the prefix |
266 | to assign a SLA per interface. | |
22ea2b0d RM |
267 | If no |
268 | .Ar interface | |
94a79cea | 269 | is given then we will assign a prefix to every other interface with a |
22ea2b0d | 270 | .Ar sla_id |
94a79cea | 271 | equivalent to the interface index assigned by the OS. |
22ea2b0d | 272 | Otherwise addresses are only assigned for each |
00ababe4 RM |
273 | .Ar interface |
274 | and | |
9ff636a5 | 275 | .Ar sla_id . |
fda2c663 RM |
276 | Each assigned address will have a |
277 | .Ar suffix , | |
278 | defaulting to 1. | |
12c77e75 RM |
279 | You cannot assign a prefix to the requesting interface unless the |
280 | DHCPv6 server supports | |
281 | .Li RFC6603 | |
282 | Prefix Exclude Option. | |
2fae05d0 RM |
283 | .Nm dhcpcd |
284 | has to be running for all the interfaces it is delegating to. | |
00ababe4 | 285 | A default |
367f7b11 | 286 | .Ar prefix_len |
94a79cea RM |
287 | of 64 is assumed, unless the maximum |
288 | .Ar sla_id | |
289 | does not fit. | |
290 | In this case | |
291 | .Ar prefix_len | |
b2feeb9e | 292 | is increased to the highest multiple of 8 that can accommodate the |
94a79cea | 293 | .Ar sla_id . |
367f7b11 RM |
294 | .Ar sla_id |
295 | is an integer and is added to the prefix which must fit inside | |
296 | .Ar prefix_len | |
297 | less the length of the delegated prefix. | |
94a79cea | 298 | .Ar sla_id can be 0 only if the Delegated Prefix is assigned to one interface. |
22ea2b0d RM |
299 | You can specify multiple |
300 | .Ar interface / | |
301 | .Ar sla_id / | |
302 | .Ar prefix_len | |
303 | per | |
304 | .Ic ia_pd , | |
305 | space separated. | |
9be26bc3 | 306 | IPv6RS should be disabled globally when requesting a Prefix Delegation. |
00ababe4 | 307 | .Pp |
9be26bc3 RM |
308 | In the following example eth0 is the externally facing interface to be |
309 | configured for both IPv4 and IPv6. | |
310 | The DHCPv4 server will provide us with an IPv4 address and a default route. | |
311 | The DHCPv6 server is going to provide us with an IPv6 address, a default | |
312 | route and a /64 subnet to be delegated to the internal interface. | |
313 | The eth1 interface will be automatically configured | |
314 | for IPv6 using the first address (::1) from the delegated prefix. | |
b9beb41b | 315 | A second prefix is requested and assigned to two other interfaces. |
9be26bc3 | 316 | .Xr rtadvd 8 |
b9beb41b RM |
317 | can be used with an empty configuration file on eth1, eth2 and eth3, |
318 | to provide automatic | |
9be26bc3 | 319 | IPv6 address configuration for the internal network. |
7e609902 | 320 | .Bd -literal |
b9beb41b RM |
321 | noipv6rs # disable routing solicitation |
322 | denyinterfaces eth2 # Don't touch eth2 at all | |
9be26bc3 | 323 | interface eth0 |
b9beb41b RM |
324 | ipv6rs # enable routing solicitation get the |
325 | # default IPv6 route | |
326 | ia_na 1 # request an IPv6 address | |
327 | ia_pd 2 eth1/0 # request a PD and assign it to eth1 | |
328 | ia_pd 3 eth2/1 eth3/2 # req a PD and assign it to eth2 and eth3 | |
329 | # we cannot use SLA 0 above because we are | |
330 | # assinging the PD to more than one interface | |
9be26bc3 | 331 | .Ed |
d7555c12 RM |
332 | .It Ic ipv4only |
333 | Only configure IPv4. | |
334 | .It Ic ipv6only | |
335 | Only confgiure IPv6. | |
cc3c3560 RM |
336 | .It Ic fqdn Op disable | ptr | both |
337 | ptr just asks the DHCP server to update the PTR | |
35ff0dbb | 338 | record of the host in DNS whereas both also updates the A record. |
cc3c3560 RM |
339 | disable will disable the FQDN option. |
340 | The default is both. | |
1b3bc477 RM |
341 | .Nm dhcpcd |
342 | itself never does any DNS updates. | |
e837a670 RM |
343 | .Nm dhcpcd |
344 | encodes the FQDN hostname as specified in | |
345 | .Li RFC1035 . | |
3adc5520 | 346 | .It Ic interface Ar interface |
012fd5d3 RM |
347 | Subsequent options are only parsed for this |
348 | .Ar interface . | |
62f12387 RM |
349 | .It Ic ipv6ra_autoconf |
350 | Generate SLAAC addresses for each Prefix advertised by a | |
351 | Router Advertisement message with the Auto flag set. | |
352 | On by default. | |
353 | .It Ic ipv6ra_noautoconf | |
354 | Disables the above option. | |
61dd6cf9 RM |
355 | .It Ic ipv6ra_fork |
356 | By default, when | |
357 | .Nm dhcpcd | |
358 | receives an IPv6 RA, | |
359 | .Nm dhcpcd | |
360 | will only fork to the background if the RA contains at least one unexpired | |
e2c4a256 | 361 | RDNSS option and a valid prefix or no DHCPv6 instruction. |
61dd6cf9 RM |
362 | Set this option so to make |
363 | .Nm dhcpcd | |
364 | always fork on an RA. | |
d7555c12 | 365 | .It Ic ipv6ra_own |
eebe9a18 RM |
366 | Disables kernel IPv6 Router Advertisment processing so dhcpcd can manage |
367 | addresses and routes. | |
d7555c12 | 368 | .It Ic ipv6ra_own_default |
eebe9a18 RM |
369 | Each time dhcpcd receives an IPv6 Router Adveristment, dhcpcd will manage |
370 | the default route only. | |
371 | This allows dhcpcd to prefer an interface for outbound traffic based on metric | |
372 | and/or user selection rather than the kernel. | |
4f0240bf | 373 | .It Ic ipv6ra_accept_nopublic |
a8e5259b | 374 | Some IPv6 routers advertise themselves as a default router without any |
4f0240bf | 375 | public prefixes or managed addresses. |
3823dbf5 | 376 | Generally, this is incorrect behaviour and |
a8e5259b | 377 | .Nm dhcpcd |
3823dbf5 | 378 | will ignore the advertisement unless this option is turned on. |
d7555c12 | 379 | .It Ic ipv6rs |
eebe9a18 RM |
380 | Enables IPv6 Router Advertisment solicitation. |
381 | This is on by default, but is documented here in the case where it is disabled | |
382 | globally but needs to be enabled for one interface. | |
ba9dfb7a RM |
383 | .It Ic leasetime Ar seconds |
384 | Request a leasetime of | |
385 | .Ar seconds . | |
069e2f28 RM |
386 | .It Ic logfile Ar logfile |
387 | Writes to the specified | |
388 | .Ar logfile | |
389 | rather than | |
390 | .Xr syslog 3 . | |
391 | The | |
392 | .Ar logfile | |
cf2dcc16 | 393 | is truncated when opened and is reopened when |
069e2f28 RM |
394 | .Nm dhcpcd |
395 | receives the | |
396 | .Dv SIGUSR2 | |
397 | signal. | |
065125d4 RM |
398 | .It Ic metric Ar metric |
399 | Metrics are used to prefer an interface over another one, lowest wins. | |
400 | .Nm dhcpcd | |
87b266d2 | 401 | will supply a default metric of 200 + |
065125d4 RM |
402 | .Xr if_nametoindex 3 . |
403 | An extra 100 will be added for wireless interfaces. | |
7dab081f | 404 | .It Ic noalias |
dffe72f6 RM |
405 | Any pre-existing IPv4 addresses existing address will be removed from the |
406 | interface when adding a new IPv4 address. | |
ba9dfb7a | 407 | .It Ic noarp |
cf42802e RM |
408 | Don't send any ARP requests. |
409 | This also disables IPv4LL. | |
c73ed171 RM |
410 | .It Ic noauthrequired |
411 | Don't require authentication even though we requested it. | |
d672ebda | 412 | Also allows FORCERENEW and RECONFIGURE messages without authentication. |
f572315d RM |
413 | .It Ic nodelay |
414 | Don't delay for an initial randomised time when starting protocols. | |
413652c1 RM |
415 | .It Ic nodev |
416 | Don't load | |
417 | .Pa /dev | |
418 | management modules. | |
d4154ba7 RM |
419 | .It Ic nodhcp |
420 | Don't start DHCP or listen to DHCP messages. | |
421 | This is only useful when allowing IPv4LL. | |
422 | .It Ic nodhcp6 | |
423 | Don't start DHCPv6 or listen to DHCPv6 messages. | |
424 | Normally DHCPv6 is started by a RA instruction or configuration. | |
ba9dfb7a RM |
425 | .It Ic nogateway |
426 | Don't install any default routes. | |
ee56a47d RM |
427 | .It Ic gateway |
428 | Install a default route if available (default). | |
37156a6b RM |
429 | .It Ic nohook Ar script |
430 | Don't run this hook script. | |
8276da82 RM |
431 | Matches full name, or prefixed with 2 numbers optionally ending with |
432 | .Pa .sh . | |
fc7ee231 RM |
433 | .Pp |
434 | So to stop | |
435 | .Nm dhcpcd | |
ca6cdf58 RM |
436 | from touching your DNS settings or starting wpa_supplicant you would do:- |
437 | .D1 nohook resolv.conf, wpa_supplicant | |
bb8051bf RM |
438 | .It Ic noipv4 |
439 | Don't attempt to configure an IPv4 address. | |
ba9dfb7a RM |
440 | .It Ic noipv4ll |
441 | Don't attempt to obtain an IPv4LL address if we failed to get one via DHCP. | |
442 | See | |
443 | .Rs | |
444 | .%T "RFC 3927" | |
445 | .Re | |
bb8051bf RM |
446 | .It Ic noipv6 |
447 | Don't attmept to configure an IPv6 address. | |
91cd7324 | 448 | .It Ic noipv6rs |
4c6a8bec | 449 | Disable solicitation and receipt of IPv6 Router Advertisements. |
a26af491 RM |
450 | .It Ic nolink |
451 | Don't receive link messages about carrier status. | |
452 | You should only set this for buggy interface drivers. | |
2862d340 RM |
453 | .It Ic noup |
454 | Don't bring the interface up when in master mode. | |
455 | If | |
456 | .Nm | |
457 | cannot determine the carrier state, | |
458 | .Nm | |
459 | will enter a tight polling loop until the interface is marked up and running | |
460 | or a valid carrier state is reported. | |
cc45fbd7 | 461 | .It Ic option Ar option |
d2616b08 | 462 | Requests the |
cc45fbd7 | 463 | .Ar option |
cf42802e RM |
464 | from the server. |
465 | It can be a variable to be used in | |
ee4e620a | 466 | .Xr dhcpcd-run-hooks 8 |
cf42802e | 467 | or the numerical value. |
b8ffa3cd RM |
468 | You can specify more |
469 | .Ar option Ns s | |
470 | separated by commas, spaces or more | |
471 | .Ic option | |
472 | lines. | |
2be15e88 | 473 | .Ar option |
b8ffa3cd RM |
474 | Prepend dhcp6_ to |
475 | .Ar option | |
476 | to request a DHCPv6 option. | |
daa70372 RM |
477 | If no DHCPv6 options are configured, |
478 | then DHCPv4 options are mapped to equivalent DHCPv6 options. | |
2be15e88 RM |
479 | .Pp |
480 | Prepend nd_ to | |
481 | .Ar option | |
482 | to handle ND options, but this only works for the | |
483 | .Ic nooption , | |
484 | .Ic reject | |
485 | and | |
486 | .Ic require | |
487 | options. | |
2063c6f9 | 488 | .It Ic nooption Ar option |
2be15e88 RM |
489 | Remove the option from the message before it's processed. |
490 | .It Ic require Ar option | |
491 | Requires the | |
492 | .Ar option | |
493 | to be present in all messages, otherwise the message is ignored. | |
494 | To enforce that | |
495 | .Nm dhcpcd | |
496 | only responds to DHCP servers and not BOOTP servers, you can | |
497 | .Ic require | |
498 | .Ar dhcp_message_type . | |
499 | This isn't an exact science though because a BOOTP server can send DHCP like | |
500 | options. | |
501 | .It Ic reject Ar option | |
502 | Reject a message that contains the | |
503 | .Ar option . | |
504 | This is useful when you cannot use | |
505 | .Ic require | |
506 | to select / de-select BOOTP messages. | |
1abffd5b RM |
507 | .It Ic destination Ar option |
508 | If | |
509 | .Nm | |
510 | detects an address added to a point to point interface (PPP, TUN, etc) then | |
511 | it will set the listed DHCP options to the destination address of the | |
512 | interface. | |
6f767217 RM |
513 | .It Ic profile Ar name |
514 | Subsequent options are only parsed for this profile | |
515 | .Ar name . | |
1abffd5b | 516 | .It Ic quiet |
87b266d2 | 517 | Suppress any dhcpcd output to the console, except for errors. |
1abffd5b | 518 | .It Ic reboot Ar seconds |
a2a9a498 RM |
519 | Allow |
520 | .Ar reboot | |
1d5d236a RM |
521 | seconds before moving to the DISCOVER phase if we have an old lease to use |
522 | and moving from DISCOVER to IPv4LL if no reply. | |
a628f34d | 523 | The default is 5 seconds. |
901b42de | 524 | A setting of 0 seconds causes |
a2a9a498 | 525 | .Nm dhcpcd |
901b42de RM |
526 | to skip the REBOOT phase and go straight into DISCOVER. |
527 | This is desirable for mobile users because if you change from network A to | |
528 | network B and they use the same subnet and the address from network A isn't | |
529 | in use on network B, then the DHCP server will remain silent even if authorative | |
530 | which means | |
531 | .Nm dhcpcd | |
532 | will timeout before moving back to the DISCOVER phase. | |
2662d519 RM |
533 | .It Ic release |
534 | .Nm dhcpcd | |
535 | will release the lease prior to stopping the interface. | |
0aeb350c RM |
536 | .It Ic script Ar script |
537 | Use | |
538 | .Ar script | |
539 | instead of the default | |
540 | .Pa @SCRIPT@ . | |
c53cf4ef RM |
541 | .It Ic ssid Ar ssid |
542 | Subsequent options are only parsed for this wireless | |
543 | .Ar ssid . | |
1aeaf0e7 RM |
544 | .It Ic slaac Op Ar hwaddr | Ar private |
545 | Selects the interface identifier used for SLAAC generated IPv6 addresses. | |
eec0cf35 RM |
546 | If |
547 | .Ar private | |
548 | is used, a RFC7217 address is generated. | |
91a44b91 RM |
549 | .It Ic static Ar value |
550 | Configures a static | |
551 | .Ar value . | |
552 | If you set | |
553 | .Ic ip_address | |
554 | then | |
555 | .Nm dhcpcd | |
556 | will not attempt to obtain a lease and just use the value for the address with | |
557 | an infinite lease time. | |
558 | .Pp | |
559 | Here is an example which configures a static address, routes and dns. | |
560 | .D1 interface eth0 | |
561 | .D1 static ip_address=192.168.0.10/24 | |
562 | .D1 static routers=192.168.0.1 | |
563 | .D1 static domain_name_servers=192.168.0.1 | |
1abffd5b RM |
564 | .Pp |
565 | Here is an example for PPP which gives the destination a default route. | |
566 | It uses the special destination keyword to insert the destination address | |
567 | into the value. | |
568 | .D1 interface ppp0 | |
569 | .D1 static ip_address= | |
570 | .D1 destination routers | |
d2616b08 | 571 | .It Ic timeout Ar seconds |
b58bf81f RM |
572 | Timeout after |
573 | .Ar seconds , | |
574 | instead of the default 30. | |
d93d7adc RM |
575 | A setting of 0 |
576 | .Ar seconds | |
577 | causes | |
578 | .Nm dhcpcd | |
579 | to wait forever to get a lease. | |
b58bf81f RM |
580 | If |
581 | .Nm dhcpcd | |
582 | is working on a single interface then | |
583 | .Nm dhcpcd | |
584 | will exit when a timeout occurs, otherwise | |
585 | .Nm dhcpcd | |
586 | will fork into the background. | |
587 | If using IPv4LL then | |
588 | .Nm dhcpcd | |
589 | start the IPv4LL process after the timeout and then wait a little longer | |
590 | before really timing out. | |
d2616b08 | 591 | .It Ic userclass Ar string |
1300150e | 592 | Tag the DHCPv4 messages with the userclass. |
cf42802e | 593 | You can specify more than one. |
bac03ede | 594 | .It Ic vendor Ar code , Ns Ar value |
87b266d2 | 595 | Add an encapsulated vendor option. |
757520c5 RM |
596 | .Ar code |
597 | should be between 1 and 254 inclusive. | |
95d6dcfa RM |
598 | To add a raw vendor string, omit |
599 | .Ar code | |
600 | but keep the comma. | |
757520c5 RM |
601 | Examples. |
602 | .Pp | |
603 | Set the vendor option 01 with an IP address. | |
604 | .D1 vendor 01,192.168.0.2 | |
605 | Set the vendor option 02 with a hex code. | |
606 | .D1 vendor 02,01:02:03:04:05 | |
607 | Set the vendor option 03 with an IP address as a string. | |
608 | .D1 vendor 03,\e"192.168.0.2\e" | |
87b266d2 | 609 | Set un-encapsulated vendor option to hello world. |
9cb58952 | 610 | .D1 vendor ,"hello world" |
bac03ede | 611 | .It Ic vendorclassid Ar string |
1300150e RM |
612 | Set the DHCP Vendor Class. |
613 | DHCPv6 has it's own option as shown below. | |
eebe9a18 RM |
614 | The default is |
615 | dhcpcd-<version>:<os>:<machine>:<platform>. | |
616 | For example | |
617 | .D1 dhcpcd-5.5.6:NetBSD-6.99.5:i386:i386 | |
bac03ede | 618 | If not set then none is sent. |
eebe9a18 RM |
619 | Some badly configured DHCP servers reject unknown vendorclassids. |
620 | To work around it, try and impersonate Windows by using the MSFT vendorclassid. | |
7a911e57 | 621 | .It Ic vendclass Ar en Ar data |
1300150e | 622 | Add the DHCPv6 Vendor Indetifying Vendor Class with the IANA assigned Enterprise |
7a911e57 RM |
623 | Number |
624 | .Ar en | |
625 | with the | |
626 | .Ar data . | |
627 | This option can be set more than once to add more data, but the behaviour, | |
628 | as per | |
629 | .Xr RFC 3925 | |
630 | is undefined if the Enterprise Number differs. | |
7013b073 | 631 | .It Ic waitip Op 4 | 6 |
2a07a2af | 632 | Wait for an address to be assigned before forking to the background. |
7013b073 RM |
633 | 4 means wait for an IPv4 address to be assigned. |
634 | 6 means wait for an IPv6 address to be assigned. | |
8b7499fd RM |
635 | If no argument is given, |
636 | .Nm | |
637 | will wait for any address protocol to be assigned. | |
638 | It is possible to wait for more than one address protocol and | |
639 | .Nm | |
640 | will only fork to the background when all waiting conditions are satisfied. | |
4242c9b3 RM |
641 | .It Ic xidhwaddr |
642 | Use the last four bytes of the hardware address as the DHCP xid instead | |
643 | of a randomly generated number. | |
eaa90296 | 644 | .El |
8e7d8c37 | 645 | .Ss Defining new options |
2be15e88 | 646 | DHCP, ND and DHCPv6 allow for the use of custom options. |
8e7d8c37 | 647 | Each option needs to be started with the |
2be15e88 RM |
648 | .Ic define , |
649 | .If definend | |
8e7d8c37 RM |
650 | or |
651 | .Ic define6 | |
652 | directive. | |
653 | This can optionally be followed by both | |
654 | .Ic embed | |
655 | or | |
656 | .Ic encap | |
657 | options. | |
658 | Both can be specified more than once and | |
659 | .Ic embed | |
660 | must come before | |
661 | .Ic encap . | |
662 | .Bl -tag -width indent | |
663 | .It Ic define Ar code Ar type Ar variable | |
664 | Defines the DHCP option | |
665 | .Ar code | |
666 | of | |
667 | .Ar type | |
668 | with a name of | |
669 | .Ar variable | |
670 | exported to | |
671 | .Xr dhcpcd-run-hooks 8 . | |
2be15e88 RM |
672 | .It Ic definend Ar code Ar type Ar variable |
673 | Defines the ND option | |
674 | .Ar code | |
675 | of | |
676 | .Ar type | |
677 | with a name of | |
678 | .Ar variable | |
679 | exported to | |
680 | .Xr dhcpcd-run-hooks 8 , | |
681 | with a prefix of | |
682 | .Va _nd . | |
8e7d8c37 RM |
683 | .It Ic define6 Ar code Ar type Ar variable |
684 | Defines the DHCPv6 option | |
685 | .Ar code | |
686 | of | |
687 | .Ar type | |
688 | with a name of | |
689 | .Ar variable | |
690 | exported to | |
691 | .Xr dhcpcd-run-hooks 8 , | |
692 | with a prefix of | |
693 | .Va _dhcp6 . | |
7a911e57 RM |
694 | .It Ic vendopt Ar code Ar type Ar variable |
695 | Defines the Vendor-Identifying Vendor Options. | |
696 | The | |
697 | .Ar code | |
698 | is the IANA Enterprise Number which will unqiuely describe the encapsulated | |
699 | options. | |
700 | .Ar type | |
701 | is normally | |
702 | .Ar encap . | |
703 | .Ar variable | |
704 | names the Vendor option to be exported. | |
8e7d8c37 RM |
705 | .It Ic embed Ar type Ar variable |
706 | Defines an embedded variable within the defined option. | |
707 | The length is determined by the | |
708 | .Ar type . | |
63bdd2c2 RM |
709 | If the |
710 | .Ar variable | |
711 | is not the same as defined in the parent option, | |
712 | it is prefixed with the parent | |
713 | .Ar variable | |
714 | first with an underscore. | |
cc71162d RM |
715 | If the |
716 | .Ar variable | |
717 | has the name of | |
718 | .Ar reserved | |
719 | then it is not processed. | |
8e7d8c37 RM |
720 | .It Ic encap Ar code Ar type Ar variable |
721 | Defines an encapsulated variable within the defined option. | |
722 | The length is determined by the | |
723 | .Ar type . | |
63bdd2c2 RM |
724 | If the |
725 | .Ar variable | |
726 | is not the same as defined in the parent option, | |
727 | it is prefixed with the parent | |
728 | .Ar variable | |
729 | first with an underscore. | |
730 | .El | |
731 | .Ss Type prefix | |
732 | These keywords come before the type itself, to describe it more fully. | |
733 | You can use more than one, but they must appear in the order listed below. | |
734 | .Bl -tag -width -indent | |
735 | .It Ic request | |
736 | Requests the option by default without having to be specified in user | |
737 | configuration | |
738 | .It Ic norequest | |
739 | This option cannot be requested, regardless of user configuration | |
ecdbb919 RM |
740 | .It Ic optional |
741 | This option is optional. | |
742 | Only makes sense for embedded options where like the client FQDN option where | |
743 | the FQDN string itself is optional. | |
03476881 RM |
744 | .It Ic index |
745 | The option can appear more than once and will be indexed. | |
63bdd2c2 | 746 | .It Ic array |
b2feeb9e | 747 | The option data is split into a space separated array, each element being |
63bdd2c2 | 748 | the same type. |
8e7d8c37 RM |
749 | .El |
750 | .Ss Types to define | |
b21cd906 RM |
751 | The type directly affects the length of data consumed inside the option. |
752 | Any remaining data is normally discarded. | |
753 | Lengths can be specified for string and binhex types, but this is generally | |
754 | with other data embedded afterwards in the same option. | |
8e7d8c37 RM |
755 | .Bl -tag -width indent |
756 | .It Ic ipaddress | |
cc71162d | 757 | An IPv4 address, 4 bytes. |
8e7d8c37 | 758 | .It Ic ip6address |
cc71162d | 759 | An IPv6 address, 16 bytes. |
b21cd906 | 760 | .It Ic string Op : Ic length |
8f008ca7 | 761 | A NVT ASCII string of printable characters. |
8e7d8c37 | 762 | .It Ic byte |
cc71162d RM |
763 | A byte. |
764 | .It Ic bitflags : Ic flags | |
765 | A byte represented as a string of flags, most significant bit first. | |
766 | For example, using ABCDEFGH then A would equal 10000000, B 01000000, | |
767 | C 00100000, etc. | |
768 | If the bit is not set, the flag is not printed. | |
769 | A flag of 0 is not printed even if the bit postition is set. | |
770 | This is to allow reservation of the first bits while assinging the last bits. | |
8e7d8c37 | 771 | .It Ic int16 |
cc71162d | 772 | A signed 16bit integer, 2 bytes. |
8e7d8c37 | 773 | .It Ic uint16 |
cc71162d | 774 | An unsigned 16bit integer, 2 bytes. |
8e7d8c37 | 775 | .It Ic int32 |
cc71162d | 776 | A signed 32bit integer, 4 bytes. |
8e7d8c37 | 777 | .It Ic uint32 |
cc71162d RM |
778 | An unsigned 32bit integer, 4 bytes. |
779 | .It Ic flag | |
780 | A fixed value (1) to indicate that the option is present, 0 bytes. | |
8e7d8c37 | 781 | .It Ic domain |
cc71162d | 782 | A RFC 3397 encoded string. |
8f008ca7 | 783 | .It Ic dname |
cc71162d | 784 | A RFC 1035 validated string. |
b21cd906 | 785 | .It Ic binhex Op : Ic length |
cc71162d | 786 | Binary data expressed as hexadecimal. |
8e7d8c37 | 787 | .It Ic embed |
cc71162d | 788 | Contains embedded options (implies encap as well). |
8e7d8c37 | 789 | .It Ic encap |
cc71162d | 790 | Contains encapsulated options (implies embed as well). |
03476881 | 791 | .It Ic option |
cc71162d | 792 | References an option from the global definition. |
8e7d8c37 RM |
793 | .El |
794 | .Ss Example definition | |
795 | .D1 # DHCP option 81, Fully Qualified Domain Name, RFC4702 | |
63bdd2c2 RM |
796 | .D1 define 81 embed fqdn |
797 | .D1 embed byte flags | |
798 | .D1 embed byte rcode1 | |
799 | .D1 embed byte rcode2 | |
8e7d8c37 RM |
800 | .D1 embed domain fqdn |
801 | .Pp | |
802 | .D1 # DHCP option 125, Vendor Specific Information Option, RFC3925 | |
63bdd2c2 RM |
803 | .D1 define 125 encap vsio |
804 | .D1 embed uint32 enterprise_number | |
8e7d8c37 | 805 | .D1 # Options defined for the enterprise number |
63bdd2c2 | 806 | .D1 encap 1 ipaddress ipaddress |
0dc49454 | 807 | .Ss Supported Authentication Protocols |
c73ed171 RM |
808 | .Bl -tag -width -indent |
809 | .It Ic token | |
0dc49454 | 810 | Sends and expects the token with the secretid 0 and realm of "" in each message. |
c73ed171 RM |
811 | .It Ic delayedrealm |
812 | Delayed Authentication. | |
813 | .Nm dhcpcd | |
814 | will send an authentication option with no key or MAC. | |
815 | The server will see this option, and select a key for | |
816 | .Nm , writing the | |
817 | .Ar realm | |
818 | and | |
819 | .Ar secretid | |
820 | in it. | |
821 | .Nm dhcpcd | |
822 | will then look for a non-expired token with a matching realm and secretid. | |
823 | This token is used to authenicate all other messages. | |
824 | .It Ic delayed | |
825 | Same as above, but without a realm. | |
826 | .El | |
0dc49454 | 827 | .Ss Supported Authentication Algorithms |
c73ed171 RM |
828 | If none specified, |
829 | .Ic hmac-md5 | |
830 | is the default. | |
831 | .Bl -tag -width -indent | |
832 | .It Ic hmac-md5 | |
833 | .El | |
834 | .Ss Supported Replay Detection Mechanisms | |
835 | If none specified, | |
836 | .Ic monotonic | |
837 | is the default. | |
cf0840ef RM |
838 | If this is changed from what was previously used, |
839 | or the means of calculating or storing it is broken then the DHCP server | |
840 | will probably have to have its notion of the clients Replay Detection Value | |
841 | reset. | |
c73ed171 | 842 | .Bl -tag -width -indent |
cf0840ef RM |
843 | .It Ic monocounter |
844 | Read the number in the file | |
845 | .Pa @DBDIR@/dhcpcd-rdm.monotonic | |
846 | and add one to it. | |
847 | .It Ic monotime | |
848 | Create a NTP timestamp from the system time. | |
c73ed171 | 849 | .It Ic monotonic |
cf0840ef RM |
850 | Same as |
851 | .Ic monotime . | |
c73ed171 | 852 | .El |
ba9dfb7a | 853 | .Sh SEE ALSO |
0b4a1931 | 854 | .Xr fnmatch 3 , |
065125d4 | 855 | .Xr if_nametoindex 3 , |
0b4a1931 RM |
856 | .Xr dhcpcd 8 , |
857 | .Xr dhcpcd-run-hooks 8 | |
ba9dfb7a | 858 | .Sh AUTHORS |
2cfe8d07 | 859 | .An Roy Marples Aq Mt roy@marples.name |
ba9dfb7a | 860 | .Sh BUGS |
fd73ceb1 RM |
861 | Please report them to |
862 | .Lk http://roy.marples.name/projects/dhcpcd |