Netboot iPXE chainloading dhcp config

i try to setup and ipxe chainloading configuration and have succsefull setup the pxe boot from the turris wiki…
next step would be to configure the ipxe chainloading like explained ln the official ipxe doc here
but i dont know where to put the “if else” directive for the dhcp

my working pxe boot in /etc/config/dhcp looks like this

config boot 'linux'
        option filename 'pxelinux.0'
        option serveraddress ''
        option servername 'turris'

so where to put?

if exists user-class and option user-class = "iPXE" {
      filename "http://my.web.server/real_boot_script.php";
  } else {
      filename "undionly.kpxe";

help would appreciated

I’m trying to do the same and looks like it just isn’t supported by openwrt with dnsmasq because dhcp_match is missing in /etc/init.d/dnsmasq.

That always surprised me: why there is /etc/config/ and even some uci tool, but no support for very basic features and tooling done in that way, that it’s impossible to just write a config.

Are there any way to do that?

1 Like

For the record:


(It points to a server for loading ipxe.efi via tftp and ipxe config via http, but you can use your router for that if needed).

1 Like

@yorik it seems like in openwrt 21.02 that is TOS6.0 its already supported. Are you still using PXE?

I would like to achieve similar goal. Do you mind helping out?

EDIT: openwrt/dnsmasq.init at openwrt-21.02 · openwrt/openwrt · GitHub