xref: /dflybsd-src/contrib/dhcpcd/src/dhcpcd.conf.5 (revision 6a6d63c5317abf314a78f8c8300ef73c2bc0c39e)
10a68f8d2SRoy Marples.\" SPDX-License-Identifier: BSD-2-Clause
20a68f8d2SRoy Marples.\"
380aa9461SRoy Marples.\" Copyright (c) 2006-2023 Roy Marples
40a68f8d2SRoy Marples.\" All rights reserved
50a68f8d2SRoy Marples.\"
60a68f8d2SRoy Marples.\" Redistribution and use in source and binary forms, with or without
70a68f8d2SRoy Marples.\" modification, are permitted provided that the following conditions
80a68f8d2SRoy Marples.\" are met:
90a68f8d2SRoy Marples.\" 1. Redistributions of source code must retain the above copyright
100a68f8d2SRoy Marples.\"    notice, this list of conditions and the following disclaimer.
110a68f8d2SRoy Marples.\" 2. Redistributions in binary form must reproduce the above copyright
120a68f8d2SRoy Marples.\"    notice, this list of conditions and the following disclaimer in the
130a68f8d2SRoy Marples.\"    documentation and/or other materials provided with the distribution.
140a68f8d2SRoy Marples.\"
150a68f8d2SRoy Marples.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
160a68f8d2SRoy Marples.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
170a68f8d2SRoy Marples.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
180a68f8d2SRoy Marples.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
190a68f8d2SRoy Marples.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
200a68f8d2SRoy Marples.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
210a68f8d2SRoy Marples.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
220a68f8d2SRoy Marples.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
230a68f8d2SRoy Marples.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
240a68f8d2SRoy Marples.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
250a68f8d2SRoy Marples.\" SUCH DAMAGE.
260a68f8d2SRoy Marples.\"
27*54175cefSRoy Marples.Dd May 24, 2024
280a68f8d2SRoy Marples.Dt DHCPCD.CONF 5
290a68f8d2SRoy Marples.Os
300a68f8d2SRoy Marples.Sh NAME
310a68f8d2SRoy Marples.Nm dhcpcd.conf
320a68f8d2SRoy Marples.Nd dhcpcd configuration file
330a68f8d2SRoy Marples.Sh DESCRIPTION
340a68f8d2SRoy MarplesAlthough
350a68f8d2SRoy Marples.Nm dhcpcd
360a68f8d2SRoy Marplescan do everything from the command line, there are cases where it's just easier
370a68f8d2SRoy Marplesto do it once in a configuration file.
380a68f8d2SRoy MarplesMost of the options found in
390a68f8d2SRoy Marples.Xr dhcpcd 8
400a68f8d2SRoy Marplescan be used here.
410a68f8d2SRoy MarplesThe first word on the line is the option and the rest of the line is the value.
420a68f8d2SRoy MarplesLeading and trailing whitespace for the option and value are trimmed.
430a68f8d2SRoy MarplesYou can escape characters in the value using the \\ character.
440a68f8d2SRoy MarplesComments can be prefixed with the # character.
450a68f8d2SRoy MarplesString values should be quoted with the " character.
460a68f8d2SRoy Marples.Pp
470a68f8d2SRoy MarplesHere's a list of available options:
480a68f8d2SRoy Marples.Bl -tag -width indent
490a68f8d2SRoy Marples.It Ic allowinterfaces Ar pattern
500a68f8d2SRoy MarplesWhen discovering interfaces, the interface name must match
510a68f8d2SRoy Marples.Ar pattern
520a68f8d2SRoy Marpleswhich is a space or comma separated list of patterns passed to
530a68f8d2SRoy Marples.Xr fnmatch 3 .
540a68f8d2SRoy MarplesIf the same interface is matched in
550a68f8d2SRoy Marples.Ic denyinterfaces
560a68f8d2SRoy Marplesthen it is still denied.
570a68f8d2SRoy Marples.It Ic denyinterfaces Ar pattern
580a68f8d2SRoy MarplesWhen discovering interfaces, the interface name must not match
590a68f8d2SRoy Marples.Ar pattern
600a68f8d2SRoy Marpleswhich is a space or comma separated list of patterns passed to
610a68f8d2SRoy Marples.Xr fnmatch 3 .
620a68f8d2SRoy Marples.It Ic anonymous
630a68f8d2SRoy MarplesEnables Anonymity Profiles for DHCP, RFC 7844.
640a68f8d2SRoy MarplesAny DUID is ignored and ClientID is set to LL only.
650a68f8d2SRoy MarplesAll non essential options are then masked at this point,
660a68f8d2SRoy Marplesbut they could be unmasked by explicitly requesting the option
670a68f8d2SRoy Marples.Sy after
680a68f8d2SRoy Marplesthe
690a68f8d2SRoy Marples.Ic anonymous
700a68f8d2SRoy Marplesoption is processed.
710a68f8d2SRoy MarplesAs such, the
720a68f8d2SRoy Marples.Ic anonymous
730a68f8d2SRoy Marplesoption
740a68f8d2SRoy Marples.Sy should
750a68f8d2SRoy Marplesbe the last option in the configuration unless you really want to
760a68f8d2SRoy Marplessend something which could identify you.
770a68f8d2SRoy Marples.Nm dhcpcd
780a68f8d2SRoy Marpleswill not try and reboot an old lease, it will go straight into
790a68f8d2SRoy MarplesDISCOVER/SOLICIT.
800a68f8d2SRoy Marples.It Ic randomise_hwaddr
810a68f8d2SRoy MarplesForces a hardware address randomisation when the interface is brought up
820a68f8d2SRoy Marplesor when the carrier is lost.
830a68f8d2SRoy MarplesThis is generally used in tandem with the anonymous option.
840a68f8d2SRoy Marples.It Ic arping Ar address Op address
850a68f8d2SRoy Marples.Nm dhcpcd
860a68f8d2SRoy Marpleswill arping each address in order before attempting DHCP.
870a68f8d2SRoy MarplesIf an address is found, we will select the replying hardware address as the
880a68f8d2SRoy Marplesprofile, otherwise the IP address.
890a68f8d2SRoy MarplesExample:
900a68f8d2SRoy Marples.Pp
910a68f8d2SRoy Marples.D1 interface bge0
920a68f8d2SRoy Marples.D1 arping 192.168.0.1
930a68f8d2SRoy Marples.Pp
940a68f8d2SRoy Marples.D1 # My specific 192.168.0.1 network
950a68f8d2SRoy Marples.D1 profile dd:ee:aa:dd:bb:ee
960a68f8d2SRoy Marples.D1 static ip_address=192.168.0.10/24
970a68f8d2SRoy Marples.Pp
980a68f8d2SRoy Marples.D1 # A generic 192.168.0.1 network
990a68f8d2SRoy Marples.D1 profile 192.168.0.1
1000a68f8d2SRoy Marples.D1 static ip_address=192.168.0.98/24
1010a68f8d2SRoy Marples.It Ic authprotocol Ar protocol Op Ar algorithm Op Ar rdm
1020a68f8d2SRoy MarplesAuthenticate DHCP messages.
1030a68f8d2SRoy MarplesSee the Supported Authentication Protocols section.
1040a68f8d2SRoy MarplesIf
1050a68f8d2SRoy Marples.Ar protocol
1060a68f8d2SRoy Marplesis
1070a68f8d2SRoy Marples.Ar token
1080a68f8d2SRoy Marplesthen
1090a68f8d2SRoy Marples.Ar algorithm is
1100a68f8d2SRoy Marplessnd_secretid/rcv_secretid so you can send and receive different tokens.
1110a68f8d2SRoy Marples.It Ic authtoken Ar secretid Ar realm Ar expire Ar key
1120a68f8d2SRoy MarplesDefine a shared key for use in authentication.
1130a68f8d2SRoy Marples.Ar realm
1140a68f8d2SRoy Marplescan be "" to for use with the
1150a68f8d2SRoy Marples.Ar delayed
1160a68f8d2SRoy Marplesprotocol.
1170a68f8d2SRoy Marples.Ar expire
1180a68f8d2SRoy Marplesis the date the token expires and should be formatted "yyy-mm-dd HH:MM".
1190a68f8d2SRoy MarplesYou can use the keyword
1200a68f8d2SRoy Marples.Ar forever
1210a68f8d2SRoy Marplesor
1220a68f8d2SRoy Marples.Ar 0
1230a68f8d2SRoy Marpleswhich means the token never expires.
1240a68f8d2SRoy MarplesFor the token protocol,
1250a68f8d2SRoy Marples.Ar secretid
1260a68f8d2SRoy Marplesneeds to be 0 and
1270a68f8d2SRoy Marples.Ar realm
1280a68f8d2SRoy Marplesneeds to be "".
1290a68f8d2SRoy MarplesIf
1300a68f8d2SRoy Marples.Nm dhcpcd
1310a68f8d2SRoy Marpleshas the error
1320a68f8d2SRoy Marples.D1 dhcp_auth_encode: Invalid argument
1330a68f8d2SRoy Marplesthen it means that
1340a68f8d2SRoy Marples.Nm dhcpcd
1350a68f8d2SRoy Marplescould not find the correct authentication token in your configuration.
1360a68f8d2SRoy Marples.It Ic background
1370a68f8d2SRoy MarplesFork to the background immediately.
1380a68f8d2SRoy MarplesThis is useful for startup scripts which don't disable link messages for
1390a68f8d2SRoy Marplescarrier status.
1400a68f8d2SRoy Marples.It Ic blacklist Ar address Ns Op /cidr
1410a68f8d2SRoy MarplesIgnores all packets from
1420a68f8d2SRoy Marples.Ar address Ns Op /cidr .
1430a68f8d2SRoy Marples.It Ic whitelist Ar address Ns Op /cidr
1440a68f8d2SRoy MarplesOnly accept packets from
1450a68f8d2SRoy Marples.Ar address Ns Op /cidr .
1460a68f8d2SRoy Marples.Ic blacklist
1470a68f8d2SRoy Marplesis ignored if
1480a68f8d2SRoy Marples.Ic whitelist
1490a68f8d2SRoy Marplesis set.
1500a68f8d2SRoy Marples.It Ic bootp
1510a68f8d2SRoy MarplesBe a BOOTP client.
1520a68f8d2SRoy MarplesBasically, this just doesn't send a DHCP Message Type option and will only
1530a68f8d2SRoy Marplesinteract with a BOOTP server.
1540a68f8d2SRoy MarplesAll other DHCP options still work.
1550a68f8d2SRoy Marples.It Ic broadcast
1560a68f8d2SRoy MarplesInstructs the DHCP server to broadcast replies back to the client.
1570a68f8d2SRoy MarplesNormally this is only set for non-Ethernet interfaces,
1580a68f8d2SRoy Marplessuch as FireWire and InfiniBand.
1590a68f8d2SRoy MarplesIn most cases,
1600a68f8d2SRoy Marples.Nm dhcpcd
1610a68f8d2SRoy Marpleswill set this automatically.
1620a68f8d2SRoy Marples.It Ic controlgroup Ar group
1630a68f8d2SRoy MarplesSets the group ownership of
1640a68f8d2SRoy Marples.Pa /var/run/dhcpcd/sock
1650a68f8d2SRoy Marplesso that users other than root can connect to
1660a68f8d2SRoy Marples.Nm dhcpcd .
1670a68f8d2SRoy Marples.It Ic debug
1680a68f8d2SRoy MarplesEcho debug messages to the stderr and syslog.
1690a68f8d2SRoy Marples.It Ic dev Ar value
1700a68f8d2SRoy MarplesLoad the
1710a68f8d2SRoy Marples.Ar value
1720a68f8d2SRoy Marples.Pa /dev
1730a68f8d2SRoy Marplesmanagement module.
1740a68f8d2SRoy Marples.Nm dhcpcd
1750a68f8d2SRoy Marpleswill load the first one found to work, if any.
1760a68f8d2SRoy Marples.It Ic env Ar value
1770a68f8d2SRoy MarplesPush
1780a68f8d2SRoy Marples.Ar value
1790a68f8d2SRoy Marplesto the environment for use in
1800a68f8d2SRoy Marples.Xr dhcpcd-run-hooks 8 .
1810a68f8d2SRoy MarplesFor example, you can force the hostname hook to always set the hostname with
1820a68f8d2SRoy Marples.Ic env
1830a68f8d2SRoy Marples.Va force_hostname=YES .
1840a68f8d2SRoy MarplesOr set which driver
1850a68f8d2SRoy Marples.Xr wpa_supplicant 8
1860a68f8d2SRoy Marplesshould use with
1870a68f8d2SRoy Marples.Ic env
1880a68f8d2SRoy Marples.Va wpa_supplicant_driver=nl80211
1890a68f8d2SRoy Marples.Pp
1900a68f8d2SRoy MarplesIf the hostname is set, it will be will set to the FQDN if possible as per
1910a68f8d2SRoy MarplesRFC 4702, section 3.1.
1920a68f8d2SRoy MarplesIf the FQDN option is missing,
1930a68f8d2SRoy Marples.Nm dhcpcd
1940a68f8d2SRoy Marpleswill still try and set a FQDN from the hostname and domain options for
1950a68f8d2SRoy Marplesconsistency.
1960a68f8d2SRoy MarplesTo override this, set
1970a68f8d2SRoy Marples.Ic env
1980a68f8d2SRoy Marples.Va hostname_fqdn=[YES|NO|SERVER] .
1990a68f8d2SRoy MarplesA value of
2000a68f8d2SRoy Marples.Va SERVER
2010a68f8d2SRoy Marplesmeans just what the server says, don't manipulate it.
2020a68f8d2SRoy MarplesThis could lead to an inconsistent hostname on a DHCPv4 and DHCPv6 network
2030a68f8d2SRoy Marpleswhere the DHCPv4 hostname is short and the DHCPv6 has an FQDN.
2040a68f8d2SRoy MarplesDHCPv6 has no hostname option.
2050a68f8d2SRoy Marples.It Ic clientid Ar string
2060a68f8d2SRoy MarplesSend the
2070a68f8d2SRoy Marples.Ar clientid .
2080a68f8d2SRoy MarplesIf the string is of the format 01:02:03 then it is encoded as hex.
2090a68f8d2SRoy MarplesFor interfaces whose hardware address is longer than 8 bytes, or if the
2100a68f8d2SRoy Marples.Ar clientid
2110a68f8d2SRoy Marplesis an empty string then
2120a68f8d2SRoy Marples.Nm dhcpcd
2130a68f8d2SRoy Marplessends a default
2140a68f8d2SRoy Marples.Ar clientid
2150a68f8d2SRoy Marplesof the hardware family and the hardware address.
2160a68f8d2SRoy Marples.It Ic duid Op ll | lt | uuid | value
2170a68f8d2SRoy MarplesUse a DHCP Unique Identifier.
2180a68f8d2SRoy MarplesIf a system UUID is available, that will be used to create a DUID-UUID,
21980aa9461SRoy Marplesotherwise if persistent storage is available then a DUID-LLT
2200a68f8d2SRoy Marples(link local address + time) is generated,
2210a68f8d2SRoy Marplesotherwise DUID-LL is generated (link local address).
2220a68f8d2SRoy MarplesThe DUID type can be hinted as an optional parameter if the file
2230a68f8d2SRoy Marples.Pa /var/db/dhcpcd/duid
2240a68f8d2SRoy Marplesdoes not exist.
2250a68f8d2SRoy MarplesIf not
2260a68f8d2SRoy Marples.Va ll ,
2270a68f8d2SRoy Marples.Va lt
2280a68f8d2SRoy Marplesor
2290a68f8d2SRoy Marples.Va uuid
2300a68f8d2SRoy Marplesthen
2310a68f8d2SRoy Marples.Va value
2320a68f8d2SRoy Marpleswill be converted from 00:11:22:33 format.
2330a68f8d2SRoy MarplesThis, plus the IAID will be used as the
2340a68f8d2SRoy Marples.Ic clientid .
2350a68f8d2SRoy MarplesThe DUID generated will be held in
2360a68f8d2SRoy Marples.Pa /var/db/dhcpcd/duid
2370a68f8d2SRoy Marplesand should not be copied to other hosts.
2380a68f8d2SRoy MarplesThis file also takes precedence over the above rules except for setting a value.
2390a68f8d2SRoy Marples.It Ic iaid Ar iaid
2400a68f8d2SRoy MarplesSet the Interface Association Identifier to
2410a68f8d2SRoy Marples.Ar iaid .
2420a68f8d2SRoy MarplesThis option must be used in an
2430a68f8d2SRoy Marples.Ic interface
2440a68f8d2SRoy Marplesblock.
2450a68f8d2SRoy MarplesThis defaults to the VLANID (prefixed with 0xff) for the interface if set,
2460a68f8d2SRoy Marplesotherwise the last 4 bytes of the hardware address assigned to the
2470a68f8d2SRoy Marplesinterface.
2480a68f8d2SRoy MarplesEach instance of this should be unique within the scope of the client and
2490a68f8d2SRoy Marples.Nm dhcpcd
2500a68f8d2SRoy Marpleswarns if a conflict is detected.
2510a68f8d2SRoy MarplesIf there is a conflict, it is only a problem if the conflicted IAIDs are
2520a68f8d2SRoy Marplesused on the same network.
2530a68f8d2SRoy Marples.It Ic dhcp
2540a68f8d2SRoy MarplesEnable DHCP on the interface, on by default.
2550a68f8d2SRoy Marples.It Ic dhcp6
2560a68f8d2SRoy MarplesEnable DHCPv6 on the interface, on by default.
2570a68f8d2SRoy Marples.It Ic ipv4
2580a68f8d2SRoy MarplesEnable IPv4 on the interface, on by default.
2590a68f8d2SRoy Marples.It Ic ipv6
2600a68f8d2SRoy MarplesEnable IPv6 on the interface, on by default.
2610a68f8d2SRoy Marples.It Ic request Op Ar address
2620a68f8d2SRoy MarplesRequest the
2630a68f8d2SRoy Marples.Ar address
2640a68f8d2SRoy Marplesin the DHCP DISCOVER message.
2650a68f8d2SRoy MarplesThere is no guarantee this is the address the DHCP server will actually give.
2660a68f8d2SRoy MarplesIf no
2670a68f8d2SRoy Marples.Ar address
2680a68f8d2SRoy Marplesis given then the first address currently assigned to the
2690a68f8d2SRoy Marples.Ar interface
2700a68f8d2SRoy Marplesis used.
2710a68f8d2SRoy Marples.It Ic inform Op Ar address Ns Op Ar /cidr Ns Op Ar /broadcast_address
2720a68f8d2SRoy MarplesBehaves like
2730a68f8d2SRoy Marples.Ic request
2740a68f8d2SRoy Marplesas above, but sends a DHCP INFORM instead of DISCOVER/REQUEST.
2750a68f8d2SRoy MarplesThis does not get a lease as such, just notifies the DHCP server of the
2760a68f8d2SRoy Marples.Ar address
2770a68f8d2SRoy Marplesin use.
2780a68f8d2SRoy MarplesYou should also include the optional
2790a68f8d2SRoy Marples.Ar cidr
2800a68f8d2SRoy Marplesnetwork number in case the address is not already configured on the interface.
2810a68f8d2SRoy Marples.Nm dhcpcd
2820a68f8d2SRoy Marplesremains running and pretends it has an infinite lease.
2830a68f8d2SRoy Marples.Nm dhcpcd
2840a68f8d2SRoy Marpleswill not de-configure the interface when it exits.
2850a68f8d2SRoy MarplesIf
2860a68f8d2SRoy Marples.Nm dhcpcd
2870a68f8d2SRoy Marplesfails to contact a DHCP server then it returns a failure instead of falling
2880a68f8d2SRoy Marplesback on IPv4LL.
2890a68f8d2SRoy Marples.It Ic inform6
2900a68f8d2SRoy MarplesPerforms a DHCPv6 Information Request.
2910a68f8d2SRoy MarplesNo address is requested or specified, but all other DHCPv6 options are allowed.
2920a68f8d2SRoy MarplesThis is normally performed automatically when an IPv6 Router Advertisement
2930a68f8d2SRoy Marplesindicates that the client should perform this operation.
2940a68f8d2SRoy MarplesThis option is only needed when
2950a68f8d2SRoy Marples.Nm dhcpcd
2960a68f8d2SRoy Marplesis not processing IPv6 RA messages and the need for a DHCPv6 Information Request
2970a68f8d2SRoy Marplesexists.
2980a68f8d2SRoy Marples.It Ic persistent
2990a68f8d2SRoy Marples.Nm dhcpcd
3000a68f8d2SRoy Marplesnormally de-configures the interface and configuration when it exits.
3010a68f8d2SRoy MarplesSometimes, this isn't desirable if, for example, you have root mounted over
3020a68f8d2SRoy MarplesNFS or SSH clients connect to this host and they need to be notified of
3030a68f8d2SRoy Marplesthe host shutting down.
3040a68f8d2SRoy MarplesYou can use this option to stop this from happening.
3050a68f8d2SRoy Marples.It Ic fallback Ar profile
3060a68f8d2SRoy MarplesFall back to using this profile if DHCP fails.
3070a68f8d2SRoy MarplesThis allows you to configure a static profile instead of using ZeroConf.
308*54175cefSRoy Marples.It Ic fallback_time Ar seconds
309*54175cefSRoy MarplesStart fallback after
310*54175cefSRoy Marples.Ar seconds .
311*54175cefSRoy MarplesThe default is 5 seconds.
3120a68f8d2SRoy Marples.It Ic hostname Ar name
3130a68f8d2SRoy MarplesSends the hostname
3140a68f8d2SRoy Marples.Ar name
3150a68f8d2SRoy Marplesto the DHCP server so it can be registered in DNS.
3160a68f8d2SRoy MarplesIf
3170a68f8d2SRoy Marples.Ar name
3180a68f8d2SRoy Marplesis an empty string then the current system hostname is sent.
3190a68f8d2SRoy MarplesIf
3200a68f8d2SRoy Marples.Ar name
3210a68f8d2SRoy Marplesis a FQDN (i.e., contains a .) then it will be encoded as such.
3220a68f8d2SRoy Marples.It Ic hostname_short
3230a68f8d2SRoy MarplesSends the short hostname to the DHCP server instead of the FQDN.
3240a68f8d2SRoy MarplesThis is useful because DHCP servers will not register the FQDN in their
3250a68f8d2SRoy MarplesDNS if the domain part does not match theirs.
3260a68f8d2SRoy Marples.Pp
3270a68f8d2SRoy MarplesAlso, see the
3280a68f8d2SRoy Marples.Ic env
3290a68f8d2SRoy Marplesoption above to control how the hostname is set on the host.
3300a68f8d2SRoy Marples.It Ic ia_na Op Ar iaid Op / address
3310a68f8d2SRoy MarplesRequest a DHCPv6 Normal Address for
3320a68f8d2SRoy Marples.Ar iaid .
3330a68f8d2SRoy Marples.Ar iaid
3340a68f8d2SRoy Marplesdefaults to the
3350a68f8d2SRoy Marples.Ic iaid
3360a68f8d2SRoy Marplesoption as described above.
3370a68f8d2SRoy MarplesYou can request more than one ia_na by specifying a unique
3380a68f8d2SRoy Marples.Ar iaid
3390a68f8d2SRoy Marplesfor each one.
3400a68f8d2SRoy Marples.It Ic ia_ta Op Ar iaid
3410a68f8d2SRoy MarplesRequest a DHCPv6 Temporary Address for
3420a68f8d2SRoy Marples.Ar iaid .
3430a68f8d2SRoy MarplesYou can request more than one ia_ta by specifying a unique
3440a68f8d2SRoy Marples.Ar iaid
3450a68f8d2SRoy Marplesfor each one.
3460a68f8d2SRoy Marples.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
3470a68f8d2SRoy MarplesRequest a DHCPv6 Delegated Prefix for
3480a68f8d2SRoy Marples.Ar iaid .
3490a68f8d2SRoy MarplesThis option must be used in an
3500a68f8d2SRoy Marples.Ic interface
3510a68f8d2SRoy Marplesblock.
3520a68f8d2SRoy MarplesUnless a
3530a68f8d2SRoy Marples.Ar sla_id
3540a68f8d2SRoy Marplesof 0 is assigned with the same resultant prefix length as the delegation,
3550a68f8d2SRoy Marplesa reject route is installed for the Delegated Prefix to
3560a68f8d2SRoy Marplesstop unallocated addresses being resolved upstream.
3570a68f8d2SRoy MarplesIf no
3580a68f8d2SRoy Marples.Ar interface
3590a68f8d2SRoy Marplesis given then we will assign a prefix to every other interface with a
3600a68f8d2SRoy Marples.Ar sla_id
3610a68f8d2SRoy Marplesequivalent to the interface index assigned by the OS.
3620a68f8d2SRoy MarplesOtherwise addresses are only assigned for each
3630a68f8d2SRoy Marples.Ar interface
3640a68f8d2SRoy Marplesand
3650a68f8d2SRoy Marples.Ar sla_id .
3660b4c9755SRoy MarplesTo avoid delegating to any interface, use - as the invalid interface name.
3670a68f8d2SRoy MarplesEach assigned address will have a
3680a68f8d2SRoy Marples.Ar suffix ,
3690a68f8d2SRoy Marplesdefaulting to 1.
3700a68f8d2SRoy MarplesIf the
3710a68f8d2SRoy Marples.Ar suffix
3720a68f8d2SRoy Marplesis 0 then a SLAAC address is assigned.
3730a68f8d2SRoy MarplesYou cannot assign a prefix to the requesting interface unless the
3740a68f8d2SRoy MarplesDHCPv6 server supports the
3750a68f8d2SRoy Marples.Li RFC 6603
3760a68f8d2SRoy MarplesPrefix Exclude Option.
3770a68f8d2SRoy Marples.Nm dhcpcd
3780a68f8d2SRoy Marpleshas to be running for all the interfaces it is delegating to.
3790a68f8d2SRoy MarplesA default
3800a68f8d2SRoy Marples.Ar prefix_len
3810a68f8d2SRoy Marplesof 64 is assumed, unless the maximum
3820a68f8d2SRoy Marples.Ar sla_id
3830a68f8d2SRoy Marplesdoes not fit.
3840a68f8d2SRoy MarplesIn this case
3850a68f8d2SRoy Marples.Ar prefix_len
3860a68f8d2SRoy Marplesis increased to the highest multiple of 8 that can accommodate the
3870a68f8d2SRoy Marples.Ar sla_id .
3880a68f8d2SRoy Marples.Ar sla_id
3890a68f8d2SRoy Marplesis an integer which must be unique inside the
3900a68f8d2SRoy Marples.Ar iaid
3910a68f8d2SRoy Marplesand is added to the prefix which must fit inside
3920a68f8d2SRoy Marples.Ar prefix_len
3930a68f8d2SRoy Marplesless the length of the delegated prefix.
3940a68f8d2SRoy MarplesYou can specify multiple
3950a68f8d2SRoy Marples.Ar interface /
3960a68f8d2SRoy Marples.Ar sla_id /
3970a68f8d2SRoy Marples.Ar prefix_len
3980a68f8d2SRoy Marplesper
3990a68f8d2SRoy Marples.Ic ia_pd ,
4000a68f8d2SRoy Marplesspace separated.
4010a68f8d2SRoy MarplesIPv6RS should be disabled globally when requesting a Prefix Delegation.
4020a68f8d2SRoy Marples.Pp
4030a68f8d2SRoy MarplesIn the following example eth0 is the externally facing interface to be
4040a68f8d2SRoy Marplesconfigured for both IPv4 and IPv6.
4050a68f8d2SRoy MarplesThe DHCPv4 server will provide us with an IPv4 address and a default route.
4060a68f8d2SRoy MarplesThe DHCPv6 server is going to provide us with an IPv6 address, a default
4070a68f8d2SRoy Marplesroute and a /64 subnet to be delegated to the internal interface.
4080a68f8d2SRoy MarplesThe eth1 interface will be automatically configured
4090a68f8d2SRoy Marplesfor IPv6 using the first address (::1) from the delegated prefix.
4100a68f8d2SRoy MarplesA second prefix is requested and assigned to two other interfaces.
4110a68f8d2SRoy Marples.Xr rtadvd 8
4120a68f8d2SRoy Marplescan be used with an empty configuration file on eth1, eth2 and eth3,
4130a68f8d2SRoy Marplesto provide automatic
4140a68f8d2SRoy MarplesIPv6 address configuration for the internal network.
4150a68f8d2SRoy Marples.Bd -literal
4160a68f8d2SRoy Marplesnoipv6rs                 # disable routing solicitation
4170a68f8d2SRoy Marplesdenyinterfaces eth2      # Don't touch eth2 at all
4180a68f8d2SRoy Marplesinterface eth0
4190a68f8d2SRoy Marples  ipv6rs                 # enable routing solicitation for eth0
4200a68f8d2SRoy Marples  ia_na 1                # request an IPv6 address
4210a68f8d2SRoy Marples  ia_pd 2 eth1/0         # request a PD and assign it to eth1
4220a68f8d2SRoy Marples  ia_pd 3 eth2/1 eth3/2  # req a PD and assign it to eth2 and eth3
4230b4c9755SRoy Marples  ia_pd 4 -              # request a PD but don't assign it
4240a68f8d2SRoy Marples.Ed
4250a68f8d2SRoy Marples.It Ic ipv4only
4260a68f8d2SRoy MarplesOnly configure IPv4.
4270a68f8d2SRoy Marples.It Ic ipv6only
4280a68f8d2SRoy MarplesOnly configure IPv6.
4290a68f8d2SRoy Marples.It Ic fqdn Op disable | none | ptr | both
4300a68f8d2SRoy Marples.Ar none
4310a68f8d2SRoy Marpleswill not ask the DHCP server to update DNS.
4320a68f8d2SRoy Marples.Ar ptr
4330a68f8d2SRoy Marplesjust asks the DHCP server to update the PTR
4340a68f8d2SRoy Marplesrecord of the host in DNS, whereas
4350a68f8d2SRoy Marples.Ar both
4360a68f8d2SRoy Marplesalso updates the A record.
4370a68f8d2SRoy Marples.Ar disable
4380a68f8d2SRoy Marpleswill disable the FQDN option.
4390a68f8d2SRoy MarplesThe default is
4400a68f8d2SRoy Marples.Ar both .
4410a68f8d2SRoy Marples.Nm dhcpcd
4420a68f8d2SRoy Marplesitself never does any DNS updates.
4430a68f8d2SRoy Marples.Nm dhcpcd
4440a68f8d2SRoy Marplesencodes the FQDN hostname as specified in
4450a68f8d2SRoy Marples.Li RFC 1035 .
4460a68f8d2SRoy Marples.It Ic interface Ar interface
4470a68f8d2SRoy MarplesSubsequent options are only parsed for this
4480a68f8d2SRoy Marples.Ar interface .
449*54175cefSRoy Marples.It Ic ipv4ll_time Ar seconds
450*54175cefSRoy MarplesWait for
451*54175cefSRoy Marples.Ar seconds
452*54175cefSRoy Marplesbefore starting IPv4LL.
453*54175cefSRoy MarplesThe default is 5 seconds.
4540a68f8d2SRoy Marples.It Ic ipv6ra_autoconf
4550a68f8d2SRoy MarplesGenerate SLAAC addresses for each Prefix advertised by an IPv6
4560a68f8d2SRoy MarplesRouter Advertisement message with the Auto flag set.
4570a68f8d2SRoy MarplesOn by default.
4580a68f8d2SRoy Marples.It Ic ipv6ra_noautoconf
4590a68f8d2SRoy MarplesDisables the above option.
4600a68f8d2SRoy Marples.It Ic ipv6ra_fork
4610a68f8d2SRoy MarplesBy default, when
4620a68f8d2SRoy Marples.Nm dhcpcd
4630a68f8d2SRoy Marplesreceives an IPv6 Router Advertisement,
4640a68f8d2SRoy Marples.Nm dhcpcd
4650a68f8d2SRoy Marpleswill only fork to the background if the RA contains at least one unexpired
4660a68f8d2SRoy MarplesRDNSS option and a valid prefix or no DHCPv6 instruction.
4670a68f8d2SRoy MarplesSet this option so to make
4680a68f8d2SRoy Marples.Nm dhcpcd
4690a68f8d2SRoy Marplesalways fork on a RA.
4700a68f8d2SRoy Marples.It Ic ipv6rs
4710a68f8d2SRoy MarplesEnables IPv6 Router Advertisement solicitation.
4720a68f8d2SRoy MarplesThis is on by default, but is documented here in the case where it is disabled
4730a68f8d2SRoy Marplesglobally but needs to be enabled for one interface.
4740a68f8d2SRoy Marples.It Ic leasetime Ar seconds
47580aa9461SRoy MarplesRequest DHCP a lease time of
4760a68f8d2SRoy Marples.Ar seconds .
4770a68f8d2SRoy Marples.Ar -1
4780a68f8d2SRoy Marplesrepresents an infinite lease time.
4790a68f8d2SRoy MarplesBy default
4800a68f8d2SRoy Marples.Nm dhcpcd
4810a68f8d2SRoy Marplesdoes not request any lease time and leaves it in the hands of the
4820a68f8d2SRoy MarplesDHCP server.
48380aa9461SRoy MarplesIt is not possible to request a DHCPv6 lease time as this is not RFC compliant.
48480aa9461SRoy MarplesSee RFC 8415 21.4, 21.6, 21.21 and 21.22.
4850a68f8d2SRoy Marples.It Ic link_rcvbuf Ar size
4860a68f8d2SRoy MarplesOverride the size of the link receive buffer from the kernel default.
4870a68f8d2SRoy MarplesWhile
4880a68f8d2SRoy Marples.Nm dhcpcd
4890a68f8d2SRoy Marpleswill recover from link buffer overflows,
4900a68f8d2SRoy Marplesthis may not be desirable on heavily loaded systems.
4910a68f8d2SRoy Marples.It Ic logfile Ar logfile
4920a68f8d2SRoy MarplesWrites to the specified
4930a68f8d2SRoy Marples.Ar logfile .
4940a68f8d2SRoy Marples.Nm dhcpcd
4950a68f8d2SRoy Marplesstill writes to
4960a68f8d2SRoy Marples.Xr syslog 3 .
4970a68f8d2SRoy MarplesThe
4980a68f8d2SRoy Marples.Ar logfile
4990a68f8d2SRoy Marplesis reopened when
5000a68f8d2SRoy Marples.Nm dhcpcd
5010a68f8d2SRoy Marplesreceives the
5020a68f8d2SRoy Marples.Dv SIGUSR2
5030a68f8d2SRoy Marplessignal.
5040a68f8d2SRoy Marples.It Ic metric Ar metric
5050a68f8d2SRoy MarplesMetrics are used to prefer an interface over another one, lowest wins.
5060a68f8d2SRoy Marples.Nm dhcpcd
5070a68f8d2SRoy Marpleswill supply a default metric of 1000 +
5080a68f8d2SRoy Marples.Xr if_nametoindex 3 .
5090a68f8d2SRoy MarplesThis will be offset by 2000 for wireless interfaces, with additional offsets
5100a68f8d2SRoy Marplesof 1000000 for IPv4LL and 2000000 for roaming interfaces.
5110a68f8d2SRoy Marples.It Ic mudurl Ar url
5120a68f8d2SRoy MarplesSpecifies the URL for a Manufacturer Usage Description (MUD).
5130a68f8d2SRoy MarplesThe description is used by upstream network devices to instantiate any
5140a68f8d2SRoy Marplesdesired access lists.
5150a68f8d2SRoy MarplesSee draft-ietf-opsawg-mud for more information.
5160a68f8d2SRoy Marples.It Ic noalias
5170a68f8d2SRoy MarplesAny pre-existing IPv4 addresses will be removed from the interface when
5180a68f8d2SRoy Marplesadding a new IPv4 address.
5190a68f8d2SRoy Marples.It Ic noarp
5200a68f8d2SRoy MarplesDon't send any ARP requests.
5210a68f8d2SRoy MarplesThis also disables IPv4LL.
522*54175cefSRoy Marples.It Ic arp_persistdefence
523*54175cefSRoy MarplesKeep the IP address even if defence fails upon IP Address conflict.
5240a68f8d2SRoy Marples.It Ic noauthrequired
5250a68f8d2SRoy MarplesDon't require authentication even though we requested it.
5260a68f8d2SRoy MarplesAlso allows FORCERENEW and RECONFIGURE messages without authentication.
5270a68f8d2SRoy Marples.It Ic nodelay
5280a68f8d2SRoy MarplesDon't delay for an initial randomised time when starting protocols.
5290a68f8d2SRoy Marples.It Ic nodev
5300a68f8d2SRoy MarplesDon't load
5310a68f8d2SRoy Marples.Pa /dev
5320a68f8d2SRoy Marplesmanagement modules.
5330a68f8d2SRoy Marples.It Ic nodhcp
5340a68f8d2SRoy MarplesDon't start DHCP or listen to DHCP messages.
5350a68f8d2SRoy MarplesThis is only useful when allowing IPv4LL.
5360a68f8d2SRoy Marples.It Ic nodhcp6
5370a68f8d2SRoy MarplesDon't start DHCPv6 or listen to DHCPv6 messages.
5380a68f8d2SRoy MarplesNormally DHCPv6 is started by an IPv6 Router Advertisement instruction or
5390a68f8d2SRoy Marplesconfiguration.
5400a68f8d2SRoy Marples.It Ic nogateway
5410a68f8d2SRoy MarplesDon't install any default routes.
5420a68f8d2SRoy Marples.It Ic gateway
5430a68f8d2SRoy MarplesInstall a default route if available (default).
5440a68f8d2SRoy Marples.It Ic nohook Ar script
5450a68f8d2SRoy MarplesDon't run this hook script.
5460a68f8d2SRoy MarplesMatches full name, or prefixed with 2 numbers optionally ending with
5470a68f8d2SRoy Marples.Pa .sh .
5480a68f8d2SRoy Marples.Pp
5490a68f8d2SRoy MarplesSo to stop
5500a68f8d2SRoy Marples.Nm dhcpcd
5510a68f8d2SRoy Marplesfrom touching your DNS settings or starting wpa_supplicant you would do:-
5520a68f8d2SRoy Marples.D1 nohook resolv.conf, wpa_supplicant
5530a68f8d2SRoy Marples.It Ic noipv4
5540a68f8d2SRoy MarplesDon't attempt to configure an IPv4 address.
5550a68f8d2SRoy Marples.It Ic noipv4ll
5560a68f8d2SRoy MarplesDon't attempt to obtain an IPv4LL address if we failed to get one via DHCP.
5570a68f8d2SRoy MarplesSee
5580a68f8d2SRoy Marples.Rs
5590a68f8d2SRoy Marples.%T "RFC 3927"
5600a68f8d2SRoy Marples.Re
5610a68f8d2SRoy Marples.It Ic noipv6
5620a68f8d2SRoy MarplesDon't solicit or accept IPv6 Router Advertisements and DHCPv6.
5630a68f8d2SRoy Marples.It Ic noipv6rs
5640a68f8d2SRoy MarplesDon't solicit or accept IPv6 Router Advertisements.
5650a68f8d2SRoy Marples.It Ic nolink
5660a68f8d2SRoy MarplesDon't receive link messages about carrier status.
5670a68f8d2SRoy MarplesYou should only set this for buggy interface drivers.
5680a68f8d2SRoy Marples.It Ic noup
5690a68f8d2SRoy MarplesDon't bring the interface up when in manager mode.
5700a68f8d2SRoy Marples.It Ic option Ar option
5710a68f8d2SRoy MarplesRequests the
5720a68f8d2SRoy Marples.Ar option
5730a68f8d2SRoy Marplesfrom the server.
5740a68f8d2SRoy MarplesIt can be a variable to be used in
5750a68f8d2SRoy Marples.Xr dhcpcd-run-hooks 8
5760a68f8d2SRoy Marplesor the numerical value.
5770a68f8d2SRoy MarplesYou can specify more
5780a68f8d2SRoy Marples.Ar option Ns s
5790a68f8d2SRoy Marplesseparated by commas, spaces or more
5800a68f8d2SRoy Marples.Ic option
5810a68f8d2SRoy Marpleslines.
5820a68f8d2SRoy MarplesPrepend dhcp6_ to
5830a68f8d2SRoy Marples.Ar option
5840a68f8d2SRoy Marplesto request a DHCPv6 option.
5850a68f8d2SRoy MarplesIf no DHCPv6 options are configured,
5860a68f8d2SRoy Marplesthen DHCPv4 options are mapped to equivalent DHCPv6 options.
5870a68f8d2SRoy Marples.Pp
5880a68f8d2SRoy MarplesPrepend nd_ to
5890a68f8d2SRoy Marples.Ar option
5900a68f8d2SRoy Marplesto handle ND options, but this only works for the
5910a68f8d2SRoy Marples.Ic nooption ,
5920a68f8d2SRoy Marples.Ic reject
5930a68f8d2SRoy Marplesand
5940a68f8d2SRoy Marples.Ic require
5950a68f8d2SRoy Marplesoptions.
5960a68f8d2SRoy Marples.Pp
5970a68f8d2SRoy MarplesTo see a list of options you can use, call
5980a68f8d2SRoy Marples.Nm dhcpcd
5990a68f8d2SRoy Marpleswith the
6000a68f8d2SRoy Marples.Fl V , Fl Fl variables
6010a68f8d2SRoy Marplesargument.
6020a68f8d2SRoy Marples.It Ic nooption Ar option
6030a68f8d2SRoy MarplesRemove the option from the message before it's processed.
6040a68f8d2SRoy Marples.It Ic require Ar option
6050a68f8d2SRoy MarplesRequires the
6060a68f8d2SRoy Marples.Ar option
6070a68f8d2SRoy Marplesto be present in all messages, otherwise the message is ignored.
6080a68f8d2SRoy MarplesTo enforce that
6090a68f8d2SRoy Marples.Nm dhcpcd
6100a68f8d2SRoy Marplesonly responds to DHCP servers and not BOOTP servers, you can
6110a68f8d2SRoy Marples.Ic require
6120a68f8d2SRoy Marples.Ar dhcp_message_type .
6130a68f8d2SRoy MarplesThis isn't an exact science though because a BOOTP server can send DHCP-like
6140a68f8d2SRoy Marplesoptions.
6150a68f8d2SRoy Marples.It Ic reject Ar option
6160a68f8d2SRoy MarplesReject a message that contains the
6170a68f8d2SRoy Marples.Ar option .
6180a68f8d2SRoy MarplesThis is useful when you cannot use
6190a68f8d2SRoy Marples.Ic require
6200a68f8d2SRoy Marplesto select / de-select BOOTP messages.
6210a68f8d2SRoy Marples.It Ic destination Ar option
6220a68f8d2SRoy MarplesIf
6230a68f8d2SRoy Marples.Nm
6240a68f8d2SRoy Marplesdetects an address added to a point to point interface (PPP, TUN, etc) then
6250a68f8d2SRoy Marplesit will set the listed DHCP options to the destination address of the
6260a68f8d2SRoy Marplesinterface.
6270a68f8d2SRoy Marples.It Ic profile Ar name
6280a68f8d2SRoy MarplesSubsequent options are only parsed for this profile
6290a68f8d2SRoy Marples.Ar name .
6300a68f8d2SRoy Marples.It Ic quiet
6310a68f8d2SRoy MarplesSuppress any dhcpcd output to the console, except for errors.
6320a68f8d2SRoy Marples.It Ic reboot Ar seconds
6330a68f8d2SRoy MarplesAllow
6340a68f8d2SRoy Marples.Ar reboot
6350a68f8d2SRoy Marplesseconds before moving to the DISCOVER phase if we have an old lease to use.
6360a68f8d2SRoy MarplesAllow
6370a68f8d2SRoy Marples.Ar reboot
6380a68f8d2SRoy Marplesseconds before starting fallback states from the DISCOVER phase.
6390a68f8d2SRoy MarplesIPv4LL is started when the first
6400a68f8d2SRoy Marples.Ar reboot
6410a68f8d2SRoy Marplestimeout is reached.
6420a68f8d2SRoy MarplesThe default is 5 seconds.
6430a68f8d2SRoy MarplesA setting of 0 seconds causes
6440a68f8d2SRoy Marples.Nm
6450a68f8d2SRoy Marplesto skip the reboot phase and go straight into DISCOVER.
6460a68f8d2SRoy MarplesThis is desirable for mobile users because if you change from network A to
6470a68f8d2SRoy Marplesnetwork B and they use the same subnet and the address from network A isn't
6480a68f8d2SRoy Marplesin use on network B, then the DHCP server will remain silent even if
6490a68f8d2SRoy Marplesauthoritative which means
6500a68f8d2SRoy Marples.Nm dhcpcd
6510a68f8d2SRoy Marpleswill timeout before moving back to the DISCOVER phase.
6520a68f8d2SRoy MarplesThis has no effect on DHCPv6 other than skipping the reboot phase.
6530a68f8d2SRoy Marples.It Ic release
6540a68f8d2SRoy Marples.Nm dhcpcd
6550a68f8d2SRoy Marpleswill release the lease prior to stopping the interface.
6560a68f8d2SRoy Marples.It Ic script Ar script
6570a68f8d2SRoy MarplesUse
6580a68f8d2SRoy Marples.Ar script
6590a68f8d2SRoy Marplesinstead of the default
6600a68f8d2SRoy Marples.Pa /usr/libexec/dhcpcd-run-hooks .
661*54175cefSRoy Marples.It Ic request_time Ar seconds
662*54175cefSRoy MarplesRequest the lease for
663*54175cefSRoy Marples.Ar seconds
664*54175cefSRoy Marplesbefore going back to DISCOVER.
665*54175cefSRoy MarplesThe default is 180 seconds.
6660a68f8d2SRoy Marples.It Ic ssid Ar ssid
6670a68f8d2SRoy MarplesSubsequent options are only parsed for this wireless
6680a68f8d2SRoy Marples.Ar ssid .
66980aa9461SRoy Marples.It Ic slaac Ic hwaddr | Ic private | Ic token Ar token Op Ic temp | Ic temporary
6700a68f8d2SRoy MarplesSelects the interface identifier used for SLAAC generated IPv6 addresses.
6710a68f8d2SRoy MarplesIf
67280aa9461SRoy Marples.Ic private
6730a68f8d2SRoy Marplesis used, a RFC 7217 address is generated.
67480aa9461SRoy MarplesIf
67580aa9461SRoy Marples.Ic token Ar token
67680aa9461SRoy Marplesis used then the token is combined with the prefix to make the final address.
6770a68f8d2SRoy MarplesThe
67880aa9461SRoy Marples.Ic temporary
6790a68f8d2SRoy Marplesdirective will create a temporary address for the prefix as well.
6800a68f8d2SRoy Marples.It Ic static Ar value
6810a68f8d2SRoy MarplesConfigures a static
6820a68f8d2SRoy Marples.Ar value .
6830a68f8d2SRoy MarplesIf you set
6840a68f8d2SRoy Marples.Ic ip_address
6850a68f8d2SRoy Marplesthen
6860a68f8d2SRoy Marples.Nm dhcpcd
6870a68f8d2SRoy Marpleswill not attempt to obtain a lease and will just use the value for the address
6880a68f8d2SRoy Marpleswith an infinite lease time.
68980aa9461SRoy MarplesIf you set an empty value this removes all prior static allocations to
69080aa9461SRoy Marplesthe same value.
69180aa9461SRoy MarplesThis is useful when using profiles and in the case of
69280aa9461SRoy Marples.Ic ip_address
69380aa9461SRoy Marplesit will remove the static allocation.
69480aa9461SRoy MarplesNote that setting 0.0.0.0 keeps the static allocation but waits for a 3rdparty
69580aa9461SRoy Marplesto configure the address.
6960a68f8d2SRoy MarplesIf you set
6970a68f8d2SRoy Marples.Ic ip6_address ,
6980a68f8d2SRoy Marples.Nm dhcpcd
6990a68f8d2SRoy Marpleswill continue auto-configuration as normal.
7000a68f8d2SRoy Marples.Pp
7010a68f8d2SRoy MarplesHere is an example which configures two static address, overriding the default
7020a68f8d2SRoy MarplesIPv4 broadcast address, an IPv4 router, DNS and disables IPv6 auto-configuration.
7030a68f8d2SRoy MarplesYou could also use the
7040a68f8d2SRoy Marples.Ic inform6
7050a68f8d2SRoy Marplescommand here if you wished to obtain more information via DHCPv6.
7060a68f8d2SRoy MarplesFor IPv4, you should use the
7070a68f8d2SRoy Marples.Ic inform Ar ipaddress
7080a68f8d2SRoy Marplesoption instead of setting a static address.
7090a68f8d2SRoy Marples.D1 interface eth0
7100a68f8d2SRoy Marples.D1 noipv6rs
7110a68f8d2SRoy Marples.D1 static ip_address=192.168.0.10/24
7120a68f8d2SRoy Marples.D1 static broadcast_address=192.168.0.63
7130a68f8d2SRoy Marples.D1 static ip6_address=fd51:42f8:caae:d92e::ff/64
7140a68f8d2SRoy Marples.D1 static routers=192.168.0.1
7150a68f8d2SRoy Marples.D1 static domain_name_servers=192.168.0.1 fd51:42f8:caae:d92e::1
7160a68f8d2SRoy Marples.Pp
7170a68f8d2SRoy MarplesHere is an example for PPP which gives the destination a default route.
7180a68f8d2SRoy MarplesIt uses the special
7190a68f8d2SRoy Marples.Ar destination
7200a68f8d2SRoy Marpleskeyword to insert the destination address
7210a68f8d2SRoy Marplesinto the value.
7220a68f8d2SRoy Marples.D1 interface ppp0
72380aa9461SRoy Marples.D1 static ip_address=0.0.0.0
7240a68f8d2SRoy Marples.D1 destination routers
7250a68f8d2SRoy Marples.It Ic timeout Ar seconds
7260a68f8d2SRoy MarplesTime out after
7270a68f8d2SRoy Marples.Ar seconds ,
7280a68f8d2SRoy Marplesinstead of the default 30.
7290a68f8d2SRoy MarplesA setting of 0
7300a68f8d2SRoy Marples.Ar seconds
7310a68f8d2SRoy Marplescauses
7320a68f8d2SRoy Marples.Nm dhcpcd
7330a68f8d2SRoy Marplesto wait forever to get a lease.
7340a68f8d2SRoy MarplesIf
7350a68f8d2SRoy Marples.Nm dhcpcd
7360a68f8d2SRoy Marplesis working on a single interface then
7370a68f8d2SRoy Marples.Nm dhcpcd
7380a68f8d2SRoy Marpleswill exit when a timeout occurs, otherwise
7390a68f8d2SRoy Marples.Nm dhcpcd
7400a68f8d2SRoy Marpleswill fork into the background.
7410a68f8d2SRoy MarplesIf using IPv4LL then
7420a68f8d2SRoy Marples.Nm dhcpcd
7430a68f8d2SRoy Marplesstart the IPv4LL process after the timeout and then wait a little longer
7440a68f8d2SRoy Marplesbefore really timing out.
7450a68f8d2SRoy Marples.It Ic userclass Ar string
7460a68f8d2SRoy MarplesTag the DHCPv4 message with the userclass.
7470a68f8d2SRoy MarplesYou can specify more than one.
7480a68f8d2SRoy Marples.It Ic msuserclass Ar string
7490a68f8d2SRoy MarplesTag the DHCPv4 mesasge with the Microsoft userclass.
7500a68f8d2SRoy MarplesUnlike the
7510a68f8d2SRoy Marples.Ic userclass
7520a68f8d2SRoy Marplesoption, this one can only be added once.
7530a68f8d2SRoy MarplesIt should only be used for Microsoft DHCP servers and the
7540a68f8d2SRoy Marples.Ic vendorclassid
7550a68f8d2SRoy Marplesshould be set to "MSFT 98" or "MSFT 5.0".
7560a68f8d2SRoy MarplesThis option is not RFC compliant.
7570a68f8d2SRoy Marples.It Ic vendor Ar code , Ns Ar value
7580a68f8d2SRoy MarplesAdd an encapsulated vendor option.
7590a68f8d2SRoy Marples.Ar code
7600a68f8d2SRoy Marplesshould be between 1 and 254 inclusive.
7610a68f8d2SRoy MarplesTo add a raw vendor string, omit
7620a68f8d2SRoy Marples.Ar code
7630a68f8d2SRoy Marplesbut keep the comma.
7640a68f8d2SRoy MarplesExamples.
7650a68f8d2SRoy Marples.Pp
7660a68f8d2SRoy MarplesSet the vendor option 01 with an IP address.
7670a68f8d2SRoy Marples.D1 vendor 01,192.168.0.2
7680a68f8d2SRoy MarplesSet the vendor option 02 with a hex code.
7690a68f8d2SRoy Marples.D1 vendor 02,01:02:03:04:05
7700a68f8d2SRoy MarplesSet the vendor option 03 with an IP address as a string.
7710a68f8d2SRoy Marples.D1 vendor 03,\e"192.168.0.2\e"
7720a68f8d2SRoy MarplesSet un-encapsulated vendor option to hello world.
7730a68f8d2SRoy Marples.D1 vendor ,"hello world"
7740a68f8d2SRoy Marples.It Ic vendorclassid Ar string
7750a68f8d2SRoy MarplesSet the DHCP Vendor Class.
7760a68f8d2SRoy MarplesDHCPv6 has its own option as shown below.
7770a68f8d2SRoy MarplesThe default is
7780a68f8d2SRoy Marplesdhcpcd-<version>:<os>:<machine>:<platform>.
7790a68f8d2SRoy MarplesFor example
7800a68f8d2SRoy Marples.D1 dhcpcd-5.5.6:NetBSD-6.99.5:i386:i386
7810a68f8d2SRoy MarplesIf not set then none is sent.
7820a68f8d2SRoy MarplesSome badly configured DHCP servers reject unknown vendorclassids.
7830a68f8d2SRoy MarplesTo work around it, try and impersonate Windows by using the MSFT vendorclassid.
7840a68f8d2SRoy Marples.It Ic vendclass Ar en Ar data
7850a68f8d2SRoy MarplesAdd the DHCPv6 Vendor Indetifying Vendor Class with the IANA assigned Enterprise
7860a68f8d2SRoy MarplesNumber
7870a68f8d2SRoy Marples.Ar en
7880a68f8d2SRoy Marpleswith the
7890a68f8d2SRoy Marples.Ar data .
7900a68f8d2SRoy MarplesThis option can be set more than once to add more data, but the behaviour,
7910a68f8d2SRoy Marplesas per RFC 3925 is undefined if the Enterprise Number differs.
7920a68f8d2SRoy Marples.It Ic waitip Op 4 | 6
7930a68f8d2SRoy MarplesWait for an address to be assigned before forking to the background.
7940a68f8d2SRoy Marples4 means wait for an IPv4 address to be assigned.
7950a68f8d2SRoy Marples6 means wait for an IPv6 address to be assigned.
7960a68f8d2SRoy MarplesIf no argument is given,
7970a68f8d2SRoy Marples.Nm
7980a68f8d2SRoy Marpleswill wait for any address protocol to be assigned.
7990a68f8d2SRoy MarplesIt is possible to wait for more than one address protocol and
8000a68f8d2SRoy Marples.Nm
8010a68f8d2SRoy Marpleswill only fork to the background when all waiting conditions are satisfied.
8020a68f8d2SRoy Marples.It Ic xidhwaddr
8030a68f8d2SRoy MarplesUse the last four bytes of the hardware address as the DHCP xid instead
8040a68f8d2SRoy Marplesof a randomly generated number.
8050a68f8d2SRoy Marples.El
8060a68f8d2SRoy Marples.Ss Defining new options
8070a68f8d2SRoy MarplesDHCP, ND and DHCPv6 allow for the use of custom options, and RFC 3925 vendor
8080a68f8d2SRoy Marplesoptions for DHCP can also be supplied.
8090a68f8d2SRoy MarplesEach option needs to be started with the
8100a68f8d2SRoy Marples.Ic define ,
8110a68f8d2SRoy Marples.Ic definend ,
8120a68f8d2SRoy Marples.Ic define6
8130a68f8d2SRoy Marplesor
8140a68f8d2SRoy Marples.Ic vendopt
8150a68f8d2SRoy Marplesdirective.
8160a68f8d2SRoy MarplesThis can optionally be followed by both
8170a68f8d2SRoy Marples.Ic embed
8180a68f8d2SRoy Marplesor
8190a68f8d2SRoy Marples.Ic encap
8200a68f8d2SRoy Marplesoptions.
8210a68f8d2SRoy MarplesBoth can be specified more than once and
8220a68f8d2SRoy Marples.Ic embed
8230a68f8d2SRoy Marplesmust come before
8240a68f8d2SRoy Marples.Ic encap .
8250a68f8d2SRoy Marples.Bl -tag -width indent
8260a68f8d2SRoy Marples.It Ic define Ar code Ar type Ar variable
8270a68f8d2SRoy MarplesDefines the DHCP option
8280a68f8d2SRoy Marples.Ar code
8290a68f8d2SRoy Marplesof
8300a68f8d2SRoy Marples.Ar type
8310a68f8d2SRoy Marpleswith a name of
8320a68f8d2SRoy Marples.Ar variable
8330a68f8d2SRoy Marplesexported to
8340a68f8d2SRoy Marples.Xr dhcpcd-run-hooks 8 .
8350a68f8d2SRoy Marples.It Ic definend Ar code Ar type Ar variable
8360a68f8d2SRoy MarplesDefines the ND option
8370a68f8d2SRoy Marples.Ar code
8380a68f8d2SRoy Marplesof
8390a68f8d2SRoy Marples.Ar type
8400a68f8d2SRoy Marpleswith a name of
8410a68f8d2SRoy Marples.Ar variable
8420a68f8d2SRoy Marplesexported to
8430a68f8d2SRoy Marples.Xr dhcpcd-run-hooks 8 ,
8440a68f8d2SRoy Marpleswith a prefix of
8450a68f8d2SRoy Marples.Va nd_ .
8460a68f8d2SRoy Marples.It Ic define6 Ar code Ar type Ar variable
8470a68f8d2SRoy MarplesDefines the DHCPv6 option
8480a68f8d2SRoy Marples.Ar code
8490a68f8d2SRoy Marplesof
8500a68f8d2SRoy Marples.Ar type
8510a68f8d2SRoy Marpleswith a name of
8520a68f8d2SRoy Marples.Ar variable
8530a68f8d2SRoy Marplesexported to
8540a68f8d2SRoy Marples.Xr dhcpcd-run-hooks 8 ,
8550a68f8d2SRoy Marpleswith a prefix of
8560a68f8d2SRoy Marples.Va dhcp6_ .
8570a68f8d2SRoy Marples.It Ic vendopt Ar code Ar type Ar variable
8580a68f8d2SRoy MarplesDefines the Vendor-Identifying Vendor Options.
8590a68f8d2SRoy MarplesThe
8600a68f8d2SRoy Marples.Ar code
8610a68f8d2SRoy Marplesis the IANA Enterprise Number which will uniquely describe the encapsulated
8620a68f8d2SRoy Marplesoptions.
8630a68f8d2SRoy Marples.Ar type
8640a68f8d2SRoy Marplesis normally
8650a68f8d2SRoy Marples.Ar encap .
8660a68f8d2SRoy Marples.Ar variable
8670a68f8d2SRoy Marplesnames the Vendor option to be exported.
8680a68f8d2SRoy Marples.It Ic embed Ar type Ar variable
8690a68f8d2SRoy MarplesDefines an embedded variable within the defined option.
8700a68f8d2SRoy MarplesThe length is determined by the
8710a68f8d2SRoy Marples.Ar type .
8720a68f8d2SRoy MarplesIf the
8730a68f8d2SRoy Marples.Ar variable
8740a68f8d2SRoy Marplesis not the same as defined in the parent option,
8750a68f8d2SRoy Marplesit is prefixed with the parent
8760a68f8d2SRoy Marples.Ar variable
8770a68f8d2SRoy Marplesfirst with an underscore.
8780a68f8d2SRoy MarplesIf the
8790a68f8d2SRoy Marples.Ar variable
8800a68f8d2SRoy Marpleshas the name of
8810a68f8d2SRoy Marples.Ar reserved
8820a68f8d2SRoy Marplesthen it is not processed.
8830a68f8d2SRoy Marples.It Ic encap Ar code Ar type Ar variable
8840a68f8d2SRoy MarplesDefines an encapsulated variable within the defined option.
8850a68f8d2SRoy MarplesThe length is determined by the
8860a68f8d2SRoy Marples.Ar type .
8870a68f8d2SRoy MarplesIf the
8880a68f8d2SRoy Marples.Ar variable
8890a68f8d2SRoy Marplesis not the same as defined in the parent option,
8900a68f8d2SRoy Marplesit is prefixed with the parent
8910a68f8d2SRoy Marples.Ar variable
8920a68f8d2SRoy Marplesfirst with an underscore.
8930a68f8d2SRoy Marples.El
8940a68f8d2SRoy Marples.Ss Type prefix
8950a68f8d2SRoy MarplesThese keywords come before the type itself, to describe it more fully.
8960a68f8d2SRoy MarplesYou can use more than one, but they must appear in the order listed below.
8970a68f8d2SRoy Marples.Bl -tag -width -indent
8980a68f8d2SRoy Marples.It Ic request
8990a68f8d2SRoy MarplesRequests the option by default without having to be specified in user
9000a68f8d2SRoy Marplesconfiguration.
9010a68f8d2SRoy Marples.It Ic norequest
9020a68f8d2SRoy MarplesThis option cannot be requested, regardless of user configuration.
9030a68f8d2SRoy Marples.It Ic optional
9040a68f8d2SRoy MarplesThis option is optional.
9050a68f8d2SRoy MarplesOnly makes sense for embedded options like the client FQDN option, where
9060a68f8d2SRoy Marplesthe FQDN string itself is optional.
9070a68f8d2SRoy Marples.It Ic index
9080a68f8d2SRoy MarplesThe option can appear more than once and will be indexed.
9090a68f8d2SRoy Marples.It Ic array
9100a68f8d2SRoy MarplesThe option data is split into a space separated array, each element being
9110a68f8d2SRoy Marplesthe same type.
9120a68f8d2SRoy Marples.El
9130a68f8d2SRoy Marples.Ss Types to define
9140a68f8d2SRoy MarplesThe type directly affects the length of data consumed inside the option.
9150a68f8d2SRoy MarplesAny remaining data is normally discarded.
9160a68f8d2SRoy MarplesLengths can be specified for string and binhex types, but this is generally
9170a68f8d2SRoy Marpleswith other data embedded afterwards in the same option.
9180a68f8d2SRoy Marples.Bl -tag -width indent
9190a68f8d2SRoy Marples.It Ic ipaddress
9200a68f8d2SRoy MarplesAn IPv4 address, 4 bytes.
9210a68f8d2SRoy Marples.It Ic ip6address
9220a68f8d2SRoy MarplesAn IPv6 address, 16 bytes.
9230a68f8d2SRoy Marples.It Ic string Op : Ic length
9240a68f8d2SRoy MarplesA NVT ASCII string of printable characters.
9250a68f8d2SRoy Marples.It Ic byte
9260a68f8d2SRoy MarplesA byte.
9270a68f8d2SRoy Marples.It Ic bitflags : Ic flags
9280a68f8d2SRoy MarplesA byte represented as a string of flags, most significant bit first.
9290a68f8d2SRoy MarplesFor example, using ABCDEFGH then A would equal 10000000, B 01000000,
9300a68f8d2SRoy MarplesC 00100000, etc.
9310a68f8d2SRoy MarplesIf the bit is not set, the flag is not printed.
9320a68f8d2SRoy MarplesA flag of 0 is not printed even if the bit position is set.
9330a68f8d2SRoy MarplesThis is to allow reservation of the first bits while assigning the last bits.
9340a68f8d2SRoy Marples.It Ic int16
9350a68f8d2SRoy MarplesA signed 16bit integer, 2 bytes.
9360a68f8d2SRoy Marples.It Ic uint16
9370a68f8d2SRoy MarplesAn unsigned 16bit integer, 2 bytes.
9380a68f8d2SRoy Marples.It Ic int32
9390a68f8d2SRoy MarplesA signed 32bit integer, 4 bytes.
9400a68f8d2SRoy Marples.It Ic uint32
9410a68f8d2SRoy MarplesAn unsigned 32bit integer, 4 bytes.
9420a68f8d2SRoy Marples.It Ic flag
9430a68f8d2SRoy MarplesA fixed value (1) to indicate that the option is present, 0 bytes.
9440a68f8d2SRoy Marples.It Ic domain
9450a68f8d2SRoy MarplesAn RFC 3397 encoded string.
9460a68f8d2SRoy Marples.It Ic dname
9470a68f8d2SRoy MarplesAn RFC 1035 validated string.
9484f235d86SRoy Marples.It Ic uri
9494f235d86SRoy MarplesIf an array then the first two bytes are the URI length inside the option data.
9504f235d86SRoy MarplesOtherwise, the whole option data is the URI.
9514f235d86SRoy MarplesAs a space is not allowed in the URI encoding, the URIs are space separated.
9520a68f8d2SRoy Marples.It Ic binhex Op : Ic length
9530a68f8d2SRoy MarplesBinary data expressed as hexadecimal.
9540a68f8d2SRoy Marples.It Ic embed
9550a68f8d2SRoy MarplesContains embedded options (implies encap as well).
9560a68f8d2SRoy Marples.It Ic encap
9570a68f8d2SRoy MarplesContains encapsulated options (implies embed as well).
9580a68f8d2SRoy Marples.It Ic option
9590a68f8d2SRoy MarplesReferences an option from the global definition.
9600a68f8d2SRoy Marples.El
9610a68f8d2SRoy Marples.Ss Example definition
9620a68f8d2SRoy Marples.D1 # DHCP option 81, Fully Qualified Domain Name, RFC 4702
9630a68f8d2SRoy Marples.D1 define 81 embed fqdn
9640a68f8d2SRoy Marples.D1 embed byte flags
9650a68f8d2SRoy Marples.D1 embed byte rcode1
9660a68f8d2SRoy Marples.D1 embed byte rcode2
9670a68f8d2SRoy Marples.D1 embed domain fqdn
9680a68f8d2SRoy Marples.Pp
9690a68f8d2SRoy Marples.D1 # DHCP option 125, Vendor Specific Information Option, RFC 3925
9700a68f8d2SRoy Marples.D1 define 125 encap vsio
9710a68f8d2SRoy Marples.D1 embed uint32 enterprise_number
9720a68f8d2SRoy Marples.D1 # Options defined for the enterprise number
9730a68f8d2SRoy Marples.D1 encap 1 ipaddress ipaddress
9740a68f8d2SRoy Marples.Ss Supported Authentication Protocols
9750a68f8d2SRoy Marples.Bl -tag -width -indent
9760a68f8d2SRoy Marples.It Ic token
9770a68f8d2SRoy MarplesSends a plain text token the server expects and matches a token sent by
9780a68f8d2SRoy Marplesthe server.
9790a68f8d2SRoy MarplesThe tokens do not have to be the same.
9800a68f8d2SRoy MarplesIf unspecified, the token with a
9810a68f8d2SRoy Marples.Ar secretid
9820a68f8d2SRoy Marplesof 0 will be used in sending messages
9830a68f8d2SRoy Marplesand validating received messages.
9840a68f8d2SRoy Marples.It Ic delayedrealm
9850a68f8d2SRoy MarplesDelayed Authentication.
9860a68f8d2SRoy Marples.Nm dhcpcd
9870a68f8d2SRoy Marpleswill send an authentication option with no key or MAC.
9880a68f8d2SRoy MarplesThe server will see this option, and select a key for
9890a68f8d2SRoy Marples.Nm , writing the
9900a68f8d2SRoy Marples.Ar realm
9910a68f8d2SRoy Marplesand
9920a68f8d2SRoy Marples.Ar secretid
9930a68f8d2SRoy Marplesin it.
9940a68f8d2SRoy Marples.Nm dhcpcd
9950a68f8d2SRoy Marpleswill then look for an unexpired token with a matching
9960a68f8d2SRoy Marples.Ar realm
9970a68f8d2SRoy Marplesand
9980a68f8d2SRoy Marples.Ar secretid .
9990a68f8d2SRoy MarplesThis token is used to authenticate all other messages.
10000a68f8d2SRoy Marples.It Ic delayed
10010a68f8d2SRoy MarplesSame as above, but without a realm.
10020a68f8d2SRoy Marples.El
10030a68f8d2SRoy Marples.Ss Supported Authentication Algorithms
10040a68f8d2SRoy MarplesIf none specified,
10050a68f8d2SRoy Marples.Ic hmac-md5
10060a68f8d2SRoy Marplesis the default.
10070a68f8d2SRoy Marples.Bl -tag -width -indent
10080a68f8d2SRoy Marples.It Ic hmac-md5
10090a68f8d2SRoy Marples.El
10100a68f8d2SRoy Marples.Ss Supported Replay Detection Mechanisms
10110a68f8d2SRoy MarplesIf none specified,
10120a68f8d2SRoy Marples.Ic monotonic
10130a68f8d2SRoy Marplesis the default.
10140a68f8d2SRoy MarplesIf this is changed from what was previously used,
10150a68f8d2SRoy Marplesor the means of calculating or storing it is broken, then the DHCP server
10160a68f8d2SRoy Marpleswill probably have to have its notion of the client's Replay Detection Value
10170a68f8d2SRoy Marplesreset.
10180a68f8d2SRoy Marples.Bl -tag -width -indent
10190a68f8d2SRoy Marples.It Ic monocounter
10200a68f8d2SRoy MarplesRead the number in the file
10210a68f8d2SRoy Marples.Pa /var/db/dhcpcd/dhcpcd-rdm.monotonic
10220a68f8d2SRoy Marplesand add one to it.
10230a68f8d2SRoy Marples.It Ic monotime
10240a68f8d2SRoy MarplesCreate an NTP timestamp from the system time.
10250a68f8d2SRoy Marples.It Ic monotonic
10260a68f8d2SRoy MarplesSame as
10270a68f8d2SRoy Marples.Ic monotime .
10280a68f8d2SRoy Marples.El
10290a68f8d2SRoy Marples.Sh SEE ALSO
10300a68f8d2SRoy Marples.Xr fnmatch 3 ,
10310a68f8d2SRoy Marples.Xr if_nametoindex 3 ,
10320a68f8d2SRoy Marples.Xr dhcpcd 8 ,
10330a68f8d2SRoy Marples.Xr dhcpcd-run-hooks 8
10340a68f8d2SRoy Marples.Sh AUTHORS
10350a68f8d2SRoy Marples.An Roy Marples Aq Mt roy@marples.name
10360a68f8d2SRoy Marples.Sh BUGS
10370a68f8d2SRoy MarplesPlease report them to
103880aa9461SRoy Marples.Lk https://roy.marples.name/projects/dhcpcd
1039