]>
Commit | Line | Data |
---|---|---|
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 | .\" | |
00ababe4 | 25 | .Dd April 1, 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 |
32 | Although | |
33 | .Nm dhcpcd | |
34 | can do everything from the command line, there are cases where it's just easier | |
cf42802e RM |
35 | to do it once in a configuration file. |
36 | Most of the options found in | |
ba9dfb7a | 37 | .Xr dhcpcd 8 |
cf42802e RM |
38 | can be used here. |
39 | The first word on the line is the option and the rest of the line is the value. | |
40 | Leading and trailing whitespace for the option and value are trimmed. | |
41 | You can escape characters in the value using the \\ character. | |
967194ef RM |
42 | .Pp |
43 | Blank lines and lines starting with # are ignored. | |
ba9dfb7a RM |
44 | .Pp |
45 | Here's a list of available options: | |
46 | .Bl -tag -width indent | |
ba97e494 RM |
47 | .It Ic allowinterfaces Ar pattern |
48 | When discovering interfaces, the interface name must match | |
49 | .Ar pattern | |
50 | which is a space or comma separated list of patterns passed to | |
51 | .Xr fnmatch 3 . | |
52 | If the same interface is matched in | |
53 | .Ic denyinterfaces | |
54 | then it is still denied. | |
55 | .It Ic denyinterfaces Ar pattern | |
56 | When discovering interfaces, the interface name must not match | |
57 | .Ar pattern | |
58 | which 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 | 62 | will arping each address in order before attempting DHCP. |
6f767217 RM |
63 | If an address is found, we will select the replying hardware address as the |
64 | profile, otherwise the ip address. | |
65 | Example: | |
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 |
73 | Background immediately. | |
74 | This is useful for startup scripts which don't disable link messages for | |
75 | carrier status. | |
6f767217 | 76 | .It Ic blacklist Ar address Ns Op /cidr |
ce6b39df | 77 | Ignores all packets from |
6f767217 | 78 | .Ar address Ns Op /cidr . |
bf80d526 RM |
79 | .It Ic whitelist Ar address Ns Op /cidr |
80 | Only accept packets from | |
81 | .Ar address Ns Op /cidr . | |
82 | .Ic blacklist | |
83 | is ignored if | |
84 | .Ic whitelist | |
85 | is set. | |
900b3da4 RM |
86 | .It Ic broadcast |
87 | Instructs the DHCP server to broadcast replies back to the client. | |
88 | Normally this is only set for non Ethernet interfaces, | |
89 | such as FireWire and InfiniBand. | |
90 | In most cases, | |
91 | .Nm dhcpcd | |
92 | will set this automatically. | |
6bfd88f1 RM |
93 | .It Ic env Ar value |
94 | Push | |
95 | .Ar value | |
96 | to the environment for use in | |
97 | .Xr dhcpcd-run-hooks 8 . | |
98 | For 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 |
102 | Send the |
103 | .Ar clientid . | |
d2616b08 | 104 | If the string is of the format 01:02:03 then it is encoded as hex. |
3faba9e6 RM |
105 | For interfaces whose hardware address is longer than 8 bytes, or if the |
106 | .Ar clientid | |
107 | is an empty string then | |
108 | .Nm dhcpcd | |
109 | sends a default | |
110 | .Ar clientid | |
111 | of the hardware family and the hardware address. | |
d2616b08 RM |
112 | .It Ic duid |
113 | Generate an | |
114 | .Rs | |
115 | .%T "RFC 4361" | |
116 | .Re | |
cf42802e RM |
117 | compliant clientid. |
118 | This requires persistent storage and not all DHCP servers work with it so it's | |
119 | not enabled by default. | |
d2616b08 RM |
120 | The duid generated will be held in |
121 | .Pa @SYSCONFDIR@/dhcpcd.duid | |
122 | and should not be copied to other hosts. | |
ff021b0b RM |
123 | .It Ic fallback Ar profile |
124 | Fallback to using this profile if DHCP fails. | |
125 | This allows you to configure a static profile instead of using ZeroConf. | |
ba9dfb7a | 126 | .It Ic hostname Ar name |
35d02ae6 | 127 | Sends |
ff021b0b | 128 | .Ar hostname |
35d02ae6 RM |
129 | to the DHCP server so it can be registered in DNS. |
130 | If | |
35ff0dbb | 131 | .Ar hostname |
35d02ae6 RM |
132 | is an empty string then the current system hostname is sent. |
133 | If | |
134 | .Ar hostname | |
135 | is a FQDN (ie, contains a .) then it will be encoded as such. | |
00ababe4 RM |
136 | .It Ic ia_na Ar iaid |
137 | Request a DHCPv6 Normal Address for | |
138 | .Ar iaid . | |
139 | If none is specified, a default | |
140 | .Ar iaid | |
141 | is used. | |
142 | If the interface name is 4 characters or less then that is used, | |
143 | otherwise the interface index is used. | |
144 | .It Ic ia_ta Ar iaid | |
145 | Request a DHCPv6 Temporary Address for | |
146 | .Ar iaid . | |
147 | .It Ic ia_pd Ar iaid Op Ar interface / Ar sla_id Op / Ar sla_len | |
148 | Request a DHCPv6 Delegated Prefix for | |
149 | .Ar iaid . | |
150 | If an | |
151 | .Ar interface | |
152 | and | |
153 | .Ar sla_id | |
154 | is given, | |
155 | then an address is also assigned to that | |
156 | .Ar interface . | |
157 | A default | |
158 | .Ar sla_len | |
159 | of 16 is assumed if not given. | |
160 | IPv6RS should be disabled globally when requesting a Prefix Delegation like so: | |
161 | .Pp | |
162 | .D1 noipv6rs | |
163 | .Pp | |
164 | .D1 interface eth0 | |
165 | .D1 ia_pd 00:11:22:33 eth1/33:44:55:66 | |
d7555c12 RM |
166 | .It Ic ipv4only |
167 | Only configure IPv4. | |
168 | .It Ic ipv6only | |
169 | Only confgiure IPv6. | |
35ff0dbb RM |
170 | .It Ic fqdn Op none | ptr | both |
171 | none disables FQDN encoding, ptr just asks the DHCP server to update the PTR | |
172 | record of the host in DNS whereas both also updates the A record. | |
1b3bc477 RM |
173 | .Nm dhcpcd |
174 | itself never does any DNS updates. | |
e837a670 RM |
175 | .Nm dhcpcd |
176 | encodes the FQDN hostname as specified in | |
177 | .Li RFC1035 . | |
3adc5520 | 178 | .It Ic interface Ar interface |
012fd5d3 RM |
179 | Subsequent options are only parsed for this |
180 | .Ar interface . | |
61dd6cf9 RM |
181 | .It Ic ipv6ra_fork |
182 | By default, when | |
183 | .Nm dhcpcd | |
184 | receives an IPv6 RA, | |
185 | .Nm dhcpcd | |
186 | will only fork to the background if the RA contains at least one unexpired | |
187 | RDNSS option. | |
188 | Set this option so to make | |
189 | .Nm dhcpcd | |
190 | always fork on an RA. | |
d7555c12 | 191 | .It Ic ipv6ra_own |
eebe9a18 RM |
192 | Disables kernel IPv6 Router Advertisment processing so dhcpcd can manage |
193 | addresses and routes. | |
d7555c12 | 194 | .It Ic ipv6ra_own_default |
eebe9a18 RM |
195 | Each time dhcpcd receives an IPv6 Router Adveristment, dhcpcd will manage |
196 | the default route only. | |
197 | This allows dhcpcd to prefer an interface for outbound traffic based on metric | |
198 | and/or user selection rather than the kernel. | |
d7555c12 | 199 | .It Ic ipv6rs |
eebe9a18 RM |
200 | Enables IPv6 Router Advertisment solicitation. |
201 | This is on by default, but is documented here in the case where it is disabled | |
202 | globally but needs to be enabled for one interface. | |
ba9dfb7a RM |
203 | .It Ic leasetime Ar seconds |
204 | Request a leasetime of | |
205 | .Ar seconds . | |
065125d4 RM |
206 | .It Ic metric Ar metric |
207 | Metrics are used to prefer an interface over another one, lowest wins. | |
208 | .Nm dhcpcd | |
87b266d2 | 209 | will supply a default metric of 200 + |
065125d4 RM |
210 | .Xr if_nametoindex 3 . |
211 | An extra 100 will be added for wireless interfaces. | |
7dab081f RM |
212 | .It Ic noalias |
213 | IPv4 addresses added will overwrite a pre-existing address instead of working | |
214 | alongside. | |
ba9dfb7a | 215 | .It Ic noarp |
cf42802e RM |
216 | Don't send any ARP requests. |
217 | This also disables IPv4LL. | |
ba9dfb7a RM |
218 | .It Ic nogateway |
219 | Don't install any default routes. | |
37156a6b RM |
220 | .It Ic nohook Ar script |
221 | Don't run this hook script. | |
8276da82 RM |
222 | Matches full name, or prefixed with 2 numbers optionally ending with |
223 | .Pa .sh . | |
fc7ee231 RM |
224 | .Pp |
225 | So to stop | |
226 | .Nm dhcpcd | |
227 | from touching your DNS or MTU settings you would do:- | |
228 | .D1 nohook resolv.conf, mtu | |
ba9dfb7a RM |
229 | .It Ic noipv4ll |
230 | Don't attempt to obtain an IPv4LL address if we failed to get one via DHCP. | |
231 | See | |
232 | .Rs | |
233 | .%T "RFC 3927" | |
234 | .Re | |
91cd7324 | 235 | .It Ic noipv6rs |
4c6a8bec | 236 | Disable solicitation and receipt of IPv6 Router Advertisements. |
a26af491 RM |
237 | .It Ic nolink |
238 | Don't receive link messages about carrier status. | |
239 | You should only set this for buggy interface drivers. | |
cc45fbd7 | 240 | .It Ic option Ar option |
d2616b08 | 241 | Requests the |
cc45fbd7 | 242 | .Ar option |
cf42802e RM |
243 | from the server. |
244 | It can be a variable to be used in | |
ee4e620a | 245 | .Xr dhcpcd-run-hooks 8 |
cf42802e | 246 | or the numerical value. |
87b266d2 | 247 | You can specify more options separated by commas, spaces or more option lines. |
2063c6f9 RM |
248 | .It Ic nooption Ar option |
249 | Remove the option from the DHCP message. | |
250 | This should only be used when a DHCP server sends a non requested option | |
251 | that should not be processed. | |
1abffd5b RM |
252 | .It Ic destination Ar option |
253 | If | |
254 | .Nm | |
255 | detects an address added to a point to point interface (PPP, TUN, etc) then | |
256 | it will set the listed DHCP options to the destination address of the | |
257 | interface. | |
6f767217 RM |
258 | .It Ic profile Ar name |
259 | Subsequent options are only parsed for this profile | |
260 | .Ar name . | |
1abffd5b | 261 | .It Ic quiet |
87b266d2 | 262 | Suppress any dhcpcd output to the console, except for errors. |
1abffd5b | 263 | .It Ic reboot Ar seconds |
a2a9a498 RM |
264 | Allow |
265 | .Ar reboot | |
266 | seconds before moving to the discover phase if we have an old lease to use. | |
499225e4 | 267 | The default is 5 seconds. |
a2a9a498 RM |
268 | A setting if 0 seconds causes |
269 | .Nm dhcpcd | |
270 | to skip the reboot phase and go straight into discover. | |
2662d519 RM |
271 | .It Ic release |
272 | .Nm dhcpcd | |
273 | will release the lease prior to stopping the interface. | |
cc45fbd7 RM |
274 | .It Ic require Ar option |
275 | Requires the | |
276 | .Ar option | |
277 | to be present in all DHCP messages, otherwise the message is ignored. | |
278 | It can be a variable to be used in | |
279 | .Xr dhcpcd-run-hooks 8 | |
280 | or the numerical value. | |
87b266d2 | 281 | You can specify more options separated by commas, spaces or more require lines. |
02d339e3 RM |
282 | To enforce that |
283 | .Nm dhcpcd | |
284 | only responds to DHCP servers and not BOOTP servers, you can | |
285 | .Ic require | |
286 | .Ar dhcp_message_type . | |
0aeb350c RM |
287 | .It Ic script Ar script |
288 | Use | |
289 | .Ar script | |
290 | instead of the default | |
291 | .Pa @SCRIPT@ . | |
c53cf4ef RM |
292 | .It Ic ssid Ar ssid |
293 | Subsequent options are only parsed for this wireless | |
294 | .Ar ssid . | |
91a44b91 RM |
295 | .It Ic static Ar value |
296 | Configures a static | |
297 | .Ar value . | |
298 | If you set | |
299 | .Ic ip_address | |
300 | then | |
301 | .Nm dhcpcd | |
302 | will not attempt to obtain a lease and just use the value for the address with | |
303 | an infinite lease time. | |
304 | .Pp | |
305 | Here is an example which configures a static address, routes and dns. | |
306 | .D1 interface eth0 | |
307 | .D1 static ip_address=192.168.0.10/24 | |
308 | .D1 static routers=192.168.0.1 | |
309 | .D1 static domain_name_servers=192.168.0.1 | |
1abffd5b RM |
310 | .Pp |
311 | Here is an example for PPP which gives the destination a default route. | |
312 | It uses the special destination keyword to insert the destination address | |
313 | into the value. | |
314 | .D1 interface ppp0 | |
315 | .D1 static ip_address= | |
316 | .D1 destination routers | |
d2616b08 | 317 | .It Ic timeout Ar seconds |
fedb3da0 | 318 | The default timeout for waiting for a DHCP response is 30 seconds which may |
d2616b08 RM |
319 | be too long or too short and can be changed here. |
320 | .It Ic userclass Ar string | |
cf42802e RM |
321 | Tag the DHCP messages with the userclass. |
322 | You can specify more than one. | |
bac03ede | 323 | .It Ic vendor Ar code , Ns Ar value |
87b266d2 | 324 | Add an encapsulated vendor option. |
757520c5 RM |
325 | .Ar code |
326 | should be between 1 and 254 inclusive. | |
95d6dcfa RM |
327 | To add a raw vendor string, omit |
328 | .Ar code | |
329 | but keep the comma. | |
757520c5 RM |
330 | Examples. |
331 | .Pp | |
332 | Set the vendor option 01 with an IP address. | |
333 | .D1 vendor 01,192.168.0.2 | |
334 | Set the vendor option 02 with a hex code. | |
335 | .D1 vendor 02,01:02:03:04:05 | |
336 | Set the vendor option 03 with an IP address as a string. | |
337 | .D1 vendor 03,\e"192.168.0.2\e" | |
87b266d2 | 338 | Set un-encapsulated vendor option to hello world. |
9cb58952 | 339 | .D1 vendor ,"hello world" |
bac03ede | 340 | .It Ic vendorclassid Ar string |
eebe9a18 RM |
341 | The default is |
342 | dhcpcd-<version>:<os>:<machine>:<platform>. | |
343 | For example | |
344 | .D1 dhcpcd-5.5.6:NetBSD-6.99.5:i386:i386 | |
bac03ede | 345 | If not set then none is sent. |
eebe9a18 RM |
346 | Some badly configured DHCP servers reject unknown vendorclassids. |
347 | To work around it, try and impersonate Windows by using the MSFT vendorclassid. | |
2a07a2af RM |
348 | .It Ic waitip |
349 | Wait for an address to be assigned before forking to the background. | |
4242c9b3 RM |
350 | .It Ic xidhwaddr |
351 | Use the last four bytes of the hardware address as the DHCP xid instead | |
352 | of a randomly generated number. | |
eaa90296 | 353 | .El |
ba9dfb7a | 354 | .Sh SEE ALSO |
ee4e620a | 355 | .Xr dhcpcd-run-hooks 8 , |
ba97e494 | 356 | .Xr dhcpcd 8 , |
065125d4 | 357 | .Xr if_nametoindex 3 , |
ba97e494 | 358 | .Xr fnmatch 3 |
ba9dfb7a | 359 | .Sh AUTHORS |
760f7628 | 360 | .An Roy Marples Aq roy@marples.name |
ba9dfb7a | 361 | .Sh BUGS |
fd73ceb1 RM |
362 | Please report them to |
363 | .Lk http://roy.marples.name/projects/dhcpcd |