Scroll to navigation

DHCPCD.CONF(5) File Formats Manual (smm) DHCPCD.CONF(5)

NAME

dhcpcd.conf
dhcpcd configuration file

DESCRIPTION

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. You can escape characters in the value using the \ character.
Blank lines and lines starting with # are ignored.
Here's a list of available options:
pattern
When discovering interfaces, the interface name must match pattern which is 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.
pattern
When discovering interfaces, the interface name must not match pattern which is a space or comma separated list of patterns passed to fnmatch(3).
address [
address
]
dhcpcd will arping each address in order before attempting DHCP. If an address is found, we will select the replying hardware address as the profile, otherwise the ip address. Example:
interface bge0
arping 192.168.0.1
profile 192.168.0.1
static ip_address=192.168.0.10/24
Background immediately. This is useful for startup scripts which don't disable link messages for carrier status.
address[
/cidr
]
Ignores all packets from address[
/cidr
].
address[
/cidr
]
Only accept packets from address[
/cidr
]. blacklist is ignored if whitelist is set.
Instructs the DHCP server to broadcast replies back to the client. Normally this is only set for non Ethernet interfaces, such as FireWire and InfiniBand. In most cases, dhcpcd will set this automatically.
value
Push value to the environment for use in dhcpcd-run-hooks(8). For example, you can force the hostname hook to always set the hostname with env force_hostname=YES.
If the hostname is set, will be will set to the FQDN if possible as per RFC 4702 section 3.1. If the FQDN option is missing, dhcpcd will still try and 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 just what the server says, don't manipulate it. 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.
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 dhcpcd sends a default clientid of the hardware family and the hardware address.
Generate an RFC 4361. compliant clientid. If persistent storage is available then a DUID-LLT (link local address + time) is generated, otherwise DUID-LL is generated (link local address). The DUID-LLT generated will be held in /etc/dhcpcd.duid and should not be copied to other hosts.
profile
Fallback to using this profile if DHCP fails. This allows you to configure a static profile instead of using ZeroConf.
name
Sends hostname to the DHCP server so it can be registered in DNS. If hostname is an empty string then the current system hostname is sent. If hostname is a FQDN (ie, contains a .) then it will be encoded as such.
Sends the short hostname to the DHCP server instead of the FQDN. This is useful because DHCP servers will not register the FQDN in their DNS if the domain part does not match theirs.
Also, see the env option above to control how the hostname is set on the host.
[
iaid
]
Request a DHCPv6 Normal Address for iaid. If none is specified, a default iaid is used. If the interface name is 4 characters or less then that is used, otherwise the interface index is used.
[
iaid
]
Request a DHCPv6 Temporary Address for iaid.
[
iaid [
interface [
/ sla_id [
/ prefix_len
]
]
]
]
Request a DHCPv6 Delegated Prefix for iaid. If no interface is given then we will assign a prefix to every other interface with a unique sla_id for each, starting from 0. Otherwise addresses are only assigned for each interface and sla_id A default prefix_len of 64 is assumed. sla_id is an integer 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 like so:
noipv6rs
interface eth0
ia_pd 1 eth1/0 eth2/1
Only configure IPv4.
Only confgiure IPv6.
[
disable | ptr | both
]
ptr just asks the DHCP server to update the PTR record of the host in DNS whereas both also updates the A record. disable will disable the FQDN option. The default is both. dhcpcd itself never does any DNS updates. dhcpcd encodes the FQDN hostname as specified in RFC1035.
interface
Subsequent options are only parsed for this interface.
By default, when dhcpcd receives an IPv6 RA, dhcpcd will only fork to the background if the RA contains at least one unexpired RDNSS option. Set this option so to make dhcpcd always fork on an RA.
Disables kernel IPv6 Router Advertisment processing so dhcpcd can manage addresses and routes. This does not work reliably on any BSD system, probably due to kernel issues.
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. This does work reliably on BSD systems.
Enables IPv6 Router Advertisment 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.
seconds
Request a leasetime of seconds.
metric
Metrics are used to prefer an interface over another one, lowest wins. dhcpcd will supply a default metric of 200 + if_nametoindex(3). An extra 100 will be added for wireless interfaces.
IPv4 addresses added will overwrite a pre-existing address instead of working alongside.
Don't send any ARP requests. This also disables IPv4LL.
Don't install any default routes.
script
Don't run this hook script. Matches full name, or prefixed with 2 numbers optionally ending with .sh.
So to stop dhcpcd from touching your DNS or MTU settings you would do:-
nohook resolv.conf, mtu
Don't attempt to obtain an IPv4LL address if we failed to get one via DHCP. See RFC 3927.
Disable solicitation and receipt of IPv6 Router Advertisements.
Don't receive link messages about carrier status. You should only set this for buggy interface drivers.
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. Prepend dhcp6_ to option to request a DHCPv6 option. DHCPv4 options are mapped to DHCPv6 where applicable.
option
Remove the option from the DHCP message. This should only be used when a DHCP server sends a non requested option that should not be processed.
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.
name
Subsequent options are only parsed for this profile name.
Suppress any dhcpcd output to the console, except for errors.
seconds
Allow reboot seconds before moving to the DISCOVER phase if we have an old lease to use. 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 authorative which means dhcpcd will timeout before moving back to the DISCOVER phase.
dhcpcd will release the lease prior to stopping the interface.
option
Requires the option to be present in all DHCP messages, otherwise the message is ignored. 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 require lines. To enforce that dhcpcd only responds to DHCP servers and not BOOTP servers, you can require dhcp_message_type.
script
Use script instead of the default /lib/dhcpcd/dhcpcd-run-hooks.
ssid
Subsequent options are only parsed for this wireless ssid.
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.
Here is an example which configures a static address, routes and dns.
interface eth0
static ip_address=192.168.0.10/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
Here is an example for PPP which gives the destination a default route. It uses the special destination keyword to insert the destination address into the value.
interface ppp0
static ip_address=
destination routers
seconds
The default timeout for waiting for a DHCP response is 30 seconds which may be too long or too short and can be changed here. A setting of 0 seconds causes dhcpcd to wait forever to get a lease.
string
Tag the DHCP messages with the userclass. You can specify more than one.
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.
Set the vendor option 01 with an IP address.
vendor 01,192.168.0.2
Set the vendor option 02 with a hex code.
vendor 02,01:02:03:04:05
Set the vendor option 03 with an IP address as a string.
vendor 03,\"192.168.0.2\"
Set un-encapsulated vendor option to hello world.
vendor ,"hello world"
string
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 badly configured DHCP servers reject unknown vendorclassids. To work around it, try and impersonate Windows by using the MSFT vendorclassid.
Wait for an address to be assigned before forking to the background.
Use the last four bytes of the hardware address as the DHCP xid instead of a randomly generated number.

SEE ALSO

dhcpcd-run-hooks(8), dhcpcd(8), if_nametoindex(3), fnmatch(3)

AUTHORS

Roy Marples <roy@marples.name>

BUGS

Please report them to http://roy.marples.name/projects/dhcpcd
July 25, 2013 Debian