DHCPcd

client

linux

dhcpcd [-146ABbDdEGgHJKLMNPpqTV] [-C| --nohook hook] [-c| --script script] [-e| --env value]
[-F| --fqdn FQDN] [-f| --config file] [-h| --hostname hostname] [-I| --clientid clientid]
[-j| --logfile logfile] [-l| --leasetime seconds] [-m| --metric metric]
[-O| --nooption option] [-o| --option option] [-Q| --require option] [-r| --request address] [-S| --static value]
[-s| --inform address [/cidr]] [--inform6] [-t| --timeout seconds] [-u| --userclass class]
[-v| --vendor code, value] [-i| --vendorclassid vendorclassid]
[-W| --whitelist address [-X| --blacklist address [/cidr]] [-w] [--waitip [4 | 6]]
[-y| --reboot seconds] [/cidr]] [-Z| --denyinterfaces pattern] [-z| --allowinterfaces pattern]
[--inactive]
                                                                                interface [interface] []

dhcpcd -n --rebind interface
dhcpcd -k --release interface
dhcpcd -U --dumplease interface
dhcpcd -x --exit
dhcpcd --version

 dhcpcd 8.1.2 Raspberry pi buster 2/3/20
Compiled in features: INET IPv4LL INET6 DHCPv6 AUTH
was:on raspberry pi 4/18/19
dhcpcd 6.11.5   
Copyright (c) 2006-2016 Roy Marples 

May be invoked by /etc/systemd/system/dhcpcd.service.d/wait.conf : /usr/lib/dhcpcd5/dhcpcd -q -w

Gets the host information (IP address, routes, etc) from a DHCP server and configures the network interfaces.
Runs configuration script which writes DNS information to resolvconf(8), or /etc/resolv.conf.
If the hostname is currently blank, (null) or localhost or force_hostnam is TRUE, sets the hostname to the one supplied by the DHCP server.

Then waits for the lease renewal time, renews its lease and reconfigures, ….

Some options send a signal a DHCPcd process already running.

If an interface reports carrier obtains a lease then forks.

Local Link configuration

If fails to obtain a lease, probes for a valid IPv4LL address (aka ZeroConf, aka APIPA). then looks for a DHCP server to get a proper address.
When using IPv4LL, failure means there is a reverse ARP proxy installed which defeats IPv4LL probing.
To disable this behaviour, use -L, --noipv4ll
  • Multiple interfaces
    As a daemon, i.e. Master mode, runs without a list of interfaces and discovers interfaces that can be configured.

  • If a single interface is given only works for that interface and runs as a separate instance
    --waitip is enabled in this instance, affects the --release, --renew , --rebind and --exit where the same interface need to be specified .

Interfaces are preferred by carrier, DHCP lease/IPv4LL and then lowest metric. For systems that support route metrics, each route will be tagged with the metric, otherwise dhcpcd changes the routes to use the interface with the same route and the lowest metric. See options below for controlling which interfaces we allow and deny through the use of patterns.

Hooking into events

Runs /lib/dhcpcd/dhcpcd-run-hooks which invokes scripts
  • /etc/dhcpcd.enter-hook distributed empty
  • /lib/dhcpcd/dhcpcd-hooks/* and
  • /etc/dhcpcd.exit-hook distributed empty
in lexical order, or the script specified by --script .
The default installation supplies the scripts 01-test, 02-dump, 20-resolv.conf and 30-hostname.
Disable a script by using --nohook . See
dhcpcd-run-hooks(8)
dhcpcd ignores the exit code of the script.

Additional scripts in /usr/share/dhcpcd/hooks: 10-wpa_supplicant, 15-timezone and 29-lookup-hostname
need to be copied to /lib/dhcpcd/dhcpcd-hooks
For example, 10-wpa_supplicant ensures that wpa_supplicant is always running on a hot-plugged wireless interface.

Actions
-T
--test
On receipt of DHCP messages call /lib/dhcpcd/dhcpcd-run-hooks with the reason of TEST which outputs specific DHCP variables in the message. The interface and configuration files are not changed.
The rapid_commit option is not sent in TEST mode so that the server does not lease an address.
To test INFORM the interface needs to be configured with the desired address before starting dhcpcd.
-d
--debug
messages to the stderr and syslog.
-j
--logfile logfile
Writes logfile not syslog, truncated when opened and is reopened on SIGUSR2
-q
--quiet
only warnings and errors will be displayed. The messages are logged .
-f
--config file
Default:/etc/dhcpcd.conf processes the config file before command line options.
-c
--script script
script instead of /lib/dhcpcd/dhcpcd-run-hooks which runs everything in
/etc/dhcpcd.enter-hook /lib/dhcpcd/dhcpcd-hooks and /etc/dhcpcd.exit-hook
-C
--nohook script
Don't run this hook script. Matches full name, or prefixed with 2 numbers optionally ending with .sh

To changing DNS settings : dhcpcd -C resolv.conf eth0

-g
--reconfigure
re-apply IP address, routing and run dhcpcd-run-hooks(8) for each interface. useful so a 3rd party such as PPP or VPN can change the routing table and / or DNS, etc and then instruct dhcpcd to put things back afterwards.
does not read a new configuration
-n
--rebind [interface]
reload configuration and rebind the specified interface.
If no interface is specified applies to all interfaces in Master mode.
If dhcpcd is not running, it starts up as normal.
May also cause wpa_supplicant(8) to reload its configuration for each interface as well if the relevant hook script has been installed.
-N
--renew [interface
renew existing addresses
If no interface is specified applies to all in Master mode.
If dhcpcd is not running, it starts up as normal.
Unlike --rebind the configuration is not reloaded.
-k
--release [interface
release lease and de-configure the interface regardless of --persistent.
If no interface is specified then applies to all in Master mode.
If no interfaces are left running, dhcpcd exits.
-y
--reboot seconds
before moving to the discover phase if there is an old lease to use.
before starting fallback states from the discover phase.
IPv4LL is started when the first reboot timeout is reached.
Default 5 seconds.
skips the reboot phase and go into discover. This on DHCPv6 only than skips the reboot phase.
-b
--background

Background immediately, for startup scripts which don't disable link messages for carrier status.

-B
--nobackground
-w Wait for an address to be assigned before forking to the background.
--waitip [4 | 6] Wait for an address to be assigned before forking to the background. 4 IPv4, 6 IPv6 address to be assigned.
It is possible to wait for more than one address protocol and dhcpcd will only fork to the background when all waiting conditions are satisfied.
-e
--env value
Add value to the environment for use in dhcpcd-run-hooks(8).
Example: force the hostname hook to always set the hostname -e force_hostname=YES.
-M
--master
Start Master mode even if only one interface specified on the command line. See Multiple Interfaces .
-D
--duid
Generate an RFC 4361 compliant clientid, and stores it in /etc/dhcpcd.duid
-p
--persistent
Don't de-configuring the interface and configuration on exit
-t
--timeout seconds
Default 30. (Don't use 0 i.e. wait forever)
If is working on a single interface then exits, otherwise forks to the background.
-U
--dumplease interface
Dumps the last lease for the interface to stdout. If omitted, standard input is used to read a DHCP wire formatted message. Use the -4 or -6 flags to specify an address family.
-P
--printpidfile
output the pidfile
--version and exits
-x
--exit [interface
signal dhcpcd running on interface to exit.
If no interface is specified, then the above is applied to all interfaces in Master mode.
See --persistent to control configuration persistence on exit, enabled by default in dhcpcd.conf(5).
Waits until this process has exited.
-V
--variables
Display a list of option codes, the associated variable and encoding for use in dhcpcd-run-hooks(8).
Variables are pre-fixed with new_ and old_ unless the option number is -.
Variables without an option are part of the DHCP message and cannot be directly requested.
> sudo dhcpcd --test --debug -V
Interface options:
 -  interface
 -  reason
 -  pid
 -  ifcarrier
 -  ifmetric
 -  ifwireless
 -  ifflags
 -  ssid
 -  profile
 -  interface_order 
DHCPv4 options:
    ip_address
    subnet_cidr
    network_number
    filename
    server_name
  1 subnet_mask                  IP addr request
121 classless_static_routes      string rfc3442
249 ms_classless_static_routes   string rfc3442
 33 static_routes                IP addrs request
  3 routers                      IP addrs request
  2 time_offset                  uint32
  4 time_servers                 IP addrs
  5 ien116_name_servers          IP addrs
  6 domain_name_servers          IP addrs
  7 log_servers                  IP addrs
  8 cookie_servers               IP addrs
  9 lpr_servers                  IP addrs
 10 impress_servers              IP addrs
 11 resource_location_servers    IP addrs

 12 host_name                    dname

 13 boot_size                    uint16
 14 merit_dump                   string

 15 domain_name                  array dname

 16 swap_server                  ipaddress

 17 root_path                    string
 18 extensions_path              string
 19 ip_forwarding                uint8
 20 non_local_source_routing     uint8
 21 policy_filter                IP addrs
 22 max_dgram_reassembly         uint16
 23 default_ip_ttl               uint8
 24 path_mtu_aging_timeout       uint32
 25 path_mtu_plateau_table       array uint16
 26 interface_mtu                uint16
 27 all_subnets_local            uint8
 28 broadcast_address            IPaddr request
 29 perform_mask_discovery       uint8
 30 mask_supplier                uint8
 31 router_discovery             uint8
 32 router_solicitation_address  IP addr
 34 trailer_encapsulation        uint8
 35 arp_cache_timeout            uint32
 36 ieee802_3_encapsulation      uint16
 37 default_tcp_ttl              uint8
 38 tcp_keepalive_interval       uint32
 39 tcp_keepalive_garbage        uint8
 40 nis_domain                   string
 41 nis_servers                  IP addrs
 42 ntp_servers                  IP addrs
 43 vendor_encapsulated_options  binhex
 44 netbios_name_servers         IP addrs
 45 netbios_dd_server            ipaddress
 46 netbios_node_type            uint8
 47 netbios_scope                string
 48 font_servers                 IP addrs
 49 x_display_manager            IP addrs
 50 dhcp_requested_address       ipaddress
 51 dhcp_lease_time              uint32 request
 52 dhcp_option_overload         uint8
 53 dhcp_message_type            uint8
 54 dhcp_server_identifier       ipaddress
 55 dhcp_parameter_request_list  array uint8
 56 dhcp_message                 string
 57 dhcp_max_message_size        uint16
 58 dhcp_renewal_time            uint32 request
 59 dhcp_rebinding_time          uint32 request

 60 vendor_class_identifier      string
 61 dhcp_client_identifier       binhex
 64 nisplus_domain               string
 65 nisplus_servers              IP addrs

 66 tftp_server_name             dname
 67 bootfile_name                string

 68 mobile_ip_home_agent         IP addrs

 69 smtp_server                  IP addrs
 70 pop_server                  IP addrs
 71 nntp_server                 IP addrs
 72 www_server                  IP addrs
 73 finger_server               IP addrs
 74 irc_server                  IP addrs
 75 streettalk_server           IP addrs
 76 streettalk_directory_assistance_serverarray 
                                ipaddress
 77 user_class                  binhex
 78 slp_agent                   embed
 79 slp_service                 embed
 80 rapid_commit                flag norequest
 81 fqdn                        embed
 83 isns                        embed
 85 nds_servers                 IP addrs
 86 nds_tree_name               raw
 87 nds_context                 raw
 88 bcms_controller_names       array domain
 89 bcms_controller_address     IP addrs
 90 auth                         embed
 91 client_last_transaction_time uint32
 92 associated_ip                IP addrs
 98 uap_servers                  string
 99 geoconf_civic                encap
100 posix_timezone               string
101 tzdb_timezone                string
116 auto_configure               uint8
117 name_service_search          array uint16
118 subnet_selection             ipaddress
119 domain_search                array domain
120 sip_server                   string rfc3361
122 tsp                          encap
123 geoconf                      binhex
124 vivco                        binhex
125 vivso                        embed
136 pana_agent                   IP addrs
137 lost_server                  domain
138 capwap_ac                    IP addrs
139 mos_ip                   encap
140 mos_domain               encap
141 sip_ua_cs_list           array domain
142 andsf                    IP addrs
143 andsf6                   array IP6addr
144 geoloc                   binhex
145 forcerenew_nonce_capable array uint8
146 rdnss_selection          embed
150 tftp_servers             IP addrs
208 pxelinux_magic           binhex
209 config_file              string
210 path_prefix              string
211 reboot_time              uint32
212 sixrd                    embed
213 access_domain            domain
221 vss                      encap
252 wpad_url                 string

ND options:
  1 source_address               binhex
  2 target_address               binhex
  3 prefix_information           embed index
  5 mtu                          embed
 25 rdnss                        embed index
 31 dnssl                        embed index

 DHCPv6 options:

 1 client_id             binhex
 2 server_id             binhex
 3 ia_na                 embed index norequest
 4 ia_ta                 embed index norequest
 5 ia_addr               embed index norequest
 6 option_request        array uint16
 7 preference            uint8
 8 elased_time           uint16
 9 dhcp_relay_msg        binhex
11 auth                  embed
12 unicast               ip6address
13 status_code           embed norequest
14 rapid_commit          flag norequest
15 user_class            binhex
16 vivco                 binhex
17 vivso                 embed
18 interface_id          binhex
19 reconfigure_msg       uint8
20 reconfigure_accept    flag
21 sip_servers_names     array domain
22 sip_servers_addresses array ip6address
23 name_servers          array ip6address
24 domain_search         array domain
25 ia_pd                 embed index norequest
26 prefix                embed index

27 nis_servers        array ip6address
28 nisp_servers       array ip6address
29 nis_domain_name    string
30 nisp_domain_name   string
31 sntp_servers       array ip6address
32 info_refresh_time  uint32
33 bcms_server_d      array domain
34 bcms_server_a      array ip6address
36 geoconf_civic      encap
37 remote_id          embed
38 subscriber_id      binhex
39 fqdn               embed
40 pana_agent         array ip6address
41 posix_timezone     string
42 tzdb_timezone      string
43 ero                array uint16
49 mip6_hnidf         domain
50 mip6_vdinf         encap
51 lost_server        domain
52 capwap_ac          array ip6address
53 relay_id           binhex
54 mos_ip             encap
55 mos_domain         encap
56 ntp_server         encap
57 access_domain      domain
58 sip_ua_cs_list     array domain

59 bootfile_url       string
60 bootfile_param     binhex
61 architecture_types array uint16
62 nii                embed
63 geoloc             binhex
64 aftr_name          domain
67 pd_exclude         embed
69 mip6_idinf         encap
70 mip6_udinf         encap
71 mip6_hnp           embed
72 mip6_haa           ip6address
73 mip6_haf           domain
74 rdnss_selection    embed
75 krb_principal_name string
76 krb_realm_name     string
78 krb_kdc            embed
80 link_address       ip6address
82 sol_max_rt         uint32 request
83 inf_max_rt         uint32 request

Restricting behaviour
-1
--oneshot
Exit after its configuring an interface.
itsiUse the --waitip to specify which protocol(s) to configure before exiting.
-4
--ipv4only
-6
--ipv6only
-A
--noarp
Don't request or claim the address by ARP. disables IPv4LL.
-K
--nolink
Don't receive link messages for carrier status.
-L
--noipv4ll
Don't use IPv4LL (aka APIPA, aka Bonjour, aka ZeroConf).
-l
--leasetime seconds
Request a specific lease time in seconds. By default leaves leasing to the DHCP server.
-E
--lastlease
If dhcpcd cannot obtain a lease, then try to use the last lease acquired for the interface.
--lastleaseextend lease will be retained after it expires. dhcpcd will give it up if any other host tries to claim it for their own via ARP. violates RFC2131 7 which states the lease should be dropped once expired.
-r
--request [address]
Request the address in the DHCP DISCOVER message. There is no guarantee the DHCP server will give it.
If no address is given then the first address currently assigned to the interface is used.
-s
--inform [address[/cidr]]
like --request but sends a DHCP INFORM instead of DISCOVER/REQUEST.
This does not get a lease, just notifies the DHCP server of the address in use.
include the optional cidr network number in case the address is not already configured on the interface.
dhcpcd remains running and as if it has an infinite lease.
Will not de-configure the interface when it exits.
If dhcpcd fails to contact a DHCP server then returns a failure instead of falling back on IPv4LL.
--inform6 Performs a DHCPv6 Information Request. No address is requested or specified, but all other DHCPv6 options are allowed. This is normally performed automatically when the IPv6 Router Advertises that the client should perform this operation. Only needed when not processing IPv6RA messages
-F
--fqdn disable|none| ptr|both
DHCP server updates DNS using FQDN instead of just a hostname. dhcpcd does no DNS updates. dhcpcd encodes the FQDN hostname as specified in RFC1035.
-h
--hostname [hostname]
Send hostname to the DHCP server to be registered in DNS. Default system hostname .
-I
--clientid [clientid]
Send the clientid. Use xx:xx:xx for hexadecimal.
If hardware address is longer than 8 bytes or clientid is an not specified sends hardware family and the hardware address.
-i
--vendorclassid vendorclassid
Override the DHCPv4 vendorclassid field sent. Default: dhcpcd-version:os:machine:platform. For example dhcpcd-5.5.6:NetBSD-6.99.5:i386:i386
-S
--static value
Does not obtain a lease and with an infinite lease time.
Example :
                   dhcpcd -S ip_address=192.168.0.10/24 \
                          -S routers=192.168.0.1 \
                          -S domain_name_servers=192.168.0.1 \
                            eth0
Cannot set static DHCPv6 values. Use --env
-u
--userclass class
Tags the DHCPv4 message.
DHCP servers use this to give members of the class DHCP options other than the default, without having to know hardware address or hostname.
-v
--vendor code[,value
Add an encapsulated vendor option. code is 1..254 .
To add a raw vendor string, omit code but keep the comma.
Examples.
             IP address: dhcpcd -v 01,192.168.0.2 eth0
             hex code:  dhcpcd -v 02,01:02:03:04:05 eth0
             IP address as a string:  dhcpcd -v 03,\"192.168.0.2\" eth0
             un-encapsulated vendor option :  dhcpcd -v ,"hello world" eth0

-o
--option option
Request option variable for use in /lib/dhcpcd/dhcpcd-run-hooks.
-m
--metric metric
Metrics used to prefer an interface over another one, lowest wins.
Default 200 + if_nametoindex(3). 100 will be added for wireless interfaces.
-G
--nogateway
Don't any default routes.
-H
--xidhwaddr
Use the last four bytes of the hardware address as xid instead of a random number.
-J
--broadcast
Instructs the DHCP server to broadcast replies back to the client.
-O
--nooption option
Removes option from the DHCP message before processing.
-Q
--require option
Requires the option to be present in all DHCP messages, otherwise the message is ignored.
To enforce that dhcpcd only responds to DHCP servers and not BOOTP servers, --require dhcp_message_type.
-W
--whitelist address[/cidr]
Only accept packets from address[/cidr]
--blacklist
is ignored if --whitelist is set.
-X
--blacklist address[/cidr]
Ignore all packets from address[/cidr].
-Z
--denyinterfaces pattern […]
When discovering interfaces, the interface name must not match pattern which is a space or comma separated list of patterns
-z
--allowinterfaces pattern
When discovering interfaces, the interface name must match pattern --denyinterfaces takes precedence!
--inactive Don't start any interfaces other than those specified on the command line. This allows dhcpcd to be started in Master mode and then wait for subsequent dhcpcd commands to start each interface as required.
--nodev Don't load any /dev management modules.
3RDPARTY LINK MANAGEMENT Some interfaces require configuration by 3rd parties, such as PPP or VPN. When an interface configuration in dhcpcd is marked as STATIC or INFORM without an address then dhcpcd will monitor the interface until an address is added or removed from it and act accordingly. For point to point interfaces (like PPP), a default route to its destination is automatically added to the configura- tion. If the point to point interface is configured for INFORM, then dhcpcd unicasts INFORM to the destination, otherwise it defaults to STATIC.

If restricting dhcpcd to a single interface and optionally address family via the command-line then all further calls to dhcpcd to rebind, reconfigure or exit need to include the same restrictive flags so that dhcpcd knows which process to signal.

Log as result of sudo ifconfig wlan0 down; sudo ifconfig wlan0 up

12:55:16 daemon.info systemd[1]: Starting dhcpcd on all interfaces...
12:55:17 daemon.err dhcpcd[279]: no valid interfaces found
12:55:17 daemon.info dhcpcd[279]: forked to background, child pid 289
12:55:17 daemon.info systemd[1]: Started dhcpcd on all interfaces.

12:55:20 daemon.info dhcpcd-run-hooks[378]: wlan0: starting wpa_supplicant

12:55:24 daemon.info dhcpcd[289]: wlan0: waiting for carrier
12:55:25 daemon.info dhcpcd[289]:                                              eth0: waiting for carrier

12:55:25 daemon.info dhcpcd[289]: wlan0: carrier acquired
12:55:25 daemon.info dhcpcd[289]: DUID 00:01:00:01:21:b0:de:59:b8:27:eb:0f:cf:06
12:55:25 daemon.info dhcpcd[289]: wlan0: IAID eb:1c:5b:93
12:55:25 daemon.info dhcpcd[289]: wlan0: adding address fe80::2360:c560:acef:fd7e
12:55:25 daemon.info dhcpcd[289]: wlan0: carrier lost
12:55:25 daemon.info dhcpcd[289]: wlan0: deleting address fe80::2360:c560:acef:fd7e

12:55:25 daemon.info dhcpcd[289]:                                              eth0: carrier acquired
12:55:25 daemon.info dhcpcd[289]:                                              eth0: IAID 4c:53:44:58
12:55:25 daemon.info dhcpcd[289]:                                              eth0: adding address fe80::dbd3:57ef:a88c:c782

12:55:25 daemon.info dhcpcd[289]: wlan0: carrier acquired
12:55:25 daemon.info dhcpcd[289]: wlan0: IAID eb:1c:5b:93
12:55:25 daemon.info dhcpcd[289]: wlan0: adding address fe80::314c:5853:cd9c:11c3
12:55:25 daemon.info dhcpcd[289]: wlan0: soliciting a DHCP lease

12:55:26 daemon.info dhcpcd[289]:                                              eth0: soliciting an IPv6 router
12:55:26 daemon.info dhcpcd[289]:                                              eth0: rebinding lease of 192.168.1.10
12:55:26 daemon.info dhcpcd[289]:                                              eth0: probing address 192.168.1.10/24

12:55:26 daemon.info dhcpcd[289]: wlan0: soliciting an IPv6 router
12:55:26 daemon.info dhcpcd[289]: wlan0: offered 192.168.1.3 from 192.168.1.1
12:55:26 daemon.info dhcpcd[289]: wlan0: probing address 192.168.1.3/24

12:55:31 daemon.info dhcpcd[289]: wlan0: leased 192.168.1.3 for 600 seconds
12:55:31 daemon.info dhcpcd[289]: wlan0: adding route to 192.168.1.0/24
12:55:31 daemon.info dhcpcd[289]: wlan0: adding default route via 192.168.1.1

12:55:32 daemon.info dhcpcd[289]:                                              eth0: leased 192.168.1.10 for 600 seconds
12:55:32 daemon.info dhcpcd[289]:                                              eth0: adding route to 192.168.1.0/24
12:55:32 daemon.info dhcpcd[289]:                                              eth0: adding default route via 192.168.1.1

12:55:38 daemon.warning dhcpcd[289]:                                           eth0: no IPv6 Routers available
12:55:38 daemon.warning dhcpcd[289]: wlan0: no IPv6 Routers available

FILES

     /etc/dhcpcd.conf 
     /etc/dhcpcd.duid               DUID used to identify the host.  
     /etc/dhcpcd.secret             secret key known only to the host.  
     /lib/dhcpcd/dhcpcd-run-hooks   Bourne shell script that is run to configure or de-configure an interface.  
     /lib/arm-linux-gnueabihf/dhcpcd/dev management modules.  
     /lib/dhcpcd/dhcpcd-hooks 

     /var/lib/dhcpcd5/dhcpcd-interface-ssid.lease actual DHCP message sent by the server.
          used when reading the last lease and use the files mtime as when it was issued.  
     /var/lib/dhcpcd5/dhcpcd-interface-ssid.lease6 

     /var/lib/dhcpcd5/dhcpcd-rdm.monotonic counter used in the replay field in Authentication Options.  
     /var/run/dhcpcd.pid            PID of dhcpcd running on all interfaces.  
     /var/run/dhcpcd-interface.pid  PID of dhcpcd running on the interface.

     /var/run/dhcpcd.sock            Control socket to the master daemon.

     /var/run/dhcpcd.unpriv.sock     Unpriviledged socket to the master daemon, only for state retrieval.  
     /var/run/dhcpcd-interface.sock Control socket to per interface daemon.

     dhcpcd is also an implementation of 
     BOOTP client specified in RFC 951.  
     IPv6 Router Solicitor as specified in RFC 4861 and RFC 6106.  
     IPv6 Privacy Extensions to AutoConf as specified in RFC 4941.  needs to be enabled in the kernel 
     DHCPv6 client as specified in RFC 3315.  
            By default, dhcpcd only starts DHCPv6 when instructed by an IPV6 Router Advertisement. 
         If no Identity Association is configured, then a Non-temporary Address is requested.

See

fnmatch(3), if_nametoindex(3), dhcpcd.conf(5), resolv.conf(5), dhcpcd-run-hooks(8), resolvconf(8)

/etc/syslog.conf : local0.* /var/log/dhcpcd.log
and refresh syslogd daemon: kill -1 `cat /var/run/syslogd.pid`


dhcpd [-knrCRSY] [-c ExecFilePath] [-s[ipaddr]] [-G[gateway]] [-w windowsize] [-LConfigDir] interface

-k Sends SIGHUP signal to the dhcpcd process that is currently running which sends DCHP_RELEASE the server and destroy dhcpcd cache.

SIGTERM normally used by shutdown(8) will not send DHCP_RELEASE and will not destroy cache. When system boots will use cache to request the same IP address from server

-n Sends SIGALRM renew the lease. If dhcpcd is not running the flag is ignored and follows the normal startup procedure.
-r Makes dhcpcd RFC1541 (obsolete) compliant. is RFC2131 compliant unless this option is specified.
-B Requests broadcast response from DHCP server.
-C calculate checksum on received packets.
-D set domainname as supplied by DHCP server. By default will NOT set domainname
-H set hostname of the host to the hostname option supplied by DHCP server. By default will NOT set hostname
-L ConfigDir ConfigDir instead of default /etc/dhcpc
-R Don't replace /etc/resolv.conf
-Y Don't replace /etc/yp.conf . Domainname is not updated unless -D is specified.
-N Don't replace existing /etc/ntp.conf
-S send second DHCP_DISCOVER message even after receiving DHCP_OFFER on the first one.
-T Test case, goes through the DHCP negotiation sequence but doesn't configure the interface.
writes the ConfigDir/dhcpcd-interface.info and ConfigDir/dhcpcd-interface.cache files and it attempt to execute ConfigDir/dhcpcd.exe script.
The pathname of dhcpcd.exe executable script can be changed with -c ExecFilePathgt; .
-t timeout seconds for how long will try to get an IP address. default 60 seconds. will not fork into background until it gets a valid IP address in which case returns 0
In a case times out before receiving a valid IP address from DHCP server return exit code 1
-c <ExecFilePath> executes ExecFilePath instead of default ConfigDir/dhcpcd.exe to configure or brings down the interface.
-hhostname string used for the hostname option field when dhcpcd sends DHCP messages. Some DHCP servers, notably those used by @Home Networks, require the hostname option field containing a specific string
-i vendorClassID vendor class identifier string.
-I ClientID client identifier string. Default MAC address
-l leasetime seconds the recommended lease time to the server. (server can override this value ). used in the DHCP_DISCOVER message. The default is infinite (0xFFFFFFFF).
-G [gateway] Prevents installing default routes provided by DHCP server. If optional gateway ip address parameter is supplied then use it for default route.
-s [ipaddr] Sends DHCP_INFORM message to DHCP server using ipaddr. The optional ipaddr parameter must be in the form xxx.xxx.xxx.xxx. If no ipaddr parameter is given on the command line uses the IP address currently assigned to the interface. If there is no IP address currently assigned uses previously obtained IP address stored in ConfigDir/dhcpcd-interface.cache
-w <windowsize> Specifies window size for the gateway route. Default=32768.
interface network interface name Default eth0

FILES

/etc/dhcpc Default ConfigDir directory used for storing files See option -L ConfigDir above.
ConfigDir/dhcpcd-interface.info the host information. The interface is replaced with the network interface name like eth0 to which dhcpcd is attached.
ConfigDir/dhcpcd.exe execute whenever it configures or brings down the interface.
The path with -c ExecFilePath .
3 parameters are passed to dhcpcd.exe script:
dhcpcd.exe HostInfoFilePath up|down|new [-d]
The first parameter HostInfoFilePath is path to dhcpcd-interface.info , interface is replaced with interface name dhcpcd is attached to, for example eth0.
The second parameter values >up|down|new means the interface has been brought up with the same address, with a new IP address or brought down ("down").
Parameter -d is passed if started with -d debug
ConfigDir/dhcpcd-interface.cache contains the previously assigned IP address and some other things. interface is replaced with the network interface name like eth0 to which dhcpcd is attached.
/etc/resolv.conf created when the client receives DNS and domain name options. The old file is renamed to /etc/resolv.conf.sv and restored when dhcpcd exits for any reason.
/etc/yp.conf created when the client receives NIS options. The old file is renamed to /etc/yp.conf.sv and restored when dhcpcd exits for any reason.
/etc/ntp.conf created when the client receives NTP options. The old file is renamed to /etc/ntp.conf.sv and restored when dhcpcd exits for any reason.
ConfigDir/dhcpcd-interface.pid containing the process id The interface is replaced with the network interface name like eth0 to which dhcpcd is attached.

See

Dynamic Host Configuration Protocol, RFC2131 and RFC1541 (obsolete)
DHCP Options and BOOTP Vendor Extensions, RFC2132


Examples

sudo dhcpcd -d 
sending commands to master dhcpcd process
send OK

01-test 
# Echo the interface flags, reason and message options

if [ "$reason" = "TEST" ]; then
    set | grep "^\(interface\|pid\|reason\|profile\|skip_hooks\)=" | sort
    set | grep "^if\(carrier\|flags\|mtu\|wireless\|ssid\)=" | sort
    set | grep "^\(new_\|old_\|nd[0-9]*_\)" | sort
    exit 0
fi

reformatted
sudo dhcpcd --test --debug
dhcpcd-6.11.5 starting
wlan0: IPv6 kernel autoconf disabled
DUID 00:01:00:01:21:b0:de:59:b8:27:eb:0f:cf:06
wlan0: IAID eb:1c:5b:93
wlan0: delaying IPv6 router solicitation for 1.0 seconds         wlan0: delaying IPv4 for 0.5 seconds
wlan0: using ClientID 01:b8:27:eb:1c:5b:93
wlan0: reading lease `/var/lib/dhcpcd5/dhcpcd-wlan0-disabled.lease'
wlan0: rebinding lease of 192.168.1.3
wlan0: sending REQUEST (xid 0x14488837), next in 3.6 seconds
wlan0: acknowledged 192.168.1.3 from 192.168.1.1
wlan0: leased 192.168.1.3 for 3600 seconds

wlan0: executing `/lib/dhcpcd/dhcpcd-run-hooks' TEST
interface='wlan0'        pid='32063'         reason='TEST'       ifcarrier='up'      ifflags='4163'  ifmtu='1500'

ifssid='disabled'        ifwireless='1'

new_broadcast_address='192.168.1.255'            new_dhcp_lease_time='3600'
new_dhcp_message_type='5'                        new_dhcp_server_identifier='192.168.1.1'
new_domain_name='germans'                        new_domain_name_servers='192.168.1.1'           new_domain_search='germans'
new_ip_address='192.168.1.3'                     new_network_number='192.168.1.0'                new_routers='192.168.1.1'
new_subnet_cidr='24'                             new_subnet_mask='255.255.255.0'

old_broadcast_address='192.168.1.255'            old_dhcp_lease_time='3600'
old_dhcp_message_type='5'                        old_dhcp_server_identifier='192.168.1.1'
old_domain_name='germans'                        old_domain_name_servers='192.168.1.1'           old_domain_search='germans'
old_ip_address='192.168.1.3'                     old_network_number='192.168.1.0'                old_routers='192.168.1.1'
old_subnet_cidr='24'                             old_subnet_mask='255.255.255.0'
dhcpcd exited

sudo dhcpcd -T
DUID 00:01:00:01:24:9e:78:19:b8:27:eb:f0:ae:08
eth0: IAID eb:f0:ae:08
eth0: rebinding lease of 192.168.1.14
eth0: soliciting an IPv6 router
eth0: leased 192.168.1.14 for 3420 seconds

interface='eth0'
pid='9112'
protocol='dhcp'
reason='TEST'

ifcarrier='up'
ifflags='4163'
ifmtu='1500'
ifwireless='0'

new_broadcast_address='192.168.1.255'
new_dhcp_lease_time='3420'
new_dhcp_message_type='5'
new_dhcp_server_identifier='192.168.1.1'
new_domain_name='germans'
new_domain_name_servers='192.168.1.1'
new_domain_search='germans'
new_ip_address='192.168.1.14'
new_network_number='192.168.1.0'
new_routers='192.168.1.1'
new_subnet_cidr='24'
new_subnet_mask='255.255.255.0'
old_broadcast_address='192.168.1.255'
old_dhcp_lease_time='3420'
old_dhcp_message_type='5'
old_dhcp_server_identifier='192.168.1.1'
old_domain_name='germans'
old_domain_name_servers='192.168.1.1'
old_domain_search='germans'
old_ip_address='192.168.1.14'
old_network_number='192.168.1.0'
old_routers='192.168.1.1'
old_subnet_cidr='24'
old_subnet_mask='255.255.255.0'


/etc

dhcpcd.duid
rc5.d/S01dhcpcd
rc2.d/S01dhcpcd
rc4.d/S01dhcpcd
rc1.d/K01dhcpcd
systemd/system/multi-user.target.wants/dhcpcd.service
systemd/system/dhcpcd5.service
init.d/dhcpcd
dhcp
dhcpcd.conf
rc0.d/K01dhcpcd
dhcpcd.secret
rc3.d/S01dhcpcd
rc6.d/K01dhcpcd
alternatives/dhcpcd.8.gz
alternatives/dhcpcd


dhcpcd.conf

dhcpcd configuration file

Although dhcpcd can do everything from the command line, there are cases where it's just easier to do it once in a configuration file. Most of the options found in dhcpcd(8) can be used here.
The first word on the line is the option and the rest of the line is the value.
Leading and trailing whitespace for the option and value are trimmed.
Escape characters in the value using the \ character.
Comments can be prefixed with the # character.
String values should be quoted with the " character.
debug Echo debug messages to the stderr and syslog.
background Background immediately. for startup scripts which don't disable link messages for carrier status.
logfile logfile Writes to logfile rather than syslog(3). The logfile is truncated when opened and is reopened when receives SIGUSR2
controlgroup group Sets the group ownership of /var/run/dhcpcd.sock so that users other than root can connect to dhcpcd.
bootp Be a BOOTP client. don't send a DHCP Message Type option and only interact with a BOOTP server. Other options still available.
persistent Supresses the de-configuring when exitng.
Helpful if root is mounted over NFS or SSH clients connect to this host and they need to be notified of the host shutting down.
allowinterfaces pattern When discovering interfaces, the name must match pattern (a space or comma separated list of patterns passed to fnmatch(3).
If the same interface is matched in denyinterfaces then it is still denied.
denyinterfaces pattern When discovering interfaces, the name must not match
broadcast Instructs the DHCP server to broadcast replies back to the client. Normally only set for non Ethernet interfaces, such as FireWire and InfiniBand. In most cases, dhcpcd will set this automatically.
nodhcp Don't start DHCP or listen to DHCP messages. useful when allowing IPv4LL.
nodhcp6 Don't start DHCPv6 or listen to DHCPv6 messages. Normally DHCPv6 is started by a RA instruction or configuration.
ipv4only Only configure IPv4.
ipv6only Only confgiure IPv6.
blacklist address[/cidr] Ignores all packets from address[/cidr].
whitelist address[/cidr] Only accept packets from address[/cidr]. blacklist is ignored if whitelist is set.
interface interface Subsequent options are only parsed for this interface.
dhcp Enable DHCP on the interface, on by default.
dhcp6 Enable DHCPv6 on the interface, on by default.
noipv4 Enable IPv4 on the interface, on by default.
noipv6 Enable IPv6 on the interface, on by default.
arping address [address] dhcpcd will arping each address in order before DHCP.
If an address is found, the replying hardware address as the profile, otherwise the ip address. Example:
 
                   interface bge0
                   arping 192.168.0.1

                   # My specific 192.168.0.1 network
                   profile dd:ee:aa:dd:bb:ee
                   static ip_address=192.168.0.10/24

                   # A generic 192.168.0.1 network
                   profile 192.168.0.1
                   static ip_address=192.168.0.98/24 
noarp Don't send any ARP requests. This also disables IPv4LL.
leasetime seconds
metric metric default metric is 200 + if_nametoindex(3) + (100 for wireless interfaces).
Metrics are used to prefer an interface over another one, lowest wins.
authprotocol protocol algorithm rdm Authenticate DHCP messages. See the Supported Authentication Protocols section.
authtoken secretid realm expire key Define a shared key for use in authentication.
realm can be to for use with the delayed prptocol.
expire date the token expires formatted "yyy-mm-dd HH:MM" or forever
For the token protocol, secretid must be 0 and realm "".
Error: dhcp_auth_encode: Invalid argument means the correct authentication token was not found in the configuration.
dev value Load the value /dev management module. dhcpcd will load the first one found to work, if any.
env value Push value to the environment for use in dhcpcd-run-hooks(8).
For example set which driver wpa_supplicant(8) should use with env wpa_supplicant_driver=nl80211

To force the hostname hook to set the hostname use env force_hostname=YES,
If the hostname is set, it will be will set to the FQDN .
If the FQDN option is missing, dhcpcd will set a FQDN from the hostname and domain options for consistency. To override this set env hostname_fqdn=[YES|NO|SERVER].
A value of server means what the server provides. This could lead to an inconsistent hostname on a DHCPv4 and DHCPv6 network where the DHCPv4 hostname is short and the DHCPv6 has an FQDN. DHCPv6 has no hostname option.

clientid string Send the clientid. If the string is of the format 01:02:03 then it is encoded as hex.
For interfaces whose hardware address is longer than 8 bytes, or if the clientid is an empty string then send a default clientid of the hardware family and the hardware address.
duid Generate an RFC 4361. compliant DHCP Unique Identifier.
If persistent storage is available then a DUID-LLT (link local address + time) is generated, otherwise DUID-LL is generated (link local address). This, plus the IAID will be used as the clientid. The DUID-LLT generated will be held in /etc/dhcpcd.duid and should not be copied to other hosts.
iaid iaid Set the Interface Association Identifier. Must be used in an interface block. defaults to the last 4 bytes of the hardware address assigned to the interface.
Eachs instance of this should be unique within the scope of the client and dhcpcd warns if a conflict is detected. If there is a conflict, it is only a problem if the conflicted IAIDs are used on the same network.
request [address] Request the address in a DHCP DISCOVER message.
There is no guarantee the DHCP server will give it.
If no address is given then the first address currently assigned to the interface is used.
inform [address[/cidr]] Like request, but sends a DHCP INFORM instead of DISCOVER/REQUEST.
This does not get a lease rather notifies the DHCP server of the address in use. include the optional cidr network number in case the address is not already configured on the interface.
Performs as if it has an infinite lease and will not de-configure the interface when it exits.
If dhcpcd fails to contact a DHCP server then it returns a failure instead of falling back on IPv4LL.
inform6 Performs a DHCPv6 Information Request. No address is requested or specified, but all other DHCPv6 options are allowed. This is normally performed automatically when the IPv6 Router Advertises that the client should perform this operation. This option is only needed when dhcpcd is not processing IPv6RA messages and the need for DHCPv6 Information Request exists.
fallback profile Fallback to using this profile if DHCP fails. This allows you to configure a static profile instead of using Zero-Conf.
hostname name Sends the hostname so it can be registered in DNS.
If name is an empty, the system hostname is sent.
If name is a FQDN (ie, contains a .) then it will be encoded as such.
hostname_short Sends the short hostname to the DHCP server instead of the FQDN.
Useful because DHCP servers will not register the FQDN in their DNS if the domain part does not match theirs.

see env to control how the hostname is set on the host.

ia_na [iaid [/ address]] Request a DHCPv6 Normal Address for iaid. more than one ia_na by specifying a unique iaid for each one.
ia_ta [iaid] Request a DHCPv6 Temporary Address for iaid.
ia_pd [iaid [/ prefix / prefix_len] [interface [/ sla_id [/ prefix_len [/ suffix]]]]] Request a DHCPv6 Delegated Prefix for iaid. Must be used in an interface block.
Unless a sla_id of 0 is assigned with the same resultant prefix length as the delegation, a reject route is installed for the Delegated Prefix to stop unallocated addresses being resolved upstream.
If no interface is given then we will assign a prefix to every other interface with a sla_id equivalent to the interface index assigned by the OS.
Otherwise addresses are only assigned for each interface and sla_id. Each assigned address will have a suffix, defaulting to 1.
If the suffix is 0 then a slaac address is assigned.
You cannot assign a prefix to the requesting interface unless the DHCPv6 server supports RFC6603 Prefix Exclude Option.
dhcpcd has to be running for all the interfaces it is delegating to.
A default prefix_len of 64 is assumed, unless the maximum sla_id does not fit. In this case prefix_len is increased to the highest multiple of 8 that can accommodate the sla_id. sla_id is an integer which must be unique inside the iaid and is added to the prefix which must fit inside prefix_len less the length of the delegated prefix. You can specify multiple interface / sla_id / prefix_len per ia_pd, space separated.
IPv6RS should be disabled globally when requesting a Prefix Delegation.

In the following example eth0 is the externally facing interface to be configured for both IPv4 and IPv6. The DHCPv4 server will provide us with an IPv4 address and a default route. The DHCPv6 server is going to provide us with an IPv6 address, a default route and a /64 subnet to be delegated to the internal interface. The eth1 inter- face will be automatically configured for IPv6 using the first address (::1) from the delegated prefix. A second prefix is requested and assigned to two other interfaces. rtadvd(8) can be used with an empty configuration file on eth1, eth2 and eth3, to provide automatic IPv6 address configuration for the internal network.

             noipv6rs                 # disable routing solicitation
             denyinterfaces eth2      # Don't touch eth2 at all
             interface eth0
               ipv6rs                 # enable routing solicitation get the
                                      # default IPv6 route
               ia_na 1                # request an IPv6 address
               ia_pd 2 eth1/0         # request a PD and assign it to eth1
               ia_pd 3 eth2/1 eth3/2  # req a PD and assign it to eth2 and eth3


     
fqdn [disable | ptr | both] ptr reqeusts the DHCP server to update the PTR record of the host in DNS
both also updates the A record.
disable will disable the FQDN option.
The default is both.
ipv6ra_autoconf Generate SLAAC addresses for each Prefix advertised by a Router Advertisement message with the Auto flag set. On by default.
ipv6ra_noautoconf
ipv6ra_fork always fork to abckground on an RA.
By default, when dhcpcd receives an IPv6 RA, forks to the background if the RA contains at least one unexpired RDNSS option and a valid prefix or no DHCPv6 instruction.
ipv6ra_own Disables kernel IPv6 Router Advertisement processing so dhcpcd can manage addresses and routes.
ipv6ra_own_default Each time dhcpcd receives an IPv6 Router Adveristment, dhcpcd will manage the default route only. This allows dhcpcd to prefer an interface for outbound traffic based on metric and/or user selection rather than the kernel.
ipv6rs Enables IPv6 Router Advertisement solicitation. This is on by default, but is documented here in the case where it is disabled globally but needs to be enabled for one interface.
noalias IPv4 addresses will be removed from the interface when adding a new IPv4 address.
noauthrequired Don't require authentication even though we requested it. Also allows FORCERENEW and RECONFIGURE messages without authentication.
nodelay Don't delay for an initial randomised time when starting protocols.
nodev Don't load /dev management modules.
nogateway don't Install a default route (default).
nohook script Don't run this hook script. Matches full name, or prefixed with 2 numbers optionally ending with .sh. So to stop dhcpcd from modifying DNS settings or starting wpa_supplicant use nohook resolv.conf, wpa_supplicant
noipv4ll Don't to obtain an IPv4LL address if failed to get one via DHCP. See RFC 3927.
noipv6rs Disable solicitation and receipt of IPv6 Router Advertisements.
nolink Don't receive link messages about carrier status. You should only set this for buggy interface drivers.
noup Don't bring the interface up when in master mode. If dhcpcd.conf cannot determine the carrier state, dhcpcd.conf will enter a tight polling loop until the interface is marked up and running or a valid carrier state is reported.
option option[ Requests the option from the server. It can be a variable to be used in dhcpcd-run-hooks(8) or the numerical value.
You can specify more options separated by commas, spaces or more option lines.
option Prepend dhcp6_ to option to request a DHCPv6 option. If no DHCPv6 options are configured, then DHCPv4 options are mapped to equivalent DHCPv6 options.

Prepend nd_ to option to handle ND options, only for the nooption, reject and require options.

To list options use dhcpcd with the -V, --variables argument.

nooption option Remove the option from the message before it's processed.
require option Requires the option to be present in all messages, otherwise the message is ignored. To enforce that dhcpcd only responds to DHCP servers and not BOOTP servers, you can require dhcp_message_type. This isn't an exact science though because a BOOTP server can send DHCP like options.
reject option Reject a message that contains the option. This is useful when you cannot use require to select / de-select BOOTP messages.
destination option If dhcpcd.conf detects an address added to a point to point interface (PPP, TUN, etc) then it will set the listed DHCP options to the destination address of the interface.
profile name Subsequent options are only parsed for this profile name.
reboot seconds Allow reboot seconds before moving to the DISCOVER phase if we have an old lease to use and moving from DISCOVER to IPv4LL if no reply. The default is 5 seconds. A setting of 0 seconds causes dhcpcd to skip the REBOOT phase and go straight into DISCOVER. This is desirable for mobile users because if you change from network A to network B and they use the same subnet and the address from network A isn't in use on network B, then the DHCP server will remain silent even if authoritative which means dhcpcd will timeout before moving back to the DISCOVER phase.
release dhcpcd will release the lease prior to stopping the interface.
script script Use script instead of the default /lib/dhcpcd/dhcpcd-run-hooks.
ssid ssid Subsequent options are only parsed for this wireless ssid.
slaac [hwaddr | private] Selects the interface identifier used for SLAAC generated IPv6 addresses. If private is used, a RFC7217 address is generated.
static value Configures a static value. If you set ip_address then dhcpcd will not attempt to obtain a lease and just use the value for the address with an infinite lease time. If you set ip6_address, dhcpcd will continue auto-configuation as normal. example which configures two static address, an IPv4 router, DNS and disables IPv6 auto-configuration. Use inform6 to obtain more information via DHCPv6.
For IPv4 use the inform ipaddress option instead of setting a static address.
              interface eth0
                   noipv6rs
                   static ip_address=192.168.0.10/24
                   static ip6_address=fd51:42f8:caae:d92e::ff/64
                   static routers=192.168.0.1
                   static domain_name_servers=192.168.0.1 fd51:42f8:caae:d92e::1 
Example for PPP which gives the destination a default route. It uses destination to insert the destination address into the value.
 interface ppp0
                   static ip_address=
                   destination routers 
timeout seconds default 30. (don't use 0 which would causes dhcpcd to wait forever to get a lease.)
If working on a single interface exits when a timeout occurs, otherwise fork into the background. If using IPv4LL then dhcpcd start the IPv4LL process after the timeout and then wait a little longer before really timing out.
userclass string Tag the DHCPv4 messages with the userclass. can be specifed more than one.
vendor [code],value Add an encapsulated vendor option. code should be between 1 and 254 inclusive. To add a raw vendor string, omit code but keep the comma. Examples.

                   vendor 01,192.168.0.2            # Set the vendor option 01 with an IP address.
                   vendor 02,01:02:03:04:05         # Set the vendor option 02 with a hex code.
                   vendor 03,\"192.168.0.2\"        # Set the vendor option 03 with an IP address as a string.
                   vendor ,"hello world"            # Set un-encapsulated vendor option to hello world.

     
vendorclassid string Set the DHCP Vendor Class. DHCPv6 has it's own option as shown below. The default is dhcpcd-version:os:machine:platform>. For example
dhcpcd-5.5.6:NetBSD-6.99.5:i386:i386
             If not set then none is sent.  Some DHCP servers reject unknown vendorclassids.  To work around it,
             try using the MSFT vendorclassid.

     
vendclass en data Add the DHCPv6 Vendor Indetifying Vendor Class with the IANA assigned Enterprise Number en with the data. This option can be set more than once to add more data, but the behaviour, as per RFC(3925) is undefined if the Enterprise Number differs.
waitip [4 | 6] Wait for an address to be assigned before forking to the background.
< 4 means wait for an IPv4 address to be assigned.
6 means wait for an IPv6 address to be assigned.
If no argument is given, dhcpcd.conf will wait for any address protocol to be assigned.
It is possible to wait for more than one address protocol and dhcpcd.conf will only fork to the background when all waiting conditions are satisfied.
xidhwaddr Use the last four bytes of the hardware address as the DHCP xid instead of a randomly generated number.
quiet Suppress output except errors.

Defining new options DHCP, ND and DHCPv6 allow for the use of custom options. Each option needs to be started with the define, infinityor define6 directive. This can optionally be followed by both embed or encap options. Both can be specified more than once and embed must come before encap.

define code type variable Defines the DHCP option code of type with a name of variable exported to dhcpcd-run-hooks(8).
definend code type variable Defines the ND option code of type with a name of variable exported to dhcpcd-run-hooks(8), with a prefix of _nd.
define6 code type variable Defines the DHCPv6 option code of type with a name of variable exported to dhcpcd-run-hooks(8), with a prefix of _dhcp6.
vendopt code type variable Defines the Vendor-Identifying Vendor Options. The code is the IANA Enterprise Number which will unqiuely describe the encapsulated options. type is normally encap. variable names the Vendor option to be exported.
embed type variable Defines an embedded variable within the defined option. The length is determined by the type. If the variable is not the same as defined in the parent option, it is prefixed with the parent variable first with an underscore. If the variable has the name of reserved then it is not processed.
encap code type variable Defines an encapsulated variable within the defined option. The length is determined by the type. If the variable is not the same as defined in the parent option, it is prefixed with the parent variable first with an underscore.
Type prefix These keywords come before the type itself, to describe it more fully. You can use more than one, but they must appear in the order listed below.
request Requests the option by default without having to be specified in user configuration
norequest This option cannot be requested, regardless of user configuration
optional This option is optional. Only makes sense for embedded options where like the client FQDN option where the FQDN string itself is optional.
index The option can appear more than once and will be indexed.
array The option data is split into a space separated array, each element being the same type.
Types to define The type directly affects the length of data consumed inside the option. Any remaining data is normally discarded. Lengths can be specified for string and binhex types, but this is generally with other data embedded afterwards in the same option.
ipaddress An IPv4 address, 4 bytes.
ip6address An IPv6 address, 16 bytes.
string [: length] A NVT ASCII string of printable characters.
byte A byte.
bitflags: flags A byte represented as a string of flags, most significant bit first. For example, using ABCDEFGH then A would equal 10000000, B 01000000, C 00100000, etc. If the bit is not set, the flag is not printed. A flag of 0 is not printed even if the bit postition is set. This is to allow reservation of the first bits while assinging the last bits.
int16 A signed 16bit integer, 2 bytes.
uint16 An unsigned 16bit integer, 2 bytes.
int32 A signed 32bit integer, 4 bytes.
uint32 An unsigned 32bit integer, 4 bytes.
flag A fixed value (1) to indicate that the option is present, 0 bytes.
domain A RFC 3397 encoded string.
dname A RFC 1035 validated string.
binhex [: length] Binary data expressed as hexadecimal.
embed Contains embedded options (implies encap as well).
encap Contains encapsulated options (implies embed as well).
option References an option from the global definition.
Example definition
 # DHCP option 81, Fully Qualified Domain Name, RFC4702
           define 81 embed fqdn
           embed byte flags
           embed byte rcode1
           embed byte rcode2
           embed domain fqdn

           # DHCP option 125, Vendor Specific Information Option, RFC3925
           define 125 encap vsio
           embed uint32 enterprise_number
           # Options defined for the enterprise number
           encap 1 ipaddress ipaddress

Supported Authentication Protocols

token Sends and expects the token with the secretid 0 and realm of "" in each message.
delayedrealm Delayed Authentication. dhcpcd will send an authentication option with no key or MAC. The server will see this option, and select a key for dhcpcd.conf, writing the realm and secretid in it. dhcpcd will then look for a non- expired token with a matching realm and secretid. This token is used to authenicate all other messages.
delayed Same as above, but without a realm.

Supported Authentication Algorithms

If none specified, hmac-md5 is the default. hmac-md5

Supported Replay Detection Mechanisms

monotonic Same as monotime. default
none If this is changed from what was previously used, or the means of calculating or storing it is broken then the DHCP server will probably have to have its notion of the clients Replay Detection Value
monocounter Read the number in /var/lib/dhcpcd5/dhcpcd-rdm.monotonic and add one to it.
monotime Create a NTP timestamp from the system time.
SEE ALSO fnmatch(3), if_nametoindex(3), dhcpcd(8), dhcpcd-run-hooks(8)

/etc/resolv.conf

# Generated by resolvconf
domain outfamily
nameserver 192.168.1.1

/etc/dhcpcd.conf

Distributed
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
#duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu

# Most distributions have NTP support.
#option ntp_servers

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate SLAAC address using the Hardware Address of the interface
#slaac hwaddr
# OR generate Stable Private IPv6 Addresses based from the DUID
slaac private

# Example static IP configuration:
#interface eth0
#static ip_address=192.168.0.10/24
#static ip6_address=fd51:42f8:caae:d92e::ff/64
#static routers=192.168.0.1
#static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1

# It is possible to fall back to a static IP if DHCP fails:
# define static profile
#profile static_eth0
#static ip_address=192.168.1.23/24
#static routers=192.168.1.1
#static domain_name_servers=192.168.1.1

# fallback to static profile on eth0
#interface eth0
#fallback static_eth0

See mac OS ifconfig