]> git.ipfire.org Git - thirdparty/dhcpcd.git/blame - dhcpcd.conf.5.in
Ensure that ND6_IFF_PERFORMNUD is set.
[thirdparty/dhcpcd.git] / dhcpcd.conf.5.in
CommitLineData
9ff636a5 1.\" Copyright (c) 2006-2014 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.\"
94bec972 25.Dd April 28, 2014
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.
967194ef
RM
42.Pp
43Blank lines and lines starting with # are ignored.
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
RM
63If an address is found, we will select the replying hardware address as the
64profile, otherwise the ip address.
65Example:
66.Pp
67.D1 interface bge0
68.D1 arping 192.168.0.1
69.Pp
70.D1 profile 192.168.0.1
71.D1 static ip_address=192.168.0.10/24
c73ed171
RM
72.It Ic authprotocol Ar protocol Ar algorithm Ar rdm
73Authenticate DHCP messages.
74See the Supported Protocols section.
75.It Ic authtoken Ar secretid Ar realm Ar expire Ar key
76Define a shared key for use in authentication.
77.Ar realm can be "" to for use with the
78.Ar delayed
79prptocol.
80.Ar expire
81is the date the token expires and should be formatted "yyy-mm-dd HH:MM".
82You can use the keyword
83.Ar forever
84or
85.Ar 0
86which means the token never expires.
bac03ede
RM
87.It Ic background
88Background immediately.
89This is useful for startup scripts which don't disable link messages for
90carrier status.
6f767217 91.It Ic blacklist Ar address Ns Op /cidr
ce6b39df 92Ignores all packets from
6f767217 93.Ar address Ns Op /cidr .
bf80d526
RM
94.It Ic whitelist Ar address Ns Op /cidr
95Only accept packets from
96.Ar address Ns Op /cidr .
97.Ic blacklist
98is ignored if
99.Ic whitelist
100is set.
900b3da4
RM
101.It Ic broadcast
102Instructs the DHCP server to broadcast replies back to the client.
103Normally this is only set for non Ethernet interfaces,
104such as FireWire and InfiniBand.
105In most cases,
106.Nm dhcpcd
107will set this automatically.
a3099289
RM
108.It Ic debug
109Echo debug messages to the stderr and syslog.
413652c1
RM
110.It Ic dev Ar value
111Load the
112.Ar value
113.Pa /dev
114management module.
115.Nm dhcpcd
116will load the first one found to work, if any.
6bfd88f1
RM
117.It Ic env Ar value
118Push
119.Ar value
120to the environment for use in
121.Xr dhcpcd-run-hooks 8 .
122For example, you can force the hostname hook to always set the hostname with
123.Ic env
124.Va force_hostname=YES .
77961e7b
RM
125.Pp
126If the hostname is set, will be will set to the FQDN if possible as per
127RFC 4702 section 3.1.
128If the FQDN option is missing,
129.Nm dhcpcd
130will still try and set a FQDN from the hostname and domain options for
131consistency.
132To override this, set
133.Ic env
134.Va hostname_fqdn=[YES|NO|SERVER] .
135A value of server means just what the server says, don't manipulate it.
136This could lead to an inconsistent hostname on a DHCPv4 and DHCPv6 network
137where the DHCPv4 hostname is short and the DHCPv6 has an FQDN.
138DHCPv6 has no hostname option.
d2616b08 139.It Ic clientid Ar string
c989b023
RM
140Send the
141.Ar clientid .
d2616b08 142If the string is of the format 01:02:03 then it is encoded as hex.
3faba9e6
RM
143For interfaces whose hardware address is longer than 8 bytes, or if the
144.Ar clientid
145is an empty string then
146.Nm dhcpcd
147sends a default
148.Ar clientid
149of the hardware family and the hardware address.
d2616b08
RM
150.It Ic duid
151Generate an
152.Rs
153.%T "RFC 4361"
154.Re
ebc9d360 155compliant DHCP Unique Identifier.
7e068c85
RM
156If persistent storage is available then a DUID-LLT (link local address + time)
157is generated, otherwise DUID-LL is generated (link local address).
ebc9d360
RM
158This, plus the IAID will be used as the
159.Ic clientid .
7e068c85 160The DUID-LLT generated will be held in
d2616b08
RM
161.Pa @SYSCONFDIR@/dhcpcd.duid
162and should not be copied to other hosts.
ebc9d360
RM
163.It Ic iaid Ar iaid
164Set the Interface Association Identifier to
165.Ar iaid .
9ff636a5
RM
166This option must be used in an
167.Ic interface
168block.
6f66c6c9
RM
169This defaults to the last 4 bytes of the hardware address assigned to the
170interface.
171Each instance of this should be unique within the scope of the client and
172.Nm dhcpcd
173warns if a conflict is detected.
174If there is a conflict, it is only a problem if the conflicted IAIDs are
175used on the same network.
94bec972
RM
176.It Ic dhcp
177Enable DHCP on the interface, on by default.
178.It Ic dhcp6
179Enable DHCPv6 on the interface, on by default.
180.It Ic ipv4
181Enable IPv4 on the interface, on by default.
182.It Ic ipv6
183Enable IPv6 on the interface, on by default.
15fc1181
RM
184.It Ic persistent
185.Nm dhcpcd
186normally de-configures the interface and configuration when it exits.
187Sometimes, this isn't desirable if, for example, you have root mounted over
a544b76a
RM
188NFS or SSH clients connect to this host and they need to be notified of
189the host shutting down.
15fc1181 190You can use this option to stop this from happening.
ff021b0b
RM
191.It Ic fallback Ar profile
192Fallback to using this profile if DHCP fails.
193This allows you to configure a static profile instead of using ZeroConf.
ba9dfb7a 194.It Ic hostname Ar name
35d02ae6 195Sends
ff021b0b 196.Ar hostname
35d02ae6
RM
197to the DHCP server so it can be registered in DNS.
198If
35ff0dbb 199.Ar hostname
35d02ae6
RM
200is an empty string then the current system hostname is sent.
201If
202.Ar hostname
203is a FQDN (ie, contains a .) then it will be encoded as such.
d6a18654
RM
204.It Ic hostname_short
205Sends the short hostname to the DHCP server instead of the FQDN.
206This is useful because DHCP servers will not register the FQDN in their
207DNS if the domain part does not match theirs.
77961e7b
RM
208.Pp
209Also, see the
210.Ic env
211option above to control how the hostname is set on the host.
22ea2b0d 212.It Ic ia_na Op Ar iaid
00ababe4
RM
213Request a DHCPv6 Normal Address for
214.Ar iaid .
00ababe4 215.Ar iaid
ebc9d360
RM
216defaults to the
217.Ic iaid
218option as described above.
219You can request more than one ia_na by specifying a unique
220.Ar iaid
221for each one.
22ea2b0d 222.It Ic ia_ta Op Ar iaid
00ababe4
RM
223Request a DHCPv6 Temporary Address for
224.Ar iaid .
ebc9d360
RM
225You can request more than one ia_ta by specifying a unique
226.Ar iaid
227for each one.
5985c4e2 228.It Ic ia_pd Op Ar iaid Op Ar interface Op / Ar sla_id Op / Ar prefix_len
00ababe4
RM
229Request a DHCPv6 Delegated Prefix for
230.Ar iaid .
9ff636a5
RM
231This option must be used in an
232.Ic interface
233block.
94a79cea
RM
234Unless a
235.Ar sla_id
236of 0 is assigned, a reject route is installed for the Delegated Prefix to
237stop unallocated addresses being resolved upstream.
22ea2b0d
RM
238If no
239.Ar interface
94a79cea 240is given then we will assign a prefix to every other interface with a
22ea2b0d 241.Ar sla_id
94a79cea 242equivalent to the interface index assigned by the OS.
22ea2b0d 243Otherwise addresses are only assigned for each
00ababe4
RM
244.Ar interface
245and
9ff636a5 246.Ar sla_id .
94a79cea 247Each assigned address will have a suffix of 1.
9ff636a5 248You cannot assign a prefix to the requesting interface.
2fae05d0
RM
249.Nm dhcpcd
250has to be running for all the interfaces it is delegating to.
00ababe4 251A default
367f7b11 252.Ar prefix_len
94a79cea
RM
253of 64 is assumed, unless the maximum
254.Ar sla_id
255does not fit.
256In this case
257.Ar prefix_len
258is increased to the highest multiple of 8 that can accomodate the
259.Ar sla_id .
367f7b11
RM
260.Ar sla_id
261is an integer and is added to the prefix which must fit inside
262.Ar prefix_len
263less the length of the delegated prefix.
94a79cea 264.Ar sla_id can be 0 only if the Delegated Prefix is assigned to one interface.
22ea2b0d
RM
265You can specify multiple
266.Ar interface /
267.Ar sla_id /
268.Ar prefix_len
269per
270.Ic ia_pd ,
271space separated.
00ababe4
RM
272IPv6RS should be disabled globally when requesting a Prefix Delegation like so:
273.Pp
94bec972
RM
274.D1 # Global settings, disable IPv4 and IPv6RS
275.D1 noipv4
00ababe4 276.D1 noipv6rs
2fae05d0
RM
277.D1 # Don't touch eth3 at all
278.D1 denyinterfaces eth3
00ababe4
RM
279.Pp
280.D1 interface eth0
94a79cea 281.D1 ia_pd 1 eth1/1 eth2/2
2fae05d0 282.Pp
94bec972 283.D1 # Enable automatic address configuration for eth1
2fae05d0
RM
284.D1 # eth1 still gets a delegated prefix
285.D1 interface eth1
94bec972
RM
286.D1 ipv4
287.D1 ipv6rs
d7555c12
RM
288.It Ic ipv4only
289Only configure IPv4.
290.It Ic ipv6only
291Only confgiure IPv6.
cc3c3560
RM
292.It Ic fqdn Op disable | ptr | both
293ptr just asks the DHCP server to update the PTR
35ff0dbb 294record of the host in DNS whereas both also updates the A record.
cc3c3560
RM
295disable will disable the FQDN option.
296The default is both.
1b3bc477
RM
297.Nm dhcpcd
298itself never does any DNS updates.
e837a670
RM
299.Nm dhcpcd
300encodes the FQDN hostname as specified in
301.Li RFC1035 .
3adc5520 302.It Ic interface Ar interface
012fd5d3
RM
303Subsequent options are only parsed for this
304.Ar interface .
61dd6cf9
RM
305.It Ic ipv6ra_fork
306By default, when
307.Nm dhcpcd
308receives an IPv6 RA,
309.Nm dhcpcd
310will only fork to the background if the RA contains at least one unexpired
e2c4a256 311RDNSS option and a valid prefix or no DHCPv6 instruction.
61dd6cf9
RM
312Set this option so to make
313.Nm dhcpcd
314always fork on an RA.
d7555c12 315.It Ic ipv6ra_own
eebe9a18
RM
316Disables kernel IPv6 Router Advertisment processing so dhcpcd can manage
317addresses and routes.
a521cdce 318This does not work reliably on any BSD system, probably due to kernel issues.
d7555c12 319.It Ic ipv6ra_own_default
eebe9a18
RM
320Each time dhcpcd receives an IPv6 Router Adveristment, dhcpcd will manage
321the default route only.
322This allows dhcpcd to prefer an interface for outbound traffic based on metric
323and/or user selection rather than the kernel.
a521cdce 324This does work reliably on BSD systems.
d7555c12 325.It Ic ipv6rs
eebe9a18
RM
326Enables IPv6 Router Advertisment solicitation.
327This is on by default, but is documented here in the case where it is disabled
328globally but needs to be enabled for one interface.
ba9dfb7a
RM
329.It Ic leasetime Ar seconds
330Request a leasetime of
331.Ar seconds .
065125d4
RM
332.It Ic metric Ar metric
333Metrics are used to prefer an interface over another one, lowest wins.
334.Nm dhcpcd
87b266d2 335will supply a default metric of 200 +
065125d4
RM
336.Xr if_nametoindex 3 .
337An extra 100 will be added for wireless interfaces.
7dab081f
RM
338.It Ic noalias
339IPv4 addresses added will overwrite a pre-existing address instead of working
340alongside.
ba9dfb7a 341.It Ic noarp
cf42802e
RM
342Don't send any ARP requests.
343This also disables IPv4LL.
c73ed171
RM
344.It Ic noauthrequired
345Don't require authentication even though we requested it.
413652c1
RM
346.It Ic nodev
347Don't load
348.Pa /dev
349management modules.
d4154ba7
RM
350.It Ic nodhcp
351Don't start DHCP or listen to DHCP messages.
352This is only useful when allowing IPv4LL.
353.It Ic nodhcp6
354Don't start DHCPv6 or listen to DHCPv6 messages.
355Normally DHCPv6 is started by a RA instruction or configuration.
ba9dfb7a
RM
356.It Ic nogateway
357Don't install any default routes.
37156a6b
RM
358.It Ic nohook Ar script
359Don't run this hook script.
8276da82
RM
360Matches full name, or prefixed with 2 numbers optionally ending with
361.Pa .sh .
fc7ee231
RM
362.Pp
363So to stop
364.Nm dhcpcd
365from touching your DNS or MTU settings you would do:-
366.D1 nohook resolv.conf, mtu
bb8051bf
RM
367.It Ic noipv4
368Don't attempt to configure an IPv4 address.
ba9dfb7a
RM
369.It Ic noipv4ll
370Don't attempt to obtain an IPv4LL address if we failed to get one via DHCP.
371See
372.Rs
373.%T "RFC 3927"
374.Re
bb8051bf
RM
375.It Ic noipv6
376Don't attmept to configure an IPv6 address.
91cd7324 377.It Ic noipv6rs
4c6a8bec 378Disable solicitation and receipt of IPv6 Router Advertisements.
a26af491
RM
379.It Ic nolink
380Don't receive link messages about carrier status.
381You should only set this for buggy interface drivers.
cc45fbd7 382.It Ic option Ar option
d2616b08 383Requests the
cc45fbd7 384.Ar option
cf42802e
RM
385from the server.
386It can be a variable to be used in
ee4e620a 387.Xr dhcpcd-run-hooks 8
cf42802e 388or the numerical value.
b8ffa3cd
RM
389You can specify more
390.Ar option Ns s
391separated by commas, spaces or more
392.Ic option
393lines.
394Prepend dhcp6_ to
395.Ar option
396to request a DHCPv6 option.
397DHCPv4 options are mapped to DHCPv6 where applicable.
2063c6f9
RM
398.It Ic nooption Ar option
399Remove the option from the DHCP message.
400This should only be used when a DHCP server sends a non requested option
401that should not be processed.
1abffd5b
RM
402.It Ic destination Ar option
403If
404.Nm
405detects an address added to a point to point interface (PPP, TUN, etc) then
406it will set the listed DHCP options to the destination address of the
407interface.
6f767217
RM
408.It Ic profile Ar name
409Subsequent options are only parsed for this profile
410.Ar name .
1abffd5b 411.It Ic quiet
87b266d2 412Suppress any dhcpcd output to the console, except for errors.
1abffd5b 413.It Ic reboot Ar seconds
a2a9a498
RM
414Allow
415.Ar reboot
901b42de 416seconds before moving to the DISCOVER phase if we have an old lease to use.
499225e4 417The default is 5 seconds.
901b42de 418A setting of 0 seconds causes
a2a9a498 419.Nm dhcpcd
901b42de
RM
420to skip the REBOOT phase and go straight into DISCOVER.
421This is desirable for mobile users because if you change from network A to
422network B and they use the same subnet and the address from network A isn't
423in use on network B, then the DHCP server will remain silent even if authorative
424which means
425.Nm dhcpcd
426will timeout before moving back to the DISCOVER phase.
2662d519
RM
427.It Ic release
428.Nm dhcpcd
429will release the lease prior to stopping the interface.
cc45fbd7
RM
430.It Ic require Ar option
431Requires the
432.Ar option
433to be present in all DHCP messages, otherwise the message is ignored.
434It can be a variable to be used in
435.Xr dhcpcd-run-hooks 8
436or the numerical value.
87b266d2 437You can specify more options separated by commas, spaces or more require lines.
02d339e3
RM
438To enforce that
439.Nm dhcpcd
440only responds to DHCP servers and not BOOTP servers, you can
441.Ic require
442.Ar dhcp_message_type .
0aeb350c
RM
443.It Ic script Ar script
444Use
445.Ar script
446instead of the default
447.Pa @SCRIPT@ .
c53cf4ef
RM
448.It Ic ssid Ar ssid
449Subsequent options are only parsed for this wireless
450.Ar ssid .
91a44b91
RM
451.It Ic static Ar value
452Configures a static
453.Ar value .
454If you set
455.Ic ip_address
456then
457.Nm dhcpcd
458will not attempt to obtain a lease and just use the value for the address with
459an infinite lease time.
460.Pp
461Here is an example which configures a static address, routes and dns.
462.D1 interface eth0
463.D1 static ip_address=192.168.0.10/24
464.D1 static routers=192.168.0.1
465.D1 static domain_name_servers=192.168.0.1
1abffd5b
RM
466.Pp
467Here is an example for PPP which gives the destination a default route.
468It uses the special destination keyword to insert the destination address
469into the value.
470.D1 interface ppp0
471.D1 static ip_address=
472.D1 destination routers
d2616b08 473.It Ic timeout Ar seconds
b58bf81f
RM
474Timeout after
475.Ar seconds ,
476instead of the default 30.
d93d7adc
RM
477A setting of 0
478.Ar seconds
479causes
480.Nm dhcpcd
481to wait forever to get a lease.
b58bf81f
RM
482If
483.Nm dhcpcd
484is working on a single interface then
485.Nm dhcpcd
486will exit when a timeout occurs, otherwise
487.Nm dhcpcd
488will fork into the background.
489If using IPv4LL then
490.Nm dhcpcd
491start the IPv4LL process after the timeout and then wait a little longer
492before really timing out.
d2616b08 493.It Ic userclass Ar string
1300150e 494Tag the DHCPv4 messages with the userclass.
cf42802e 495You can specify more than one.
bac03ede 496.It Ic vendor Ar code , Ns Ar value
87b266d2 497Add an encapsulated vendor option.
757520c5
RM
498.Ar code
499should be between 1 and 254 inclusive.
95d6dcfa
RM
500To add a raw vendor string, omit
501.Ar code
502but keep the comma.
757520c5
RM
503Examples.
504.Pp
505Set the vendor option 01 with an IP address.
506.D1 vendor 01,192.168.0.2
507Set the vendor option 02 with a hex code.
508.D1 vendor 02,01:02:03:04:05
509Set the vendor option 03 with an IP address as a string.
510.D1 vendor 03,\e"192.168.0.2\e"
87b266d2 511Set un-encapsulated vendor option to hello world.
9cb58952 512.D1 vendor ,"hello world"
bac03ede 513.It Ic vendorclassid Ar string
1300150e
RM
514Set the DHCP Vendor Class.
515DHCPv6 has it's own option as shown below.
eebe9a18
RM
516The default is
517dhcpcd-<version>:<os>:<machine>:<platform>.
518For example
519.D1 dhcpcd-5.5.6:NetBSD-6.99.5:i386:i386
bac03ede 520If not set then none is sent.
eebe9a18
RM
521Some badly configured DHCP servers reject unknown vendorclassids.
522To work around it, try and impersonate Windows by using the MSFT vendorclassid.
7a911e57 523.It Ic vendclass Ar en Ar data
1300150e 524Add the DHCPv6 Vendor Indetifying Vendor Class with the IANA assigned Enterprise
7a911e57
RM
525Number
526.Ar en
527with the
528.Ar data .
529This option can be set more than once to add more data, but the behaviour,
530as per
531.Xr RFC 3925
532is undefined if the Enterprise Number differs.
7013b073 533.It Ic waitip Op 4 | 6
2a07a2af 534Wait for an address to be assigned before forking to the background.
7013b073
RM
5354 means wait for an IPv4 address to be assigned.
5366 means wait for an IPv6 address to be assigned.
8b7499fd
RM
537If no argument is given,
538.Nm
539will wait for any address protocol to be assigned.
540It is possible to wait for more than one address protocol and
541.Nm
542will only fork to the background when all waiting conditions are satisfied.
4242c9b3
RM
543.It Ic xidhwaddr
544Use the last four bytes of the hardware address as the DHCP xid instead
545of a randomly generated number.
eaa90296 546.El
8e7d8c37
RM
547.Ss Defining new options
548DHCP allows for the use of custom options.
549Each option needs to be started with the
550.Ic define
551or
552.Ic define6
553directive.
554This can optionally be followed by both
555.Ic embed
556or
557.Ic encap
558options.
559Both can be specified more than once and
560.Ic embed
561must come before
562.Ic encap .
563.Bl -tag -width indent
564.It Ic define Ar code Ar type Ar variable
565Defines the DHCP option
566.Ar code
567of
568.Ar type
569with a name of
570.Ar variable
571exported to
572.Xr dhcpcd-run-hooks 8 .
573.It Ic define6 Ar code Ar type Ar variable
574Defines the DHCPv6 option
575.Ar code
576of
577.Ar type
578with a name of
579.Ar variable
580exported to
581.Xr dhcpcd-run-hooks 8 ,
582with a prefix of
583.Va _dhcp6 .
7a911e57
RM
584.It Ic vendopt Ar code Ar type Ar variable
585Defines the Vendor-Identifying Vendor Options.
586The
587.Ar code
588is the IANA Enterprise Number which will unqiuely describe the encapsulated
589options.
590.Ar type
591is normally
592.Ar encap .
593.Ar variable
594names the Vendor option to be exported.
8e7d8c37
RM
595.It Ic embed Ar type Ar variable
596Defines an embedded variable within the defined option.
597The length is determined by the
598.Ar type .
63bdd2c2
RM
599If the
600.Ar variable
601is not the same as defined in the parent option,
602it is prefixed with the parent
603.Ar variable
604first with an underscore.
8e7d8c37
RM
605.It Ic encap Ar code Ar type Ar variable
606Defines an encapsulated variable within the defined option.
607The length is determined by the
608.Ar type .
63bdd2c2
RM
609If the
610.Ar variable
611is not the same as defined in the parent option,
612it is prefixed with the parent
613.Ar variable
614first with an underscore.
615.El
616.Ss Type prefix
617These keywords come before the type itself, to describe it more fully.
618You can use more than one, but they must appear in the order listed below.
619.Bl -tag -width -indent
620.It Ic request
621Requests the option by default without having to be specified in user
622configuration
623.It Ic norequest
624This option cannot be requested, regardless of user configuration
03476881
RM
625.It Ic index
626The option can appear more than once and will be indexed.
63bdd2c2
RM
627.It Ic array
628The option data is split into a space seperated array, each element being
629the same type.
8e7d8c37
RM
630.El
631.Ss Types to define
b21cd906
RM
632The type directly affects the length of data consumed inside the option.
633Any remaining data is normally discarded.
634Lengths can be specified for string and binhex types, but this is generally
635with other data embedded afterwards in the same option.
8e7d8c37
RM
636.Bl -tag -width indent
637.It Ic ipaddress
638An IPv4 address, 4 bytes
639.It Ic ip6address
640An IPv6 address, 16 bytes
b21cd906 641.It Ic string Op : Ic length
8e7d8c37
RM
642A shell escaped string (binary data escaped as octal)
643.It Ic byte
644A byte
645.It Ic int16
646A signed 16bit integer, 2 bytes
647.It Ic uint16
648An unsigned 16bit integer, 2 bytes
649.It Ic int32
650A signed 32bit integer, 4 bytes
651.It Ic uint32
652An unsigned 32bit integer, 4 bytes
1cd05a96
RM
653.It Ic flag
654A fixed value (1) to indicate that the option is present, 0 bytes
8e7d8c37
RM
655.It Ic domain
656A RFC 3397 encoded string
b21cd906 657.It Ic binhex Op : Ic length
8e7d8c37
RM
658Binary data expressed as hexadecimal
659.It Ic embed
660Contains embedded options (implies encap as well)
661.It Ic encap
662Contains encapsulated options (implies embed as well)
03476881
RM
663.It Ic option
664References an option from the global definition
8e7d8c37
RM
665.El
666.Ss Example definition
667.D1 # DHCP option 81, Fully Qualified Domain Name, RFC4702
63bdd2c2
RM
668.D1 define 81 embed fqdn
669.D1 embed byte flags
670.D1 embed byte rcode1
671.D1 embed byte rcode2
8e7d8c37
RM
672.D1 embed domain fqdn
673.Pp
674.D1 # DHCP option 125, Vendor Specific Information Option, RFC3925
63bdd2c2
RM
675.D1 define 125 encap vsio
676.D1 embed uint32 enterprise_number
8e7d8c37 677.D1 # Options defined for the enterprise number
63bdd2c2 678.D1 encap 1 ipaddress ipaddress
c73ed171
RM
679.Ss Supported protocols
680.Bl -tag -width -indent
681.It Ic token
682Sends and expects the token with the secretid 0 in each message.
683.It Ic delayedrealm
684Delayed Authentication.
685.Nm dhcpcd
686will send an authentication option with no key or MAC.
687The server will see this option, and select a key for
688.Nm , writing the
689.Ar realm
690and
691.Ar secretid
692in it.
693.Nm dhcpcd
694will then look for a non-expired token with a matching realm and secretid.
695This token is used to authenicate all other messages.
696.It Ic delayed
697Same as above, but without a realm.
698.El
699.Ss Supported algorithms
700If none specified,
701.Ic hmac-md5
702is the default.
703.Bl -tag -width -indent
704.It Ic hmac-md5
705.El
706.Ss Supported Replay Detection Mechanisms
707If none specified,
708.Ic monotonic
709is the default.
cf0840ef
RM
710If this is changed from what was previously used,
711or the means of calculating or storing it is broken then the DHCP server
712will probably have to have its notion of the clients Replay Detection Value
713reset.
c73ed171 714.Bl -tag -width -indent
cf0840ef
RM
715.It Ic monocounter
716Read the number in the file
717.Pa @DBDIR@/dhcpcd-rdm.monotonic
718and add one to it.
719.It Ic monotime
720Create a NTP timestamp from the system time.
c73ed171 721.It Ic monotonic
cf0840ef
RM
722Same as
723.Ic monotime .
c73ed171 724.El
ba9dfb7a 725.Sh SEE ALSO
0b4a1931 726.Xr fnmatch 3 ,
065125d4 727.Xr if_nametoindex 3 ,
0b4a1931
RM
728.Xr dhcpcd 8 ,
729.Xr dhcpcd-run-hooks 8
ba9dfb7a 730.Sh AUTHORS
2cfe8d07 731.An Roy Marples Aq Mt roy@marples.name
ba9dfb7a 732.Sh BUGS
ebc9d360 733When configuring DHCPv6 you can only select one IA type.
4d88e2c9
RM
734I can't think of a use case where you would want different types,
735so if you have one then please bring it up for discussion on the
736.Aq Mt dhcpcd-discuss@marples.name
737mailing list.
ebc9d360 738.Pp
fd73ceb1
RM
739Please report them to
740.Lk http://roy.marples.name/projects/dhcpcd