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

s k sat98 at hotmail.com
Mon Mar 13 05:22:23 UTC 2023


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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20230313/9ed38cb8/attachment.htm>


More information about the Kea-users mailing list