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