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