bolvan
October 24, 2018, 7:00am
1
Hi !
I'm experimenting with network boot.
I can start debian with nfs root using legacy PXE (pxelinux.0), it works fine.
Now I'd like to add support for UEFI PXE.
From what I read I need syslinux.efi and special conditional configuration for DHCP.
Something like this :
class "pxeclient" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
if substring (option vendor-class-identifier, 15, 5) = "00000" {
# BIOS client
filename "undionly.kpxe";
}
elsif substring (option vendor-class-identifier, 15, 5) = "00006" {
# EFI client 32 bit
filename "ipxe32.efi";
}
else
# default to EFI 64 bit
filename "ipxe.efi";
}
How to configure similar behavior for openwrt/dnsmasq ?
bolvan
October 24, 2018, 8:02am
2
This does not seem to be well documented but looking into /etc/init.d/dnsmasq I found solution
config match
option networkid 'set:bios'
option match '60,PXEClient:Arch:00000'
config match
option networkid 'set:efi64'
option match '60,PXEClient:Arch:00009'
config match
option networkid 'set:efi64'
option match '60,PXEClient:Arch:00007'
config boot
option filename 'tag:bios,bios/pxelinux.0'
option serveraddress '192.168.1.1'
option servername 'router'
config boot
option filename 'tag:efi64,efi64/syslinux.efi'
option serveraddress '192.168.1.1'
option servername 'router'
bolvan
October 25, 2018, 4:58pm
3
This is how its done for iPXE.
Its special tricky case.
If client is NOT iPXE then dhcp should provide path to executable
if client IS iPXE then dhcp provides path to initial config file for iPXE
config match
option networkid 'set:bios'
option match '60,PXEClient:Arch:00000'
config match
option networkid 'set:efi64'
option match '60,PXEClient:Arch:00009'
config match
option networkid 'set:efi64'
option match '60,PXEClient:Arch:00007'
config userclass
option networkid 'set:ipxe'
option userclass 'iPXE'
config boot
option filename 'tag:bios,tag:!ipxe,bios/undionly.kpxe'
option serveraddress '192.168.1.1'
option servername 'router'
config boot
option filename 'tag:bios,tag:ipxe,bios/ipxe/boot.ipxe'
option serveraddress '192.168.1.1'
option servername 'router'
config boot
option filename 'tag:efi64,tag:!ipxe,efi64/ipxe.efi'
option serveraddress '192.168.1.1'
option servername 'router'
config boot
option filename 'tag:efi64,tag:ipxe,efi64/ipxe/boot.ipxe'
option serveraddress '192.168.1.1'
option servername 'router'
1 Like
I'm really sorry not to be able to help with your issue bolvan but I haven't graduated to efi boot yet
But you have succeeded where I am failing to boot distros, if you could look at my post here and suggest anything that would be much appreciated:
Thanks for responding Wulfy
Yes client machine is non-efi and I called vmlinuz & initrd.lz from within casper directory, both distros are 32 bit
The files are being sent to the PXE client machine according to syslog
and client machine seems to be receiving them
but the boot process goes bent after initramfs loads normally
are you saying this could still be a problem with NFS?
If you think the NFS implementation could be to blame how should I test that from another client machine, please, t…
The format appears to have changed slightly for the upcoming 22.03 release , the rules now look like this:
config match
option networkid 'bios'
option match '60,PXEClient:Arch:00000'
I added this syslinux based example to the wiki as it was very useful, and under-documented as you say. If you want to add another working one for iPXE I'm sure many would find it handy
DNS and DHCP examples See also: DNS and DHCP configuration, DNS encryption, DNS hijacking Introduction This how-to provides most common dnsmasq and odhcpd tuning scenarios adapted for OpenWrt. Instructions Static leases LuCI -> DHCP and DNS...