What's new

DHCP - UEFI and PXE support.

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

kryptto

Regular Contributor
Team,

I have read and use the DHCP PXE config with my RT-AC87 already. I would like to know if there is a way to configure UEFI DHCP settings. Using the following example: dnsmasq.conf located /jffs/configs with the dhcp-boot=pxelinux.0,,192.168.0.1

Works perfectly for PXE BIOS booting. Looking to support iPXE/UEFI BIOS booting. Anyone have any advice? Thanks in advance!
 
Looks like it should work the same way as normal PXE provided you have a valid EFI boot loader. What options have you tried? Are you seeing any error messages?

https://docs.oracle.com/cd/E37670_01/E41137/html/ol-dnsmasq-conf.html

Colin, Thanks for that link! Very helpful, so can I have the following entries at the same time? With the proper IP and *.efi entries from below?

dhcp-boot=efi/BOOTX64.efi
dhcp-boot=pxelinux/pxelinux.0,10.0.0.11

Maybe a better question is how can I write the option to choose the correct response based on the type of DHCP request? iPXE/UEFI/BIOS Legacy?

I have found this in the same Oracle Linux documentation you provided:

"You can use gpxelinux.0 with BIOS-based PXE clients and with UEFI-based PXE clients in legacy mode but not in UEFI mode."
https://docs.oracle.com/cd/E37670_01/E41137/html/section_skc_2y2_yr.html
 
Last edited:
OK, I added the following lines to dnsmasq.conf and it appears to work (at least for my laptop).

Code:
enable-tftp
tftp-root=/tmp/mnt/VERBATIM/ASUS/pxe

dhcp-vendorclass=BIOS,PXEClient:Arch:00000
dhcp-vendorclass=UEFI32,PXEClient:Arch:00006
dhcp-vendorclass=UEFI,PXEClient:Arch:00007
dhcp-vendorclass=UEFI64,PXEClient:Arch:00009

dhcp-boot=net:BIOS,undionly.kpxe
dhcp-boot=net:UEFI32,ipxe.efi
dhcp-boot=net:UEFI,ipxe.efi
dhcp-boot=net:UEFI64,ipxe.efi
 
OK, I added the following lines to dnsmasq.conf and it appears to work (at least for my laptop).

Code:
enable-tftp
tftp-root=/tmp/mnt/VERBATIM/ASUS/pxe

dhcp-vendorclass=BIOS,PXEClient:Arch:00000
dhcp-vendorclass=UEFI32,PXEClient:Arch:00006
dhcp-vendorclass=UEFI,PXEClient:Arch:00007
dhcp-vendorclass=UEFI64,PXEClient:Arch:00009

dhcp-boot=net:BIOS,undionly.kpxe
dhcp-boot=net:UEFI32,ipxe.efi
dhcp-boot=net:UEFI,ipxe.efi
dhcp-boot=net:UEFI64,ipxe.efi

Need to try it out thanks!
 
Currently using the following... seems to be working, but I feel legacy BIOS boot say vs UEFI is not being picked up.

dhcp-vendorclass=BIOS,PXEClient:Arch:00000
dhcp-vendorclass=UEFI32,PXEClient:Arch:00006
dhcp-vendorclass=UEFI,PXEClient:Arch:00007
dhcp-vendorclass=UEFI64,PXEClient:Arch:00009

dhcp-boot=net:BIOS,undionly.kpxe,,192.168.1.x
dhcp-boot=net:UEFI32,ipxe.efi,,192.168.1.x
dhcp-boot=net:UEFI,ipxe.efi,,192.168.1.x
dhcp-boot=net:UEFI64,ipxe.efi,,192.168.1.x
 
You should be able to see what file is being transferred by looking at the messages in the syslog. By switching my laptop BIOS's boot setting between "Legacy" and "UEIF" I could boot the different images.

Code:
Nov  3 15:10:08 dnsmasq-dhcp[15589]: DHCPDISCOVER(br0) f0:76:1c:21:93:35
Nov  3 15:10:08 dnsmasq-dhcp[15589]: DHCPOFFER(br0) 192.168.1.11 f0:76:1c:21:93:35
Nov  3 15:10:10 dnsmasq-dhcp[15589]: DHCPREQUEST(br0) 192.168.1.11 f0:76:1c:21:93:35
Nov  3 15:10:10 dnsmasq-dhcp[15589]: DHCPACK(br0) 192.168.1.11 f0:76:1c:21:93:35
Nov  3 15:10:10 dnsmasq-tftp[15589]: sent /tmp/mnt/VERBATIM/ASUS/pxe/undionly.kpxe to 192.168.1.11

Code:
Nov  3 15:23:17 dnsmasq-dhcp[16680]: DHCPDISCOVER(br0) f0:76:1c:21:93:35
Nov  3 15:23:17 dnsmasq-dhcp[16680]: DHCPOFFER(br0) 192.168.1.11 f0:76:1c:21:93:35
Nov  3 15:23:21 dnsmasq-dhcp[16680]: DHCPREQUEST(br0) 192.168.1.11 f0:76:1c:21:93:35
Nov  3 15:23:21 dnsmasq-dhcp[16680]: DHCPACK(br0) 192.168.1.11 f0:76:1c:21:93:35
Nov  3 15:23:21 dnsmasq-tftp[16680]: sent /tmp/mnt/VERBATIM/ASUS/pxe/ipxe.efi to 192.168.1.11
 
Last edited:
@colin I wanted to thank you for all your help with this. i am working just fine had to do some fine tuning for my custom environment.
 
dhcp-vendorclass=LEGACY,PXEClient:Arch:00000
dhcp-vendorclass=UEFI64-1,PXEClient:Arch:00007
dhcp-vendorclass=UNDI:003016,PXEClient:Arch:00007
dhcp-vendorclass=UEFI64-2,PXEClient:Arch:00009

dhcp-boot=net:LEGACY,undionly.kpxe,,192.168.0.x
dhcp-boot=net:UEFI-64-1,ipxe.efi,,192.168.0.x
dhcp-boot=net:UNDI:003016,ipxe.efi,,192.168.0.x
dhcp-boot=net:UEFI64-2,ipxe.efi,,192.168.0.x

Support for MS Surface Pro..... ;)
 
You can also make menus.

Code:
###################################################
# /jffs/configs/dnsmasq.conf.add
###################################################

# microsoft specific option: release dhcp lease on shutdown
dhcp-option=vendor:MSFT 5.0,2,1i

# menu
pxe-prompt="Press F8 for menu.", 60

pxe-service=x86PC, "Boot from local disk", 0
pxe-service=x86-64_EFI, "Boot from local disk", 0

pxe-service=X86-64_EFI, "WinPE", pxeboot.n12, 192.168.1.5
pxe-service=X86-64_EFI, "PXELinux", pxeboot
 
Hi @ColinTaylor, @kryptto

Just wondering where you got the following files from and whether they were pre-built binaries or you had to build them yourself with embedded drivers/scripts?

BIOS - undionly.kpxe
UEFI-64 - ipxe.efi
UEFI-32 - ipxe.efi

I assume that the UEFI-64 and UEFI-32 files (both named ipxe.efi) are the same actual file or are they different 64/32bit files with the same filename?

Thanks!
 
Last edited:
Hello, I was just thinking about this. Do you think that @RMerlin would add this option to the "LAN-DHCP Server" page?
It would be nice to configure PXE through the web interface rather than SSH.
1680020431375.png
 
Personally, I would call that feature bloat. An option that would confuse a lot a users and generate forum questions, for something that only two people in five years have asked about. For such a niche use case I think it's best left to user scripts.
 
Personally, I would call that feature bloat. An option that would confuse a lot a users and generate forum questions, for something that ly two people in five years have asked about. For such a niche use case I think it's best left to user scripts.
Wait, so because people haven't asked about it you think nobody wants it?

PXE boot is VERY useful, but more for business settings & less for amateur hobbyists.
pfSense, Ubiquiti, some old Linksys, OpenWRT, & professional grade DHCP servers support it.
It's used in things like Netboot.xyz, iVentoy, MaaS, even Windows can host a Pixie server for net deployment.
Every BIOS or UEFI has the option to boot to IPv4 (that's PXE)

Most of us who use it just do it the stupid way that is available, but it is severely limited.
Certain things like Windows actually need to be hosted off of a Windows Machine, so the ASUS version doesn't work well with it. If you customize Netboot.xyz you have to run it on a local machine or in Docker. The Netboot.xyz instructions for ASUS Merlin need to host the PXE on the JFFS, so it severely limits the ability to customize, & makes many of the options not possible.

I found this because I was tired of not being able to set a proper redirect in Merlin so I tried just replacing [B]tftp-root=/jffs/tftproot[/B] with a redirect like tftp-root=//192.168.1.147:69/ but that actually made my router freeze up & need to be hard reset.


It's not that it's unavailable because nobody wants it, nobody knows about it because it's hard to use, except for those who use industrial equipment where, wouldn't you know it, it's not hard to use. Before I found Netboot.xyz I would literally turn off DHCP, turn it on on the device needed to host, each time. Need to run recovery tools? Need to use gParted or install an OS? Instead of having a USB drive you just boot to network & it does it for you. In a business, like many retailers & I'm sure Chick-Fil-A with their Nuc collection, or offices where you have many machines, when a computer has a problem & IT tells them to restart & mash [F12] then the computer re-provisions itself & is good to go? That relies on the magic of the PXE boot.
It's not a feature people aren't interested in, People are hesitant to want it because it's hard to use. There's a big difference.
 
Wait, so because people haven't asked about it you think nobody wants it?

PXE boot is VERY useful, but more for business settings & less for amateur hobbyists.
pfSense, Ubiquiti, some old Linksys, OpenWRT, & professional grade DHCP servers support it.
It's used in things like Netboot.xyz, iVentoy, MaaS, even Windows can host a Pixie server for net deployment.
Every BIOS or UEFI has the option to boot to IPv4 (that's PXE)

Most of us who use it just do it the stupid way that is available, but it is severely limited.
Certain things like Windows actually need to be hosted off of a Windows Machine, so the ASUS version doesn't work well with it. If you customize Netboot.xyz you have to run it on a local machine or in Docker. The Netboot.xyz instructions for ASUS Merlin need to host the PXE on the JFFS, so it severely limits the ability to customize, & makes many of the options not possible.

I found this because I was tired of not being able to set a proper redirect in Merlin so I tried just replacing [B]tftp-root=/jffs/tftproot[/B] with a redirect like tftp-root=//192.168.1.147:69/ but that actually made my router freeze up & need to be hard reset.


It's not that it's unavailable because nobody wants it, nobody knows about it because it's hard to use, except for those who use industrial equipment where, wouldn't you know it, it's not hard to use. Before I found Netboot.xyz I would literally turn off DHCP, turn it on on the device needed to host, each time. Need to run recovery tools? Need to use gParted or install an OS? Instead of having a USB drive you just boot to network & it does it for you. In a business, like many retailers & I'm sure Chick-Fil-A with their Nuc collection, or offices where you have many machines, when a computer has a problem & IT tells them to restart & mash [F12] then the computer re-provisions itself & is good to go? That relies on the magic of the PXE boot.
It's not a feature people aren't interested in, People are hesitant to want it because it's hard to use. There's a big difference.
I`m very interested in PXE boot too, but there is no way I would ask any of the devs to implement this, they devote enough time and resources to Asuswrt-Merlin as it is.....There are some very talented people on here at smallnetbuilder, why not ask one of them to develop a script to support PXE boot...
 
Last edited:
Nobody is saying "Stop what you are doing & make this happen". It's not the most important thing, but it is a reasonable request.
  1. If implemented there are sure to be hundreds of users happy about it.
  2. The ability to do it, at least to some degree already exists within the firmware. Adding an interface page for it in the GUI shouldn't require complicated workarounds, rather it should require only really making an interface page, a "user7.asp" like other addons do. scMerlin gives buttons to click that are essentially executing CLI code in the background, this would be similar.
  3. It wouldn't need it's own page, it could go on a page with other things. When someone sees this & is like "Oh, I can add that to this page with other things I'm already working on or have done in the past" THAT'S what the best case scenario is. Or it could add to an existing page like YazDCHP stuff does.
  4. It seems more likely that it wasn't added because nobody doing the development was thinking about it, rather than because it was hard. I feel the request was more a "Here's a thing that'd be cool. Have it on your mind so maybe you can add it when you are doing your regular stuff & see a spot that makes sense to put it"
As for asking someone to make a script... That would be completely missing the whole goal of having a way to do it without needing to SSH in. I'd much rather there be a good guide on how to configure it (something that doesn't exist anywhere) than a script to do it. The best things we can find are examples like those here, & they often don't translate well when trying to use it as a base for a different PXE
 
Last edited:

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top