[Kea-users] Subnet_cmds Subnet ID gets reset on service restart

Darren Ankney darren.ankney at gmail.com
Mon Mar 13 09:49:29 UTC 2023


Hello,

How are you having the subnets persist across restarts?  Are you
executing a config-write?  What order are the subnets ending up in on
the drive after that?  Do they have IDs listed?  If not, I'm sure it
will generate them in the order they are found in the configuration
file.

Also, you are running an older development version.  I would suggest
you start using the latest current stable version of 2.2.0.

On Mon, Mar 13, 2023 at 1:22 AM s k <sat98 at hotmail.com> wrote:
>
> Hi
>
>   I am using  subnet6-add command from subnet6 hook library  for adding subnets . And i am not  assigning  subnet id and let the system maintain auto generated value based on the notes below . it works well until we restart the service , on restart subnet-id gets reset and starts from 1 again which fails due to duplicate ID . i am using version 2.1.6.  can you shed some light ?
>
>
>
> {
>     "command": "subnet6-add",
>     "arguments": {
>         "subnet6": [ {
>             "subnet": "2001:db8:1::/64",
>             ...
>         } ]
>     }
> }
>
> Notes
>
> It is recommended, but not mandatory, to specify the subnet ID. If not specified, Kea will try to assign the next subnet-id value.
>
> This automatic ID value generator is simple; it returns a previously automatically assigned value, increased by 1. This works well, unless a subnet is manually created with a value bigger than one previously used. For example, if subnet4-add is called five times, each without an ID, Kea will assign IDs 1, 2, 3, 4, and 5 and it will work just fine. However, if subnet4-add is called five times, with the first subnet having the subnet-id of value 3 and the remaining ones having no subnet-id, the operation will fail. The first command (with the explicit value) will use subnet-id 3; the second command will create a subnet with id of 1; the third will use a value of 2; and finally the fourth will have the subnet-id value auto-generated as 3. However, since there is already a subnet with that ID, the process will fail.
>
> The general recommendation is either never use explicit values, so the auto-generated values will always work; or always use explicit values, so the auto-generation is never used. The two approaches can be mixed only if the administrator understands how internal automatic subnet-id generation works in Kea.
>
>
> --
> 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
> Kea-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/kea-users


More information about the Kea-users mailing list