Skip to content

[READY] building specific kea v6 configs - #1085

Merged
sarcasticadmin merged 4 commits into
socallinuxexpo:masterfrom
kylerisse:kr/20260213030921
Feb 13, 2026
Merged

[READY] building specific kea v6 configs#1085
sarcasticadmin merged 4 commits into
socallinuxexpo:masterfrom
kylerisse:kr/20260213030921

Conversation

@kylerisse

Copy link
Copy Markdown
Member

Fixes #1084
Fixes #958

Description of PR

Due to complexities in Kea for IPv6, we need to create building specific configs that capture an "interface" value within the subnet definition for the subnet that containers the server itself. This is a poor implementation but this entire function is slated for a cleanup post 23x, so it's good enough for now. Due to the additional complexities of how dictionaries and variable assignments work in python, the copy package is used and to avoid getting too clever there are a lot of variable definitions.

Previous Behavior

  • clients on vlan503 to get an address for vlan103 when v6 autoconfig is disabled on vlan503

New Behavior

  • clients on vlan503 now get an address for vlan503 via DHCP as expected

Tests

  1. diff the building specific configs
> nix build -L .#legacyPackages.x86_64-linux.scale-network.scale-inventory
> diff result/config/dhcp6-server-expo.conf result/config/dhcp6-server-conf.conf
result/config/dhcp6-server-expo.conf                                                           result/config/dhcp6-server-conf.conf
      87             "pool": "2001:470:f026:103:d8c::1 - 2001:470:f026:103:d8c::800"                 87             "pool": "2001:470:f026:103:d8c::1 - 2001:470:f026:103:d8c::800"
      88           }                                                                                 88           }
      89         ],                                                                                  89         ],
      90         "valid-lifetime": 300,                                                              90         "valid-lifetime": 300,
      91         "min-valid-lifetime": 300,                                                          91         "min-valid-lifetime": 300,
      92         "max-valid-lifetime": 300,                                                          92         "max-valid-lifetime": 300
      93         "interface": "@@INTERFACE@@"
      94       },                                                                                    93       },
      95       {                                                                                     94       {
      96         "subnet": "2001:470:f026:104::/64",                                                 95         "subnet": "2001:470:f026:104::/64",
      97         "id": 24836,                                                                        96         "id": 24836,
      98         "user-context": {                                                                   97         "user-context": {
---                                                                                            ---
    3787             "pool": "2001:470:f026:503:d8c::1 - 2001:470:f026:503:d8c::800"               3786             "pool": "2001:470:f026:503:d8c::1 - 2001:470:f026:503:d8c::800"
    3788           }                                                                               3787           }
    3789         ],                                                                                3788         ],
    3790         "valid-lifetime": 300,                                                            3789         "valid-lifetime": 300,
    3791         "min-valid-lifetime": 300,                                                        3790         "min-valid-lifetime": 300,
    3792         "max-valid-lifetime": 300                                                         3791         "max-valid-lifetime": 300,
                                                                                                   3792         "interface": "@@INTERFACE@@"
    3793       },                                                                                  3793       },
    3794       {                                                                                   3794       {
    3795         "subnet": "2001:470:f026:504::/64",                                               3795         "subnet": "2001:470:f026:504::/64",
    3796         "id": 25860,                                                                      3796         "id": 25860,
    3797         "user-context": {                                                                 3797         "user-context": {
  1. build core-expo and verify v6 config
> nix build -L .#nixosConfigurations.core-expo.config.system.build.toplevel
> cat result/etc/kea/dhcp6-server.conf | grep -B9 -A1 virbr0
{
  "Dhcp6": {
    "valid-lifetime": 1440,
    "min-valid-lifetime": 1440,
    "max-valid-lifetime": 1440,
    "interfaces-config": {
      "interfaces": [
        "virbr0",
        "virbr0/2001:470:f026:103::20"
      ],
--
        },
        "pools": [
          {
            "pool": "2001:470:f026:103:d8c::1 - 2001:470:f026:103:d8c::800"
          }
        ],
        "valid-lifetime": 300,
        "min-valid-lifetime": 300,
        "max-valid-lifetime": 300,
        "interface": "virbr0"
      },
  1. build core-conf and verify v6 config
> nix build -L .#nixosConfigurations.core-conf.config.system.build.toplevel
> cat result/etc/kea/dhcp6-server.conf | grep -B9 -A1 virbr0
{
  "Dhcp6": {
    "valid-lifetime": 1440,
    "min-valid-lifetime": 1440,
    "max-valid-lifetime": 1440,
    "interfaces-config": {
      "interfaces": [
        "virbr0",
        "virbr0/2001:470:f026:503::20"
      ],
--
        },
        "pools": [
          {
            "pool": "2001:470:f026:503:d8c::1 - 2001:470:f026:503:d8c::800"
          }
        ],
        "valid-lifetime": 300,
        "min-valid-lifetime": 300,
        "max-valid-lifetime": 300,
        "interface": "virbr0"
      },
  1. Diff new files against master branch version and confirm expected changes to core-conf none to conf-expo
> nix build -L .#legacyPackages.x86_64-linux.scale-network.scale-inventory
> cp result/config/dhcp6-server-* /tmp/
> git checkout master
Switched to branch 'master'
> nix build -L .#legacyPackages.x86_64-linux.scale-network.scale-inventory
> diff result/config/dhcp6-server.conf /tmp/dhcp6-server-conf.conf
result/config/dhcp6-server.conf                                                                /tmp/dhcp6-server-conf.conf
      87             "pool": "2001:470:f026:103:d8c::1 - 2001:470:f026:103:d8c::800"                 87             "pool": "2001:470:f026:103:d8c::1 - 2001:470:f026:103:d8c::800"
      88           }                                                                                 88           }
      89         ],                                                                                  89         ],
      90         "valid-lifetime": 300,                                                              90         "valid-lifetime": 300,
      91         "min-valid-lifetime": 300,                                                          91         "min-valid-lifetime": 300,
      92         "max-valid-lifetime": 300,                                                          92         "max-valid-lifetime": 300
      93         "interface": "@@INTERFACE@@"
      94       },                                                                                    93       },
      95       {                                                                                     94       {
      96         "subnet": "2001:470:f026:104::/64",                                                 95         "subnet": "2001:470:f026:104::/64",
      97         "id": 24836,                                                                        96         "id": 24836,
      98         "user-context": {                                                                   97         "user-context": {
---                                                                                            ---
    3787             "pool": "2001:470:f026:503:d8c::1 - 2001:470:f026:503:d8c::800"               3786             "pool": "2001:470:f026:503:d8c::1 - 2001:470:f026:503:d8c::800"
    3788           }                                                                               3787           }
    3789         ],                                                                                3788         ],
    3790         "valid-lifetime": 300,                                                            3789         "valid-lifetime": 300,
    3791         "min-valid-lifetime": 300,                                                        3790         "min-valid-lifetime": 300,
    3792         "max-valid-lifetime": 300                                                         3791         "max-valid-lifetime": 300,
                                                                                                   3792         "interface": "@@INTERFACE@@"
    3793       },                                                                                  3793       },
    3794       {                                                                                   3794       {
    3795         "subnet": "2001:470:f026:504::/64",                                               3795         "subnet": "2001:470:f026:504::/64",
    3796         "id": 25860,                                                                      3796         "id": 25860,
    3797         "user-context": {                                                                 3797         "user-context": {
[1]> diff result/config/dhcp6-server.conf /tmp/dhcp6-server-expo.conf
>

@sarcasticadmin

Copy link
Copy Markdown
Member

@kylerisse thanks for digging into this and Im ok with the work around for 23x.

confirmed this working after applied to core-conf and from a rpi sign:

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute
       valid_lft forever preferred_lft forever
2: end0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether dc:a6:32:41:43:5b brd ff:ff:ff:ff:ff:ff
    altname enxdca63241435b
    inet 10.128.3.81/24 brd 10.128.3.255 scope global dynamic noprefixroute end0
       valid_lft 156sec preferred_lft 118sec
    inet6 2001:470:f026:503:d8c::3/128 scope global dynamic noprefixroute
       valid_lft 272sec preferred_lft 159sec
    inet6 2001:470:f026:503:dea6:32ff:fe41:435b/64 scope global dynamic mngtmpaddr noprefixroute
       valid_lft 86253sec preferred_lft 14253sec
    inet6 fe80::dea6:32ff:fe41:435b/64 scope link
       valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether dc:a6:32:41:43:5c brd ff:ff:ff:ff:ff:ff
    altname wlxdca63241435c

@sarcasticadmin

Copy link
Copy Markdown
Member

Running the following test to confirm nixos-vm tests passes:

nix run .#verify-scale-nixos-tests
...

@sarcasticadmin sarcasticadmin changed the title [REVIEW] building specific kea v6 configs [READY] building specific kea v6 configs Feb 13, 2026
@sarcasticadmin
sarcasticadmin merged commit f0924bd into socallinuxexpo:master Feb 13, 2026
2 checks passed
@owendelong

Copy link
Copy Markdown
Collaborator

Looks like this might make it into KEA-3.2. Not sure what the release schedule for 3.2 is or when work will start on it. Current dev branch seems to be 3.1.x with 3.0.2 current stable. IIRC, we are running something like 2.5.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

building specific v6 kea configs noc vlan dhcp doesn't work without expo building

3 participants