source: rtems-libbsd/dhcpcd/dhcpcd.conf.5.in @ f949b43

55-freebsd-126-freebsd-12
Last change on this file since f949b43 was f2ed769, checked in by Sebastian Huber <sebastian.huber@…>, on 01/30/14 at 12:29:46

DHCPCD(8): Import

Import DHCPCD(8) from:

http://roy.marples.name/projects/dhcpcd/

The upstream sources can be obtained via:

fossil clone http://roy.marples.name/projects/dhcpcd

The imported version is 2014-01-29 19:46:44 [6b209507bb].

  • Property mode set to 100644
File size: 20.5 KB
Line 
1.\" Copyright (c) 2006-2014 Roy Marples
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.\"
25.Dd January 29, 2014
26.Dt DHCPCD.CONF 5
27.Os
28.Sh NAME
29.Nm dhcpcd.conf
30.Nd dhcpcd configuration file
31.Sh DESCRIPTION
32Although
33.Nm dhcpcd
34can do everything from the command line, there are cases where it's just easier
35to do it once in a configuration file.
36Most of the options found in
37.Xr dhcpcd 8
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.
42.Pp
43Blank lines and lines starting with # are ignored.
44.Pp
45Here's a list of available options:
46.Bl -tag -width indent
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 .
60.It Ic arping Ar address Op address
61.Nm dhcpcd
62will arping each address in order before attempting DHCP.
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
72.It Ic authprotocol Ar protocol Ar algorithm Ar rdm
73Authenticate DHCP messages.
74See the Supported Protocols section.
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.
87.It Ic background
88Background immediately.
89This is useful for startup scripts which don't disable link messages for
90carrier status.
91.It Ic blacklist Ar address Ns Op /cidr
92Ignores all packets from
93.Ar address Ns Op /cidr .
94.It Ic whitelist Ar address Ns Op /cidr
95Only accept packets from
96.Ar address Ns Op /cidr .
97.Ic blacklist
98is ignored if
99.Ic whitelist
100is set.
101.It Ic broadcast
102Instructs the DHCP server to broadcast replies back to the client.
103Normally this is only set for non Ethernet interfaces,
104such as FireWire and InfiniBand.
105In most cases,
106.Nm dhcpcd
107will set this automatically.
108.It Ic dev Ar value
109Load the
110.Ar value
111.Pa /dev
112management module.
113.Nm dhcpcd
114will load the first one found to work, if any.
115.It Ic env Ar value
116Push
117.Ar value
118to the environment for use in
119.Xr dhcpcd-run-hooks 8 .
120For example, you can force the hostname hook to always set the hostname with
121.Ic env
122.Va force_hostname=YES .
123.Pp
124If the hostname is set, will be will set to the FQDN if possible as per
125RFC 4702 section 3.1.
126If the FQDN option is missing,
127.Nm dhcpcd
128will still try and set a FQDN from the hostname and domain options for
129consistency.
130To override this, set
131.Ic env
132.Va hostname_fqdn=[YES|NO|SERVER] .
133A value of server means just what the server says, don't manipulate it.
134This could lead to an inconsistent hostname on a DHCPv4 and DHCPv6 network
135where the DHCPv4 hostname is short and the DHCPv6 has an FQDN.
136DHCPv6 has no hostname option.
137.It Ic clientid Ar string
138Send the
139.Ar clientid .
140If the string is of the format 01:02:03 then it is encoded as hex.
141For interfaces whose hardware address is longer than 8 bytes, or if the
142.Ar clientid
143is an empty string then
144.Nm dhcpcd
145sends a default
146.Ar clientid
147of the hardware family and the hardware address.
148.It Ic duid
149Generate an
150.Rs
151.%T "RFC 4361"
152.Re
153compliant DHCP Unique Identifier.
154If persistent storage is available then a DUID-LLT (link local address + time)
155is generated, otherwise DUID-LL is generated (link local address).
156This, plus the IAID will be used as the
157.Ic clientid .
158The DUID-LLT generated will be held in
159.Pa @SYSCONFDIR@/dhcpcd.duid
160and should not be copied to other hosts.
161.It Ic iaid Ar iaid
162Set the Interface Association Identifier to
163.Ar iaid .
164This option must be used in an
165.Ic interface
166block.
167This defaults to the last 4 bytes of the hardware address assigned to the
168interface.
169Each instance of this should be unique within the scope of the client and
170.Nm dhcpcd
171warns if a conflict is detected.
172If there is a conflict, it is only a problem if the conflicted IAIDs are
173used on the same network.
174.It Ic persistent
175.Nm dhcpcd
176normally de-configures the interface and configuration when it exits.
177Sometimes, this isn't desirable if, for example, you have root mounted over
178NFS or SSH clients connect to this host and they need to be notified of
179the host shutting down.
180You can use this option to stop this from happening.
181.It Ic fallback Ar profile
182Fallback to using this profile if DHCP fails.
183This allows you to configure a static profile instead of using ZeroConf.
184.It Ic hostname Ar name
185Sends
186.Ar hostname
187to the DHCP server so it can be registered in DNS.
188If
189.Ar hostname
190is an empty string then the current system hostname is sent.
191If
192.Ar hostname
193is a FQDN (ie, contains a .) then it will be encoded as such.
194.It Ic hostname_short
195Sends the short hostname to the DHCP server instead of the FQDN.
196This is useful because DHCP servers will not register the FQDN in their
197DNS if the domain part does not match theirs.
198.Pp
199Also, see the
200.Ic env
201option above to control how the hostname is set on the host.
202.It Ic ia_na Op Ar iaid
203Request a DHCPv6 Normal Address for
204.Ar iaid .
205.Ar iaid
206defaults to the
207.Ic iaid
208option as described above.
209You can request more than one ia_na by specifying a unique
210.Ar iaid
211for each one.
212.It Ic ia_ta Op Ar iaid
213Request a DHCPv6 Temporary Address for
214.Ar iaid .
215You can request more than one ia_ta by specifying a unique
216.Ar iaid
217for each one.
218.It Ic ia_pd Op Ar iaid Op Ar interface Op / Ar sla_id Op / Ar prefix_len
219Request a DHCPv6 Delegated Prefix for
220.Ar iaid .
221This option must be used in an
222.Ic interface
223block.
224If no
225.Ar interface
226is given then we will assign a prefix to every other interface with a unique
227.Ar sla_id
228for each, starting from 0.
229Otherwise addresses are only assigned for each
230.Ar interface
231and
232.Ar sla_id .
233You cannot assign a prefix to the requesting interface.
234.Nm dhcpcd
235has to be running for all the interfaces it is delegating to.
236A default
237.Ar prefix_len
238of 64 is assumed.
239.Ar sla_id
240is an integer and is added to the prefix which must fit inside
241.Ar prefix_len
242less the length of the delegated prefix.
243You can specify multiple
244.Ar interface /
245.Ar sla_id /
246.Ar prefix_len
247per
248.Ic ia_pd ,
249space separated.
250IPv6RS should be disabled globally when requesting a Prefix Delegation like so:
251.Pp
252.D1 noipv6rs
253.D1 # Don't touch eth3 at all
254.D1 denyinterfaces eth3
255.Pp
256.D1 interface eth0
257.D1 ia_pd 1 eth1/0 eth2/1
258.Pp
259.D1 # Disable automatic address configuration for eth1
260.D1 # eth1 still gets a delegated prefix
261.D1 interface eth1
262.D1 noipv4
263.D1 noipv6
264.It Ic ipv4only
265Only configure IPv4.
266.It Ic ipv6only
267Only confgiure IPv6.
268.It Ic fqdn Op disable | ptr | both
269ptr just asks the DHCP server to update the PTR
270record of the host in DNS whereas both also updates the A record.
271disable will disable the FQDN option.
272The default is both.
273.Nm dhcpcd
274itself never does any DNS updates.
275.Nm dhcpcd
276encodes the FQDN hostname as specified in
277.Li RFC1035 .
278.It Ic interface Ar interface
279Subsequent options are only parsed for this
280.Ar interface .
281.It Ic ipv6ra_fork
282By default, when
283.Nm dhcpcd
284receives an IPv6 RA,
285.Nm dhcpcd
286will only fork to the background if the RA contains at least one unexpired
287RDNSS option.
288Set this option so to make
289.Nm dhcpcd
290always fork on an RA.
291.It Ic ipv6ra_own
292Disables kernel IPv6 Router Advertisment processing so dhcpcd can manage
293addresses and routes.
294This does not work reliably on any BSD system, probably due to kernel issues.
295.It Ic ipv6ra_own_default
296Each time dhcpcd receives an IPv6 Router Adveristment, dhcpcd will manage
297the default route only.
298This allows dhcpcd to prefer an interface for outbound traffic based on metric
299and/or user selection rather than the kernel.
300This does work reliably on BSD systems.
301.It Ic ipv6rs
302Enables IPv6 Router Advertisment solicitation.
303This is on by default, but is documented here in the case where it is disabled
304globally but needs to be enabled for one interface.
305.It Ic leasetime Ar seconds
306Request a leasetime of
307.Ar seconds .
308.It Ic metric Ar metric
309Metrics are used to prefer an interface over another one, lowest wins.
310.Nm dhcpcd
311will supply a default metric of 200 +
312.Xr if_nametoindex 3 .
313An extra 100 will be added for wireless interfaces.
314.It Ic noalias
315IPv4 addresses added will overwrite a pre-existing address instead of working
316alongside.
317.It Ic noarp
318Don't send any ARP requests.
319This also disables IPv4LL.
320.It Ic noauthrequired
321Don't require authentication even though we requested it.
322.It Ic nodev
323Don't load
324.Pa /dev
325management modules.
326.It Ic nodhcp
327Don't start DHCP or listen to DHCP messages.
328This is only useful when allowing IPv4LL.
329.It Ic nodhcp6
330Don't start DHCPv6 or listen to DHCPv6 messages.
331Normally DHCPv6 is started by a RA instruction or configuration.
332.It Ic nogateway
333Don't install any default routes.
334.It Ic nohook Ar script
335Don't run this hook script.
336Matches full name, or prefixed with 2 numbers optionally ending with
337.Pa .sh .
338.Pp
339So to stop
340.Nm dhcpcd
341from touching your DNS or MTU settings you would do:-
342.D1 nohook resolv.conf, mtu
343.It Ic noipv4
344Don't attempt to configure an IPv4 address.
345.It Ic noipv4ll
346Don't attempt to obtain an IPv4LL address if we failed to get one via DHCP.
347See
348.Rs
349.%T "RFC 3927"
350.Re
351.It Ic noipv6
352Don't attmept to configure an IPv6 address.
353.It Ic noipv6rs
354Disable solicitation and receipt of IPv6 Router Advertisements.
355.It Ic nolink
356Don't receive link messages about carrier status.
357You should only set this for buggy interface drivers.
358.It Ic option Ar option
359Requests the
360.Ar option
361from the server.
362It can be a variable to be used in
363.Xr dhcpcd-run-hooks 8
364or the numerical value.
365You can specify more
366.Ar option Ns s
367separated by commas, spaces or more
368.Ic option
369lines.
370Prepend dhcp6_ to
371.Ar option
372to request a DHCPv6 option.
373DHCPv4 options are mapped to DHCPv6 where applicable.
374.It Ic nooption Ar option
375Remove the option from the DHCP message.
376This should only be used when a DHCP server sends a non requested option
377that should not be processed.
378.It Ic destination Ar option
379If
380.Nm
381detects an address added to a point to point interface (PPP, TUN, etc) then
382it will set the listed DHCP options to the destination address of the
383interface.
384.It Ic profile Ar name
385Subsequent options are only parsed for this profile
386.Ar name .
387.It Ic quiet
388Suppress any dhcpcd output to the console, except for errors.
389.It Ic reboot Ar seconds
390Allow
391.Ar reboot
392seconds before moving to the DISCOVER phase if we have an old lease to use.
393The default is 5 seconds.
394A setting of 0 seconds causes
395.Nm dhcpcd
396to skip the REBOOT phase and go straight into DISCOVER.
397This is desirable for mobile users because if you change from network A to
398network B and they use the same subnet and the address from network A isn't
399in use on network B, then the DHCP server will remain silent even if authorative
400which means
401.Nm dhcpcd
402will timeout before moving back to the DISCOVER phase.
403.It Ic release
404.Nm dhcpcd
405will release the lease prior to stopping the interface.
406.It Ic require Ar option
407Requires the
408.Ar option
409to be present in all DHCP messages, otherwise the message is ignored.
410It can be a variable to be used in
411.Xr dhcpcd-run-hooks 8
412or the numerical value.
413You can specify more options separated by commas, spaces or more require lines.
414To enforce that
415.Nm dhcpcd
416only responds to DHCP servers and not BOOTP servers, you can
417.Ic require
418.Ar dhcp_message_type .
419.It Ic script Ar script
420Use
421.Ar script
422instead of the default
423.Pa @SCRIPT@ .
424.It Ic ssid Ar ssid
425Subsequent options are only parsed for this wireless
426.Ar ssid .
427.It Ic static Ar value
428Configures a static
429.Ar value .
430If you set
431.Ic ip_address
432then
433.Nm dhcpcd
434will not attempt to obtain a lease and just use the value for the address with
435an infinite lease time.
436.Pp
437Here is an example which configures a static address, routes and dns.
438.D1 interface eth0
439.D1 static ip_address=192.168.0.10/24
440.D1 static routers=192.168.0.1
441.D1 static domain_name_servers=192.168.0.1
442.Pp
443Here is an example for PPP which gives the destination a default route.
444It uses the special destination keyword to insert the destination address
445into the value.
446.D1 interface ppp0
447.D1 static ip_address=
448.D1 destination routers
449.It Ic timeout Ar seconds
450Timeout after
451.Ar seconds ,
452instead of the default 30.
453A setting of 0
454.Ar seconds
455causes
456.Nm dhcpcd
457to wait forever to get a lease.
458If
459.Nm dhcpcd
460is working on a single interface then
461.Nm dhcpcd
462will exit when a timeout occurs, otherwise
463.Nm dhcpcd
464will fork into the background.
465If using IPv4LL then
466.Nm dhcpcd
467start the IPv4LL process after the timeout and then wait a little longer
468before really timing out.
469.It Ic userclass Ar string
470Tag the DHCPv4 messages with the userclass.
471You can specify more than one.
472.It Ic vendor Ar code , Ns Ar value
473Add an encapsulated vendor option.
474.Ar code
475should be between 1 and 254 inclusive.
476To add a raw vendor string, omit
477.Ar code
478but keep the comma.
479Examples.
480.Pp
481Set the vendor option 01 with an IP address.
482.D1 vendor 01,192.168.0.2
483Set the vendor option 02 with a hex code.
484.D1 vendor 02,01:02:03:04:05
485Set the vendor option 03 with an IP address as a string.
486.D1 vendor 03,\e"192.168.0.2\e"
487Set un-encapsulated vendor option to hello world.
488.D1 vendor ,"hello world"
489.It Ic vendorclassid Ar string
490Set the DHCP Vendor Class.
491DHCPv6 has it's own option as shown below.
492The default is
493dhcpcd-<version>:<os>:<machine>:<platform>.
494For example
495.D1 dhcpcd-5.5.6:NetBSD-6.99.5:i386:i386
496If not set then none is sent.
497Some badly configured DHCP servers reject unknown vendorclassids.
498To work around it, try and impersonate Windows by using the MSFT vendorclassid.
499.It Ic vendclass Ar en Ar data
500Add the DHCPv6 Vendor Indetifying Vendor Class with the IANA assigned Enterprise
501Number
502.Ar en
503with the
504.Ar data .
505This option can be set more than once to add more data, but the behaviour,
506as per
507.Xr RFC 3925
508is undefined if the Enterprise Number differs.
509.It Ic waitip Op 4 | 6
510Wait for an address to be assigned before forking to the background.
5114 means wait for an IPv4 address to be assigned.
5126 means wait for an IPv6 address to be assigned.
513If no argument is given,
514.Nm
515will wait for any address protocol to be assigned.
516It is possible to wait for more than one address protocol and
517.Nm
518will only fork to the background when all waiting conditions are satisfied.
519.It Ic xidhwaddr
520Use the last four bytes of the hardware address as the DHCP xid instead
521of a randomly generated number.
522.El
523.Ss Defining new options
524DHCP allows for the use of custom options.
525Each option needs to be started with the
526.Ic define
527or
528.Ic define6
529directive.
530This can optionally be followed by both
531.Ic embed
532or
533.Ic encap
534options.
535Both can be specified more than once and
536.Ic embed
537must come before
538.Ic encap .
539.Bl -tag -width indent
540.It Ic define Ar code Ar type Ar variable
541Defines the DHCP option
542.Ar code
543of
544.Ar type
545with a name of
546.Ar variable
547exported to
548.Xr dhcpcd-run-hooks 8 .
549.It Ic define6 Ar code Ar type Ar variable
550Defines the DHCPv6 option
551.Ar code
552of
553.Ar type
554with a name of
555.Ar variable
556exported to
557.Xr dhcpcd-run-hooks 8 ,
558with a prefix of
559.Va _dhcp6 .
560.It Ic vendopt Ar code Ar type Ar variable
561Defines the Vendor-Identifying Vendor Options.
562The
563.Ar code
564is the IANA Enterprise Number which will unqiuely describe the encapsulated
565options.
566.Ar type
567is normally
568.Ar encap .
569.Ar variable
570names the Vendor option to be exported.
571.It Ic embed Ar type Ar variable
572Defines an embedded variable within the defined option.
573The length is determined by the
574.Ar type .
575If the
576.Ar variable
577is not the same as defined in the parent option,
578it is prefixed with the parent
579.Ar variable
580first with an underscore.
581.It Ic encap Ar code Ar type Ar variable
582Defines an encapsulated variable within the defined option.
583The length is determined by the
584.Ar type .
585If the
586.Ar variable
587is not the same as defined in the parent option,
588it is prefixed with the parent
589.Ar variable
590first with an underscore.
591.El
592.Ss Type prefix
593These keywords come before the type itself, to describe it more fully.
594You can use more than one, but they must appear in the order listed below.
595.Bl -tag -width -indent
596.It Ic request
597Requests the option by default without having to be specified in user
598configuration
599.It Ic norequest
600This option cannot be requested, regardless of user configuration
601.It Ic index
602The option can appear more than once and will be indexed.
603.It Ic array
604The option data is split into a space seperated array, each element being
605the same type.
606.El
607.Ss Types to define
608The type directly affects the length of data consumed inside the option.
609Any remaining data is normally discarded.
610Lengths can be specified for string and binhex types, but this is generally
611with other data embedded afterwards in the same option.
612.Bl -tag -width indent
613.It Ic ipaddress
614An IPv4 address, 4 bytes
615.It Ic ip6address
616An IPv6 address, 16 bytes
617.It Ic string Op : Ic length
618A shell escaped string (binary data escaped as octal)
619.It Ic byte
620A byte
621.It Ic int16
622A signed 16bit integer, 2 bytes
623.It Ic uint16
624An unsigned 16bit integer, 2 bytes
625.It Ic int32
626A signed 32bit integer, 4 bytes
627.It Ic uint32
628An unsigned 32bit integer, 4 bytes
629.It Ic flag
630A fixed value (1) to indicate that the option is present, 0 bytes
631.It Ic domain
632A RFC 3397 encoded string
633.It Ic binhex Op : Ic length
634Binary data expressed as hexadecimal
635.It Ic embed
636Contains embedded options (implies encap as well)
637.It Ic encap
638Contains encapsulated options (implies embed as well)
639.It Ic option
640References an option from the global definition
641.El
642.Ss Example definition
643.D1 # DHCP option 81, Fully Qualified Domain Name, RFC4702
644.D1 define 81 embed fqdn
645.D1 embed byte flags
646.D1 embed byte rcode1
647.D1 embed byte rcode2
648.D1 embed domain fqdn
649.Pp
650.D1 # DHCP option 125, Vendor Specific Information Option, RFC3925
651.D1 define 125 encap vsio
652.D1 embed uint32 enterprise_number
653.D1 # Options defined for the enterprise number
654.D1 encap 1 ipaddress ipaddress
655.Ss Supported protocols
656.Bl -tag -width -indent
657.It Ic token
658Sends and expects the token with the secretid 0 in each message.
659.It Ic delayedrealm
660Delayed Authentication.
661.Nm dhcpcd
662will send an authentication option with no key or MAC.
663The server will see this option, and select a key for
664.Nm , writing the
665.Ar realm
666and
667.Ar secretid
668in it.
669.Nm dhcpcd
670will then look for a non-expired token with a matching realm and secretid.
671This token is used to authenicate all other messages.
672.It Ic delayed
673Same as above, but without a realm.
674.El
675.Ss Supported algorithms
676If none specified,
677.Ic hmac-md5
678is the default.
679.Bl -tag -width -indent
680.It Ic hmac-md5
681.El
682.Ss Supported Replay Detection Mechanisms
683If none specified,
684.Ic monotonic
685is the default.
686.Bl -tag -width -indent
687.It Ic monotonic
688.El
689.Sh SEE ALSO
690.Xr fnmatch 3 ,
691.Xr if_nametoindex 3 ,
692.Xr dhcpcd 8 ,
693.Xr dhcpcd-run-hooks 8
694.Sh AUTHORS
695.An Roy Marples Aq Mt roy@marples.name
696.Sh BUGS
697When configuring DHCPv6 you can only select one IA type.
698I can't think of a use case where you would want different types,
699so if you have one then please bring it up for discussion on the
700.Aq Mt  dhcpcd-discuss@marples.name
701mailing list.
702.Pp
703Please report them to
704.Lk http://roy.marples.name/projects/dhcpcd
Note: See TracBrowser for help on using the repository browser.