dhcpcd: Install and configure dhcpcd
`dhcpcd` is a fully-featured network manager, without all the bloat of `NetworkManager`.
This commit is contained in:
112
roles/dhcpcd/templates/dhcpcd.conf.j2
Normal file
112
roles/dhcpcd/templates/dhcpcd.conf.j2
Normal file
@@ -0,0 +1,112 @@
|
||||
# A sample configuration for dhcpcd.
|
||||
# See dhcpcd.conf(5) for details.
|
||||
|
||||
# Allow users of this group to interact with dhcpcd via the control socket.
|
||||
{% if dhcpcd_controlgroup is defined %}
|
||||
controlgroup {{ dhcpcd_controlgroup }}
|
||||
{% else %}
|
||||
#controlgroup wheel
|
||||
{% endif %}
|
||||
{% if dhcpcd_allow_interfaces is defined %}
|
||||
|
||||
allowinterfaces {{ dhcpcd_allow_interfaces }}
|
||||
{% endif %}
|
||||
{% if dhcpcd_deny_interfaces is defined %}
|
||||
|
||||
denyinterfaces {{ dhcpcd_deny_interfaces }}
|
||||
{% endif %}
|
||||
|
||||
# Inform the DHCP server of our hostname for DDNS.
|
||||
{% if dhcpcd_send_hostname|bool %}
|
||||
hostname
|
||||
{% else %}
|
||||
#hostname
|
||||
{% endif %}
|
||||
|
||||
# Use the hardware address of the interface for the Client ID.
|
||||
{% if dhcpcd_use_clientid|bool %}
|
||||
clientid
|
||||
{% else %}
|
||||
#clientid
|
||||
{% endif %}
|
||||
# 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.
|
||||
{% if not dhcpcd_use_clientid|bool %}
|
||||
duid
|
||||
{% else %}
|
||||
#duid
|
||||
{% endif %}
|
||||
|
||||
# Persist interface configuration when dhcpcd exits.
|
||||
{% if dhcpcd_persistent|bool %}
|
||||
persistent
|
||||
{% else %}
|
||||
#persistent
|
||||
{% endif %}
|
||||
|
||||
# Rapid commit support.
|
||||
# Safe to enable by default because it requires the equivalent option set
|
||||
# on the server to actually work.
|
||||
{% if dhcpcd_rapid_commit|bool %}
|
||||
option rapid_commit
|
||||
{% else %}
|
||||
#option rapid_commit
|
||||
{% endif %}
|
||||
|
||||
# A list of options to request from the DHCP server.
|
||||
{% for option in dhcpcd_options %}
|
||||
option {{ option }}
|
||||
{% endfor %}
|
||||
# Most distributions have NTP support.
|
||||
{% if dhcpcd_ntp_servers|bool %}
|
||||
option ntp_servers
|
||||
{% else %}
|
||||
#option ntp_servers
|
||||
{% endif %}
|
||||
# Respect the network MTU. This is applied to DHCP routes.
|
||||
{% if dhcpcd_interface_mtu|bool %}
|
||||
option interface_mtu
|
||||
{% else %}
|
||||
#option interface_mtu
|
||||
{% endif %}
|
||||
|
||||
# A ServerID is required by RFC2131.
|
||||
{% if dhcpcd_require_server_id|bool %}
|
||||
require dhcp_server_identifier
|
||||
{% else %}
|
||||
#require dhcp_server_identifier
|
||||
{% endif %}
|
||||
|
||||
# Generate Stable Private IPv6 Addresses instead of hardware based ones
|
||||
{% if dhcpcd_slaac_private|bool %}
|
||||
slaac private
|
||||
{% else %}
|
||||
#slaac private
|
||||
{% endif %}
|
||||
{% if dhcpcd_noipv4ll|bool %}
|
||||
|
||||
# Disable IPv4 link-local address automatic configuration (APIPA)
|
||||
noipv4ll
|
||||
{% endif %}
|
||||
{% if dhcpcd_noipv4|bool %}
|
||||
|
||||
# Disable IPv4 configuration entirely
|
||||
noipv4
|
||||
{% endif %}
|
||||
{% if dhcpcd_noipv6rs|bool %}
|
||||
|
||||
# Disable IPv6 router solicitations
|
||||
noipv6rs
|
||||
{% endif %}
|
||||
{% for iface in dhcpcd_interfaces %}
|
||||
|
||||
{% if iface.description is defined %}
|
||||
# {{ iface.description }}
|
||||
{% endif %}
|
||||
interface {{ iface.name }}
|
||||
{% for setting in iface.config %}
|
||||
{{ setting }}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
Reference in New Issue
Block a user