Network booting detect BIOS vs UEFI

I have these lines in my /etc/dnsmasq.conf for this purpose:

dhcp-match=set:x86-legacy,option:client-arch,0
dhcp-match=set:x86_64-uefi,option:client-arch,7
dhcp-match=set:x86_64-uefi,option:client-arch,9
dhcp-match=set:ipxe,77,"iPXE"

dhcp-boot=tag:x86-legacy,undionly.kpxe,pxe.lan,192.168.1.54
dhcp-boot=tag:x86_64-uefi,ipxe.efi,pxe.lan,192.168.1.54
dhcp-boot=tag:ipxe,http://192.168.1.54/boot/boot.ipxe,pxe.lan,192.168.1.54

You can read about the dhcp-match and dhcp-boot options in the dnsmasq manual. In short, the dhcp-match lines sets one or more tags (internal dnsmasq identifier) based on the DHCP options the client sends. In my environment I have both legacy and UEFI clients, and I also utilize iPXE. When a legacy PXE ROM boots it will receive the legacy iPXE boot file (undionly.kpxe). When a UEFI ROM boots it will receive the UEFI version of iPXE (ipxe.efi). If iPXE boots (whether legacy or UEFI), it will receive a URL to the iPXE boot menu I want it to load.

1 Like