]> git.ipfire.org Git - thirdparty/dhcpcd.git/blame - dhcpcd.conf.5.in
Use Mt for email address.
[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.\"
a521cdce 25.Dd June 19, 2013
ba9dfb7a 26.Dt DHCPCD.CONF 5 SMM
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.
6bfd88f1
RM
93.It Ic env Ar value
94Push
95.Ar value
96to the environment for use in
97.Xr dhcpcd-run-hooks 8 .
98For example, you can force the hostname hook to always set the hostname with
99.Ic env
100.Va force_hostname=YES .
d2616b08 101.It Ic clientid Ar string
c989b023
RM
102Send the
103.Ar clientid .
d2616b08 104If the string is of the format 01:02:03 then it is encoded as hex.
3faba9e6
RM
105For interfaces whose hardware address is longer than 8 bytes, or if the
106.Ar clientid
107is an empty string then
108.Nm dhcpcd
109sends a default
110.Ar clientid
111of the hardware family and the hardware address.
d2616b08
RM
112.It Ic duid
113Generate an
114.Rs
115.%T "RFC 4361"
116.Re
cf42802e 117compliant clientid.
7e068c85
RM
118If persistent storage is available then a DUID-LLT (link local address + time)
119is generated, otherwise DUID-LL is generated (link local address).
120The DUID-LLT generated will be held in
d2616b08
RM
121.Pa @SYSCONFDIR@/dhcpcd.duid
122and should not be copied to other hosts.
ff021b0b
RM
123.It Ic fallback Ar profile
124Fallback to using this profile if DHCP fails.
125This allows you to configure a static profile instead of using ZeroConf.
ba9dfb7a 126.It Ic hostname Ar name
35d02ae6 127Sends
ff021b0b 128.Ar hostname
35d02ae6
RM
129to the DHCP server so it can be registered in DNS.
130If
35ff0dbb 131.Ar hostname
35d02ae6
RM
132is an empty string then the current system hostname is sent.
133If
134.Ar hostname
135is a FQDN (ie, contains a .) then it will be encoded as such.
22ea2b0d 136.It Ic ia_na Op Ar iaid
00ababe4
RM
137Request a DHCPv6 Normal Address for
138.Ar iaid .
139If none is specified, a default
140.Ar iaid
141is used.
142If the interface name is 4 characters or less then that is used,
143otherwise the interface index is used.
22ea2b0d 144.It Ic ia_ta Op Ar iaid
00ababe4
RM
145Request a DHCPv6 Temporary Address for
146.Ar iaid .
5985c4e2 147.It Ic ia_pd Op Ar iaid Op Ar interface Op / Ar sla_id Op / Ar prefix_len
00ababe4
RM
148Request a DHCPv6 Delegated Prefix for
149.Ar iaid .
22ea2b0d
RM
150If no
151.Ar interface
152is given then we will assign a prefix to every other interface with a unique
153.Ar sla_id
154for each, starting from 0.
155Otherwise addresses are only assigned for each
00ababe4
RM
156.Ar interface
157and
158.Ar sla_id
00ababe4 159A default
367f7b11 160.Ar prefix_len
22ea2b0d 161of 64 is assumed.
367f7b11
RM
162.Ar sla_id
163is an integer and is added to the prefix which must fit inside
164.Ar prefix_len
165less the length of the delegated prefix.
22ea2b0d
RM
166You can specify multiple
167.Ar interface /
168.Ar sla_id /
169.Ar prefix_len
170per
171.Ic ia_pd ,
172space separated.
00ababe4
RM
173IPv6RS should be disabled globally when requesting a Prefix Delegation like so:
174.Pp
175.D1 noipv6rs
176.Pp
177.D1 interface eth0
74ceb961 178.D1 ia_pd 1 eth1/0 eth2/1
d7555c12
RM
179.It Ic ipv4only
180Only configure IPv4.
181.It Ic ipv6only
182Only confgiure IPv6.
cc3c3560
RM
183.It Ic fqdn Op disable | ptr | both
184ptr just asks the DHCP server to update the PTR
35ff0dbb 185record of the host in DNS whereas both also updates the A record.
cc3c3560
RM
186disable will disable the FQDN option.
187The default is both.
1b3bc477
RM
188.Nm dhcpcd
189itself never does any DNS updates.
e837a670
RM
190.Nm dhcpcd
191encodes the FQDN hostname as specified in
192.Li RFC1035 .
3adc5520 193.It Ic interface Ar interface
012fd5d3
RM
194Subsequent options are only parsed for this
195.Ar interface .
61dd6cf9
RM
196.It Ic ipv6ra_fork
197By default, when
198.Nm dhcpcd
199receives an IPv6 RA,
200.Nm dhcpcd
201will only fork to the background if the RA contains at least one unexpired
202RDNSS option.
203Set this option so to make
204.Nm dhcpcd
205always fork on an RA.
d7555c12 206.It Ic ipv6ra_own
eebe9a18
RM
207Disables kernel IPv6 Router Advertisment processing so dhcpcd can manage
208addresses and routes.
a521cdce 209This does not work reliably on any BSD system, probably due to kernel issues.
d7555c12 210.It Ic ipv6ra_own_default
eebe9a18
RM
211Each time dhcpcd receives an IPv6 Router Adveristment, dhcpcd will manage
212the default route only.
213This allows dhcpcd to prefer an interface for outbound traffic based on metric
214and/or user selection rather than the kernel.
a521cdce 215This does work reliably on BSD systems.
d7555c12 216.It Ic ipv6rs
eebe9a18
RM
217Enables IPv6 Router Advertisment solicitation.
218This is on by default, but is documented here in the case where it is disabled
219globally but needs to be enabled for one interface.
ba9dfb7a
RM
220.It Ic leasetime Ar seconds
221Request a leasetime of
222.Ar seconds .
065125d4
RM
223.It Ic metric Ar metric
224Metrics are used to prefer an interface over another one, lowest wins.
225.Nm dhcpcd
87b266d2 226will supply a default metric of 200 +
065125d4
RM
227.Xr if_nametoindex 3 .
228An extra 100 will be added for wireless interfaces.
7dab081f
RM
229.It Ic noalias
230IPv4 addresses added will overwrite a pre-existing address instead of working
231alongside.
ba9dfb7a 232.It Ic noarp
cf42802e
RM
233Don't send any ARP requests.
234This also disables IPv4LL.
ba9dfb7a
RM
235.It Ic nogateway
236Don't install any default routes.
37156a6b
RM
237.It Ic nohook Ar script
238Don't run this hook script.
8276da82
RM
239Matches full name, or prefixed with 2 numbers optionally ending with
240.Pa .sh .
fc7ee231
RM
241.Pp
242So to stop
243.Nm dhcpcd
244from touching your DNS or MTU settings you would do:-
245.D1 nohook resolv.conf, mtu
ba9dfb7a
RM
246.It Ic noipv4ll
247Don't attempt to obtain an IPv4LL address if we failed to get one via DHCP.
248See
249.Rs
250.%T "RFC 3927"
251.Re
91cd7324 252.It Ic noipv6rs
4c6a8bec 253Disable solicitation and receipt of IPv6 Router Advertisements.
a26af491
RM
254.It Ic nolink
255Don't receive link messages about carrier status.
256You should only set this for buggy interface drivers.
cc45fbd7 257.It Ic option Ar option
d2616b08 258Requests the
cc45fbd7 259.Ar option
cf42802e
RM
260from the server.
261It can be a variable to be used in
ee4e620a 262.Xr dhcpcd-run-hooks 8
cf42802e 263or the numerical value.
b8ffa3cd
RM
264You can specify more
265.Ar option Ns s
266separated by commas, spaces or more
267.Ic option
268lines.
269Prepend dhcp6_ to
270.Ar option
271to request a DHCPv6 option.
272DHCPv4 options are mapped to DHCPv6 where applicable.
2063c6f9
RM
273.It Ic nooption Ar option
274Remove the option from the DHCP message.
275This should only be used when a DHCP server sends a non requested option
276that should not be processed.
1abffd5b
RM
277.It Ic destination Ar option
278If
279.Nm
280detects an address added to a point to point interface (PPP, TUN, etc) then
281it will set the listed DHCP options to the destination address of the
282interface.
6f767217
RM
283.It Ic profile Ar name
284Subsequent options are only parsed for this profile
285.Ar name .
1abffd5b 286.It Ic quiet
87b266d2 287Suppress any dhcpcd output to the console, except for errors.
1abffd5b 288.It Ic reboot Ar seconds
a2a9a498
RM
289Allow
290.Ar reboot
901b42de 291seconds before moving to the DISCOVER phase if we have an old lease to use.
499225e4 292The default is 5 seconds.
901b42de 293A setting of 0 seconds causes
a2a9a498 294.Nm dhcpcd
901b42de
RM
295to skip the REBOOT phase and go straight into DISCOVER.
296This is desirable for mobile users because if you change from network A to
297network B and they use the same subnet and the address from network A isn't
298in use on network B, then the DHCP server will remain silent even if authorative
299which means
300.Nm dhcpcd
301will timeout before moving back to the DISCOVER phase.
2662d519
RM
302.It Ic release
303.Nm dhcpcd
304will release the lease prior to stopping the interface.
cc45fbd7
RM
305.It Ic require Ar option
306Requires the
307.Ar option
308to be present in all DHCP messages, otherwise the message is ignored.
309It can be a variable to be used in
310.Xr dhcpcd-run-hooks 8
311or the numerical value.
87b266d2 312You can specify more options separated by commas, spaces or more require lines.
02d339e3
RM
313To enforce that
314.Nm dhcpcd
315only responds to DHCP servers and not BOOTP servers, you can
316.Ic require
317.Ar dhcp_message_type .
0aeb350c
RM
318.It Ic script Ar script
319Use
320.Ar script
321instead of the default
322.Pa @SCRIPT@ .
c53cf4ef
RM
323.It Ic ssid Ar ssid
324Subsequent options are only parsed for this wireless
325.Ar ssid .
91a44b91
RM
326.It Ic static Ar value
327Configures a static
328.Ar value .
329If you set
330.Ic ip_address
331then
332.Nm dhcpcd
333will not attempt to obtain a lease and just use the value for the address with
334an infinite lease time.
335.Pp
336Here is an example which configures a static address, routes and dns.
337.D1 interface eth0
338.D1 static ip_address=192.168.0.10/24
339.D1 static routers=192.168.0.1
340.D1 static domain_name_servers=192.168.0.1
1abffd5b
RM
341.Pp
342Here is an example for PPP which gives the destination a default route.
343It uses the special destination keyword to insert the destination address
344into the value.
345.D1 interface ppp0
346.D1 static ip_address=
347.D1 destination routers
d2616b08 348.It Ic timeout Ar seconds
fedb3da0 349The default timeout for waiting for a DHCP response is 30 seconds which may
d2616b08 350be too long or too short and can be changed here.
d93d7adc
RM
351A setting of 0
352.Ar seconds
353causes
354.Nm dhcpcd
355to wait forever to get a lease.
d2616b08 356.It Ic userclass Ar string
cf42802e
RM
357Tag the DHCP messages with the userclass.
358You can specify more than one.
bac03ede 359.It Ic vendor Ar code , Ns Ar value
87b266d2 360Add an encapsulated vendor option.
757520c5
RM
361.Ar code
362should be between 1 and 254 inclusive.
95d6dcfa
RM
363To add a raw vendor string, omit
364.Ar code
365but keep the comma.
757520c5
RM
366Examples.
367.Pp
368Set the vendor option 01 with an IP address.
369.D1 vendor 01,192.168.0.2
370Set the vendor option 02 with a hex code.
371.D1 vendor 02,01:02:03:04:05
372Set the vendor option 03 with an IP address as a string.
373.D1 vendor 03,\e"192.168.0.2\e"
87b266d2 374Set un-encapsulated vendor option to hello world.
9cb58952 375.D1 vendor ,"hello world"
bac03ede 376.It Ic vendorclassid Ar string
eebe9a18
RM
377The default is
378dhcpcd-<version>:<os>:<machine>:<platform>.
379For example
380.D1 dhcpcd-5.5.6:NetBSD-6.99.5:i386:i386
bac03ede 381If not set then none is sent.
eebe9a18
RM
382Some badly configured DHCP servers reject unknown vendorclassids.
383To work around it, try and impersonate Windows by using the MSFT vendorclassid.
2a07a2af
RM
384.It Ic waitip
385Wait for an address to be assigned before forking to the background.
4242c9b3
RM
386.It Ic xidhwaddr
387Use the last four bytes of the hardware address as the DHCP xid instead
388of a randomly generated number.
eaa90296 389.El
ba9dfb7a 390.Sh SEE ALSO
ee4e620a 391.Xr dhcpcd-run-hooks 8 ,
ba97e494 392.Xr dhcpcd 8 ,
065125d4 393.Xr if_nametoindex 3 ,
ba97e494 394.Xr fnmatch 3
ba9dfb7a 395.Sh AUTHORS
2cfe8d07 396.An Roy Marples Aq Mt roy@marples.name
ba9dfb7a 397.Sh BUGS
fd73ceb1
RM
398Please report them to
399.Lk http://roy.marples.name/projects/dhcpcd