]>
Commit | Line | Data |
---|---|---|
114167a2 YY |
1 | .\" SPDX-License-Identifier: BSD-2-Clause |
2 | .\" | |
a2566f54 | 3 | .\" Copyright (c) 2006-2020 Roy Marples |
ba9dfb7a RM |
4 | .\" All rights reserved |
5 | .\" | |
6 | .\" Redistribution and use in source and binary forms, with or without | |
7 | .\" modification, are permitted provided that the following conditions | |
8 | .\" are met: | |
9 | .\" 1. Redistributions of source code must retain the above copyright | |
10 | .\" notice, this list of conditions and the following disclaimer. | |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
12 | .\" notice, this list of conditions and the following disclaimer in the | |
13 | .\" documentation and/or other materials provided with the distribution. | |
14 | .\" | |
15 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | |
16 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
17 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
18 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | |
19 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
20 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
21 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
22 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
23 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
24 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
25 | .\" SUCH DAMAGE. | |
26 | .\" | |
a2566f54 | 27 | .Dd January 3, 2020 |
0b4a1931 | 28 | .Dt DHCPCD.CONF 5 |
918338f2 | 29 | .Os |
ba9dfb7a RM |
30 | .Sh NAME |
31 | .Nm dhcpcd.conf | |
443c8695 | 32 | .Nd dhcpcd configuration file |
ba9dfb7a RM |
33 | .Sh DESCRIPTION |
34 | Although | |
35 | .Nm dhcpcd | |
36 | can do everything from the command line, there are cases where it's just easier | |
cf42802e RM |
37 | to do it once in a configuration file. |
38 | Most of the options found in | |
ba9dfb7a | 39 | .Xr dhcpcd 8 |
cf42802e RM |
40 | can be used here. |
41 | The first word on the line is the option and the rest of the line is the value. | |
42 | Leading and trailing whitespace for the option and value are trimmed. | |
43 | You can escape characters in the value using the \\ character. | |
67f84564 RM |
44 | Comments can be prefixed with the # character. |
45 | String values should be quoted with the " character. | |
ba9dfb7a RM |
46 | .Pp |
47 | Here's a list of available options: | |
48 | .Bl -tag -width indent | |
ba97e494 RM |
49 | .It Ic allowinterfaces Ar pattern |
50 | When discovering interfaces, the interface name must match | |
51 | .Ar pattern | |
52 | which is a space or comma separated list of patterns passed to | |
53 | .Xr fnmatch 3 . | |
54 | If the same interface is matched in | |
55 | .Ic denyinterfaces | |
56 | then it is still denied. | |
57 | .It Ic denyinterfaces Ar pattern | |
58 | When discovering interfaces, the interface name must not match | |
59 | .Ar pattern | |
60 | which is a space or comma separated list of patterns passed to | |
61 | .Xr fnmatch 3 . | |
6f767217 RM |
62 | .It Ic arping Ar address Op address |
63 | .Nm dhcpcd | |
ff021b0b | 64 | will arping each address in order before attempting DHCP. |
6f767217 | 65 | If an address is found, we will select the replying hardware address as the |
569c0b11 | 66 | profile, otherwise the IP address. |
6f767217 RM |
67 | Example: |
68 | .Pp | |
69 | .D1 interface bge0 | |
70 | .D1 arping 192.168.0.1 | |
71 | .Pp | |
a6162a75 RM |
72 | .D1 # My specific 192.168.0.1 network |
73 | .D1 profile dd:ee:aa:dd:bb:ee | |
6f767217 | 74 | .D1 static ip_address=192.168.0.10/24 |
a6162a75 RM |
75 | .Pp |
76 | .D1 # A generic 192.168.0.1 network | |
77 | .D1 profile 192.168.0.1 | |
78 | .D1 static ip_address=192.168.0.98/24 | |
32945b61 | 79 | .It Ic authprotocol Ar protocol Op Ar algorithm Op Ar rdm |
c73ed171 | 80 | Authenticate DHCP messages. |
0dc49454 | 81 | See the Supported Authentication Protocols section. |
32945b61 RM |
82 | If |
83 | .Ar protocol | |
84 | is | |
85 | .Ar token | |
86 | then | |
87 | .Ar algorithm is | |
21932eab | 88 | snd_secretid/rcv_secretid so you can send and receive different tokens. |
c73ed171 RM |
89 | .It Ic authtoken Ar secretid Ar realm Ar expire Ar key |
90 | Define a shared key for use in authentication. | |
c07e0ab0 RM |
91 | .Ar realm |
92 | can be "" to for use with the | |
c73ed171 | 93 | .Ar delayed |
c07e0ab0 | 94 | protocol. |
c73ed171 RM |
95 | .Ar expire |
96 | is the date the token expires and should be formatted "yyy-mm-dd HH:MM". | |
97 | You can use the keyword | |
98 | .Ar forever | |
99 | or | |
100 | .Ar 0 | |
101 | which means the token never expires. | |
0dc49454 RM |
102 | For the token protocol, |
103 | .Ar secretid | |
104 | needs to be 0 and | |
105 | .Ar realm | |
106 | needs to be "". | |
107 | If | |
108 | .Nm dhcpcd | |
109 | has the error | |
110 | .D1 dhcp_auth_encode: Invalid argument | |
111 | then it means that | |
112 | .Nm dhcpcd | |
113 | could not find the correct authentication token in your configuration. | |
bac03ede | 114 | .It Ic background |
ef13f300 | 115 | Fork to the background immediately. |
bac03ede RM |
116 | This is useful for startup scripts which don't disable link messages for |
117 | carrier status. | |
6f767217 | 118 | .It Ic blacklist Ar address Ns Op /cidr |
ce6b39df | 119 | Ignores all packets from |
6f767217 | 120 | .Ar address Ns Op /cidr . |
bf80d526 RM |
121 | .It Ic whitelist Ar address Ns Op /cidr |
122 | Only accept packets from | |
123 | .Ar address Ns Op /cidr . | |
124 | .Ic blacklist | |
125 | is ignored if | |
126 | .Ic whitelist | |
127 | is set. | |
8f924434 RM |
128 | .It Ic bootp |
129 | Be a BOOTP client. | |
130 | Basically, this just doesn't send a DHCP Message Type option and will only | |
131 | interact with a BOOTP server. | |
132 | All other DHCP options still work. | |
900b3da4 RM |
133 | .It Ic broadcast |
134 | Instructs the DHCP server to broadcast replies back to the client. | |
569c0b11 | 135 | Normally this is only set for non-Ethernet interfaces, |
900b3da4 RM |
136 | such as FireWire and InfiniBand. |
137 | In most cases, | |
138 | .Nm dhcpcd | |
139 | will set this automatically. | |
a93e79c6 RM |
140 | .It Ic controlgroup Ar group |
141 | Sets the group ownership of | |
d5aadbad | 142 | .Pa @RUNDIR@/sock |
a93e79c6 RM |
143 | so that users other than root can connect to |
144 | .Nm dhcpcd . | |
a3099289 RM |
145 | .It Ic debug |
146 | Echo debug messages to the stderr and syslog. | |
413652c1 RM |
147 | .It Ic dev Ar value |
148 | Load the | |
149 | .Ar value | |
150 | .Pa /dev | |
151 | management module. | |
152 | .Nm dhcpcd | |
153 | will load the first one found to work, if any. | |
6bfd88f1 RM |
154 | .It Ic env Ar value |
155 | Push | |
156 | .Ar value | |
157 | to the environment for use in | |
158 | .Xr dhcpcd-run-hooks 8 . | |
159 | For example, you can force the hostname hook to always set the hostname with | |
160 | .Ic env | |
161 | .Va force_hostname=YES . | |
bbd250b4 RM |
162 | Or set which driver |
163 | .Xr wpa_supplicant 8 | |
164 | should use with | |
165 | .Ic env | |
166 | .Va wpa_supplicant_driver=nl80211 | |
77961e7b | 167 | .Pp |
c883b7b9 | 168 | If the hostname is set, it will be will set to the FQDN if possible as per |
569c0b11 | 169 | RFC 4702, section 3.1. |
77961e7b RM |
170 | If the FQDN option is missing, |
171 | .Nm dhcpcd | |
172 | will still try and set a FQDN from the hostname and domain options for | |
173 | consistency. | |
174 | To override this, set | |
175 | .Ic env | |
176 | .Va hostname_fqdn=[YES|NO|SERVER] . | |
569c0b11 DG |
177 | A value of |
178 | .Va SERVER | |
179 | means just what the server says, don't manipulate it. | |
77961e7b RM |
180 | This could lead to an inconsistent hostname on a DHCPv4 and DHCPv6 network |
181 | where the DHCPv4 hostname is short and the DHCPv6 has an FQDN. | |
182 | DHCPv6 has no hostname option. | |
d2616b08 | 183 | .It Ic clientid Ar string |
c989b023 RM |
184 | Send the |
185 | .Ar clientid . | |
d2616b08 | 186 | If the string is of the format 01:02:03 then it is encoded as hex. |
3faba9e6 RM |
187 | For interfaces whose hardware address is longer than 8 bytes, or if the |
188 | .Ar clientid | |
189 | is an empty string then | |
190 | .Nm dhcpcd | |
191 | sends a default | |
192 | .Ar clientid | |
193 | of the hardware family and the hardware address. | |
d2616b08 | 194 | .It Ic duid |
239b962f RM |
195 | Use a DHCP Unique Identifier. |
196 | If a system UUID is available, that will be used to create a DUID-UUID, | |
197 | otheriwse if persistent storage is available then a DUID-LLT | |
198 | (link local address + time) is generated, | |
199 | otherwise DUID-LL is generated (link local address). | |
ebc9d360 RM |
200 | This, plus the IAID will be used as the |
201 | .Ic clientid . | |
239b962f | 202 | The DUID generated will be held in |
9f51e22b | 203 | .Pa @DBDIR@/duid |
d2616b08 | 204 | and should not be copied to other hosts. |
239b962f | 205 | This file also takes precedence over the above rules. |
ebc9d360 RM |
206 | .It Ic iaid Ar iaid |
207 | Set the Interface Association Identifier to | |
208 | .Ar iaid . | |
9ff636a5 RM |
209 | This option must be used in an |
210 | .Ic interface | |
211 | block. | |
9db242be RM |
212 | This defaults to the VLANID (prefixed with 0xff) for the interface if set, |
213 | otherwise the last 4 bytes of the hardware address assigned to the | |
6f66c6c9 RM |
214 | interface. |
215 | Each instance of this should be unique within the scope of the client and | |
216 | .Nm dhcpcd | |
217 | warns if a conflict is detected. | |
218 | If there is a conflict, it is only a problem if the conflicted IAIDs are | |
219 | used on the same network. | |
94bec972 RM |
220 | .It Ic dhcp |
221 | Enable DHCP on the interface, on by default. | |
222 | .It Ic dhcp6 | |
223 | Enable DHCPv6 on the interface, on by default. | |
224 | .It Ic ipv4 | |
225 | Enable IPv4 on the interface, on by default. | |
226 | .It Ic ipv6 | |
227 | Enable IPv6 on the interface, on by default. | |
438cfdcd RM |
228 | .It Ic request Op Ar address |
229 | Request the | |
230 | .Ar address | |
231 | in the DHCP DISCOVER message. | |
232 | There is no guarantee this is the address the DHCP server will actually give. | |
233 | If no | |
234 | .Ar address | |
235 | is given then the first address currently assigned to the | |
236 | .Ar interface | |
237 | is used. | |
6dc3763d | 238 | .It Ic inform Op Ar address Ns Op Ar /cidr Ns Op Ar /broadcast_address |
438cfdcd RM |
239 | Behaves like |
240 | .Ic request | |
241 | as above, but sends a DHCP INFORM instead of DISCOVER/REQUEST. | |
242 | This does not get a lease as such, just notifies the DHCP server of the | |
243 | .Ar address | |
244 | in use. | |
245 | You should also include the optional | |
246 | .Ar cidr | |
247 | network number in case the address is not already configured on the interface. | |
248 | .Nm dhcpcd | |
249 | remains running and pretends it has an infinite lease. | |
250 | .Nm dhcpcd | |
251 | will not de-configure the interface when it exits. | |
252 | If | |
253 | .Nm dhcpcd | |
254 | fails to contact a DHCP server then it returns a failure instead of falling | |
255 | back on IPv4LL. | |
256 | .It Ic inform6 | |
257 | Performs a DHCPv6 Information Request. | |
258 | No address is requested or specified, but all other DHCPv6 options are allowed. | |
569c0b11 DG |
259 | This is normally performed automatically when an IPv6 Router Advertisement |
260 | indicates that the client should perform this operation. | |
438cfdcd RM |
261 | This option is only needed when |
262 | .Nm dhcpcd | |
569c0b11 | 263 | is not processing IPv6 RA messages and the need for a DHCPv6 Information Request |
438cfdcd | 264 | exists. |
15fc1181 RM |
265 | .It Ic persistent |
266 | .Nm dhcpcd | |
267 | normally de-configures the interface and configuration when it exits. | |
268 | Sometimes, this isn't desirable if, for example, you have root mounted over | |
a544b76a RM |
269 | NFS or SSH clients connect to this host and they need to be notified of |
270 | the host shutting down. | |
15fc1181 | 271 | You can use this option to stop this from happening. |
ff021b0b | 272 | .It Ic fallback Ar profile |
569c0b11 | 273 | Fall back to using this profile if DHCP fails. |
ff021b0b | 274 | This allows you to configure a static profile instead of using ZeroConf. |
ba9dfb7a | 275 | .It Ic hostname Ar name |
c883b7b9 RM |
276 | Sends the hostname |
277 | .Ar name | |
35d02ae6 RM |
278 | to the DHCP server so it can be registered in DNS. |
279 | If | |
c883b7b9 | 280 | .Ar name |
35d02ae6 RM |
281 | is an empty string then the current system hostname is sent. |
282 | If | |
c883b7b9 | 283 | .Ar name |
569c0b11 | 284 | is a FQDN (i.e., contains a .) then it will be encoded as such. |
d6a18654 RM |
285 | .It Ic hostname_short |
286 | Sends the short hostname to the DHCP server instead of the FQDN. | |
287 | This is useful because DHCP servers will not register the FQDN in their | |
288 | DNS if the domain part does not match theirs. | |
77961e7b RM |
289 | .Pp |
290 | Also, see the | |
291 | .Ic env | |
292 | option above to control how the hostname is set on the host. | |
8fe4bf14 | 293 | .It Ic ia_na Op Ar iaid Op / address |
00ababe4 RM |
294 | Request a DHCPv6 Normal Address for |
295 | .Ar iaid . | |
00ababe4 | 296 | .Ar iaid |
ebc9d360 RM |
297 | defaults to the |
298 | .Ic iaid | |
299 | option as described above. | |
300 | You can request more than one ia_na by specifying a unique | |
301 | .Ar iaid | |
302 | for each one. | |
22ea2b0d | 303 | .It Ic ia_ta Op Ar iaid |
00ababe4 RM |
304 | Request a DHCPv6 Temporary Address for |
305 | .Ar iaid . | |
ebc9d360 RM |
306 | You can request more than one ia_ta by specifying a unique |
307 | .Ar iaid | |
308 | for each one. | |
fda2c663 | 309 | .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 |
310 | Request a DHCPv6 Delegated Prefix for |
311 | .Ar iaid . | |
9ff636a5 RM |
312 | This option must be used in an |
313 | .Ic interface | |
314 | block. | |
94a79cea RM |
315 | Unless a |
316 | .Ar sla_id | |
e3883bfc RM |
317 | of 0 is assigned with the same resultant prefix length as the delegation, |
318 | a reject route is installed for the Delegated Prefix to | |
94a79cea | 319 | stop unallocated addresses being resolved upstream. |
22ea2b0d RM |
320 | If no |
321 | .Ar interface | |
94a79cea | 322 | is given then we will assign a prefix to every other interface with a |
22ea2b0d | 323 | .Ar sla_id |
94a79cea | 324 | equivalent to the interface index assigned by the OS. |
22ea2b0d | 325 | Otherwise addresses are only assigned for each |
00ababe4 RM |
326 | .Ar interface |
327 | and | |
9ff636a5 | 328 | .Ar sla_id . |
fda2c663 RM |
329 | Each assigned address will have a |
330 | .Ar suffix , | |
331 | defaulting to 1. | |
f9f15d95 RM |
332 | If the |
333 | .Ar suffix | |
569c0b11 | 334 | is 0 then a SLAAC address is assigned. |
12c77e75 | 335 | You cannot assign a prefix to the requesting interface unless the |
569c0b11 DG |
336 | DHCPv6 server supports the |
337 | .Li RFC 6603 | |
12c77e75 | 338 | Prefix Exclude Option. |
2fae05d0 RM |
339 | .Nm dhcpcd |
340 | has to be running for all the interfaces it is delegating to. | |
00ababe4 | 341 | A default |
367f7b11 | 342 | .Ar prefix_len |
94a79cea RM |
343 | of 64 is assumed, unless the maximum |
344 | .Ar sla_id | |
345 | does not fit. | |
346 | In this case | |
347 | .Ar prefix_len | |
b2feeb9e | 348 | is increased to the highest multiple of 8 that can accommodate the |
94a79cea | 349 | .Ar sla_id . |
367f7b11 | 350 | .Ar sla_id |
663d44bf RM |
351 | is an integer which must be unique inside the |
352 | .Ar iaid | |
353 | and is added to the prefix which must fit inside | |
367f7b11 RM |
354 | .Ar prefix_len |
355 | less the length of the delegated prefix. | |
22ea2b0d RM |
356 | You can specify multiple |
357 | .Ar interface / | |
358 | .Ar sla_id / | |
359 | .Ar prefix_len | |
360 | per | |
361 | .Ic ia_pd , | |
362 | space separated. | |
9be26bc3 | 363 | IPv6RS should be disabled globally when requesting a Prefix Delegation. |
00ababe4 | 364 | .Pp |
9be26bc3 RM |
365 | In the following example eth0 is the externally facing interface to be |
366 | configured for both IPv4 and IPv6. | |
367 | The DHCPv4 server will provide us with an IPv4 address and a default route. | |
368 | The DHCPv6 server is going to provide us with an IPv6 address, a default | |
369 | route and a /64 subnet to be delegated to the internal interface. | |
370 | The eth1 interface will be automatically configured | |
371 | for IPv6 using the first address (::1) from the delegated prefix. | |
b9beb41b | 372 | A second prefix is requested and assigned to two other interfaces. |
9be26bc3 | 373 | .Xr rtadvd 8 |
b9beb41b RM |
374 | can be used with an empty configuration file on eth1, eth2 and eth3, |
375 | to provide automatic | |
9be26bc3 | 376 | IPv6 address configuration for the internal network. |
7e609902 | 377 | .Bd -literal |
b9beb41b RM |
378 | noipv6rs # disable routing solicitation |
379 | denyinterfaces eth2 # Don't touch eth2 at all | |
9be26bc3 | 380 | interface eth0 |
ffb6d59b | 381 | ipv6rs # enable routing solicitation for eth0 |
b9beb41b RM |
382 | ia_na 1 # request an IPv6 address |
383 | ia_pd 2 eth1/0 # request a PD and assign it to eth1 | |
384 | ia_pd 3 eth2/1 eth3/2 # req a PD and assign it to eth2 and eth3 | |
9be26bc3 | 385 | .Ed |
d7555c12 RM |
386 | .It Ic ipv4only |
387 | Only configure IPv4. | |
388 | .It Ic ipv6only | |
925fc70e | 389 | Only configure IPv6. |
329e1f12 | 390 | .It Ic fqdn Op disable | none | ptr | both |
569c0b11 DG |
391 | .Ar none |
392 | will not ask the DHCP server to update DNS. | |
393 | .Ar ptr | |
394 | just asks the DHCP server to update the PTR | |
395 | record of the host in DNS, whereas | |
396 | .Ar both | |
397 | also updates the A record. | |
398 | .Ar disable | |
399 | will disable the FQDN option. | |
400 | The default is | |
cb8c4252 | 401 | .Ar both . |
1b3bc477 RM |
402 | .Nm dhcpcd |
403 | itself never does any DNS updates. | |
e837a670 RM |
404 | .Nm dhcpcd |
405 | encodes the FQDN hostname as specified in | |
569c0b11 | 406 | .Li RFC 1035 . |
3adc5520 | 407 | .It Ic interface Ar interface |
012fd5d3 RM |
408 | Subsequent options are only parsed for this |
409 | .Ar interface . | |
62f12387 | 410 | .It Ic ipv6ra_autoconf |
569c0b11 | 411 | Generate SLAAC addresses for each Prefix advertised by an IPv6 |
62f12387 RM |
412 | Router Advertisement message with the Auto flag set. |
413 | On by default. | |
414 | .It Ic ipv6ra_noautoconf | |
415 | Disables the above option. | |
61dd6cf9 RM |
416 | .It Ic ipv6ra_fork |
417 | By default, when | |
418 | .Nm dhcpcd | |
569c0b11 | 419 | receives an IPv6 Router Advertisement, |
61dd6cf9 RM |
420 | .Nm dhcpcd |
421 | will only fork to the background if the RA contains at least one unexpired | |
e2c4a256 | 422 | RDNSS option and a valid prefix or no DHCPv6 instruction. |
61dd6cf9 RM |
423 | Set this option so to make |
424 | .Nm dhcpcd | |
425 | always fork on an RA. | |
d7555c12 | 426 | .It Ic ipv6rs |
b831a425 | 427 | Enables IPv6 Router Advertisement solicitation. |
eebe9a18 RM |
428 | This is on by default, but is documented here in the case where it is disabled |
429 | globally but needs to be enabled for one interface. | |
ba9dfb7a RM |
430 | .It Ic leasetime Ar seconds |
431 | Request a leasetime of | |
432 | .Ar seconds . | |
281818ae RM |
433 | .It Ic link_rcvbuf Ar size |
434 | Override the size of the link receive buffer from the kernel default. | |
435 | While | |
436 | .Nm dhcpcd | |
437 | will recover from link buffer overflows, | |
438 | this may not be desirable on heavily loaded systems. | |
94d1ded9 RM |
439 | .It Ic logfile Ar logfile |
440 | Writes to the specified | |
441 | .Ar logfile | |
442 | rather than | |
443 | .Xr syslog 3 . | |
444 | The | |
445 | .Ar logfile | |
9cc7e848 | 446 | is reopened when |
94d1ded9 RM |
447 | .Nm dhcpcd |
448 | receives the | |
449 | .Dv SIGUSR2 | |
450 | signal. | |
065125d4 RM |
451 | .It Ic metric Ar metric |
452 | Metrics are used to prefer an interface over another one, lowest wins. | |
453 | .Nm dhcpcd | |
87b266d2 | 454 | will supply a default metric of 200 + |
065125d4 RM |
455 | .Xr if_nametoindex 3 . |
456 | An extra 100 will be added for wireless interfaces. | |
a6d84af0 | 457 | .It Ic mudurl Ar url |
569c0b11 | 458 | Specifies the URL for a Manufacturer Usage Description (MUD). |
d85ad7d0 RM |
459 | The description is used by upstream network devices to instantiate any |
460 | desired access lists. | |
461 | See draft-ietf-opsawg-mud for more information. | |
7dab081f | 462 | .It Ic noalias |
569c0b11 DG |
463 | Any pre-existing IPv4 addresses will be removed from the interface when |
464 | adding a new IPv4 address. | |
ba9dfb7a | 465 | .It Ic noarp |
cf42802e RM |
466 | Don't send any ARP requests. |
467 | This also disables IPv4LL. | |
c73ed171 RM |
468 | .It Ic noauthrequired |
469 | Don't require authentication even though we requested it. | |
d672ebda | 470 | Also allows FORCERENEW and RECONFIGURE messages without authentication. |
f572315d RM |
471 | .It Ic nodelay |
472 | Don't delay for an initial randomised time when starting protocols. | |
413652c1 RM |
473 | .It Ic nodev |
474 | Don't load | |
475 | .Pa /dev | |
476 | management modules. | |
d4154ba7 RM |
477 | .It Ic nodhcp |
478 | Don't start DHCP or listen to DHCP messages. | |
479 | This is only useful when allowing IPv4LL. | |
480 | .It Ic nodhcp6 | |
481 | Don't start DHCPv6 or listen to DHCPv6 messages. | |
569c0b11 DG |
482 | Normally DHCPv6 is started by an IPv6 Router Advertisement instruction or |
483 | configuration. | |
feb553d0 RM |
484 | .It Ic nogateway |
485 | Don't install any default routes. | |
486 | .It Ic gateway | |
487 | Install a default route if available (default). | |
37156a6b RM |
488 | .It Ic nohook Ar script |
489 | Don't run this hook script. | |
8276da82 RM |
490 | Matches full name, or prefixed with 2 numbers optionally ending with |
491 | .Pa .sh . | |
fc7ee231 RM |
492 | .Pp |
493 | So to stop | |
494 | .Nm dhcpcd | |
ca6cdf58 RM |
495 | from touching your DNS settings or starting wpa_supplicant you would do:- |
496 | .D1 nohook resolv.conf, wpa_supplicant | |
bb8051bf RM |
497 | .It Ic noipv4 |
498 | Don't attempt to configure an IPv4 address. | |
ba9dfb7a RM |
499 | .It Ic noipv4ll |
500 | Don't attempt to obtain an IPv4LL address if we failed to get one via DHCP. | |
501 | See | |
502 | .Rs | |
503 | .%T "RFC 3927" | |
504 | .Re | |
bb8051bf | 505 | .It Ic noipv6 |
fabcbe2e | 506 | Don't solicit or accept IPv6 Router Advertisements and DHCPv6. |
91cd7324 | 507 | .It Ic noipv6rs |
fabcbe2e | 508 | Don't solicit or accept IPv6 Router Advertisements. |
a26af491 RM |
509 | .It Ic nolink |
510 | Don't receive link messages about carrier status. | |
511 | You should only set this for buggy interface drivers. | |
2862d340 RM |
512 | .It Ic noup |
513 | Don't bring the interface up when in master mode. | |
514 | If | |
515 | .Nm | |
516 | cannot determine the carrier state, | |
517 | .Nm | |
518 | will enter a tight polling loop until the interface is marked up and running | |
519 | or a valid carrier state is reported. | |
cc45fbd7 | 520 | .It Ic option Ar option |
d2616b08 | 521 | Requests the |
cc45fbd7 | 522 | .Ar option |
cf42802e RM |
523 | from the server. |
524 | It can be a variable to be used in | |
ee4e620a | 525 | .Xr dhcpcd-run-hooks 8 |
cf42802e | 526 | or the numerical value. |
b8ffa3cd RM |
527 | You can specify more |
528 | .Ar option Ns s | |
529 | separated by commas, spaces or more | |
530 | .Ic option | |
531 | lines. | |
532 | Prepend dhcp6_ to | |
533 | .Ar option | |
534 | to request a DHCPv6 option. | |
daa70372 RM |
535 | If no DHCPv6 options are configured, |
536 | then DHCPv4 options are mapped to equivalent DHCPv6 options. | |
2be15e88 RM |
537 | .Pp |
538 | Prepend nd_ to | |
539 | .Ar option | |
540 | to handle ND options, but this only works for the | |
541 | .Ic nooption , | |
542 | .Ic reject | |
543 | and | |
544 | .Ic require | |
545 | options. | |
f38394c1 RM |
546 | .Pp |
547 | To see a list of options you can use, call | |
548 | .Nm dhcpcd | |
549 | with the | |
550 | .Fl V , Fl Fl variables | |
551 | argument. | |
2063c6f9 | 552 | .It Ic nooption Ar option |
2be15e88 RM |
553 | Remove the option from the message before it's processed. |
554 | .It Ic require Ar option | |
555 | Requires the | |
556 | .Ar option | |
557 | to be present in all messages, otherwise the message is ignored. | |
558 | To enforce that | |
559 | .Nm dhcpcd | |
560 | only responds to DHCP servers and not BOOTP servers, you can | |
561 | .Ic require | |
562 | .Ar dhcp_message_type . | |
569c0b11 | 563 | This isn't an exact science though because a BOOTP server can send DHCP-like |
2be15e88 RM |
564 | options. |
565 | .It Ic reject Ar option | |
566 | Reject a message that contains the | |
567 | .Ar option . | |
568 | This is useful when you cannot use | |
569 | .Ic require | |
570 | to select / de-select BOOTP messages. | |
1abffd5b RM |
571 | .It Ic destination Ar option |
572 | If | |
573 | .Nm | |
574 | detects an address added to a point to point interface (PPP, TUN, etc) then | |
575 | it will set the listed DHCP options to the destination address of the | |
576 | interface. | |
6f767217 RM |
577 | .It Ic profile Ar name |
578 | Subsequent options are only parsed for this profile | |
579 | .Ar name . | |
1abffd5b | 580 | .It Ic quiet |
87b266d2 | 581 | Suppress any dhcpcd output to the console, except for errors. |
1abffd5b | 582 | .It Ic reboot Ar seconds |
a2a9a498 RM |
583 | Allow |
584 | .Ar reboot | |
1d5d236a RM |
585 | seconds before moving to the DISCOVER phase if we have an old lease to use |
586 | and moving from DISCOVER to IPv4LL if no reply. | |
a628f34d | 587 | The default is 5 seconds. |
901b42de | 588 | A setting of 0 seconds causes |
a2a9a498 | 589 | .Nm dhcpcd |
901b42de RM |
590 | to skip the REBOOT phase and go straight into DISCOVER. |
591 | This is desirable for mobile users because if you change from network A to | |
592 | network B and they use the same subnet and the address from network A isn't | |
b831a425 RM |
593 | in use on network B, then the DHCP server will remain silent even if |
594 | authoritative which means | |
901b42de RM |
595 | .Nm dhcpcd |
596 | will timeout before moving back to the DISCOVER phase. | |
2662d519 RM |
597 | .It Ic release |
598 | .Nm dhcpcd | |
599 | will release the lease prior to stopping the interface. | |
0aeb350c RM |
600 | .It Ic script Ar script |
601 | Use | |
602 | .Ar script | |
603 | instead of the default | |
604 | .Pa @SCRIPT@ . | |
c53cf4ef RM |
605 | .It Ic ssid Ar ssid |
606 | Subsequent options are only parsed for this wireless | |
607 | .Ar ssid . | |
1aeaf0e7 RM |
608 | .It Ic slaac Op Ar hwaddr | Ar private |
609 | Selects the interface identifier used for SLAAC generated IPv6 addresses. | |
eec0cf35 RM |
610 | If |
611 | .Ar private | |
cb8c4252 | 612 | is used, an RFC 7217 address is generated. |
91a44b91 RM |
613 | .It Ic static Ar value |
614 | Configures a static | |
615 | .Ar value . | |
616 | If you set | |
617 | .Ic ip_address | |
618 | then | |
619 | .Nm dhcpcd | |
569c0b11 DG |
620 | will not attempt to obtain a lease and will just use the value for the address |
621 | with an infinite lease time. | |
408fe755 RM |
622 | If you set |
623 | .Ic ip6_address , | |
624 | .Nm dhcpcd | |
ea781ba6 | 625 | will continue auto-configuration as normal. |
91a44b91 | 626 | .Pp |
6dc3763d RM |
627 | Here is an example which configures two static address, overriding the default |
628 | IPv4 broadcast address, an IPv4 router, DNS and disables IPv6 auto-configuration. | |
408fe755 RM |
629 | You could also use the |
630 | .Ic inform6 | |
631 | command here if you wished to obtain more information via DHCPv6. | |
632 | For IPv4, you should use the | |
633 | .Ic inform Ar ipaddress | |
634 | option instead of setting a static address. | |
91a44b91 | 635 | .D1 interface eth0 |
408fe755 | 636 | .D1 noipv6rs |
91a44b91 | 637 | .D1 static ip_address=192.168.0.10/24 |
6dc3763d | 638 | .D1 static broadcast_address=192.168.0.63 |
408fe755 | 639 | .D1 static ip6_address=fd51:42f8:caae:d92e::ff/64 |
91a44b91 | 640 | .D1 static routers=192.168.0.1 |
408fe755 | 641 | .D1 static domain_name_servers=192.168.0.1 fd51:42f8:caae:d92e::1 |
1abffd5b RM |
642 | .Pp |
643 | Here is an example for PPP which gives the destination a default route. | |
569c0b11 DG |
644 | It uses the special |
645 | .Ar destination | |
646 | keyword to insert the destination address | |
1abffd5b RM |
647 | into the value. |
648 | .D1 interface ppp0 | |
649 | .D1 static ip_address= | |
650 | .D1 destination routers | |
d2616b08 | 651 | .It Ic timeout Ar seconds |
569c0b11 | 652 | Time out after |
b58bf81f RM |
653 | .Ar seconds , |
654 | instead of the default 30. | |
d93d7adc RM |
655 | A setting of 0 |
656 | .Ar seconds | |
657 | causes | |
658 | .Nm dhcpcd | |
659 | to wait forever to get a lease. | |
b58bf81f RM |
660 | If |
661 | .Nm dhcpcd | |
662 | is working on a single interface then | |
663 | .Nm dhcpcd | |
664 | will exit when a timeout occurs, otherwise | |
665 | .Nm dhcpcd | |
666 | will fork into the background. | |
667 | If using IPv4LL then | |
668 | .Nm dhcpcd | |
669 | start the IPv4LL process after the timeout and then wait a little longer | |
670 | before really timing out. | |
d2616b08 | 671 | .It Ic userclass Ar string |
1300150e | 672 | Tag the DHCPv4 messages with the userclass. |
cf42802e | 673 | You can specify more than one. |
bac03ede | 674 | .It Ic vendor Ar code , Ns Ar value |
87b266d2 | 675 | Add an encapsulated vendor option. |
757520c5 RM |
676 | .Ar code |
677 | should be between 1 and 254 inclusive. | |
95d6dcfa RM |
678 | To add a raw vendor string, omit |
679 | .Ar code | |
680 | but keep the comma. | |
757520c5 RM |
681 | Examples. |
682 | .Pp | |
683 | Set the vendor option 01 with an IP address. | |
684 | .D1 vendor 01,192.168.0.2 | |
685 | Set the vendor option 02 with a hex code. | |
686 | .D1 vendor 02,01:02:03:04:05 | |
687 | Set the vendor option 03 with an IP address as a string. | |
688 | .D1 vendor 03,\e"192.168.0.2\e" | |
87b266d2 | 689 | Set un-encapsulated vendor option to hello world. |
9cb58952 | 690 | .D1 vendor ,"hello world" |
bac03ede | 691 | .It Ic vendorclassid Ar string |
1300150e | 692 | Set the DHCP Vendor Class. |
569c0b11 | 693 | DHCPv6 has its own option as shown below. |
eebe9a18 RM |
694 | The default is |
695 | dhcpcd-<version>:<os>:<machine>:<platform>. | |
696 | For example | |
697 | .D1 dhcpcd-5.5.6:NetBSD-6.99.5:i386:i386 | |
bac03ede | 698 | If not set then none is sent. |
eebe9a18 RM |
699 | Some badly configured DHCP servers reject unknown vendorclassids. |
700 | To work around it, try and impersonate Windows by using the MSFT vendorclassid. | |
7a911e57 | 701 | .It Ic vendclass Ar en Ar data |
1300150e | 702 | Add the DHCPv6 Vendor Indetifying Vendor Class with the IANA assigned Enterprise |
7a911e57 RM |
703 | Number |
704 | .Ar en | |
705 | with the | |
706 | .Ar data . | |
707 | This option can be set more than once to add more data, but the behaviour, | |
ea781ba6 | 708 | as per RFC 3925 is undefined if the Enterprise Number differs. |
7013b073 | 709 | .It Ic waitip Op 4 | 6 |
2a07a2af | 710 | Wait for an address to be assigned before forking to the background. |
7013b073 RM |
711 | 4 means wait for an IPv4 address to be assigned. |
712 | 6 means wait for an IPv6 address to be assigned. | |
8b7499fd RM |
713 | If no argument is given, |
714 | .Nm | |
715 | will wait for any address protocol to be assigned. | |
716 | It is possible to wait for more than one address protocol and | |
717 | .Nm | |
718 | will only fork to the background when all waiting conditions are satisfied. | |
4242c9b3 RM |
719 | .It Ic xidhwaddr |
720 | Use the last four bytes of the hardware address as the DHCP xid instead | |
721 | of a randomly generated number. | |
eaa90296 | 722 | .El |
8e7d8c37 | 723 | .Ss Defining new options |
569c0b11 DG |
724 | DHCP, ND and DHCPv6 allow for the use of custom options, and RFC 3925 vendor |
725 | options for DHCP can also be supplied. | |
8e7d8c37 | 726 | Each option needs to be started with the |
2be15e88 | 727 | .Ic define , |
a6d84af0 | 728 | .Ic definend , |
8e7d8c37 | 729 | .Ic define6 |
569c0b11 DG |
730 | or |
731 | .Ic vendopt | |
8e7d8c37 RM |
732 | directive. |
733 | This can optionally be followed by both | |
734 | .Ic embed | |
735 | or | |
736 | .Ic encap | |
737 | options. | |
738 | Both can be specified more than once and | |
739 | .Ic embed | |
740 | must come before | |
741 | .Ic encap . | |
742 | .Bl -tag -width indent | |
743 | .It Ic define Ar code Ar type Ar variable | |
744 | Defines the DHCP option | |
745 | .Ar code | |
746 | of | |
747 | .Ar type | |
748 | with a name of | |
749 | .Ar variable | |
750 | exported to | |
751 | .Xr dhcpcd-run-hooks 8 . | |
2be15e88 RM |
752 | .It Ic definend Ar code Ar type Ar variable |
753 | Defines the ND option | |
754 | .Ar code | |
755 | of | |
756 | .Ar type | |
757 | with a name of | |
758 | .Ar variable | |
759 | exported to | |
760 | .Xr dhcpcd-run-hooks 8 , | |
761 | with a prefix of | |
762 | .Va _nd . | |
8e7d8c37 RM |
763 | .It Ic define6 Ar code Ar type Ar variable |
764 | Defines the DHCPv6 option | |
765 | .Ar code | |
766 | of | |
767 | .Ar type | |
768 | with a name of | |
769 | .Ar variable | |
770 | exported to | |
771 | .Xr dhcpcd-run-hooks 8 , | |
772 | with a prefix of | |
773 | .Va _dhcp6 . | |
7a911e57 RM |
774 | .It Ic vendopt Ar code Ar type Ar variable |
775 | Defines the Vendor-Identifying Vendor Options. | |
776 | The | |
777 | .Ar code | |
925fc70e | 778 | is the IANA Enterprise Number which will uniquely describe the encapsulated |
7a911e57 RM |
779 | options. |
780 | .Ar type | |
781 | is normally | |
782 | .Ar encap . | |
783 | .Ar variable | |
784 | names the Vendor option to be exported. | |
8e7d8c37 RM |
785 | .It Ic embed Ar type Ar variable |
786 | Defines an embedded variable within the defined option. | |
787 | The length is determined by the | |
788 | .Ar type . | |
63bdd2c2 RM |
789 | If the |
790 | .Ar variable | |
791 | is not the same as defined in the parent option, | |
792 | it is prefixed with the parent | |
793 | .Ar variable | |
794 | first with an underscore. | |
cc71162d RM |
795 | If the |
796 | .Ar variable | |
797 | has the name of | |
798 | .Ar reserved | |
799 | then it is not processed. | |
8e7d8c37 RM |
800 | .It Ic encap Ar code Ar type Ar variable |
801 | Defines an encapsulated variable within the defined option. | |
802 | The length is determined by the | |
803 | .Ar type . | |
63bdd2c2 RM |
804 | If the |
805 | .Ar variable | |
806 | is not the same as defined in the parent option, | |
807 | it is prefixed with the parent | |
808 | .Ar variable | |
809 | first with an underscore. | |
810 | .El | |
811 | .Ss Type prefix | |
812 | These keywords come before the type itself, to describe it more fully. | |
813 | You can use more than one, but they must appear in the order listed below. | |
814 | .Bl -tag -width -indent | |
815 | .It Ic request | |
816 | Requests the option by default without having to be specified in user | |
569c0b11 | 817 | configuration. |
63bdd2c2 | 818 | .It Ic norequest |
569c0b11 | 819 | This option cannot be requested, regardless of user configuration. |
ecdbb919 RM |
820 | .It Ic optional |
821 | This option is optional. | |
569c0b11 | 822 | Only makes sense for embedded options like the client FQDN option, where |
ecdbb919 | 823 | the FQDN string itself is optional. |
03476881 RM |
824 | .It Ic index |
825 | The option can appear more than once and will be indexed. | |
63bdd2c2 | 826 | .It Ic array |
b2feeb9e | 827 | The option data is split into a space separated array, each element being |
63bdd2c2 | 828 | the same type. |
8e7d8c37 RM |
829 | .El |
830 | .Ss Types to define | |
b21cd906 RM |
831 | The type directly affects the length of data consumed inside the option. |
832 | Any remaining data is normally discarded. | |
833 | Lengths can be specified for string and binhex types, but this is generally | |
834 | with other data embedded afterwards in the same option. | |
8e7d8c37 RM |
835 | .Bl -tag -width indent |
836 | .It Ic ipaddress | |
cc71162d | 837 | An IPv4 address, 4 bytes. |
8e7d8c37 | 838 | .It Ic ip6address |
cc71162d | 839 | An IPv6 address, 16 bytes. |
b21cd906 | 840 | .It Ic string Op : Ic length |
8f008ca7 | 841 | A NVT ASCII string of printable characters. |
8e7d8c37 | 842 | .It Ic byte |
cc71162d RM |
843 | A byte. |
844 | .It Ic bitflags : Ic flags | |
845 | A byte represented as a string of flags, most significant bit first. | |
846 | For example, using ABCDEFGH then A would equal 10000000, B 01000000, | |
847 | C 00100000, etc. | |
848 | If the bit is not set, the flag is not printed. | |
925fc70e RM |
849 | A flag of 0 is not printed even if the bit position is set. |
850 | This is to allow reservation of the first bits while assigning the last bits. | |
8e7d8c37 | 851 | .It Ic int16 |
cc71162d | 852 | A signed 16bit integer, 2 bytes. |
8e7d8c37 | 853 | .It Ic uint16 |
cc71162d | 854 | An unsigned 16bit integer, 2 bytes. |
8e7d8c37 | 855 | .It Ic int32 |
cc71162d | 856 | A signed 32bit integer, 4 bytes. |
8e7d8c37 | 857 | .It Ic uint32 |
cc71162d RM |
858 | An unsigned 32bit integer, 4 bytes. |
859 | .It Ic flag | |
860 | A fixed value (1) to indicate that the option is present, 0 bytes. | |
8e7d8c37 | 861 | .It Ic domain |
569c0b11 | 862 | An RFC 3397 encoded string. |
8f008ca7 | 863 | .It Ic dname |
569c0b11 | 864 | An RFC 1035 validated string. |
b21cd906 | 865 | .It Ic binhex Op : Ic length |
cc71162d | 866 | Binary data expressed as hexadecimal. |
8e7d8c37 | 867 | .It Ic embed |
cc71162d | 868 | Contains embedded options (implies encap as well). |
8e7d8c37 | 869 | .It Ic encap |
cc71162d | 870 | Contains encapsulated options (implies embed as well). |
03476881 | 871 | .It Ic option |
cc71162d | 872 | References an option from the global definition. |
8e7d8c37 RM |
873 | .El |
874 | .Ss Example definition | |
569c0b11 | 875 | .D1 # DHCP option 81, Fully Qualified Domain Name, RFC 4702 |
63bdd2c2 RM |
876 | .D1 define 81 embed fqdn |
877 | .D1 embed byte flags | |
878 | .D1 embed byte rcode1 | |
879 | .D1 embed byte rcode2 | |
8e7d8c37 RM |
880 | .D1 embed domain fqdn |
881 | .Pp | |
569c0b11 | 882 | .D1 # DHCP option 125, Vendor Specific Information Option, RFC 3925 |
63bdd2c2 RM |
883 | .D1 define 125 encap vsio |
884 | .D1 embed uint32 enterprise_number | |
8e7d8c37 | 885 | .D1 # Options defined for the enterprise number |
63bdd2c2 | 886 | .D1 encap 1 ipaddress ipaddress |
0dc49454 | 887 | .Ss Supported Authentication Protocols |
c73ed171 RM |
888 | .Bl -tag -width -indent |
889 | .It Ic token | |
32945b61 RM |
890 | Sends a plain text token the server expects and matches a token sent by |
891 | the server. | |
569c0b11 DG |
892 | The tokens do not have to be the same. |
893 | If unspecified, the token with a | |
894 | .Ar secretid | |
895 | of 0 will be used in sending messages | |
32945b61 | 896 | and validating received messages. |
c73ed171 RM |
897 | .It Ic delayedrealm |
898 | Delayed Authentication. | |
899 | .Nm dhcpcd | |
900 | will send an authentication option with no key or MAC. | |
901 | The server will see this option, and select a key for | |
902 | .Nm , writing the | |
903 | .Ar realm | |
904 | and | |
905 | .Ar secretid | |
906 | in it. | |
907 | .Nm dhcpcd | |
569c0b11 DG |
908 | will then look for an unexpired token with a matching |
909 | .Ar realm | |
910 | and | |
911 | .Ar secretid . | |
925fc70e | 912 | This token is used to authenticate all other messages. |
c73ed171 RM |
913 | .It Ic delayed |
914 | Same as above, but without a realm. | |
915 | .El | |
0dc49454 | 916 | .Ss Supported Authentication Algorithms |
c73ed171 RM |
917 | If none specified, |
918 | .Ic hmac-md5 | |
919 | is the default. | |
920 | .Bl -tag -width -indent | |
921 | .It Ic hmac-md5 | |
922 | .El | |
923 | .Ss Supported Replay Detection Mechanisms | |
924 | If none specified, | |
925 | .Ic monotonic | |
926 | is the default. | |
cf0840ef | 927 | If this is changed from what was previously used, |
569c0b11 DG |
928 | or the means of calculating or storing it is broken, then the DHCP server |
929 | will probably have to have its notion of the client's Replay Detection Value | |
cf0840ef | 930 | reset. |
c73ed171 | 931 | .Bl -tag -width -indent |
cf0840ef RM |
932 | .It Ic monocounter |
933 | Read the number in the file | |
934 | .Pa @DBDIR@/dhcpcd-rdm.monotonic | |
935 | and add one to it. | |
936 | .It Ic monotime | |
569c0b11 | 937 | Create an NTP timestamp from the system time. |
c73ed171 | 938 | .It Ic monotonic |
cf0840ef RM |
939 | Same as |
940 | .Ic monotime . | |
c73ed171 | 941 | .El |
ba9dfb7a | 942 | .Sh SEE ALSO |
0b4a1931 | 943 | .Xr fnmatch 3 , |
065125d4 | 944 | .Xr if_nametoindex 3 , |
0b4a1931 RM |
945 | .Xr dhcpcd 8 , |
946 | .Xr dhcpcd-run-hooks 8 | |
ba9dfb7a | 947 | .Sh AUTHORS |
2cfe8d07 | 948 | .An Roy Marples Aq Mt roy@marples.name |
ba9dfb7a | 949 | .Sh BUGS |
fd73ceb1 RM |
950 | Please report them to |
951 | .Lk http://roy.marples.name/projects/dhcpcd |