Skip to content

Commit 3606e97

Browse files
committed
Fix DHCPv6 PXE boot: use option6:client-arch for architecture detection
The IPv6 section of the dnsmasq template used option:client-arch to match client architecture, but this is a DHCPv4-only alias (option 93). In dnsmasq, the "option:" prefix resolves via the DHCPv4 option table (opttab) and the resulting match rule is added to daemon->dhcp_match, which is never evaluated by the DHCPv6 server code (rfc3315.c only iterates daemon->dhcp_match6). The directives were silently ignored. The fix uses option6:client-arch, which correctly resolves to DHCPv6 option 61 (Client System Architecture Type, RFC 5970). Both EDK2/OVMF and iPXE send this option in DHCPv6 SOLICIT messages. Note: option6:client-arch requires dnsmasq to have option 61 in its DHCPv6 option table (opttab6). Upstream dnsmasq is missing this entry, but Red Hat has carried a downstream patch adding it since 2021 (dnsmasq-2.86-dhcpv6-client-arch.patch), which is included in the CentOS Stream 9 base image used by this container. Also replaces the impossible BIOS fallback (undionly.kpxe over IPv6) with an x86_64 EFI fallback for PXE clients whose architecture could not be determined. Fixes: #916
1 parent 5ef9aa8 commit 3606e97

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

ironic-config/dnsmasq.conf.j2

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,19 @@ ra-param={{ env.PROVISIONING_INTERFACE }},0,0
5656

5757
dhcp-vendorclass=set:pxe6,enterprise:343,PXEClient
5858
dhcp-userclass=set:ipxe6,iPXE
59+
# Architecture detection via DHCPv6 option 61 (RFC 5970).
60+
# Note: option:client-arch is a DHCPv4-only alias (option 93) and silently
61+
# adds rules to the DHCPv4 match list; use option6:client-arch for DHCPv6.
62+
dhcp-match=set:amd64,option6:client-arch,7
63+
dhcp-match=set:amd64,option6:client-arch,9
5964
# Client is (i)PXE booting on EFI machine
60-
dhcp-match=set:amd64,option:client-arch,7
61-
dhcp-match=set:amd64,option:client-arch,9
6265
dhcp-option=tag:pxe6,tag:amd64,option6:bootfile-url,tftp://{{ env.IRONIC_URL_HOST }}/snponly-x86_64.efi
6366
# Client is (i)PXE booting on arm64 EFI machine
64-
dhcp-match=set:arm64,option:client-arch,11
67+
dhcp-match=set:arm64,option6:client-arch,11
6568
dhcp-option=tag:pxe6,tag:arm64,option6:bootfile-url,tftp://{{ env.IRONIC_URL_HOST }}/snponly-arm64.efi
66-
# Client is running (i)PXE on BIOS machine
67-
dhcp-option=tag:!pxe6,option6:bootfile-url,tftp://{{ env.IRONIC_URL_HOST }}/undionly.kpxe
69+
# Fallback: serve x86_64 when PXE client is detected but architecture
70+
# could not be determined. Legacy BIOS does not support IPv6 PXE.
71+
dhcp-option=tag:pxe6,tag:!amd64,tag:!arm64,option6:bootfile-url,tftp://{{ env.IRONIC_URL_HOST }}/snponly-x86_64.efi
6872
{%- if env.IPXE_TLS_SETUP != "true" %}
6973
dhcp-option=tag:ipxe6,option6:bootfile-url,{{ env.IRONIC_HTTP_URL }}/boot.ipxe
7074
{% endif %}

0 commit comments

Comments
 (0)