OPNsense Forum

English Forums => 24.1 Production Series => Topic started by: KeithRBrown on February 07, 2024, 09:08:40 pm

Title: KEA DHCP - Reservation DNS Server Override
Post by: KeithRBrown on February 07, 2024, 09:08:40 pm
A feature which I currently use on ISC DHCPv4 is the ability to override the DNS Server setting in a Static Mapping.

Will this feature be added to KEA DHCPv4 in the future?
Title: Re: KEA DHCP - Reservation DNS Server Override
Post by: bbh on April 19, 2024, 04:56:19 pm
I am also using that feature on ISC DHCPv4 and I definitely require it.

After I stopped ISC DHCPv4 and enabled KEA DHCPv4 I am unable to find an option to configure alternative DNS servers even though the docs at https://docs.opnsense.org/manual/dhcp.html#kea-dhcp mentions a settings option "Default DNS servers to offer to the client".  :'(

I am running "OPNsense 24.1.5_3-amd64" and was looking at the 24.1.6 release notes.

The notes confuse me a bit since it states:
===
"OPNsense 24.1.6 released
Today we are happy to announce another milestone regarding ISC DHCP removal: the arrival of a DHCRelay replacement based on code forked and maintained by OpenBSD.
==

Based upon that part I was guessing that ISC DHCP is removed. However, within the patch notes I am reading:
- isc-dhcp: fix log file location

Which sort of tells me that ISC DHCP is still available in 24.1.6...

So now I am wondering:
a) is ISC DHCP removed in 24.1.6 and is that milestone line just an indication that development is moving forward clearing the way for removal in a future release post 24.1.6?
b) is the "Default DNS servers to offer to the client" hidden somewhere in 24.1.5_3, only available with 24.1.6 or not available at all yet?

For now I reverted back to ISC DHCPv4 and stay put at 24.1.5_3.
Based upon answers for above questions I can reconsider.

Thoughts??

 
Title: Re: KEA DHCP - Reservation DNS Server Override
Post by: securid on April 19, 2024, 05:13:13 pm
Another one here.

After reading the release notes saying ISC DHCP removal, I looked into moving the DHCP ranges. Manual moving is a bitch with more than a few interfaces and custom DHCP settings like DNS servers, domain names, etc.

In addition, I am also using DHCPv6 which KEA does not yet have. I certainly hope ICS will not be removed before DHCPv6 is implemented.
Title: Re: KEA DHCP - Reservation DNS Server Override
Post by: bbh on April 19, 2024, 05:24:52 pm
I meanwhile found out that unchecking "Auto collect option data" on a defined subnet allows you to configure "Routers (gateway)", "DNS servers" etc.

Unfortunately after entering the DNS servers I would like the clients to receive within the "DNS servers" field,  saving this and restarting the "Kea DHCPv4" my clients do not receive my defined DNS servers when they receive the new lease  :'(

Moving back to ISC DHCPv4 again  >:(
Title: Re: KEA DHCP - Reservation DNS Server Override
Post by: AhnHEL on April 19, 2024, 05:31:26 pm
That's strange because I use that exact option under 'Services: Kea DHCP [new]: Kea DHCPv4" in the Subnets tab
and my clients receive the DNS Servers I have assigned.
Title: Re: KEA DHCP - Reservation DNS Server Override
Post by: bbh on April 19, 2024, 07:23:47 pm
Hello AhnHEL (Angel)!

I re-activated it and tried again and this time the clients do get the proper DNS servers configured.  8)

/usr/local/etc/kea/kea-dhcp4.conf
...
        "subnet4": [
            {
                "id": 1,
                "subnet": "192.168.0.0/17",
                "option-data": [
                    {
                        "name": "domain-name-servers",
                        "data": "192.168.0.39,192.168.0.139"
                    },
                    {
                        "name": "routers",
                        "data": "192.168.0.138"
                    },
                    {
                        "name": "ntp-servers",
                        "data": "192.168.0.138"
                    },
                    {
                        "name": "domain-name",
                        "data": "lan"
                    }
                ],
...

Windows client:

Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . : lan
   Description . . . . . . . . . . . : Intel(R) Ethernet Connection (10) I219-V
   Physical Address. . . . . . . . . : 1C-69-7A-66-9A-6E
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::44b5:b8db:adb1:a1d6%8(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.0.50(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.128.0
   Lease Obtained. . . . . . . . . . : vrijdag 19 april 2024 19:13:53
   Lease Expires . . . . . . . . . . : vrijdag 19 april 2024 20:20:33
   Default Gateway . . . . . . . . . : 192.168.0.138
   DHCP Server . . . . . . . . . . . : 192.168.0.138
   DHCPv6 IAID . . . . . . . . . . . : 605841786
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-28-6E-71-DF-0C-7A-15-87-40-1A
   DNS Servers . . . . . . . . . . . : 192.168.0.39
                                       192.168.0.139

   NetBIOS over Tcpip. . . . . . . . : Enabled


No idea why it did not work previously.   ::)
At least this is working now. I will keep it running with my current OPNsense 24.1.5_3 for a bit prior to upgrading to 24.1.6 to confirm it is stable enough to move to that version and possibly using my fallback option towards ISC DHCP...

Thanks for making me aware that it should work well.
Title: Re: KEA DHCP - Reservation DNS Server Override
Post by: AhnHEL on April 19, 2024, 07:44:54 pm
No clue why it wouldn't have taken the first time but I'm glad you got it sorted.  I've found KEA to be very reliable despite it not being as featured as ISC but I'm sure the team will get it there.
Title: Re: KEA DHCP - Reservation DNS Server Override
Post by: bbh on April 25, 2024, 09:45:02 pm
Just a for the record.... ISC DHCPv4 and DHCPv6 are still available in OPNsense 24.1.6.

@KeithRBrown with "A feature which I currently use on ISC DHCPv4 is the ability to override the DNS Server setting in a Static Mapping." do you mean the ability to configure a different DNS server for the entire DHCP subnet instead of pointing to the address of the OPNsense instance itself? For instance OPNsense runs with 192.168.1.1 so DHCP clients for the 192.168 subnet get pointed to 192.168.1.1 but configure 192.168.1.200 as the alternative DNS server to be used? That is possible with Kea DHCP already by editing the defined subnet and remove the tick in the box for "Auto collect option data".

OR are you looking for an option to configure different DHCP settings for one or more individual MAC address entries to overrule the settings defined at the subnet level? That finer granularity is NOT available in Kea DHCP (yet?) at the individual client level. To workaround that I have created different subnets for DHCP clients so I can apply differences at that level. Which is something you cannot do with ISC DHCP as that appears to work at the interface level. While thinking about it now, I actually prefer the Kea DHCP approach I am using at the subnet level as I can apply those differences easier for multiple clients in one go.
Title: Re: KEA DHCP - Reservation DNS Server Override
Post by: Andori on May 09, 2024, 10:51:55 am

OR are you looking for an option to configure different DHCP settings for one or more individual MAC address entries to overrule the settings defined at the subnet level? That finer granularity is NOT available in Kea DHCP (yet?) at the individual client level. To workaround that I have created different subnets for DHCP clients so I can apply differences at that level. Which is something you cannot do with ISC DHCP as that appears to work at the interface level. While thinking about it now, I actually prefer the Kea DHCP approach I am using at the subnet level as I can apply those differences easier for multiple clients in one go.

Like others probably did, I saw the comment about removal of ISC DHCP in 24.1.6 and started to panic a little.

I'm only using 1 subnet atm (I really should sort it an split stuff into VLANs, but too lazy).  After a look around, I did find a migration tool that was painless in populating the reservation list in KEA.

Most devices use the DNS on the OPNsense box, but some things (TVs etc.)  I want to use PiHole (running on a TrueNAS box), so I want to be able to redirect those devices, so add me to the list of people who want to be able to define a different DNS (if required) on individual reservations.
Title: Re: KEA DHCP - Reservation DNS Server Override
Post by: DEC670airp414user on May 11, 2024, 12:30:44 pm
not having the option to add a specific dns server is the ONLY thing holding me back to Kea.

I have literally added all my ip, Macs, and hostnames.   but there is no option to add a dns server....

hopefully this is added soon
Title: Re: KEA DHCP - Reservation DNS Server Override
Post by: DEC670airp414user on May 12, 2024, 01:20:25 pm
uncheck  Auto collect option data

and then you can manually add a DNS server.  and it does work perfectly
Title: Re: KEA DHCP - Reservation DNS Server Override
Post by: lwndow on May 20, 2024, 03:54:54 pm
uncheck  Auto collect option data

and then you can manually add a DNS server.  and it does work perfectly

can't wait until we have parity with ISC and can do this at the reservation level