UEFI PXE boot server on OpenWrt

Now that I've resolved the few frustrations I had with roaming and IPv6 on the router and WireGaurd on my personal Linux machine, I'm ready for my next "adventure".

I actually have been eyeing network boot for quite a while. I do occasionally need to boot different OSes, and since I have a 64GB flash and an RT3200 with a USB port, I would like to give PXE booting a go. I've never used PXE boot let alone configure a server, so before going any further, a couple questions: will it work with UEFI? If not, I will not have have much use for it. And does Windows work with PXE?

Wiki does have instructions, but as with most other things it appears to be extremely outdated:

Now, I've found a more modern instructions, I'm linking here for a quick sanity check if anything about it has changed since:
https://der-jd.de/blog/2021/03/22/OpenWRT-router-as-PXE-server/

I can see there's PXE/TFTP Settings tab under DHCP and DNS on LuCi, and just as the instructions says, I can define only a single Network boot image. Does that mean I have to manually change image name every time I want to boot a different OS? UCI is supposed to be able to set multiple images, but it apparently didn't work for the author.

I'm on the same adventure, with the difference that I installed a netboot.xyz machine as a docker container. Now I need to point dnsmasq to the image server. I'm finding it difficult to configure the server. I suspect there might be a conflict with unbound, but I'm not sure. Tomorrow I will dedicate a few more minutes to this.

There's a couple UEFI PXE threads here at the forum, have you already read them ?

Yes. I read them all. I've already tried changing via dnsmasq and dhcp config files directly and also via UCI, as instructed in the netboot.xyz tutorial itself. Maybe my problem is with unbound and odhcp which I'm using for recursive dns? I'll keep trying.

The only useful posts that I found are these two:

According to the first post, you don't even need your own TFTP server. But it seems like this can't be done on LuCi, would've been very helpful for quick set up and changes.

I tried to configure dnsmasq according to the first post, including some variations, without success. I even made sure there was no conflict with any configuration via Luci. My problem seems to be pointing to my netboot.xyz in docker, which on my network is at 192.168.1.204. I have put this IP in the settings and I don't know if I'm doing it right.

But I want to try this model, with netboot.xyz in my docker server. If I can’t get it working correctly, I’ll try the alternative solution.

For now I'm routing with a Google onhub that has a USB 3.0 port. But I'm using this port for a dongle with a Wifi 6e AX radio, so the idea of ​​using a pendrive is hampered.

Did you manage to make it work? Can you share your configuration please.

I mean, you could try it with the exact same config just to eliminate variables. If it works, then it means something wrong with reaching your Docker container (also remember, this config is using HTTP, not TFTP). If it doesn't, then something's wrong on the dnsmasq or OpenWrt side of things.

Oh, I haven't done anything. Putting aside that I'm notoriously slow to put things into action, I also like to understand more before getting into the thick of it. I'm waiting for more input on this thread, if there's more changes to PXE boot system that hasn't been documented anywhere.

1 Like

Let's go on this journey together, then. Any news or insights that come up, I'll post here. One suggestion, since you are going to use a USB drive, why not install a Debian in chroot and make a netboot.xyz as a container. The adventure would be even greater. Lol

1 Like

hi,

what is not working for you actually? it looks you expect some kind of functionality but maybe your expectation does not match with what PXE designed for.

from owrt and or DHCP server (either dnsmasq or unbound) point of view, owrt is only responsible to hand out files which client can use to continue the boot process. what these files can or cannot do is out of scope.

not sure why you state the wiki guide is outdated when it clearly says it is for legacy boot not UEFI, so from legacy boot point of view it is still ok.

i suggest to start reading https://ipxe.org/ if you need enhanced functionalities like http, iscsi, uefi support. then search the forum how a proper ipxe config should look like (hint: double dhcp request).

meaning what? whether you can boot into Windows and install it to local machine, or run a whole Windows? as these are two very different things ... former definitely works, latter i don't know. you can boot into a Windows PE via PXE and mount an SMB share where your windows installation files and setup.exe are, and can run from there.

Oh, hell no. The moment I found TFTP might not be necessary, I thought to forgo the flash storage entirely. Though maybe I'd still need it if I want to boot Windows.

I'm sorry but it clearly says? If you use the browser find function, "legacy" is mentioned only once as part of a "hint" half-way through the wiki. There's no reference to how or even if UEFI is possible, which was only found outside the wiki. Either way, if it's an instruction on legacy booting only, then more the reason for me to make this forum thread, as that doesn't apply to what I want to do at all.

I don't know, simply booting it like a normal USB installer? Like I said, I've never used PXE before, so I'm just asking if whatever PXE is is even compatible with Windows at all. My expectations are whatever OS I boot with PXE would basically be the same as booting from USB. If I'm wrong, please correct me, I'm clearly ignorant about the whole system.

I just want to point the machine to my netboot.xyz server, were de install images living. The netboot server is a docker in the same network of openwrt, in address 192.168.1.204. The router is 192.168.1.1.

I had the same issues.
These is what i have done. I'm with openwrt-22.03 branch.

First make sure you have TFTP options disable through Luci.

Go to Network>DHCP and DNS>PXE/TFTP Settings and make sure that you have uncheck the option "Enable TFTP server". Save and apply if not.

Then ssh your box and edit /etc/dnsmasq.conf

Add this to the end of the file and change to your docker ip address

enable-tftp

dhcp-match=set:bios,60,PXEClient:Arch:00000                                 
dhcp-boot=tag:bios,netboot.xyz.kpxe,,IPADDRESS                          
dhcp-match=set:efi32,60,PXEClient:Arch:00002                                
dhcp-boot=tag:efi32,netboot.xyz.efi,,IPADDRESS                          
dhcp-match=set:efi32-1,60,PXEClient:Arch:00006                              
dhcp-boot=tag:efi32-1,netboot.xyz.efi,,IPADDRESS                        
dhcp-match=set:efi64,60,PXEClient:Arch:00007                                
dhcp-boot=tag:efi64,netboot.xyz.efi,,IPADDRESS                    
dhcp-match=set:efi64-1,60,PXEClient:Arch:00008                              
dhcp-boot=tag:efi64-1,netboot.xyz.efi,,IPADDRESS                        
dhcp-match=set:efi64-2,60,PXEClient:Arch:00009                              
dhcp-boot=tag:efi64-2,netboot.xyz.efi,,IPADDRESS

Finally restart dnsmasq
/etc/init.d/dnsmasq restart

1 Like