Trouble with DnsMasq, DHCP proxy, PXE for UEFI clients

dhcpdnsmasqnetworkingpxe-bootuefi

I'm trying to setup a PXE server with dnsmasq as a dhcp-proxy.

It works well with client-arch=0 (x86 legacy clients) but UEFI client doesn't even terminate the DHCP packets exchange with the PXE server, and not even a pxe-prompt (setted with dnsmasq) appears on those newer clients.

I have made dumps of the DHCP dialog between PXE server and clients with Wireshark, I see some differences but I can't figure why only legacy clients connect successfully with my server.

Dump of DHCP messages between PXE server and legacy BIOS client (Works!)

Dump of DHCP messages between PXE server and UEFI client (Don't work 🙁 )

I couldn't find a working configuration online: following a lot of examples, all I get is that UEFI systems don't exchange final REQUEST/ACK with PXE server.

Dnsmasq config:

port=0
interface=bond
log-dhcp
dhcp-range=192.168.1.200,proxy,255.255.255.0
dhcp-no-override

dhcp-option=vendor:,6,2b

pxe-prompt="Press any key for boot menu", 5

dhcp-match=set:x86PC, option:client-arch, 0
dhcp-match=set:BC_EFI, option:client-arch, 7

pxe-service=tag:x86PC,x86PC, "Legacy BIOS PXE", bios/pxelinux
pxe-service=tag:BC_EFI,BC_EFI, "UEFI PXE", efi64/syslinux.efi

dhcp-boot=tag:x86PC, bios/pxelinux.0
dhcp-boot=tag:BC_EFI, efi64/syslinux.efi

Is out there a solution?

EDIT: I'm using version 2.76, with UEFI support (see changelog on official site).

EDIT2: My UEFI client is classified as PXEClient:Arch:00007 (so, BC_EFI is the correct dnsmasq arch tag).

Best Answer

DnsMasq proxyDHCP does not work on UEFI environments:

http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2015q4/009907.html

EDIT_1 if you are using the new DnsMasq with UEFI suport then try adding the missing architecture 9

 dhcp-match=set:EFI_ x86-64, option:client-arch, 9

UEFI 64 clients also use 9 as architecture.

EDIT_2

please base your config on this one

# Don't function as a DNS server:
port=0

# Log lots of extra information about DHCP transactions.
log-dhcp

# Set the root directory for files available via FTP.
tftp-root=/tftpboot

# Disable re-use of the DHCP servername and filename fields as extra
# option space. That's to avoid confusing some old or broken DHCP clients.
dhcp-no-override

# The boot filename, Server name, Server Ip Address
dhcp-boot=bios/pxelinux,,192.168.1.200

# PXE menu.  The first part is the text displayed to the user.  The second is the timeout, in seconds.
# pxe-prompt="Booting PXE Client", 1

# The known types are x86PC, PC98, IA64_EFI, Alpha, Arc_x86,
# Intel_Lean_Client, IA32_EFI, ARM_EFI, BC_EFI, Xscale_EFI and X86-64_EFI
# This option is first and will be the default if there is no input from the user.

# PXEClient:Arch:00000
pxe-service=X86PC, "Boot BIOS PXE", bios/pxelinux

# PXEClient:Arch:00007
pxe-service=BC_EFI, "Boot UEFI PXE-BC", efi64/syslinux.efi

# PXEClient:Arch:00009
pxe-service=X86-64_EFI, "Boot UEFI PXE-64", efi64/syslinux.efi

dhcp-range=192.168.1.200,proxy,255.255.255.0

Source https://wiki.fogproject.org/wiki/index.php?title=ProxyDHCP_with_dnsmasq (Adding UEFI support to the basic script)