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