From 8fe69788e792de449197a41b9f5a6e6b0ba12a30 Mon Sep 17 00:00:00 2001 From: Bob Fournier Date: Thu, 17 Oct 2019 20:15:54 -0400 Subject: [PATCH] Use client architecture and set bootfile-url for DHCPv6 in inspector For DHCPv6 PXE boot, the Client Architecture option uses code 61, see https://tools.ietf.org/html/rfc5970#section-3.3. Use this to determine if booting over EFI and set the DHCPv6 bootfile-url when booting PXE over EFI. Change-Id: I096ac412c015c3ac488d712010aafe52b572cfad (cherry picked from commit 3af894300266428ba3daa243d579680f583c7e96) --- .../dhcpv6-pxe-boot-client-arch-ba8857e4f1386710.yaml | 8 ++++++++ templates/inspector_dnsmasq_http.erb | 5 +++++ 2 files changed, 13 insertions(+) create mode 100644 releasenotes/notes/dhcpv6-pxe-boot-client-arch-ba8857e4f1386710.yaml diff --git a/releasenotes/notes/dhcpv6-pxe-boot-client-arch-ba8857e4f1386710.yaml b/releasenotes/notes/dhcpv6-pxe-boot-client-arch-ba8857e4f1386710.yaml new file mode 100644 index 00000000..b61b28af --- /dev/null +++ b/releasenotes/notes/dhcpv6-pxe-boot-client-arch-ba8857e4f1386710.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + For DHCPv6 PXE boot, the Client Architecture option code (61) + as defined in https://tools.ietf.org/html/rfc5970#section-3.3 is + different than the one for DHCP. This is used to determine + if booting over EFI. This change sets the DHCPv6 bootfile-url + when booting PXE over EFI. diff --git a/templates/inspector_dnsmasq_http.erb b/templates/inspector_dnsmasq_http.erb index 8d1a12e7..cca959f6 100644 --- a/templates/inspector_dnsmasq_http.erb +++ b/templates/inspector_dnsmasq_http.erb @@ -43,12 +43,17 @@ dhcp-match=ipxe,175 dhcp-match=set:efi,option:client-arch,7 dhcp-match=set:efi,option:client-arch,9 dhcp-match=set:efi,option:client-arch,11 +# dhcpv6s for Client System Architecture Type (61) +dhcp-match=set:efi6,option6:61,0007 +dhcp-match=set:efi6,option6:61,0009 +dhcp-match=set:efi6,option6:61,0011 dhcp-userclass=set:ipxe6,iPXE # Client is already running iPXE; move to next stage of chainloading dhcp-boot=tag:ipxe,http://<%= @dnsmasq_local_ip_real %>:<%= @http_port_real %>/inspector.ipxe dhcp-option=tag:ipxe6,option6:bootfile-url,http://<%= @dnsmasq_local_ip_real %>:<%= @http_port_real %>/inspector.ipxe # Client is PXE booting over EFI without iPXE ROM; send EFI version of iPXE chainloader dhcp-boot=tag:efi,tag:!ipxe,ipxe.efi +dhcp-option=tag:efi6,tag:!ipxe6,option6:bootfile-url,tftp://<%= @dnsmasq_local_ip_real %>/ipxe.efi # Client is running PXE over BIOS; send BIOS version of iPXE chainloader dhcp-boot=undionly.kpxe,localhost.localdomain,<%= @dnsmasq_local_ip %> <% if @dnsmasq_dhcp_hostsdir %>