opnsense / core

OPNsense GUI, API and systems backend
https://opnsense.org/
BSD 2-Clause "Simplified" License
3.31k stars 738 forks source link

KEA-DHCP needs network-booting-options like ISC-DHCP #7189

Closed mayerthomas closed 4 months ago

mayerthomas commented 8 months ago

Important notices

Description of my problem

In order to PXE-boot my clients to my FOG-cloning-server, I had a successful setup with ISC-DHCP:

This setup only worked for me with the ISC-DHCP-Network-Booting-Settings, but never with the ISC-DHCP-TFTP-Server-Settings. At the moment, KEA-DHCP in OPNSense only ships with TFTP-Server-Settings, which do not work for me.

Possible Solution

Is there a possibility to add Network-Booting-Settings to KEA-DHCP?

ndom91 commented 7 months ago

You should be able to edit the /usr/local/etc/kea/kea-dhcp4.conf file to add these kinds of options while they're not yet exposed in the UI.

mayerthomas commented 7 months ago

Thanks for the tip! In terms of user-friendliness for all OPNsense-users, I would prefer appropriate setting-options in the UI. But I'm sure, that they will come. I just wanted to raise my hand for bringing this feature into the UI.

Darkfella91 commented 4 months ago

I tried adding those options manually in the config but after reload of Kea DHCP service they get removed.

h3krn commented 4 months ago

Maybe I'm getting the question wrong, but the's a "TFTP server" and "TFTP bootfile name" entry box in the "Edit Subnet" dialog. Isnt' that what you are looking for?

"Kea DHCPv4" -> "Subnets" -> \<edit range> -> "DHCP option data"

mayerthomas commented 4 months ago

I need the setting "next-server" like in the former ISC-DHCP-Server under "Network Booting" > "Set next-server IP"

h3krn commented 4 months ago

Thnx for explaining @mayerthomas , I now realize I need this as well. (same use case being PXE booting from FOG). Last night I was assuming I just had broken hardware. But looking up the next-server parameter and comparing to my old dhcpd config this fixes my FOG setup as well.

I'm not a programmer, but I took a swing ad adding the parameter myself and created a PR hoping it can be included.

AdSchellevis commented 4 months ago

@h3krn if you want to take a stab at adding missing options, here's an example https://github.com/opnsense/core/commit/fc6aae60a231bf609f203237da67de944ecd2568. It should be quite easy to add a missing one, just open a PR and I'll take a look.

EDIT missed that you already opened a PR, I'll take a look

bcatubig commented 4 months ago

You should be able to edit the /usr/local/etc/kea/kea-dhcp4.conf file to add these kinds of options while they're not yet exposed in the UI.

Is there any way to prevent OPNsense from reverting manual configs to this file? Upon Kea service restart via the web ui, any manual changes to the file are lost.

Thanks!

fichtner commented 4 months ago

I think this is how it works. If you want to modify the configs you need to adjust the code, but this will also be overwritten on the next update. It all boils down to contributing changes to the project.

Cheers, Franco

ndom91 commented 4 months ago

You should be able to edit the /usr/local/etc/kea/kea-dhcp4.conf file to add these kinds of options while they're not yet exposed in the UI.

Is there any way to prevent OPNsense from reverting manual configs to this file? Upon Kea service restart via the web ui, any manual changes to the file are lost.

Thanks!

No unfortunately I don't know any workarounds for this