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