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