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