PXE-boot openwrt

Openwrt

SSH into OpenWrt and create a new directory to download the PXE files into. This will be the ftpd root later as well. Then download the PXE files from https://netboot.xyz/downloads/:

mkdir /mnt/ftpd
cd /mnt/ftpd/
wget https://boot.netboot.xyz/ipxe/netboot.xyz.kpxe
wget https://boot.netboot.xyz/ipxe/netboot.xyz.efi
wget https://boot.netboot.xyz/ipxe/netboot.xyz-snponly.efi
wget https://boot.netboot.xyz/ipxe/netboot.xyz-arm64.efi
wget https://boot.netboot.xyz/ipxe/netboot.xyz-arm64-snponly.efi
wget https://boot.netboot.xyz/ipxe/netboot.xyz-rpi4-snp.efi

Add this to /etc/config/dhcp (replace the tftp_root, serveraddress and servername with yours):

/etc/config/dhcp

config dnsmasq
    option enable_tftp '1'
    option tftp_root '/mnt/tftp'

config match
        option networkid 'bios'
        option match '60,PXEClient:Arch:00000' # x86 bios
config match
        option networkid 'efi64'
        option match '60,PXEClient:Arch:00007' # x64 UEFI
config match
        option networkid 'efi64'
        option match '60,PXEClient:Arch:00006' # x86 UEFI
config match
        option networkid 'efiarm64'
        option match '60,PXEClient:Arch:00011' # ARM 64-bit UEFI

config match
        option networkid 'efirpi3'
        option match '60,PXEClient:Arch:00000:UNDI:002001"' # rpi 3b+

config match
        option networkid 'efirpi'
        option match '60,PXEClient:Arch:00041' # arm rpiboot

config userclass
        option networkid 'ipxe'
        option userclass 'iPXE'

config boot
        option filename         'tag:bios,tag:!ipxe,netboot.xyz.kpxe'
        option serveraddress    '192.168.1.1'
        option servername       'OpenWrt'
config boot
        option filename         'tag:bios,tag:ipxe,netboot.xyz.kpxe'
        option serveraddress    '192.168.1.1'
        option servername       'OpenWrt'
config boot
        option filename         'tag:efi64,tag:!ipxe,netboot.xyz-snponly.efi'
        option serveraddress    '192.168.1.1'
        option servername       'OpenWrt'
config boot
        option filename         'tag:efi64,tag:ipxe,netboot.xyz.efi'
        option serveraddress    '192.168.1.1'
        option servername       'OpenWrt'

config boot
        option filename         'tag:efiarm64,tag:ipxe,netboot.xyz-arm64.efi'
        option serveraddress    '192.168.1.1'
        option servername       'OpenWrt'
config boot
        option filename         'tag:efiarm64,tag:!ipxe,netboot.xyz-arm64-snponly.efi'
        option serveraddress    '192.168.1.1'
        option servername       'OpenWrt'
config boot
        option filename         'tag:efirpi3,raspios/'
        option serveraddress    '192.168.1.1'
        option servername       'OpenWrt'
config boot
        option filename         'tag:efirpi,netboot.xyz-rpi4-snp.efi'
        option serveraddress    '192.168.1.1'
        option servername       'OpenWrt'