]> git.ipfire.org Git - thirdparty/dhcpcd.git/blame - dhcpcd.conf.5.in
Allow IAID to be configured in DHCPv4 clientid.
[thirdparty/dhcpcd.git] / dhcpcd.conf.5.in
CommitLineData
4c6a8bec 1.\" Copyright (c) 2006-2013 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.\"
ebc9d360 25.Dd November 15, 2013
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
bac03ede
RM
72.It Ic background
73Background immediately.
74This is useful for startup scripts which don't disable link messages for
75carrier status.
6f767217 76.It Ic blacklist Ar address Ns Op /cidr
ce6b39df 77Ignores all packets from
6f767217 78.Ar address Ns Op /cidr .
bf80d526
RM
79.It Ic whitelist Ar address Ns Op /cidr
80Only accept packets from
81.Ar address Ns Op /cidr .
82.Ic blacklist
83is ignored if
84.Ic whitelist
85is set.
900b3da4
RM
86.It Ic broadcast
87Instructs the DHCP server to broadcast replies back to the client.
88Normally this is only set for non Ethernet interfaces,
89such as FireWire and InfiniBand.
90In most cases,
91.Nm dhcpcd
92will set this automatically.
413652c1
RM
93.It Ic dev Ar value
94Load the
95.Ar value
96.Pa /dev
97management module.
98.Nm dhcpcd
99will load the first one found to work, if any.
6bfd88f1
RM
100.It Ic env Ar value
101Push
102.Ar value
103to the environment for use in
104.Xr dhcpcd-run-hooks 8 .
105For example, you can force the hostname hook to always set the hostname with
106.Ic env
107.Va force_hostname=YES .
77961e7b
RM
108.Pp
109If the hostname is set, will be will set to the FQDN if possible as per
110RFC 4702 section 3.1.
111If the FQDN option is missing,
112.Nm dhcpcd
113will still try and set a FQDN from the hostname and domain options for
114consistency.
115To override this, set
116.Ic env
117.Va hostname_fqdn=[YES|NO|SERVER] .
118A value of server means just what the server says, don't manipulate it.
119This could lead to an inconsistent hostname on a DHCPv4 and DHCPv6 network
120where the DHCPv4 hostname is short and the DHCPv6 has an FQDN.
121DHCPv6 has no hostname option.
d2616b08 122.It Ic clientid Ar string
c989b023
RM
123Send the
124.Ar clientid .
d2616b08 125If the string is of the format 01:02:03 then it is encoded as hex.
3faba9e6
RM
126For interfaces whose hardware address is longer than 8 bytes, or if the
127.Ar clientid
128is an empty string then
129.Nm dhcpcd
130sends a default
131.Ar clientid
132of the hardware family and the hardware address.
d2616b08
RM
133.It Ic duid
134Generate an
135.Rs
136.%T "RFC 4361"
137.Re
ebc9d360 138compliant DHCP Unique Identifier.
7e068c85
RM
139If persistent storage is available then a DUID-LLT (link local address + time)
140is generated, otherwise DUID-LL is generated (link local address).
ebc9d360
RM
141This, plus the IAID will be used as the
142.Ic clientid .
7e068c85 143The DUID-LLT generated will be held in
d2616b08
RM
144.Pa @SYSCONFDIR@/dhcpcd.duid
145and should not be copied to other hosts.
ebc9d360
RM
146.It Ic iaid Ar iaid
147Set the Interface Association Identifier to
148.Ar iaid .
149This defaults to the interface name if 4 or less characters.
150If more then it defaults to the interface index.
15fc1181
RM
151.It Ic persistent
152.Nm dhcpcd
153normally de-configures the interface and configuration when it exits.
154Sometimes, this isn't desirable if, for example, you have root mounted over
a544b76a
RM
155NFS or SSH clients connect to this host and they need to be notified of
156the host shutting down.
15fc1181 157You can use this option to stop this from happening.
ff021b0b
RM
158.It Ic fallback Ar profile
159Fallback to using this profile if DHCP fails.
160This allows you to configure a static profile instead of using ZeroConf.
ba9dfb7a 161.It Ic hostname Ar name
35d02ae6 162Sends
ff021b0b 163.Ar hostname
35d02ae6
RM
164to the DHCP server so it can be registered in DNS.
165If
35ff0dbb 166.Ar hostname
35d02ae6
RM
167is an empty string then the current system hostname is sent.
168If
169.Ar hostname
170is a FQDN (ie, contains a .) then it will be encoded as such.
d6a18654
RM
171.It Ic hostname_short
172Sends the short hostname to the DHCP server instead of the FQDN.
173This is useful because DHCP servers will not register the FQDN in their
174DNS if the domain part does not match theirs.
77961e7b
RM
175.Pp
176Also, see the
177.Ic env
178option above to control how the hostname is set on the host.
22ea2b0d 179.It Ic ia_na Op Ar iaid
00ababe4
RM
180Request a DHCPv6 Normal Address for
181.Ar iaid .
00ababe4 182.Ar iaid
ebc9d360
RM
183defaults to the
184.Ic iaid
185option as described above.
186You can request more than one ia_na by specifying a unique
187.Ar iaid
188for each one.
22ea2b0d 189.It Ic ia_ta Op Ar iaid
00ababe4
RM
190Request a DHCPv6 Temporary Address for
191.Ar iaid .
ebc9d360
RM
192You can request more than one ia_ta by specifying a unique
193.Ar iaid
194for each one.
5985c4e2 195.It Ic ia_pd Op Ar iaid Op Ar interface Op / Ar sla_id Op / Ar prefix_len
00ababe4
RM
196Request a DHCPv6 Delegated Prefix for
197.Ar iaid .
22ea2b0d
RM
198If no
199.Ar interface
200is given then we will assign a prefix to every other interface with a unique
201.Ar sla_id
202for each, starting from 0.
203Otherwise addresses are only assigned for each
00ababe4
RM
204.Ar interface
205and
206.Ar sla_id
00ababe4 207A default
367f7b11 208.Ar prefix_len
22ea2b0d 209of 64 is assumed.
367f7b11
RM
210.Ar sla_id
211is an integer and is added to the prefix which must fit inside
212.Ar prefix_len
213less the length of the delegated prefix.
22ea2b0d
RM
214You can specify multiple
215.Ar interface /
216.Ar sla_id /
217.Ar prefix_len
218per
219.Ic ia_pd ,
220space separated.
00ababe4
RM
221IPv6RS should be disabled globally when requesting a Prefix Delegation like so:
222.Pp
223.D1 noipv6rs
224.Pp
225.D1 interface eth0
74ceb961 226.D1 ia_pd 1 eth1/0 eth2/1
d7555c12
RM
227.It Ic ipv4only
228Only configure IPv4.
229.It Ic ipv6only
230Only confgiure IPv6.
cc3c3560
RM
231.It Ic fqdn Op disable | ptr | both
232ptr just asks the DHCP server to update the PTR
35ff0dbb 233record of the host in DNS whereas both also updates the A record.
cc3c3560
RM
234disable will disable the FQDN option.
235The default is both.
1b3bc477
RM
236.Nm dhcpcd
237itself never does any DNS updates.
e837a670
RM
238.Nm dhcpcd
239encodes the FQDN hostname as specified in
240.Li RFC1035 .
3adc5520 241.It Ic interface Ar interface
012fd5d3
RM
242Subsequent options are only parsed for this
243.Ar interface .
61dd6cf9
RM
244.It Ic ipv6ra_fork
245By default, when
246.Nm dhcpcd
247receives an IPv6 RA,
248.Nm dhcpcd
249will only fork to the background if the RA contains at least one unexpired
250RDNSS option.
251Set this option so to make
252.Nm dhcpcd
253always fork on an RA.
d7555c12 254.It Ic ipv6ra_own
eebe9a18
RM
255Disables kernel IPv6 Router Advertisment processing so dhcpcd can manage
256addresses and routes.
a521cdce 257This does not work reliably on any BSD system, probably due to kernel issues.
d7555c12 258.It Ic ipv6ra_own_default
eebe9a18
RM
259Each time dhcpcd receives an IPv6 Router Adveristment, dhcpcd will manage
260the default route only.
261This allows dhcpcd to prefer an interface for outbound traffic based on metric
262and/or user selection rather than the kernel.
a521cdce 263This does work reliably on BSD systems.
d7555c12 264.It Ic ipv6rs
eebe9a18
RM
265Enables IPv6 Router Advertisment solicitation.
266This is on by default, but is documented here in the case where it is disabled
267globally but needs to be enabled for one interface.
ba9dfb7a
RM
268.It Ic leasetime Ar seconds
269Request a leasetime of
270.Ar seconds .
065125d4
RM
271.It Ic metric Ar metric
272Metrics are used to prefer an interface over another one, lowest wins.
273.Nm dhcpcd
87b266d2 274will supply a default metric of 200 +
065125d4
RM
275.Xr if_nametoindex 3 .
276An extra 100 will be added for wireless interfaces.
7dab081f
RM
277.It Ic noalias
278IPv4 addresses added will overwrite a pre-existing address instead of working
279alongside.
ba9dfb7a 280.It Ic noarp
cf42802e
RM
281Don't send any ARP requests.
282This also disables IPv4LL.
413652c1
RM
283.It Ic nodev
284Don't load
285.Pa /dev
286management modules.
ba9dfb7a
RM
287.It Ic nogateway
288Don't install any default routes.
37156a6b
RM
289.It Ic nohook Ar script
290Don't run this hook script.
8276da82
RM
291Matches full name, or prefixed with 2 numbers optionally ending with
292.Pa .sh .
fc7ee231
RM
293.Pp
294So to stop
295.Nm dhcpcd
296from touching your DNS or MTU settings you would do:-
297.D1 nohook resolv.conf, mtu
bb8051bf
RM
298.It Ic noipv4
299Don't attempt to configure an IPv4 address.
ba9dfb7a
RM
300.It Ic noipv4ll
301Don't attempt to obtain an IPv4LL address if we failed to get one via DHCP.
302See
303.Rs
304.%T "RFC 3927"
305.Re
bb8051bf
RM
306.It Ic noipv6
307Don't attmept to configure an IPv6 address.
91cd7324 308.It Ic noipv6rs
4c6a8bec 309Disable solicitation and receipt of IPv6 Router Advertisements.
a26af491
RM
310.It Ic nolink
311Don't receive link messages about carrier status.
312You should only set this for buggy interface drivers.
cc45fbd7 313.It Ic option Ar option
d2616b08 314Requests the
cc45fbd7 315.Ar option
cf42802e
RM
316from the server.
317It can be a variable to be used in
ee4e620a 318.Xr dhcpcd-run-hooks 8
cf42802e 319or the numerical value.
b8ffa3cd
RM
320You can specify more
321.Ar option Ns s
322separated by commas, spaces or more
323.Ic option
324lines.
325Prepend dhcp6_ to
326.Ar option
327to request a DHCPv6 option.
328DHCPv4 options are mapped to DHCPv6 where applicable.
2063c6f9
RM
329.It Ic nooption Ar option
330Remove the option from the DHCP message.
331This should only be used when a DHCP server sends a non requested option
332that should not be processed.
1abffd5b
RM
333.It Ic destination Ar option
334If
335.Nm
336detects an address added to a point to point interface (PPP, TUN, etc) then
337it will set the listed DHCP options to the destination address of the
338interface.
6f767217
RM
339.It Ic profile Ar name
340Subsequent options are only parsed for this profile
341.Ar name .
1abffd5b 342.It Ic quiet
87b266d2 343Suppress any dhcpcd output to the console, except for errors.
1abffd5b 344.It Ic reboot Ar seconds
a2a9a498
RM
345Allow
346.Ar reboot
901b42de 347seconds before moving to the DISCOVER phase if we have an old lease to use.
499225e4 348The default is 5 seconds.
901b42de 349A setting of 0 seconds causes
a2a9a498 350.Nm dhcpcd
901b42de
RM
351to skip the REBOOT phase and go straight into DISCOVER.
352This is desirable for mobile users because if you change from network A to
353network B and they use the same subnet and the address from network A isn't
354in use on network B, then the DHCP server will remain silent even if authorative
355which means
356.Nm dhcpcd
357will timeout before moving back to the DISCOVER phase.
2662d519
RM
358.It Ic release
359.Nm dhcpcd
360will release the lease prior to stopping the interface.
cc45fbd7
RM
361.It Ic require Ar option
362Requires the
363.Ar option
364to be present in all DHCP messages, otherwise the message is ignored.
365It can be a variable to be used in
366.Xr dhcpcd-run-hooks 8
367or the numerical value.
87b266d2 368You can specify more options separated by commas, spaces or more require lines.
02d339e3
RM
369To enforce that
370.Nm dhcpcd
371only responds to DHCP servers and not BOOTP servers, you can
372.Ic require
373.Ar dhcp_message_type .
0aeb350c
RM
374.It Ic script Ar script
375Use
376.Ar script
377instead of the default
378.Pa @SCRIPT@ .
c53cf4ef
RM
379.It Ic ssid Ar ssid
380Subsequent options are only parsed for this wireless
381.Ar ssid .
91a44b91
RM
382.It Ic static Ar value
383Configures a static
384.Ar value .
385If you set
386.Ic ip_address
387then
388.Nm dhcpcd
389will not attempt to obtain a lease and just use the value for the address with
390an infinite lease time.
391.Pp
392Here is an example which configures a static address, routes and dns.
393.D1 interface eth0
394.D1 static ip_address=192.168.0.10/24
395.D1 static routers=192.168.0.1
396.D1 static domain_name_servers=192.168.0.1
1abffd5b
RM
397.Pp
398Here is an example for PPP which gives the destination a default route.
399It uses the special destination keyword to insert the destination address
400into the value.
401.D1 interface ppp0
402.D1 static ip_address=
403.D1 destination routers
d2616b08 404.It Ic timeout Ar seconds
b58bf81f
RM
405Timeout after
406.Ar seconds ,
407instead of the default 30.
d93d7adc
RM
408A setting of 0
409.Ar seconds
410causes
411.Nm dhcpcd
412to wait forever to get a lease.
b58bf81f
RM
413If
414.Nm dhcpcd
415is working on a single interface then
416.Nm dhcpcd
417will exit when a timeout occurs, otherwise
418.Nm dhcpcd
419will fork into the background.
420If using IPv4LL then
421.Nm dhcpcd
422start the IPv4LL process after the timeout and then wait a little longer
423before really timing out.
d2616b08 424.It Ic userclass Ar string
cf42802e
RM
425Tag the DHCP messages with the userclass.
426You can specify more than one.
bac03ede 427.It Ic vendor Ar code , Ns Ar value
87b266d2 428Add an encapsulated vendor option.
757520c5
RM
429.Ar code
430should be between 1 and 254 inclusive.
95d6dcfa
RM
431To add a raw vendor string, omit
432.Ar code
433but keep the comma.
757520c5
RM
434Examples.
435.Pp
436Set the vendor option 01 with an IP address.
437.D1 vendor 01,192.168.0.2
438Set the vendor option 02 with a hex code.
439.D1 vendor 02,01:02:03:04:05
440Set the vendor option 03 with an IP address as a string.
441.D1 vendor 03,\e"192.168.0.2\e"
87b266d2 442Set un-encapsulated vendor option to hello world.
9cb58952 443.D1 vendor ,"hello world"
bac03ede 444.It Ic vendorclassid Ar string
eebe9a18
RM
445The default is
446dhcpcd-<version>:<os>:<machine>:<platform>.
447For example
448.D1 dhcpcd-5.5.6:NetBSD-6.99.5:i386:i386
bac03ede 449If not set then none is sent.
eebe9a18
RM
450Some badly configured DHCP servers reject unknown vendorclassids.
451To work around it, try and impersonate Windows by using the MSFT vendorclassid.
7013b073 452.It Ic waitip Op 4 | 6
2a07a2af 453Wait for an address to be assigned before forking to the background.
7013b073
RM
4544 means wait for an IPv4 address to be assigned.
4556 means wait for an IPv6 address to be assigned.
8b7499fd
RM
456If no argument is given,
457.Nm
458will wait for any address protocol to be assigned.
459It is possible to wait for more than one address protocol and
460.Nm
461will only fork to the background when all waiting conditions are satisfied.
4242c9b3
RM
462.It Ic xidhwaddr
463Use the last four bytes of the hardware address as the DHCP xid instead
464of a randomly generated number.
eaa90296 465.El
ba9dfb7a 466.Sh SEE ALSO
0b4a1931 467.Xr fnmatch 3 ,
065125d4 468.Xr if_nametoindex 3 ,
0b4a1931
RM
469.Xr dhcpcd 8 ,
470.Xr dhcpcd-run-hooks 8
ba9dfb7a 471.Sh AUTHORS
2cfe8d07 472.An Roy Marples Aq Mt roy@marples.name
ba9dfb7a 473.Sh BUGS
ebc9d360
RM
474When configuring DHCPv6 you can only select one IA type.
475.Pp
fd73ceb1
RM
476Please report them to
477.Lk http://roy.marples.name/projects/dhcpcd