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