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