Skip to content

Instantly share code, notes, and snippets.

@SparksD2145
Created August 25, 2018 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SparksD2145/2a8c620e41f746e5f148834381dc918f to your computer and use it in GitHub Desktop.
Save SparksD2145/2a8c620e41f746e5f148834381dc918f to your computer and use it in GitHub Desktop.
iPXE and dnsmasq special sauce!
# look for client architecture
dhcp-vendorclass=set:BIOS,PXEClient:Arch:00006
dhcp-vendorclass=set:UEFI,PXEClient:Arch:00007
# set tag ipxe if request comes from iPXE (iPXE user class)
dhcp-userclass=set:ipxe,iPXE
dhcp-match=set:ipxe,175 # alternative way, look for option 175
# determine if using default firmware
tag-if=set:DEFAULT_FIRMWARE, tag:!ipxe
tag-if=set:DEFAULT_FIRMWARE_BIOS, tag:DEFAULT_FIRMWARE, tag:BIOS
tag-if=set:DEFAULT_FIRMWARE_UEFI, tag:DEFAULT_FIRMWARE, tag:UEFI
# if request comes from firmware, load iPXE via TFTP
dhcp-boot=tag:DEFAULT_FIRMWARE_BIOS, ipxe.bios, BIOS-Chainload, 10.10.1.6
dhcp-boot=tag:DEFAULT_FIRMWARE_UEFI, ipxe.efi, UEFI-Chainload, 10.10.1.6
# if architecture unknown, assume it
tag-if=set:UNKNOWN, tag:!DEFAULT_FIRMWARE_BIOS, tag:!DEFAULT_FIRMWARE_UEFI
dhcp-boot=tag:UNKNOWN, ipxe.bios, UNKNOWN-FIRM-BIOS-CHAINLOAD, 10.10.1.6 # Comment this out and uncomment below
# dhcp-boot=tag:UNKNOWN, ipxe.efi, UNKNOWN-FIRM-UEFI-CHAINLOAD, 10.10.1.6 # if you want to assume UEFI instead.
# if request comes from iPXE, direct it to boot from script
dhcp-boot=tag:ipxe,http://10.10.1.6/scripts/ipxe.script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment