core icon indicating copy to clipboard operation
core copied to clipboard

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

Open mayerthomas opened this issue 1 year ago • 2 comments

Important notices

  • [x] I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
  • [X] I am convinced that my issue is new after having checked both open and closed issues at https://github.com/opnsense/core/issues?q=is%3Aissue

Description of my problem

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

  • Enabled Network Booting
  • Set next-server IP
  • Set default bios filename

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?

mayerthomas avatar Jan 31 '24 19:01 mayerthomas

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.

ndom91 avatar Mar 11 '24 13:03 ndom91

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.

mayerthomas avatar Mar 13 '24 14:03 mayerthomas

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

Darkfella91 avatar May 27 '24 20:05 Darkfella91

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"

h3krn avatar May 31 '24 20:05 h3krn

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

mayerthomas avatar Jun 01 '24 07:06 mayerthomas

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.

h3krn avatar Jun 01 '24 10:06 h3krn

@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

AdSchellevis avatar Jun 01 '24 11:06 AdSchellevis

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!

bcatubig avatar Jun 01 '24 21:06 bcatubig

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

fichtner avatar Jun 02 '24 07:06 fichtner

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

ndom91 avatar Jun 02 '24 11:06 ndom91