Table of Contents

DHCP user class setting

Name

  user-class

Details

Type String
DHCP option number 77
ISC dhcpd syntax option user-class

Examples

Specify a custom DHCP user class

  iPXE> set user-class thinclient

Detect the DHCP user class in ISC dhcpd

  # in /etc/dhcpd.conf
  if exists user-class and option user-class = "thinclient" {
      filename "thinclient.ipxe";
  }

Avoid an infinite loop when chainloading

  # in /etc/dhcpd.conf
  if exists user-class and option user-class = "iPXE" {
      filename "http://my.web.server/real_boot_script.php";
  } else {
      filename "undionly.kpxe";
  }

Description

Specifies the user class sent by iPXE in DHCP requests. If no user class has been explicitly specified, iPXE will send the user class “iPXE”.

The DHCP user class can be used to identify groups of related clients to the DHCP server.

See also

Notes

The DHCP user class can be used to avoid the problem of an infinite loop when chainloading iPXE from an existing PXE ROM.

RFC 3004 defines the DHCP user class as a set of length-value tuples, but iPXE treats it as a string.1) You can choose to manually construct a value which conforms to RFC 3004 using the set command. For example:

  # Length 4, value 'i' (0x69), 'P' (0x50), 'X' (0x48), 'E' (0x45)
  set user-class:hex 04:69:50:48:45
1)
This is a long-standing bug both in iPXE and in the reference DHCP server implementation (ISC dhcpd). There is a substantial amount of documentation which suggests checking option 77 for the value “iPXE” to identify iPXE clients, and using “set user-class <text>” to specify a custom user class. To avoid breaking existing setups, iPXE will continue to provide option 77 as a plain string for DHCPv4.