Hi Owen,
I'm afraid I don't have much experience actually using the mechanism.
In your proposed suggestion, I think it would look like this:
“prefix”: "<?include “prefix_file”?>1:/64” {
and the contents of prefix_file would be:
2001:db8:f342:384
with no new line character or spaces. Would that work? I don't know.
Perhaps you could test in a lab setting before implementation?
Thank you,
Darren Ankney
On Wed, Jan 15, 2025 at 7:40 AM Owen DeLong <[email protected]> wrote:
>
> Can I really substitute part of a string from an include file? Forgive my
> ignorance, but what would the syntax for that look like?
>
> Imagine: prefix in file is “2001:db8:f342:384” an example representing a /60
> typically issued by a certain address stingy cable provider.
>
> Statement needed in kea:
> “prefix”: “2001:db8:f342:3841::/64” {
>
> Ignoring for the moment, the need to include said prefix fragment in 16x3
> places (subnet declaration, pool start, pool end, plus in each reservation),
> I’m trying to figure out how even this one statement would look:
>
> “prefix”: <include “prefix_file”>”1:/64” {
>
> Seems unlikely to parse. Can I make a call to concat() in that context and
> use the include directive as one of its arguments?
>
> I’m not trying to be obtuse, just trying to figure out a practical
> implementation of your suggestion.
>
> Owen
>
> > On Jan 14, 2025, at 15:27, Darren Ankney <[email protected]> wrote:
> >
> > Perhaps you could make use of the "include" mechanism?
> > https://kea.readthedocs.io/en/kea-2.7.5/arm/config.html#configuration-files-inclusion
> >
> >> On Tue, Jan 14, 2025 at 2:25 PM Owen DeLong <[email protected]> wrote:
> >>
> >> Is there any way to at least template the configuration so that I don’t
> >> have to change every occurrence of the prefix in the
> >> Entire file, but rather change a configuration variable that is referenced
> >> everywhere?
> >>
> >> I’m presuming some variant of the concat() expression commonly used in
> >> client classing might be useful here, but It’s not
> >> Clear to me how widely expressions can be used in a kea configuration file
> >> outside of client classes.
> >>
> >> If that capability doesn’t currently exist, it’s probably very much worth
> >> adding to the enhancements list.
> >>
> >> Owen
> >>
> >>
> >>>> On Jan 14, 2025, at 10:02, Darren Ankney <[email protected]> wrote:
> >>>
> >>> Hi Owen,
> >>>
> >>> I can't think of anyway from within Kea to do this. Kea would have no
> >>> knowledge of what prefix was delegated. I would say that you would
> >>> need to do scripts or find some consumer device that already does this
> >>> for you (e.g., perhaps one of the ASUS routers?).
> >>>
> >>> Thank you,
> >>> Darren Ankney
> >>>
> >>> On Tue, Jan 14, 2025 at 4:33 AM Owen DeLong via Kea-users
> >>> <[email protected]> wrote:
> >>>>
> >>>> I’ve got a router running on a linux box using IPv4 NAT, and the KEA
> >>>> dhcp4 configuration is limited, but simple because my only option is to
> >>>> assign static RFC-1918 subnets and NAT them.
> >>>>
> >>>> However, for IPv6, I’m receiving an IA_PD and I’m able to use
> >>>> systemd-networkd to put the prefixes on the interfaces, but I’m stumped
> >>>> how to get KEA to pick up those prefixes to build DHCPv6 pools for
> >>>> address assignment. Sadly, I’ve got a few devices that won’t do SLAAC
> >>>> (yes, I know this is sacrilege, but I lack leverage to move the vendors
> >>>> in question). My clients that speak SLAAC are getting valid information
> >>>> and working.
> >>>>
> >>>> However, I’d like to provide M+O bits and do some reservations and
> >>>> stateful DHCPv6 in some cases. However, I don’t want to have to go in
> >>>> and edit the kea-dhcp6.conf every time the upstream decides to change
> >>>> the delegated prefix, so I’m trying to avoid hardcoding a dynamic prefix
> >>>> into the kea configuration file.
> >>>>
> >>>> Is there currently any way to do this in KEA? I suppose worst case, I
> >>>> can write scripts to update the kea configuration and put them in
> >>>> systemd-networkd hooks so that when the prefix is changed, they update
> >>>> kea, but that feels horribly hacky and I can’t help but think this would
> >>>> be a common implementation situation in the SOHO world.
> >>>>
> >>>> Any pointers or assistance greatly appreciated. If the question is asked
> >>>> and answered, links are appreciated as I haven’t found the answer in any
> >>>> of my searching so far.
> >>>>
> >>>> Thanks,
> >>>>
> >>>> Owen
> >>>>
> >>>> --
> >>>> ISC funds the development of this software with paid support
> >>>> subscriptions. Contact us at https://www.isc.org/contact/ for more
> >>>> information.
> >>>>
> >>>> To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
> >>>>
> >>>> Kea-users mailing list
> >>>> [email protected]
> >>>> https://lists.isc.org/mailman/listinfo/kea-users
> >>
>
--
ISC funds the development of this software with paid support subscriptions.
Contact us at https://www.isc.org/contact/ for more information.
To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
Kea-users mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/kea-users