Skip to content

Instantly share code, notes, and snippets.

@vookimedlo
Created December 19, 2023 23:05
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 vookimedlo/ea401d2a74be2738b0fdf84f7292ce15 to your computer and use it in GitHub Desktop.
Save vookimedlo/ea401d2a74be2738b0fdf84f7292ce15 to your computer and use it in GitHub Desktop.
netboot.xyz dnsmasq configuration
tee -a /etc/dnsmasq.conf << EOF
###################################
# TFTP Server custom configutation
####################################
enable-tftp
tftp-root=/root/tftp

# Architecture list
# https://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml#processor-architecture

# x86_64 Legacy (PCBIOS) iPXE Bootloaders
dhcp-match=set:bios,option:client-arch,0

# x86_64 UEFI iPXE Bootloaders
dhcp-match=set:efi-i32,option:client-arch,6
dhcp-match=set:efi-i64,option:client-arch,7

# ARM64 iPXE Bootloaders
dhcp-match=set:efi-a64,option:client-arch,11

# x86_64 UEFI HTTP Bootloaders
dhcp-match=set:http-efi-i32,option:client-arch,15
dhcp-match=set:http-efi-i64,option:client-arch,16

# ARM64 UEFI HTTP Bootloaders
dhcp-match=set:http-efi-a64,option:client-arch,19

# x86_64 Legacy (PCBIOS) HTTP Bootloaders
dhcp-match=set:http-bios,option:client-arch,20


dhcp-userclass=set:freebsd, FreeBSD    # FreeBSD 'loader.efi'
dhcp-userclass=set:ipxe,    iPXE       # iPXE

dhcp-vendorclass=set:pxe,   PXEClient
dhcp-vendorclass=set:http,  HTTPClient

tag-if=set:efi-a,tag:efi-a*
tag-if=set:efi-i,tag:efi-i*
tag-if=set:http-efi-a,tag:http-efi-a*
tag-if=set:http-efi-i,tag:http-efi-i*
tag-if=set:supports-http,tag:http*


# HTTP
#
dhcp-option=lan,tag:http-bios,option:bootfile-name,http://boot.netboot.xyz/ipxe/netboot.xyz.kpxe
dhcp-option=lan,tag:http-efi-i,option:bootfile-name,http://boot.netboot.xyz/ipxe/netboot.xyz.efi
dhcp-option=lan,tag:http-efi-a,option:bootfile-name,http://boot.netboot.xyz/ipxe/netboot.xyz-arm64.efi

dhcp-option=lan,tag:supports-http,option:vendor-class,HTTPClient


# TFTP
#
dhcp-boot=tag:efi-i,tag:!supports-http,ipxe/netboot.xyz.efi
dhcp-boot=tag:efi-a,tag:!supports-http,ipxe/netboot.xyz-arm64.efi
dhcp-boot=tag:bios,tag:!supports-http,tag:!ipxe,ipxe/netboot.xyz.kpxe

# Try HTTP for BIOS
#
dhcp-option=lan,tag:bios,tag:ipxe,option:bootfile-name,http://boot.netboot.xyz/ipxe/netboot.xyz.kpxe
dhcp-option=lan,tag:ipxe,option:vendor-class,HTTPClient


EOF

/etc/init.d/dnsmasq restart

The follow-up documentation:

Tested on Turris Omnia router.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment