Kea DHCP UEFI PXE boot sends wrong boot file
-
@Misterb said in Kea DHCP UEFI PXE boot sends wrong boot file:
@TheNetStriker said in Kea DHCP UEFI PXE boot sends wrong boot file:
I checked the DHCP packages and the UEFI bios sets the DHCP option 93 correctly to 0x0007, but receives the legacy bios image.
My understanding is that KEA does not yet support DHCP options.
What exactly do you mean with DHCP options? Regading the logs the client classes are working as expected. When I start a computer with legacy bios the ipxe_64_lan and ipxe_64_lan_pool_0 are evaluated to 0, so this seem to work correctly. But the order in which those classes are evaluated seem to be reversed. As far as I understand the ipxe_legacy_lan and ipxe_legacy_lan_pool_0 should be evaluated after the other classes.
-
@TheNetStriker said in Kea DHCP UEFI PXE boot sends wrong boot file:
What exactly do you mean with DHCP options?
The following excerpt is taken from a Netgate blog post about KEA:
Basic functionality is present in version 23.09, but the Kea implementation lacks the following DHCP server features:
Local DNS Resolver/Forwarder Registration for static and dynamic DHCP clients Remote DNS server registration DHCPv6 Prefix Delegation High Availability Failover Lease statistics/graphs Custom DHCP options
So I assume that UEFI setting the DHCP option 93 will be ignored by KEA.
-
@Misterb I guess just found what is causing this problem. The order of the client-classes are correct, but the order of the require-client-classes is wrong. I just put the ipxe_legacy... class in both require-client-classes arrays to the bottom and restarted the DHCP service and now booting works for legacy and uefi bios.
I would have found this sooner, but for some reason the DHCP restart button in pfSense does not work. I had to restart the service over the command line.
I will take a look at the config generator for this config file. Maybe I can fix the problem myself and upload a pull request on GitHub to fix this.
-
I think I found the problem. In the services.inc file is an array_unshift command for the legacy classes which puts the legacy class at the top of the array. I just changed this to add the class to the end of the array and now booting from legacy and uefi works!
I also created a patch file for the services.inc file:
--- /etc/inc/services.inc.save 2023-11-24 15:19:26.797541000 +0100 +++ /etc/inc/services.inc 2023-11-24 15:24:17.000000000 +0100 @@ -1548,7 +1548,7 @@ if (!is_array($keapool['require-client-classes'])) { $keapool['require-client-classes'] = []; } - array_unshift($keapool['require-client-classes'], $name); + $keapool['require-client-classes'][] = $name; } if (!empty($poolconf['rootpath'])) { @@ -1719,7 +1719,7 @@ if (!is_array($keasubnet['require-client-classes'])) { $keasubnet['require-client-classes'] = []; } - array_unshift($keasubnet['require-client-classes'], $name); + $keasubnet['require-client-classes'][] = $name; } if (!empty($dhcpifconf['rootpath'])) {
Just add this to the system patches and set the "Path Strip Count" to 0.
Can we somehow get a pfSense developer to take a look at this if this is the correct solution?
-
@TheNetStriker you can open a Redmine.pfsense.org issue.
-
@SteveITS I just created a bug report:
https://redmine.pfsense.org/issues/15032 -
We also have a problem with network boot and Kea DHCP server. We use Fog Project as our network boot server.
Setting in pfSense that works with ISC DHCP:
TFTP Server: IP of my netboot server (Fog Project)
Enable Network Booting: yes
Next Server: IP of my netboot server (Fog Project)
Default BIOS File Name: ipxe.kpxe
UEFI 32 bit File Name: i386-efi/snponly.efi
UEFI 64 bit File Name: snponly.efi
Root Path: /tftpbootBut if we change DHCP Server Backend to Kea DHCP, clients receive such error:
NBP filename is ipxe.kpxeÿ
NBP filesize is 0 Bytes
PXE-E23: Client received TFTP error from server.
As you can see client receive wrong Default BIOS File Name from Kea DHCP Server. -
@nockdown Have you tried to apply the patch I posted under System -- Patches? This should fix the problem with the wrong pxe file until this is fixed by Netgate.
-
@TheNetStriker We are having the exact same problem. I've not been able to prove the solution still as I'm finding that my edits to /usr/local/etc/kea/kea-dhcp4.conf to move the legacy to the bottom of each of the arrays are reverted when the DHCP service restarts. Am I missing something?
Thanks!
Tony -
I've now realised that services.inc creates the conf file. I've edited services.inc and can now see that legacy is the lowest priority and the problem seems to be solved.
Thanks!
-
I dont want to create more like this theme, i'm asking here
pfsense
Current Base System2.7.2
Latest Base System2.7.2
Kea DHCP
legacy BIOS~~May 16 10:48:41 kea-dhcp4 1713 INFO [kea-dhcp4.dhcpsrv.0x5b893e15f00] EVAL_RESULT Expression pool_lan_0 evaluated to 1 May 16 10:48:41 kea-dhcp4 1713 INFO [kea-dhcp4.leases.0x5b893e15f00] DHCP4_LEASE_ADVERT [hwtype=1 00:21:97:93:09:13], cid=[no info], tid=0x98930913: lease 192.168.110.3 will be advertised May 16 10:48:41 kea-dhcp4 1713 INFO [kea-dhcp4.dhcp4.0x5b893e15f00] EVAL_RESULT Expression ipxe_legacy_lan evaluated to 1 May 16 10:48:41 kea-dhcp4 1713 INFO [kea-dhcp4.dhcp4.0x5b893e15f00] EVAL_RESULT Expression ipxe_legacy_lan_pool_0 evaluated to 1 May 16 10:48:43 kea-dhcp4 1713 INFO [kea-dhcp4.dhcpsrv.0x5b893e15f00] EVAL_RESULT Expression pool_lan_0 evaluated to 1 May 16 10:48:43 kea-dhcp4 1713 INFO [kea-dhcp4.leases.0x5b893e15f00] DHCP4_LEASE_ALLOC [hwtype=1 00:21:97:93:09:13], cid=[no info], tid=0x98930913: lease 192.168.110.3 has been allocated for 7200 seconds May 16 10:48:43 kea-dhcp4 1713 INFO [kea-dhcp4.dhcp4.0x5b893e15f00] EVAL_RESULT Expression ipxe_legacy_lan evaluated to 1 May 16 10:48:43 kea-dhcp4 1713 INFO [kea-dhcp4.dhcp4.0x5b893e15f00] EVAL_RESULT Expression ipxe_legacy_lan_pool_0 evaluated to 1 May 16 10:48:47 kea-dhcp4 1713 INFO [kea-dhcp4.dhcpsrv.0x5b893e15f00] EVAL_RESULT Expression pool_lan_0 evaluated to 1 May 16 10:48:47 kea-dhcp4 1713 INFO [kea-dhcp4.leases.0x5b893e15f00] DHCP4_LEASE_ADVERT [hwtype=1 00:21:97:93:09:13], cid=[no info], tid=0x98930913: lease 192.168.110.3 will be advertised May 16 10:48:47 kea-dhcp4 1713 INFO [kea-dhcp4.dhcp4.0x5b893e15f00] **EVAL_RESULT Expression ipxe_legacy_lan evaluated to 1** May 16 10:48:47 kea-dhcp4 1713 INFO [kea-dhcp4.dhcp4.0x5b893e15f00] **EVAL_RESULT Expression ipxe_legacy_lan_pool_0 evaluated to 1**~~
-
@TheNetStriker Your patch resolved order, so UEFI client can get .efi boot file.
I edited services.inc file (by Diagnostics / Edit File) and changed mentioned lines.
But similar as @nockdown now my UEFI client receive boot file with addtional ÿ.
Not sure if I should do anything related to "Path Strip Count" ? And how to do it...