config for PXE Booting using isc-dhcp-server

Here is a section of the config file for isc-dhcp-server, showing the syntax to cater for a variety of PXE client types – BIOS & UEFI, LAN cards & virtual machines.

In this example the TFTP server has IP address 192.168.1.252

/etc/dhcp/dhcpd.conf:

# For LAN card ROM booting:
option tftp-server-address 192.168.1.252;
filename "pxelinux.0";
# For iPXE:
next-server 192.168.1.252; 
# For HyperV guests:
option dhcp-client-identifier "PXEClient"; #option 60
option tftp-server-name "192.168.1.252"; #option 66
option bootfile-name "pxelinux.bin"; #option 67
#option vendor-class-identifier "PXEClient";

# Serve different files based upon
# 32-bit, 64-bit, BIOS or EFI:
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";

if option architecture-type = 00:00 {
  filename "pxelinux.0"; # BIOS
} elsif option architecture-type = 00:07 {
  filename "syslinux.efi"; # EFI
  option bootfile-name "syslinux.efi";
} elsif option architecture-type = 00:09 {
  filename "EFIia64/syslinux.efi"; # ia64_EFI
  option bootfile-name "syslinux.ia64";
} elsif option architecture-type = 00:06 {
  filename "EFIia32/syslinux.efi"; # ia32_EFI
}