Cookbooks
dhcp
documentation
Dhcp Class

dhcp_class

Back to resource list

Create a DHCPD class configuration. (https://kb.isc.org/docs/isc-dhcp-44-manual-pages-dhcpdconf#client-classing (opens in a new tab))

Introduced: v7.0.0

Actions

  • :create
  • :delete

Properties

NameTypeDefaultDescriptionAllowed Values
commentStringnilComment to add to the configuration file
ip_versionSymbol:ipv4Select DHCP or DHCPv6 server to configure:ipv4, :ipv6
conf_dirString/etc/dhcp/dhcpd(6).d/classes.dDirectory to create configuration file in
cookbookString/etc/dhcp/dhcpd(6).d/classes.dCookbook to source configuration file template from
templateString/etc/dhcp/dhcpd(6).d/classes.dTemplate to use to generate the configuration file
ownerStringPlatform dependantOwner of the generated configuration file
groupStringPlatform dependantGroup of the generated configuration file
modeString'0640'Filemode of the generated configuration file
matchStringnilDHCPD match statement
optionsArray, HashnilDHCPD options for the class
parametersArray, HashnilDHCPD parameters for the class
subclassArraynilSubclasses to include within the class

Examples

dhcp_class 'BlankClass' do
  match 'hardware'
end
dhcp_class 'RegisteredHosts' do
  match 'hardware'
  subclass [
    '1:10:bf:48:42:55:01',
    '1:10:bf:48:42:55:02',
  ]
end
dhcp_class 'SpecialHosts' do
  match 'hardware'
  subclass [
    '1:10:bf:48:42:56:01',
    '1:10:bf:48:42:56:02',
  ]
  option(
    'special-option' => 'value'
  )
end