Pxe boot forward with UEFI support


#1

I followed the excellent instructions on
Chris Sanders blog in the article MAAS for the home. Unfortunately the line it has to modify dnsmasq.conf only does pxe forwarding for legacy boot.

How do I add forwarding that supports non legacy boot and UEFI?


#2

I had a ton of fun with this just last night. See this old bug that’s still not resolved for metal UEFI.

I added the following snippet on my subnet:

if option arch = 00:07 and exists user-class and option user-class = "iPXE" {
    # iPXE uefi_amd64
    filename "grubx64.efi";
} elsif option arch = 00:09 and exists user-class and option user-class = "iPXE" {
    # iPXE uefi_amd64
    filename "grubx64.efi";
}

That should work if you’re booting via iPXE on those nodes.


#3

Like so?


#4

Can you please link to the specific blog your talking about?

You mentioned dnsmasq which MAAS doesn’t use. I assume that means you are using an external DHCP server? In which case setting it as a DHCP snippet in MAAS would have no effect.


#5

Here is the blog post I referred to. It makes a nice home setup. I use it with my nuc homelab.

http://chris-sanders.github.io/2018-02-02-maas-for-the-home/

Indeed it uses external DHCP. Both the blog post writer and I had an Asus router providing dhcp.

This is a tail of the dnsmasq.conf that ended up making UEFI PXE boot work on my setup…

dhcp-host=00:50:B6:BA:24:88,192.168.0.5
dhcp-boot=pxelinux.0,192.168.0.5
dhcp-match=set:efi-x86_64,option:client-arch,9
dhcp-match=set:efi-x86_64,option:client-arch,7
dhcp-boot=tag:efi-x86_64,bootx64.efi,192.168.0.5

In this setup maas is given a static IP of 192.168.0.5

Important things are not forgetting the double commas… (dhcp-boot=tag:efi-x86_64,bootx64.efi->,<-192.168.0.5)

And with my particular setup dnsmasq.conf wipes all the custom lines if I go into the router web config and change things.

I think I can get persistence with jffs, put that’s for later…

Now, whenever I need to change it I open it with the text editor, add the vital lines for pxe forwarding and then issue cd /etc && killall dnsmasq && dnsmasq -C ./dnsmasq.conf to restart dnsmasq with the changes.

Thanks!


#7

Recently sprinting on trying to get external legacy pxe boot to work where maas is the external pxe/tftp server.

I am able to get external dhcp-relay (where maas is the primary dhcp server and relays dhcp to the bridge device on a switch) working using the following in my dnsmasq.conf on my switch:

interface=br66 
port=0
dhcp-relay=10.3.1.1,10.3.2.10

Where 10.3.1.1 (br66) is the network device in my switch that I am running dhcp-relay on, and 10.3.2.10 is my maas server (reachable, but on a different subnet/broadcast domain).

I would be really interested in knowing what configuration can be supplied to dnsmasq to enable using maas to provide external pxe/tftp/dhcp.

I was not able to get remote pxe/tftp working by adding the dnsmasq config

dhcp-boot=pxelinux.0,,10.3.2.10

from the blog.

Played around with a few other dnsmasq configs as well to no avail.

Thoughts? Ideas?


#8

How about

dhcp-match=set:efi-x86_64,option:client-arch,9
dhcp-match=set:efi-x86_64,option:client-arch,7
dhcp-boot=tag:efi-x86_64,bootx64.efi,10.3.2.10

?


#9

I was having trouble with PfSense running DHCP and getting MAAS to PXE boot from it. The answer for me, seemed to be adding the following settings:
TFTP Server: xxx.xxx.xx.100
Network Booting: Enable
Next Server: xxx.xxx.xx.100
Default Bios Name: bootx64.efi
UEFI 32 bit File Name: bootx64.efi
UEFI 64 bit File NAme: bootx64.efi
(left Root Path empty).

Hope this helps. I’m going to post it as a solution on both forums in case other people are having google problems like I did.