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