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*0b4c9755SRoy Marples.Dd December 10, 2023 280a68f8d2SRoy Marples.Dt DHCPCD 8 290a68f8d2SRoy Marples.Os 300a68f8d2SRoy Marples.Sh NAME 310a68f8d2SRoy Marples.Nm dhcpcd 320a68f8d2SRoy Marples.Nd a DHCP client 330a68f8d2SRoy Marples.Sh SYNOPSIS 340a68f8d2SRoy Marples.Nm 350a68f8d2SRoy Marples.Op Fl 146ABbDdEGgHJKLMNPpqTV 360a68f8d2SRoy Marples.Op Fl C , Fl Fl nohook Ar hook 370a68f8d2SRoy Marples.Op Fl c , Fl Fl script Ar script 380a68f8d2SRoy Marples.Op Fl e , Fl Fl env Ar value 390a68f8d2SRoy Marples.Op Fl F , Fl Fl fqdn Ar FQDN 400a68f8d2SRoy Marples.Op Fl f , Fl Fl config Ar file 410a68f8d2SRoy Marples.Op Fl h , Fl Fl hostname Ar hostname 420a68f8d2SRoy Marples.Op Fl I , Fl Fl clientid Ar clientid 430a68f8d2SRoy Marples.Op Fl i , Fl Fl vendorclassid Ar vendorclassid 440a68f8d2SRoy Marples.Op Fl j , Fl Fl logfile Ar logfile 450a68f8d2SRoy Marples.Op Fl l , Fl Fl leasetime Ar seconds 460a68f8d2SRoy Marples.Op Fl m , Fl Fl metric Ar metric 470a68f8d2SRoy Marples.Op Fl O , Fl Fl nooption Ar option 480a68f8d2SRoy Marples.Op Fl o , Fl Fl option Ar option 490a68f8d2SRoy Marples.Op Fl Q , Fl Fl require Ar option 500a68f8d2SRoy Marples.Op Fl r , Fl Fl request Ar address 510a68f8d2SRoy Marples.Op Fl S , Fl Fl static Ar value 520a68f8d2SRoy Marples.Op Fl s , Fl Fl inform Ar address Ns Op Ar /cidr Ns Op Ar /broadcast_address 530a68f8d2SRoy Marples.Op Fl Fl inform6 540a68f8d2SRoy Marples.Op Fl t , Fl Fl timeout Ar seconds 550a68f8d2SRoy Marples.Op Fl u , Fl Fl userclass Ar class 560a68f8d2SRoy Marples.Op Fl v , Fl Fl vendor Ar code , Ar value 570a68f8d2SRoy Marples.Op Fl W , Fl Fl whitelist Ar address Ns Op Ar /cidr 580a68f8d2SRoy Marples.Op Fl w 590a68f8d2SRoy Marples.Op Fl Fl waitip Ns = Ns Op 4 | 6 600a68f8d2SRoy Marples.Op Fl y , Fl Fl reboot Ar seconds 610a68f8d2SRoy Marples.Op Fl X , Fl Fl blacklist Ar address Ns Op Ar /cidr 620a68f8d2SRoy Marples.Op Fl Z , Fl Fl denyinterfaces Ar pattern 630a68f8d2SRoy Marples.Op Fl z , Fl Fl allowinterfaces Ar pattern 640a68f8d2SRoy Marples.Op Fl Fl inactive 650a68f8d2SRoy Marples.Op Fl Fl configure 660a68f8d2SRoy Marples.Op Fl Fl noconfigure 670a68f8d2SRoy Marples.Op interface 680a68f8d2SRoy Marples.Op ... 690a68f8d2SRoy Marples.Nm 700a68f8d2SRoy Marples.Fl n , Fl Fl rebind 710a68f8d2SRoy Marples.Op interface 720a68f8d2SRoy Marples.Nm 730a68f8d2SRoy Marples.Fl k , Fl Fl release 740a68f8d2SRoy Marples.Op interface 750a68f8d2SRoy Marples.Nm 760a68f8d2SRoy Marples.Fl U , Fl Fl dumplease 770a68f8d2SRoy Marples.Op Ar interface 780a68f8d2SRoy Marples.Nm 790a68f8d2SRoy Marples.Fl Fl version 800a68f8d2SRoy Marples.Nm 810a68f8d2SRoy Marples.Fl x , Fl Fl exit 820a68f8d2SRoy Marples.Op interface 830a68f8d2SRoy Marples.Sh DESCRIPTION 840a68f8d2SRoy Marples.Nm 850a68f8d2SRoy Marplesis an implementation of the DHCP client specified in 860a68f8d2SRoy Marples.Li RFC 2131 . 870a68f8d2SRoy Marples.Nm 880a68f8d2SRoy Marplesgets the host information 890a68f8d2SRoy Marples.Po 900a68f8d2SRoy MarplesIP address, routes, etc 910a68f8d2SRoy Marples.Pc 920a68f8d2SRoy Marplesfrom a DHCP server and configures the network 930a68f8d2SRoy Marples.Ar interface 940a68f8d2SRoy Marplesof the 950a68f8d2SRoy Marplesmachine on which it is running. 960a68f8d2SRoy Marples.Nm 970a68f8d2SRoy Marplesthen runs the configuration script which writes DNS information to 980a68f8d2SRoy Marples.Xr resolvconf 8 , 990a68f8d2SRoy Marplesif available, otherwise directly to 1000a68f8d2SRoy Marples.Pa /etc/resolv.conf . 1010a68f8d2SRoy MarplesIf the hostname is currently blank, (null) or localhost, or 1020a68f8d2SRoy Marples.Va force_hostname 1030a68f8d2SRoy Marplesis YES or TRUE or 1 then 1040a68f8d2SRoy Marples.Nm 1050a68f8d2SRoy Marplessets the hostname to the one supplied by the DHCP server. 1060a68f8d2SRoy Marples.Nm 1070a68f8d2SRoy Marplesthen daemonises and waits for the lease renewal time to lapse. 1080a68f8d2SRoy MarplesIt will then attempt to renew its lease and reconfigure if the new lease 1090a68f8d2SRoy Marpleschanges when the lease begins to expire or the DHCP server sends a message 1100a68f8d2SRoy Marplesto renew early. 1110a68f8d2SRoy Marples.Pp 1120a68f8d2SRoy MarplesIf any interface reports a working carrier then 1130a68f8d2SRoy Marples.Nm 1140a68f8d2SRoy Marpleswill try to obtain a lease before forking to the background, 1150a68f8d2SRoy Marplesotherwise it will fork right away. 1160a68f8d2SRoy MarplesThis behaviour can be modified with the 1170a68f8d2SRoy Marples.Fl b , Fl Fl background 1180a68f8d2SRoy Marplesand 1190a68f8d2SRoy Marples.Fl w , Fl Fl waitip 1200a68f8d2SRoy Marplesoptions. 1210a68f8d2SRoy Marples.Pp 1220a68f8d2SRoy Marples.Nm 1230a68f8d2SRoy Marplesis also an implementation of the BOOTP client specified in 1240a68f8d2SRoy Marples.Li RFC 951 . 1250a68f8d2SRoy Marples.Pp 1260a68f8d2SRoy Marples.Nm 1270a68f8d2SRoy Marplesis also an implementation of the IPv6 Router Solicitor as specified in 1280a68f8d2SRoy Marples.Li RFC 4861 1290a68f8d2SRoy Marplesand 1300a68f8d2SRoy Marples.Li RFC 6106 . 1310a68f8d2SRoy Marples.Pp 1320a68f8d2SRoy Marples.Nm 1330a68f8d2SRoy Marplesis also an implementation of the IPv6 Privacy Extensions to AutoConf as 1340a68f8d2SRoy Marplesspecified in 1350a68f8d2SRoy Marples.Li RFC 4941 . 1360a68f8d2SRoy MarplesThis feature needs to be enabled in the kernel and 1370a68f8d2SRoy Marples.Nm 1380a68f8d2SRoy Marpleswill start using it. 1390a68f8d2SRoy Marples.Pp 1400a68f8d2SRoy Marples.Nm 1410a68f8d2SRoy Marplesis also an implementation of the DHCPv6 client as specified in 1420a68f8d2SRoy Marples.Li RFC 3315 . 1430a68f8d2SRoy MarplesBy default, 1440a68f8d2SRoy Marples.Nm 1450a68f8d2SRoy Marplesonly starts DHCPv6 when instructed to do so by an IPV6 Router Advertisement. 1460a68f8d2SRoy MarplesIf no Identity Association is configured, 1470a68f8d2SRoy Marplesthen a Non-temporary Address is requested. 1480a68f8d2SRoy Marples.Ss Local Link configuration 1490a68f8d2SRoy MarplesIf 1500a68f8d2SRoy Marples.Nm 1510a68f8d2SRoy Marplesfailed to obtain a lease, it probes for a valid IPv4LL address 1520a68f8d2SRoy Marples.Po 1530a68f8d2SRoy Marplesaka ZeroConf, aka APIPA 1540a68f8d2SRoy Marples.Pc . 1550a68f8d2SRoy MarplesOnce obtained it restarts the process of looking for a DHCP server to get a 1560a68f8d2SRoy Marplesproper address. 1570a68f8d2SRoy Marples.Pp 1580a68f8d2SRoy MarplesWhen using IPv4LL, 1590a68f8d2SRoy Marples.Nm 1600a68f8d2SRoy Marplesnearly always succeeds and returns an exit code of 0. 1610a68f8d2SRoy MarplesIn the rare case it fails, it normally means that there is a reverse ARP proxy 1620a68f8d2SRoy Marplesinstalled which always defeats IPv4LL probing. 1630a68f8d2SRoy MarplesTo disable this behaviour, you can use the 1640a68f8d2SRoy Marples.Fl L , Fl Fl noipv4ll 1650a68f8d2SRoy Marplesoption. 1660a68f8d2SRoy Marples.Ss Multiple interfaces 1670a68f8d2SRoy MarplesIf a list of interfaces are given on the command line, then 1680a68f8d2SRoy Marples.Nm 1690a68f8d2SRoy Marplesonly works with those interfaces, otherwise 1700a68f8d2SRoy Marples.Nm 1710a68f8d2SRoy Marplesdiscovers available Ethernet interfaces that can be configured. 1720a68f8d2SRoy MarplesWhen 1730a68f8d2SRoy Marples.Nm 17480aa9461SRoy Marplesis not limited to one interface on the command line, 1750a68f8d2SRoy Marplesit is running in Manager mode. 1760a68f8d2SRoy MarplesThe 1770a68f8d2SRoy Marples.Nm dhcpcd-ui 1780a68f8d2SRoy Marplesproject expects dhcpcd to be running this way. 1790a68f8d2SRoy Marples.Pp 1800a68f8d2SRoy MarplesIf a single interface is given then 1810a68f8d2SRoy Marples.Nm 1820a68f8d2SRoy Marplesonly works for that interface and runs as a separate instance to other 1830a68f8d2SRoy Marples.Nm 1840a68f8d2SRoy Marplesprocesses. 18580aa9461SRoy MarplesThe 1860a68f8d2SRoy Marples.Fl w , Fl Fl waitip 1870a68f8d2SRoy Marplesoption is enabled in this instance to maintain compatibility with older 1880a68f8d2SRoy Marplesversions. 189*0b4c9755SRoy MarplesUsing a single interface, 190*0b4c9755SRoy Marplesoptionally further limited to an address protocol, 191*0b4c9755SRoy Marplesalso affects the 1920a68f8d2SRoy Marples.Fl k , 1930a68f8d2SRoy Marples.Fl N , 1940a68f8d2SRoy Marples.Fl n 1950a68f8d2SRoy Marplesand 1960a68f8d2SRoy Marples.Fl x 197*0b4c9755SRoy Marplesoptions, where the same interface and any address protocol 198*0b4c9755SRoy Marpleswill need to be specified, as a lack of an 1990a68f8d2SRoy Marplesinterface will imply Manager mode which this is not. 2000a68f8d2SRoy MarplesTo force starting in Manager mode with only one interface, the 2010a68f8d2SRoy Marples.Fl M , Fl Fl manager 2020a68f8d2SRoy Marplesoption can be used. 2030a68f8d2SRoy Marples.Pp 2040a68f8d2SRoy MarplesInterfaces are preferred by carrier, DHCP lease/IPv4LL and then lowest metric. 2050a68f8d2SRoy MarplesFor systems that support route metrics, each route will be tagged with the 2060a68f8d2SRoy Marplesmetric, otherwise 2070a68f8d2SRoy Marples.Nm 2080a68f8d2SRoy Marpleschanges the routes to use the interface with the same route and the lowest 2090a68f8d2SRoy Marplesmetric. 2100a68f8d2SRoy MarplesSee options below for controlling which interfaces we allow and deny through 2110a68f8d2SRoy Marplesthe use of patterns. 2120a68f8d2SRoy Marples.Pp 2130a68f8d2SRoy MarplesNon-ethernet interfaces and some virtual ethernet interfaces 2140a68f8d2SRoy Marplessuch as TAP and bridge are ignored by default, 2150a68f8d2SRoy Marplesas is the FireWire interface. 2160a68f8d2SRoy MarplesTo work with these devices they either need to be specified on the command line, 2170a68f8d2SRoy Marplesbe listed in 2180a68f8d2SRoy Marples.Fl Fl allowinterfaces 2190a68f8d2SRoy Marplesor have an interface directive in 2200a68f8d2SRoy Marples.Pa /etc/dhcpcd.conf . 2210a68f8d2SRoy Marples.Ss Hooking into events 2220a68f8d2SRoy Marples.Nm 2230a68f8d2SRoy Marplesruns 2240a68f8d2SRoy Marples.Pa /usr/libexec/dhcpcd-run-hooks , 2250a68f8d2SRoy Marplesor the script specified by the 2260a68f8d2SRoy Marples.Fl c , Fl Fl script 2270a68f8d2SRoy Marplesoption. 2280a68f8d2SRoy MarplesThis script runs each script found in 2290a68f8d2SRoy Marples.Pa /usr/libexec/dhcpcd-hooks 2300a68f8d2SRoy Marplesin a lexical order. 2310a68f8d2SRoy MarplesThe default installation supplies the scripts 2320a68f8d2SRoy Marples.Pa 01-test , 2330a68f8d2SRoy Marples.Pa 20-resolv.conf 2340a68f8d2SRoy Marplesand 2350a68f8d2SRoy Marples.Pa 30-hostname . 2360a68f8d2SRoy MarplesYou can disable each script by using the 2370a68f8d2SRoy Marples.Fl C , Fl Fl nohook 2380a68f8d2SRoy Marplesoption. 2390a68f8d2SRoy MarplesSee 2400a68f8d2SRoy Marples.Xr dhcpcd-run-hooks 8 2410a68f8d2SRoy Marplesfor details on how these scripts work. 2420a68f8d2SRoy Marples.Nm 2430a68f8d2SRoy Marplescurrently ignores the exit code of the script. 2440a68f8d2SRoy Marples.Pp 2450a68f8d2SRoy MarplesMore scripts are supplied in 2460a68f8d2SRoy Marples.Pa /usr/share/dhcpcd/hooks 2470a68f8d2SRoy Marplesand need to be copied to 2480a68f8d2SRoy Marples.Pa /usr/libexec/dhcpcd-hooks 2490a68f8d2SRoy Marplesif you intend to use them. 2500a68f8d2SRoy MarplesFor example, you could install 2510a68f8d2SRoy Marples.Pa 29-lookup-hostname 2520a68f8d2SRoy Marplesso that 2530a68f8d2SRoy Marples.Nm 2540a68f8d2SRoy Marplescan lookup the hostname of the IP address in DNS if no hostname 2550a68f8d2SRoy Marplesis given by the lease and one is not already set. 2560a68f8d2SRoy Marples.Ss Fine tuning 2570a68f8d2SRoy MarplesYou can fine-tune the behaviour of 2580a68f8d2SRoy Marples.Nm 2590a68f8d2SRoy Marpleswith the following options: 2600a68f8d2SRoy Marples.Bl -tag -width indent 2610a68f8d2SRoy Marples.It Fl b , Fl Fl background 2620a68f8d2SRoy MarplesBackground immediately. 2630a68f8d2SRoy MarplesThis is useful for startup scripts which don't disable link messages for 2640a68f8d2SRoy Marplescarrier status. 2650a68f8d2SRoy Marples.It Fl c , Fl Fl script Ar script 2660a68f8d2SRoy MarplesUse this 2670a68f8d2SRoy Marples.Ar script 2680a68f8d2SRoy Marplesinstead of the default 2690a68f8d2SRoy Marples.Pa /usr/libexec/dhcpcd-run-hooks . 2700a68f8d2SRoy Marples.It Fl D , Fl Fl duid Op Ar ll | lt | uuid | value 2710a68f8d2SRoy MarplesUse a DHCP Unique Identifier. 2720a68f8d2SRoy MarplesIf a system UUID is available, that will be used to create a DUID-UUID, 27380aa9461SRoy Marplesotherwise if persistent storage is available then a DUID-LLT 2740a68f8d2SRoy Marples(link local address + time) is generated, 2750a68f8d2SRoy Marplesotherwise DUID-LL is generated (link local address). 2760a68f8d2SRoy MarplesThe DUID type can be hinted as an optional parameter if the file 2770a68f8d2SRoy Marples.Pa /var/db/dhcpcd/duid 2780a68f8d2SRoy Marplesdoes not exist. 2790a68f8d2SRoy MarplesIf not 2800a68f8d2SRoy Marples.Va ll , 2810a68f8d2SRoy Marples.Va lt 2820a68f8d2SRoy Marplesor 2830a68f8d2SRoy Marples.Va uuid 2840a68f8d2SRoy Marplesthen 2850a68f8d2SRoy Marples.Va value 2860a68f8d2SRoy Marpleswill be converted from 00:11:22:33 format. 2870a68f8d2SRoy MarplesThis, plus the IAID will be used as the 2880a68f8d2SRoy Marples.Fl I , Fl Fl clientid . 2890a68f8d2SRoy MarplesThe DUID generated will be held in 2900a68f8d2SRoy Marples.Pa /var/db/dhcpcd/duid 2910a68f8d2SRoy Marplesand should not be copied to other hosts. 2920a68f8d2SRoy MarplesThis file also takes precedence over the above rules except for setting a value. 2930a68f8d2SRoy Marples.It Fl d , Fl Fl debug 2940a68f8d2SRoy MarplesEcho debug messages to the stderr and syslog. 2950a68f8d2SRoy Marples.It Fl E , Fl Fl lastlease 2960a68f8d2SRoy MarplesIf 2970a68f8d2SRoy Marples.Nm 2980a68f8d2SRoy Marplescannot obtain a lease, then try to use the last lease acquired for the 2990a68f8d2SRoy Marplesinterface. 3000a68f8d2SRoy Marples.It Fl Fl lastleaseextend 3010a68f8d2SRoy MarplesSame as the above, but the lease will be retained even if it expires. 3020a68f8d2SRoy Marples.Nm 3030a68f8d2SRoy Marpleswill give it up if any other host tries to claim it for their own via ARP. 3040a68f8d2SRoy MarplesThis violates RFC 2131, section 3.7, which states the lease should be 3050a68f8d2SRoy Marplesdropped once it has expired. 3060a68f8d2SRoy Marples.It Fl e , Fl Fl env Ar value 3070a68f8d2SRoy MarplesPush 3080a68f8d2SRoy Marples.Ar value 3090a68f8d2SRoy Marplesto the environment for use in 3100a68f8d2SRoy Marples.Xr dhcpcd-run-hooks 8 . 3110a68f8d2SRoy MarplesFor example, you can force the hostname hook to always set the hostname with 3120a68f8d2SRoy Marples.Fl e 3130a68f8d2SRoy Marples.Va force_hostname=YES . 3140a68f8d2SRoy Marples.It Fl g , Fl Fl reconfigure 3150a68f8d2SRoy Marples.Nm 3160a68f8d2SRoy Marpleswill re-apply IP address, routing and run 3170a68f8d2SRoy Marples.Xr dhcpcd-run-hooks 8 3180a68f8d2SRoy Marplesfor each interface. 3190a68f8d2SRoy MarplesThis is useful so that a 3rd party such as PPP or VPN can change the routing 3200a68f8d2SRoy Marplestable and / or DNS, etc and then instruct 3210a68f8d2SRoy Marples.Nm 3220a68f8d2SRoy Marplesto put things back afterwards. 3230a68f8d2SRoy Marples.Nm 3240a68f8d2SRoy Marplesdoes not read a new configuration when this happens - you should rebind if you 3250a68f8d2SRoy Marplesneed that functionality. 3260a68f8d2SRoy Marples.It Fl F , Fl Fl fqdn Ar fqdn 32780aa9461SRoy MarplesRequests that the DHCP server update DNS using FQDN instead of just a 3280a68f8d2SRoy Marpleshostname. 3290a68f8d2SRoy MarplesValid values for 3300a68f8d2SRoy Marples.Ar fqdn 3310a68f8d2SRoy Marplesare disable, none, ptr and both. 3320a68f8d2SRoy Marples.Nm 3330a68f8d2SRoy Marplesitself never does any DNS updates. 3340a68f8d2SRoy Marples.Nm 3350a68f8d2SRoy Marplesencodes the FQDN hostname as specified in 3360a68f8d2SRoy Marples.Li RFC 1035 . 3370a68f8d2SRoy Marples.It Fl f , Fl Fl config Ar file 3380a68f8d2SRoy MarplesSpecify a config to load instead of 3390a68f8d2SRoy Marples.Pa /etc/dhcpcd.conf . 3400a68f8d2SRoy Marples.Nm 3410a68f8d2SRoy Marplesalways processes the config file before any command line options. 3420a68f8d2SRoy Marples.It Fl h , Fl Fl hostname Ar hostname 3430a68f8d2SRoy MarplesSends 3440a68f8d2SRoy Marples.Ar hostname 3450a68f8d2SRoy Marplesto the DHCP server so it can be registered in DNS. 3460a68f8d2SRoy MarplesIf 3470a68f8d2SRoy Marples.Ar hostname 3480a68f8d2SRoy Marplesis an empty string then the current system hostname is sent. 3490a68f8d2SRoy MarplesIf 3500a68f8d2SRoy Marples.Ar hostname 3510a68f8d2SRoy Marplesis a FQDN (i.e., contains a .) then it will be encoded as such. 3520a68f8d2SRoy Marples.It Fl I , Fl Fl clientid Ar clientid 3530a68f8d2SRoy MarplesSend the 3540a68f8d2SRoy Marples.Ar clientid . 3550a68f8d2SRoy MarplesIf the string is of the format 01:02:03 then it is encoded as hex. 3560a68f8d2SRoy MarplesFor interfaces whose hardware address is longer than 8 bytes, or if the 3570a68f8d2SRoy Marples.Ar clientid 3580a68f8d2SRoy Marplesis an empty string then 3590a68f8d2SRoy Marples.Nm 3600a68f8d2SRoy Marplessends a default 3610a68f8d2SRoy Marples.Ar clientid 3620a68f8d2SRoy Marplesof the hardware family and the hardware address. 3630a68f8d2SRoy Marples.It Fl i , Fl Fl vendorclassid Ar vendorclassid 3640a68f8d2SRoy MarplesOverride the DHCPv4 3650a68f8d2SRoy Marples.Ar vendorclassid 3660a68f8d2SRoy Marplesfield sent. 3670a68f8d2SRoy MarplesThe default is 3680a68f8d2SRoy Marplesdhcpcd-<version>:<os>:<machine>:<platform>. 3690a68f8d2SRoy MarplesFor example 3700a68f8d2SRoy Marples.D1 dhcpcd-5.5.6:NetBSD-6.99.5:i386:i386 3710a68f8d2SRoy MarplesIf not set then none is sent. 3720a68f8d2SRoy MarplesSome badly configured DHCP servers reject unknown vendorclassids. 3730a68f8d2SRoy MarplesTo work around it, try and impersonate Windows by using the MSFT vendorclassid. 3740a68f8d2SRoy Marples.It Fl j , Fl Fl logfile Ar logfile 3750a68f8d2SRoy MarplesWrites to the specified 3760a68f8d2SRoy Marples.Ar logfile . 3770a68f8d2SRoy Marples.Nm 3780a68f8d2SRoy Marplesstill writes to 3790a68f8d2SRoy Marples.Xr syslog 3 . 3800a68f8d2SRoy MarplesThe 3810a68f8d2SRoy Marples.Ar logfile 3820a68f8d2SRoy Marplesis reopened when 3830a68f8d2SRoy Marples.Nm 3840a68f8d2SRoy Marplesreceives the 3850a68f8d2SRoy Marples.Dv SIGUSR2 3860a68f8d2SRoy Marplessignal. 3870a68f8d2SRoy Marples.It Fl k , Fl Fl release Op Ar interface 3880a68f8d2SRoy MarplesThis causes an existing 3890a68f8d2SRoy Marples.Nm 3900a68f8d2SRoy Marplesprocess running on the 3910a68f8d2SRoy Marples.Ar interface 3920a68f8d2SRoy Marplesto release its lease and de-configure the 3930a68f8d2SRoy Marples.Ar interface 3940a68f8d2SRoy Marplesregardless of the 3950a68f8d2SRoy Marples.Fl p , Fl Fl persistent 3960a68f8d2SRoy Marplesoption. 3970a68f8d2SRoy MarplesIf no 3980a68f8d2SRoy Marples.Ar interface 3990a68f8d2SRoy Marplesis specified then this applies to all interfaces in Manager mode. 4000a68f8d2SRoy MarplesIf no interfaces are left running, 4010a68f8d2SRoy Marples.Nm 4020a68f8d2SRoy Marpleswill exit. 4030a68f8d2SRoy Marples.It Fl l , Fl Fl leasetime Ar seconds 4040a68f8d2SRoy MarplesRequest a lease time of 4050a68f8d2SRoy Marples.Ar seconds . 4060a68f8d2SRoy Marples.Ar -1 4070a68f8d2SRoy Marplesrepresents an infinite lease time. 4080a68f8d2SRoy MarplesBy default 4090a68f8d2SRoy Marples.Nm 4100a68f8d2SRoy Marplesdoes not request any lease time and leaves it in the hands of the 4110a68f8d2SRoy MarplesDHCP server. 4120a68f8d2SRoy Marples.It Fl M , Fl Fl manager 4130a68f8d2SRoy MarplesStart 4140a68f8d2SRoy Marples.Nm 4150a68f8d2SRoy Marplesin Manager mode even if only one interface specified on the command line. 4160a68f8d2SRoy MarplesSee the Multiple Interfaces section above. 4170a68f8d2SRoy Marples.It Fl m , Fl Fl metric Ar metric 4180a68f8d2SRoy MarplesMetrics are used to prefer an interface over another one, lowest wins. 4190a68f8d2SRoy Marples.Nm 4200a68f8d2SRoy Marpleswill supply a default metric of 1000 + 4210a68f8d2SRoy Marples.Xr if_nametoindex 3 . 4220a68f8d2SRoy MarplesThis will be offset by 2000 for wireless interfaces, with additional offsets 4230a68f8d2SRoy Marplesof 1000000 for IPv4LL and 2000000 for roaming interfaces. 4240a68f8d2SRoy Marples.It Fl n , Fl Fl rebind Op Ar interface 4250a68f8d2SRoy MarplesNotifies 4260a68f8d2SRoy Marples.Nm 4270a68f8d2SRoy Marplesto reload its configuration and rebind the specified 4280a68f8d2SRoy Marples.Ar interface . 4290a68f8d2SRoy MarplesIf no 4300a68f8d2SRoy Marples.Ar interface 4310a68f8d2SRoy Marplesis specified then this applies to all interfaces in Manager mode. 4320a68f8d2SRoy MarplesIf 4330a68f8d2SRoy Marples.Nm 4340a68f8d2SRoy Marplesis not running, then it starts up as normal. 4350a68f8d2SRoy Marples.It Fl N , Fl Fl renew Op Ar interface 4360a68f8d2SRoy MarplesNotifies 4370a68f8d2SRoy Marples.Nm 4380a68f8d2SRoy Marplesto renew existing addresses on the specified 4390a68f8d2SRoy Marples.Ar interface . 4400a68f8d2SRoy MarplesIf no 4410a68f8d2SRoy Marples.Ar interface 4420a68f8d2SRoy Marplesis specified then this applies to all interfaces in Manager mode. 4430a68f8d2SRoy MarplesIf 4440a68f8d2SRoy Marples.Nm 4450a68f8d2SRoy Marplesis not running, then it starts up as normal. 4460a68f8d2SRoy MarplesUnlike the 4470a68f8d2SRoy Marples.Fl n , Fl Fl rebind 4480a68f8d2SRoy Marplesoption above, the configuration for 4490a68f8d2SRoy Marples.Nm 4500a68f8d2SRoy Marplesis not reloaded. 4510a68f8d2SRoy Marples.It Fl o , Fl Fl option Ar option 4520a68f8d2SRoy MarplesRequest the DHCP 4530a68f8d2SRoy Marples.Ar option 4540a68f8d2SRoy Marplesvariable for use in 4550a68f8d2SRoy Marples.Pa /usr/libexec/dhcpcd-run-hooks . 4560a68f8d2SRoy Marples.It Fl p , Fl Fl persistent 4570a68f8d2SRoy Marples.Nm 4584f235d86SRoy Marplesde-configures the 4590a68f8d2SRoy Marples.Ar interface 4604f235d86SRoy Marpleswhen it exits unless this option is enabled. 4610a68f8d2SRoy MarplesSometimes, this isn't desirable if, for example, you have root mounted over 4620a68f8d2SRoy MarplesNFS or SSH clients connect to this host and they need to be notified of 4630a68f8d2SRoy Marplesthe host shutting down. 4640a68f8d2SRoy MarplesYou can use this option to stop this from happening. 4650a68f8d2SRoy Marples.It Fl r , Fl Fl request Ar address 4660a68f8d2SRoy MarplesRequest the 4670a68f8d2SRoy Marples.Ar address 4680a68f8d2SRoy Marplesin the DHCP DISCOVER message. 4690a68f8d2SRoy MarplesThere is no guarantee this is the address the DHCP server will actually give. 4700a68f8d2SRoy MarplesIf no 4710a68f8d2SRoy Marples.Ar address 4720a68f8d2SRoy Marplesis given then the first address currently assigned to the 4730a68f8d2SRoy Marples.Ar interface 4740a68f8d2SRoy Marplesis used. 4750a68f8d2SRoy Marples.It Fl s , Fl Fl inform Ar address Ns Op Ar /cidr Ns Op Ar /broadcast_address 4760a68f8d2SRoy MarplesBehaves like 4770a68f8d2SRoy Marples.Fl r , Fl Fl request 4780a68f8d2SRoy Marplesas above, but sends a DHCP INFORM instead of DISCOVER/REQUEST. 4790a68f8d2SRoy MarplesThis does not get a lease as such, just notifies the DHCP server of the 4800a68f8d2SRoy Marples.Ar address 4810a68f8d2SRoy Marplesin use. 4820a68f8d2SRoy MarplesYou should also include the optional 4830a68f8d2SRoy Marples.Ar cidr 4840a68f8d2SRoy Marplesnetwork number in case the address is not already configured on the interface. 4850a68f8d2SRoy Marples.Nm 4860a68f8d2SRoy Marplesremains running and pretends it has an infinite lease. 4870a68f8d2SRoy Marples.Nm 4880a68f8d2SRoy Marpleswill not de-configure the interface when it exits. 4890a68f8d2SRoy MarplesIf 4900a68f8d2SRoy Marples.Nm 4910a68f8d2SRoy Marplesfails to contact a DHCP server then it returns a failure instead of falling 4920a68f8d2SRoy Marplesback on IPv4LL. 4930a68f8d2SRoy Marples.It Fl Fl inform6 4940a68f8d2SRoy MarplesPerforms a DHCPv6 Information Request. 4950a68f8d2SRoy MarplesNo address is requested or specified, but all other DHCPv6 options are allowed. 4960a68f8d2SRoy MarplesThis is normally performed automatically when the IPv6 Router Advertises 4970a68f8d2SRoy Marplesthat the client should perform this operation. 4980a68f8d2SRoy MarplesThis option is only needed when 4990a68f8d2SRoy Marples.Nm 5000a68f8d2SRoy Marplesis not processing IPv6RA messages and the need for DHCPv6 Information Request 5010a68f8d2SRoy Marplesexists. 5020a68f8d2SRoy Marples.It Fl S , Fl Fl static Ar value 5030a68f8d2SRoy MarplesConfigures a static DHCP 5040a68f8d2SRoy Marples.Ar value . 5050a68f8d2SRoy MarplesIf you set 5060a68f8d2SRoy Marples.Ic ip_address 5070a68f8d2SRoy Marplesthen 5080a68f8d2SRoy Marples.Nm 5090a68f8d2SRoy Marpleswill not attempt to obtain a lease and just use the value for the address with 5100a68f8d2SRoy Marplesan infinite lease time. 5110a68f8d2SRoy Marples.Pp 5120a68f8d2SRoy MarplesHere is an example which configures a static address, routes and DNS. 5130a68f8d2SRoy Marples.D1 dhcpcd -S ip_address=192.168.0.10/24 \e 5140a68f8d2SRoy Marples.D1 -S routers=192.168.0.1 \e 5150a68f8d2SRoy Marples.D1 -S domain_name_servers=192.168.0.1 \e 5160a68f8d2SRoy Marples.D1 eth0 5170a68f8d2SRoy Marples.Pp 5180a68f8d2SRoy MarplesYou cannot presently set static DHCPv6 values. 5190a68f8d2SRoy MarplesUse the 5200a68f8d2SRoy Marples.Fl e , Fl Fl env 5210a68f8d2SRoy Marplesoption instead. 5220a68f8d2SRoy Marples.It Fl t , Fl Fl timeout Ar seconds 5230a68f8d2SRoy MarplesTimeout after 5240a68f8d2SRoy Marples.Ar seconds , 5250a68f8d2SRoy Marplesinstead of the default 30. 5260a68f8d2SRoy MarplesA setting of 0 5270a68f8d2SRoy Marples.Ar seconds 5280a68f8d2SRoy Marplescauses 5290a68f8d2SRoy Marples.Nm 5300a68f8d2SRoy Marplesto wait forever to get a lease. 5310a68f8d2SRoy MarplesIf 5320a68f8d2SRoy Marples.Nm 5330a68f8d2SRoy Marplesis working on a single interface then 5340a68f8d2SRoy Marples.Nm 5350a68f8d2SRoy Marpleswill exit when a timeout occurs, otherwise 5360a68f8d2SRoy Marples.Nm 5370a68f8d2SRoy Marpleswill fork into the background. 5380a68f8d2SRoy Marples.It Fl u , Fl Fl userclass Ar class 5390a68f8d2SRoy MarplesTags the DHCPv4 message with the userclass 5400a68f8d2SRoy Marples.Ar class . 5410a68f8d2SRoy MarplesDHCP servers use this to give members of the class DHCP options other than the 5420a68f8d2SRoy Marplesdefault, without having to know things like hardware address or hostname. 5430a68f8d2SRoy Marples.It Fl v , Fl Fl vendor Ar code , Ns Ar value 5440a68f8d2SRoy MarplesAdd an encapsulated vendor option. 5450a68f8d2SRoy Marples.Ar code 5460a68f8d2SRoy Marplesshould be between 1 and 254 inclusive. 5470a68f8d2SRoy MarplesTo add a raw vendor string, omit 5480a68f8d2SRoy Marples.Ar code 5490a68f8d2SRoy Marplesbut keep the comma. 5500a68f8d2SRoy MarplesExamples. 5510a68f8d2SRoy Marples.Pp 5520a68f8d2SRoy MarplesSet the vendor option 01 with an IP address. 5530a68f8d2SRoy Marples.D1 dhcpcd \-v 01,192.168.0.2 eth0 5540a68f8d2SRoy MarplesSet the vendor option 02 with a hex code. 5550a68f8d2SRoy Marples.D1 dhcpcd \-v 02,01:02:03:04:05 eth0 5560a68f8d2SRoy MarplesSet the vendor option 03 with an IP address as a string. 5570a68f8d2SRoy Marples.D1 dhcpcd \-v 03,\e"192.168.0.2\e" eth0 5580a68f8d2SRoy MarplesSet un-encapsulated vendor option to hello world. 5590a68f8d2SRoy Marples.D1 dhcpcd \-v ,"hello world" eth0 5600a68f8d2SRoy Marples.It Fl Fl version 5610a68f8d2SRoy MarplesDisplay both program version and copyright information. 5620a68f8d2SRoy Marples.Nm 5630a68f8d2SRoy Marplesthen exits before doing any configuration. 5640a68f8d2SRoy Marples.It Fl w 5650a68f8d2SRoy MarplesWait for an address to be assigned before forking to the background. 5660a68f8d2SRoy MarplesDoes not take an argument, unlike the below option. 5670a68f8d2SRoy Marples.It Fl Fl waitip Ns = Ns Op 4 | 6 5680a68f8d2SRoy MarplesWait for an address to be assigned before forking to the background. 5690a68f8d2SRoy Marples4 means wait for an IPv4 address to be assigned. 5700a68f8d2SRoy Marples6 means wait for an IPv6 address to be assigned. 5710a68f8d2SRoy MarplesIf no argument is given, 5720a68f8d2SRoy Marples.Nm 5730a68f8d2SRoy Marpleswill wait for any address protocol to be assigned. 5740a68f8d2SRoy MarplesIt is possible to wait for more than one address protocol and 5750a68f8d2SRoy Marples.Nm 5760a68f8d2SRoy Marpleswill only fork to the background when all waiting conditions are satisfied. 5770a68f8d2SRoy Marples.It Fl x , Fl Fl exit Op Ar interface 5780a68f8d2SRoy MarplesThis will signal an existing 5790a68f8d2SRoy Marples.Nm 5800a68f8d2SRoy Marplesprocess running on the 5810a68f8d2SRoy Marples.Ar interface 5820a68f8d2SRoy Marplesto exit. 5830a68f8d2SRoy MarplesIf no 5840a68f8d2SRoy Marples.Ar interface 5850a68f8d2SRoy Marplesis specified, then the above is applied to all interfaces in Manager mode. 5860a68f8d2SRoy MarplesSee the 5870a68f8d2SRoy Marples.Fl p , Fl Fl persistent 5880a68f8d2SRoy Marplesoption to control configuration persistence on exit, 5890a68f8d2SRoy Marpleswhich is enabled by default in 5900a68f8d2SRoy Marples.Xr dhcpcd.conf 5 . 5910a68f8d2SRoy Marples.Nm 5920a68f8d2SRoy Marplesthen waits until this process has exited. 5930a68f8d2SRoy Marples.It Fl y , Fl Fl reboot Ar seconds 5940a68f8d2SRoy MarplesAllow 5950a68f8d2SRoy Marples.Ar reboot 5960a68f8d2SRoy Marplesseconds before moving to the discover phase if we have an old lease to use. 5970a68f8d2SRoy MarplesAllow 5980a68f8d2SRoy Marples.Ar reboot 5990a68f8d2SRoy Marplesseconds before starting fallback states from the discover phase. 6000a68f8d2SRoy MarplesIPv4LL is started when the first 6010a68f8d2SRoy Marples.Ar reboot 6020a68f8d2SRoy Marplestimeout is reached. 6030a68f8d2SRoy MarplesThe default is 5 seconds. 6040a68f8d2SRoy MarplesA setting of 0 seconds causes 6050a68f8d2SRoy Marples.Nm 6060a68f8d2SRoy Marplesto skip the reboot phase and go straight into discover. 6070a68f8d2SRoy MarplesThis has no effect on DHCPv6 other than skipping the reboot phase. 6080a68f8d2SRoy Marples.El 6090a68f8d2SRoy Marples.Ss Restricting behaviour 6100a68f8d2SRoy Marples.Nm 6110a68f8d2SRoy Marpleswill try to do as much as it can by default. 6120a68f8d2SRoy MarplesHowever, there are sometimes situations where you don't want the things to be 6130a68f8d2SRoy Marplesconfigured exactly how the DHCP server wants. 6140a68f8d2SRoy MarplesHere are some options that deal with turning these bits off. 6150a68f8d2SRoy Marples.Pp 6160a68f8d2SRoy MarplesNote that when 6170a68f8d2SRoy Marples.Nm 6180a68f8d2SRoy Marplesis restricted to a single interface then the interface also needs to be 6190a68f8d2SRoy Marplesspecified when asking 6200a68f8d2SRoy Marples.Nm 6210a68f8d2SRoy Marplesto exit using the commandline. 6220a68f8d2SRoy MarplesIf the protocol is restricted as well then the protocol needs to be included 6230a68f8d2SRoy Marpleswith the exit instruction. 6240a68f8d2SRoy Marples.Bl -tag -width indent 6250a68f8d2SRoy Marples.It Fl 1 , Fl Fl oneshot 6260a68f8d2SRoy MarplesExit after configuring an interface. 6270a68f8d2SRoy MarplesUse the 6280a68f8d2SRoy Marples.Fl w , Fl Fl waitip 6290a68f8d2SRoy Marplesoption to specify which protocol(s) to configure before exiting. 6300a68f8d2SRoy Marples.It Fl 4 , Fl Fl ipv4only 6310a68f8d2SRoy MarplesConfigure IPv4 only. 6320a68f8d2SRoy Marples.It Fl 6 , Fl Fl ipv6only 6330a68f8d2SRoy MarplesConfigure IPv6 only. 6340a68f8d2SRoy Marples.It Fl A , Fl Fl noarp 6350a68f8d2SRoy MarplesDon't request or claim the address by ARP. 6360a68f8d2SRoy MarplesThis also disables IPv4LL. 6370a68f8d2SRoy Marples.It Fl B , Fl Fl nobackground 6380a68f8d2SRoy MarplesDon't run in the background when we acquire a lease. 6390a68f8d2SRoy MarplesThis is mainly useful for running under the control of another process, such 6400a68f8d2SRoy Marplesas a debugger or a network manager. 6410a68f8d2SRoy Marples.It Fl C , Fl Fl nohook Ar script 6420a68f8d2SRoy MarplesDon't run this hook script. 6430a68f8d2SRoy MarplesMatches full name, or prefixed with 2 numbers optionally ending with 6440a68f8d2SRoy Marples.Pa .sh . 6450a68f8d2SRoy Marples.Pp 6460a68f8d2SRoy MarplesSo to stop 6470a68f8d2SRoy Marples.Nm 6480a68f8d2SRoy Marplesfrom touching your DNS settings you would do:- 6490a68f8d2SRoy Marples.D1 dhcpcd -C resolv.conf eth0 6500a68f8d2SRoy Marples.It Fl G , Fl Fl nogateway 6510a68f8d2SRoy MarplesDon't set any default routes. 6520a68f8d2SRoy Marples.It Fl H , Fl Fl xidhwaddr 6530a68f8d2SRoy MarplesUse the last four bytes of the hardware address as the DHCP xid instead 6540a68f8d2SRoy Marplesof a randomly generated number. 6550a68f8d2SRoy Marples.It Fl J , Fl Fl broadcast 6560a68f8d2SRoy MarplesInstructs the DHCP server to broadcast replies back to the client. 6570a68f8d2SRoy MarplesNormally this is only set for non-Ethernet interfaces, 6580a68f8d2SRoy Marplessuch as FireWire and InfiniBand. 6590a68f8d2SRoy MarplesIn most instances, 6600a68f8d2SRoy Marples.Nm 6610a68f8d2SRoy Marpleswill set this automatically. 6620a68f8d2SRoy Marples.It Fl K , Fl Fl nolink 6630a68f8d2SRoy MarplesDon't receive link messages for carrier status. 6640a68f8d2SRoy MarplesYou should only have to use this with buggy device drivers or running 6650a68f8d2SRoy Marples.Nm 6660a68f8d2SRoy Marplesthrough a network manager. 6670a68f8d2SRoy Marples.It Fl L , Fl Fl noipv4ll 6680a68f8d2SRoy MarplesDon't use IPv4LL (aka APIPA, aka Bonjour, aka ZeroConf). 6690a68f8d2SRoy Marples.It Fl O , Fl Fl nooption Ar option 6700a68f8d2SRoy MarplesRemoves the 6710a68f8d2SRoy Marples.Ar option 6720a68f8d2SRoy Marplesfrom the DHCP message before processing. 6730a68f8d2SRoy Marples.It Fl P , Fl Fl printpidfile 6740a68f8d2SRoy MarplesPrint the 6750a68f8d2SRoy Marples.Pa pidfile 6760a68f8d2SRoy Marples.Nm 67780aa9461SRoy Marpleswill use based on command-line arguments to stdout. 6780a68f8d2SRoy Marples.It Fl Q , Fl Fl require Ar option 6790a68f8d2SRoy MarplesRequires the 6800a68f8d2SRoy Marples.Ar option 6810a68f8d2SRoy Marplesto be present in all DHCP messages, otherwise the message is ignored. 6820a68f8d2SRoy MarplesTo enforce that 6830a68f8d2SRoy Marples.Nm 6840a68f8d2SRoy Marplesonly responds to DHCP servers and not BOOTP servers, you can 6850a68f8d2SRoy Marples.Fl Q 6860a68f8d2SRoy Marples.Ar dhcp_message_type . 6870a68f8d2SRoy Marples.It Fl q , Fl Fl quiet 6880a68f8d2SRoy MarplesQuiet 6890a68f8d2SRoy Marples.Nm 6900a68f8d2SRoy Marpleson the command line, only warnings and errors will be displayed. 6910a68f8d2SRoy MarplesIf this option is used another time then all console output is disabled. 6920a68f8d2SRoy MarplesThese messages are still logged via 6930a68f8d2SRoy Marples.Xr syslog 3 . 6940a68f8d2SRoy Marples.It Fl T , Fl Fl test 6950a68f8d2SRoy MarplesOn receipt of DHCP messages just call 6960a68f8d2SRoy Marples.Pa /usr/libexec/dhcpcd-run-hooks 6970a68f8d2SRoy Marpleswith the reason of TEST which echos the DHCP variables found in the message 6980a68f8d2SRoy Marplesto the console. 6990a68f8d2SRoy MarplesThe interface configuration isn't touched and neither are any configuration 7000a68f8d2SRoy Marplesfiles. 7010a68f8d2SRoy MarplesThe 7020a68f8d2SRoy Marples.Ar rapid_commit 7030a68f8d2SRoy Marplesoption is not sent in TEST mode so that the server does not lease an address. 7040a68f8d2SRoy MarplesTo test INFORM the interface needs to be configured with the desired address 7050a68f8d2SRoy Marplesbefore starting 7060a68f8d2SRoy Marples.Nm . 7070a68f8d2SRoy Marples.It Fl U , Fl Fl dumplease Op Ar interface 7080a68f8d2SRoy MarplesDumps the current lease for the 7090a68f8d2SRoy Marples.Ar interface 7100a68f8d2SRoy Marplesto stdout. 7110a68f8d2SRoy MarplesIf no 7120a68f8d2SRoy Marples.Ar interface 7130a68f8d2SRoy Marplesis given then all interfaces are dumped. 7140a68f8d2SRoy MarplesUse the 7150a68f8d2SRoy Marples.Fl 4 7160a68f8d2SRoy Marplesor 7170a68f8d2SRoy Marples.Fl 6 7180a68f8d2SRoy Marplesflags to specify an address family. 7190a68f8d2SRoy MarplesIf a lease is piped in via standard input then that is dumped. 7200a68f8d2SRoy MarplesIn this case, specifying an address family is mandatory. 7210a68f8d2SRoy Marples.It Fl V , Fl Fl variables 7220a68f8d2SRoy MarplesDisplay a list of option codes, the associated variable and encoding for use in 7230a68f8d2SRoy Marples.Xr dhcpcd-run-hooks 8 . 7240a68f8d2SRoy MarplesVariables are prefixed with new_ and old_ unless the option number is -. 7250a68f8d2SRoy MarplesVariables without an option are part of the DHCP message and cannot be 7260a68f8d2SRoy Marplesdirectly requested. 7270a68f8d2SRoy Marples.It Fl W , Fl Fl whitelist Ar address Ns Op /cidr 7280a68f8d2SRoy MarplesOnly accept packets from 7290a68f8d2SRoy Marples.Ar address Ns Op /cidr . 7300a68f8d2SRoy Marples.Fl X , Fl Fl blacklist 7310a68f8d2SRoy Marplesis ignored if 7320a68f8d2SRoy Marples.Fl W , Fl Fl whitelist 7330a68f8d2SRoy Marplesis set. 7340a68f8d2SRoy Marples.It Fl X , Fl Fl blacklist Ar address Ns Op Ar /cidr 7350a68f8d2SRoy MarplesIgnore all packets from 7360a68f8d2SRoy Marples.Ar address Ns Op Ar /cidr . 7370a68f8d2SRoy Marples.It Fl Z , Fl Fl denyinterfaces Ar pattern 7380a68f8d2SRoy MarplesWhen discovering interfaces, the interface name must not match 7390a68f8d2SRoy Marples.Ar pattern 7400a68f8d2SRoy Marpleswhich is a space or comma separated list of patterns passed to 7410a68f8d2SRoy Marples.Xr fnmatch 3 . 7420a68f8d2SRoy Marples.It Fl z , Fl Fl allowinterfaces Ar pattern 7430a68f8d2SRoy MarplesWhen discovering interfaces, the interface name must match 7440a68f8d2SRoy Marples.Ar pattern 7450a68f8d2SRoy Marpleswhich is a space or comma separated list of patterns passed to 7460a68f8d2SRoy Marples.Xr fnmatch 3 . 7470a68f8d2SRoy MarplesIf the same interface is matched in 7480a68f8d2SRoy Marples.Fl Z , Fl Fl denyinterfaces 7490a68f8d2SRoy Marplesthen it is still denied. 7500a68f8d2SRoy Marples.It Fl Fl inactive 7510a68f8d2SRoy MarplesDon't start any interfaces other than those specified on the command line. 7520a68f8d2SRoy MarplesThis allows 7530a68f8d2SRoy Marples.Nm 7540a68f8d2SRoy Marplesto be started in Manager mode and then wait for subsequent 7550a68f8d2SRoy Marples.Nm 7560a68f8d2SRoy Marplescommands to start each interface as required. 7570a68f8d2SRoy Marples.It Fl Fl configure 7580a68f8d2SRoy MarplesAllows 7590a68f8d2SRoy Marples.Nm 7600a68f8d2SRoy Marplesto configure the system. 7610a68f8d2SRoy MarplesThis is the default behaviour and sets 7620a68f8d2SRoy Marples.Ev if_configured=true . 7630a68f8d2SRoy Marples.It Fl Fl noconfigure 7640a68f8d2SRoy Marples.Nm 7650a68f8d2SRoy Marpleswill not configure the system at all. 7660a68f8d2SRoy MarplesThis is only of use if the 7670a68f8d2SRoy Marples.Fl Fl script 7680a68f8d2SRoy Marplesthat 7690a68f8d2SRoy Marples.Nm 7700a68f8d2SRoy Marplescalls at each network event configures the system instead. 7710a68f8d2SRoy MarplesThis is different from 7720a68f8d2SRoy Marples.Fl T , Fl Fl test 7730a68f8d2SRoy Marplesmode in that it's not one shot and the only change to the environment is the 7740a68f8d2SRoy Marplesaddition of 7750a68f8d2SRoy Marples.Ev if_configured=false . 7760a68f8d2SRoy Marples.It Fl Fl nodev 7770a68f8d2SRoy MarplesDon't load any 7780a68f8d2SRoy Marples.Pa /dev 7790a68f8d2SRoy Marplesmanagement modules. 7800a68f8d2SRoy Marples.El 7810a68f8d2SRoy Marples.Sh 3RDPARTY LINK MANAGEMENT 7820a68f8d2SRoy MarplesSome interfaces require configuration by 3rd parties, such as PPP or VPN. 7830a68f8d2SRoy MarplesWhen an interface configuration in 7840a68f8d2SRoy Marples.Nm 7850a68f8d2SRoy Marplesis marked as STATIC or INFORM without an address then 7860a68f8d2SRoy Marples.Nm 7870a68f8d2SRoy Marpleswill monitor the interface until an address is added or removed from it and 7880a68f8d2SRoy Marplesact accordingly. 7890a68f8d2SRoy MarplesFor point to point interfaces (like PPP), a default route to its 7900a68f8d2SRoy Marplesdestination is automatically added to the configuration. 7910a68f8d2SRoy MarplesIf the point to point interface is configured for INFORM, then 7920a68f8d2SRoy Marples.Nm 7930a68f8d2SRoy Marplesunicasts INFORM to the destination, otherwise it defaults to STATIC. 7940a68f8d2SRoy Marples.Sh NOTES 7950a68f8d2SRoy Marples.Nm 79680aa9461SRoy Marplesrequires a Berkeley Packet Filter, or BPF device on BSD based systems and a 7970a68f8d2SRoy MarplesLinux Socket Filter, or LPF device on Linux based systems for all IPv4 7980a68f8d2SRoy Marplesconfiguration. 7990a68f8d2SRoy Marples.Pp 8000a68f8d2SRoy MarplesIf restricting 8010a68f8d2SRoy Marples.Nm 8020a68f8d2SRoy Marplesto a single interface and optionally address family via the command-line 8030a68f8d2SRoy Marplesthen all further calls to 8040a68f8d2SRoy Marples.Nm 8050a68f8d2SRoy Marplesto rebind, reconfigure or exit need to include the same restrictive flags 8060a68f8d2SRoy Marplesso that 8070a68f8d2SRoy Marples.Nm 8080a68f8d2SRoy Marplesknows which process to signal. 8090a68f8d2SRoy Marples.Pp 8100a68f8d2SRoy MarplesSome DHCP servers implement ClientID filtering. 8110a68f8d2SRoy MarplesIf 8120a68f8d2SRoy Marples.Nm 8130a68f8d2SRoy Marplesis replacing an in-use DHCP client then you might need to adjust the clientid 8140a68f8d2SRoy Marplesoption 8150a68f8d2SRoy Marples.Nm 8160a68f8d2SRoy Marplessends to match. 8170a68f8d2SRoy MarplesIf using a DUID in place of the ClientID, edit 8180a68f8d2SRoy Marples.Pa /var/db/dhcpcd/duid 8190a68f8d2SRoy Marplesaccordingly. 8200a68f8d2SRoy Marples.Sh FILES 8210a68f8d2SRoy Marples.Bl -ohang 8220a68f8d2SRoy Marples.It Pa /etc/dhcpcd.conf 8230a68f8d2SRoy MarplesConfiguration file for dhcpcd. 8240a68f8d2SRoy MarplesIf you always use the same options, put them here. 8250a68f8d2SRoy Marples.It Pa /usr/libexec/dhcpcd-run-hooks 8260a68f8d2SRoy MarplesBourne shell script that is run to configure or de-configure an interface. 8270a68f8d2SRoy Marples.It Pa /lib/dhcpcd/dev 8280a68f8d2SRoy MarplesLinux 8290a68f8d2SRoy Marples.Pa /dev 8300a68f8d2SRoy Marplesmanagement modules. 8310a68f8d2SRoy Marples.It Pa /usr/libexec/dhcpcd-hooks 83280aa9461SRoy MarplesA directory containing Bourne shell scripts that are run by the above script. 8330a68f8d2SRoy MarplesEach script can be disabled by using the 8340a68f8d2SRoy Marples.Fl C , Fl Fl nohook 8350a68f8d2SRoy Marplesoption described above. 8360a68f8d2SRoy Marples.It Pa /var/db/dhcpcd/duid 8370a68f8d2SRoy MarplesText file that holds the DUID used to identify the host. 8380a68f8d2SRoy Marples.It Pa /var/db/dhcpcd/secret 8390a68f8d2SRoy MarplesText file that holds a secret key known only to the host. 8400a68f8d2SRoy Marples.It Pa /var/db/dhcpcd/ Ns Ar interface Ns Ar -ssid Ns .lease 8410a68f8d2SRoy MarplesThe actual DHCP message sent by the server. 8420a68f8d2SRoy MarplesWe use this when reading the last 8430a68f8d2SRoy Marpleslease and use the file's mtime as when it was issued. 8440a68f8d2SRoy Marples.It Pa /var/db/dhcpcd/ Ns Ar interface Ns Ar -ssid Ns .lease6 8450a68f8d2SRoy MarplesThe actual DHCPv6 message sent by the server. 8460a68f8d2SRoy MarplesWe use this when reading the last 8470a68f8d2SRoy Marpleslease and use the file's mtime as when it was issued. 8480a68f8d2SRoy Marples.It Pa /var/db/dhcpcd/rdm_monotonic 8490a68f8d2SRoy MarplesStores the monotonic counter used in the 8500a68f8d2SRoy Marples.Ar replay 8510a68f8d2SRoy Marplesfield in Authentication Options. 8520a68f8d2SRoy Marples.It Pa /var/run/dhcpcd/pid 8530a68f8d2SRoy MarplesStores the PID of 8540a68f8d2SRoy Marples.Nm 8550a68f8d2SRoy Marplesrunning on all interfaces. 8560a68f8d2SRoy Marples.It Pa /var/run/dhcpcd/ Ns Ar interface Ns .pid 8570a68f8d2SRoy MarplesStores the PID of 8580a68f8d2SRoy Marples.Nm 8590a68f8d2SRoy Marplesrunning on the 8600a68f8d2SRoy Marples.Ar interface . 8610a68f8d2SRoy Marples.It Pa /var/run/dhcpcd/sock 8620a68f8d2SRoy MarplesControl socket to the manager daemon. 8630a68f8d2SRoy Marples.It Pa /var/run/dhcpcd/unpriv.sock 8640a68f8d2SRoy MarplesUnprivileged socket to the manager daemon, only allows state retrieval. 8650a68f8d2SRoy Marples.It Pa /var/run/dhcpcd/ Ns Ar interface Ns .sock 8660a68f8d2SRoy MarplesControl socket to per interface daemon. 8670a68f8d2SRoy Marples.It Pa /var/run/dhcpcd/ Ns Ar interface Ns .unpriv.sock 8680a68f8d2SRoy MarplesUnprivileged socket to per interface daemon, only allows state retrieval. 8690a68f8d2SRoy Marples.El 8700a68f8d2SRoy Marples.Sh SEE ALSO 8710a68f8d2SRoy Marples.Xr fnmatch 3 , 8720a68f8d2SRoy Marples.Xr if_nametoindex 3 , 8730a68f8d2SRoy Marples.Xr dhcpcd.conf 5 , 8740a68f8d2SRoy Marples.Xr resolv.conf 5 , 8750a68f8d2SRoy Marples.Xr dhcpcd-run-hooks 8 , 8760a68f8d2SRoy Marples.Xr resolvconf 8 8770a68f8d2SRoy Marples.Sh STANDARDS 8780a68f8d2SRoy MarplesRFC\ 951, RFC\ 1534, RFC\ 2104, RFC\ 2131, RFC\ 2132, RFC\ 2563, RFC\ 2855, 8790a68f8d2SRoy MarplesRFC\ 3004, RFC\ 3118, RFC\ 3203, RFC\ 3315, RFC\ 3361, RFC\ 3633, RFC\ 3396, 8800a68f8d2SRoy MarplesRFC\ 3397, RFC\ 3442, RFC\ 3495, RFC\ 3925, RFC\ 3927, RFC\ 4039, RFC\ 4075, 8810a68f8d2SRoy MarplesRFC\ 4242, RFC\ 4361, RFC\ 4390, RFC\ 4702, RFC\ 4074, RFC\ 4861, RFC\ 4833, 8820a68f8d2SRoy MarplesRFC\ 4941, RFC\ 5227, RFC\ 5942, RFC\ 5969, RFC\ 6106, RFC\ 6334, RFC\ 6355, 8830a68f8d2SRoy MarplesRFC\ 6603, RFC\ 6704, RFC\ 7217, RFC\ 7550, RFC\ 7844. 8840a68f8d2SRoy Marples.Sh AUTHORS 8850a68f8d2SRoy Marples.An Roy Marples Aq Mt roy@marples.name 8860a68f8d2SRoy Marples.Sh BUGS 8870a68f8d2SRoy MarplesPlease report them to 88880aa9461SRoy Marples.Lk https://roy.marples.name/projects/dhcpcd 889