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