<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Aptos;
        panose-1:2 11 0 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Aptos",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:11.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1851483747;
        mso-list-template-ids:1993373710;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif">We’ve done this with CSV lease files. Stopped both servers, modified our configuration files, ran a script to update the subnet IDs in the lease files, and restarted the servers.
 Worked fine!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif">Norman<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif"><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span lang="SV" style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">From:
</span></b><span lang="SV" style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">Kea-users <kea-users-bounces@lists.isc.org> on behalf of Per von Zweigbergk via Kea-users <kea-users@lists.isc.org><br>
<b>Date: </b>Tuesday, October 14, 2025 at 7:15</span><span lang="SV" style="font-size:12.0pt;font-family:"Arial",sans-serif;color:black"> </span><span lang="SV" style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">AM<br>
<b>To: </b>kea-users@lists.isc.org <kea-users@lists.isc.org><br>
<b>Cc: </b>Per von Zweigbergk <per.von.zweigbergk@cag.se><br>
<b>Subject: </b>[Kea-users] Changing subnet ID<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="SV">Hello!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="SV"> <o:p></o:p></span></p>
<p class="MsoNormal">I am running kea in a 2-node HA cluster (hot-standby mode), with manually written JSON configuration and memfile lease backend.<span lang="SV"><o:p></o:p></span></p>
<p class="MsoNormal"> <span lang="SV"><o:p></o:p></span></p>
<p class="MsoNormal">We’d like to migrate to using <a href="https://github.com/francoismdj/netbox-kea-dhcp">
netbox-kea-dhcp</a> to generate DHCP configuration. As far as I can tell from reading the source code, the tool works by generating configuration based on subnet ID being equal to the prefix ID in Netbox. (A prefix in Netbox is an object representing an IP
 subnet, and has its own ID.)<span lang="SV"><o:p></o:p></span></p>
<p class="MsoNormal"> <span lang="SV"><o:p></o:p></span></p>
<p class="MsoNormal">This won’t work for us out of the box, because if we just blindly start creating subnet objects with prefix IDs that collide with our previous manually configured subnet IDs, the lease database will get confused. Therefore, as an intermediate
 step before implementing this sync, I would like to change the subnet IDs in my configuration, so the subnet IDs match up with the prefix IDs in Netbox.<span lang="SV"><o:p></o:p></span></p>
<p class="MsoNormal"> <span lang="SV"><o:p></o:p></span></p>
<p class="MsoNormal">However, if I just change this in the config, we’ll get this lease database confusion. Therefore, my idea is to:<span lang="SV"><o:p></o:p></span></p>
<p class="MsoNormal"> <span lang="SV"><o:p></o:p></span></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">In an outage window, stop both kea servers in the cluster to make sure the lease database isn’t being touched<span lang="SV"><o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">Change the JSON configuration to update the subnet IDs to the new desired subnet IDs, keeping note of the old ones<span lang="SV"><o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">Run some type of tool to change the subnet ID column of each rows to change from the old to new subnet ID (should be easy, it’s just a CSV file)<span lang="SV"><o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">Restart kea<span lang="SV"><o:p></o:p></span></li></ul>
<p class="MsoNormal"> <span lang="SV"><o:p></o:p></span></p>
<p class="MsoNormal">Before I go ahead and do this, I’d like some feedback from the community. Is there anything wrong with my approach? And is there an easier way of doing the same thing?<span lang="SV"><o:p></o:p></span></p>
<p class="MsoNormal"> <span lang="SV"><o:p></o:p></span></p>
<p class="MsoNormal">(One thing to consider might be to de-couple kea subnet IDs from the netbox prefix IDs, and instead use user-context to store the netbox ID and do the mapping that way, but that would likely be more work than just doing the one-time operation
 above.)<span lang="SV"><o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>