[Kea-users] API call 'reservation-del' removes all v6 reservations.

Darren Ankney darren.ankney at gmail.com
Thu Mar 14 13:39:21 UTC 2024


Hi Andy,

I altered my configuration to remove the pool and add the ip of
ens256.  I was able to delete just one entry from the subnet as
before.  Perhaps provide your configuration and all of your API
commands and I could try using your (slightly modified to match
interface)  configuration?  Here are all of my API commands and
configuration (attached).

API commands executed like this:

$ cat reservation-get-all.json  | sudo socat UNIX:/tmp/socket6
-,ignoreeof | jq .
{
  "arguments": {
    "hosts": [
      {
        "client-classes": [],
        "duid": "1a:1b:1c:1d:1e:0a",
        "hostname": "",
        "ip-addresses": [
          "2001:db8::101"
        ],
        "option-data": [],
        "prefixes": [],
        "subnet-id": 1
      }
    ]
  },
  "result": 0,
  "text": "1 IPv6 host(s) found."
}


Thank you,
Darren Ankney

On Thu, Mar 14, 2024 at 6:22 AM Andrew Mulheirn
<andrew.mulheirn at vorboss.com> wrote:
>
> Hi Darren,
>
> Thanks for taking the time to test this.   I queried the API for the version and it says 2.4.1.
>
> I am using the same config lines as you show below, with two exceptions:
> On the interfaces, I have specified the address on eth1 that it is to listen on:
>
>     "interfaces-config": {
>         "interfaces": [ "eth1/2a00:e340:1100::32"]
>     },
>
>
> Also I have no pool defined because we want to have only static reservations.  I define the subnet.  In your example, it looks like the reservations are within the pool:
>
>          "subnet6": [
>             {
>                 "id": 1,
>                 "subnet": "2a00:e340:1102::/64",
>             }
>         ],
>
> I've trimmed various unnecessary things out of my config since the first post just to see if it made any difference, but no luck.  I might try reservations by DUID like you're doing to see if the behaviour changes (though we really need flex-id)
>
> Kind regards,
>
> Andy
>
>
> Andrew Mulheirn
>
> Senior Network Architect
>
> M: +44 (0) 74 3654 8126
>
> E: andrew.mulheirn at vorboss.com
>
> vorboss.com
>
>
> Not sure who currently provides your internet?
> Find out here and take our speed test.
>
>
> Disclaimer: This message is private and confidential. If you have received this message in error, please remove it from your system and notify us at sysadmin at vorboss.net or by telephone +44(0)20 3582 8500. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.   Privacy Note: Vorboss Limited may monitor email traffic data and also the content of email for the purposes of security. This email does not create or vary any contractual obligations between Vorboss Limited and the intended recipient.
>
> Vorboss Limited is a limited company registered in England and Wales. Registered number: 05678571. Registered Office: Vorboss Limited, Broadwalk House, 5 Appold Street, London, EC2A 2AG, UNITED KINGDOM.
>
>
> -----Original Message-----
> From: Darren Ankney <darren.ankney at gmail.com>
> Sent: Wednesday, March 13, 2024 9:25 PM
> To: Kea user's list <kea-users at lists.isc.org>
> Cc: Andrew Mulheirn <andrew.mulheirn at vorboss.com>
> Subject: Re: [Kea-users] API call 'reservation-del' removes all v6 reservations.
>
> Hi Andy,
>
> I was not able to reproduce this in 2.4.0.  What version were you using?
>
> I tested using this simple configuration:
>
> {
>   "Dhcp6": {
>     "control-socket": {
>       "socket-type": "unix",
>       "socket-name": "/tmp/socket6"
>     },
>     "interfaces-config": {
>       "interfaces": [
>         "ens256"
>       ]
>     },
>     "hosts-database": {
>       "type": "mysql",
>       "name": "kea",
>       "user": "kea",
>       "password": "kea",
>     },
>     "hooks-libraries": [
>       {
>         "library": "/usr/local/kea/2.4.0/lib/kea/hooks/libdhcp_host_cmds.so"
>       }
>     ],
>     "subnet6": [
>       {
>         "id": 1,
>         "subnet": "2001:db8::/64",
>         "pools": [
>           {
>             "pool": "2001:db8::aaaa-2001:db8::ffff"
>           }
>         ]
>       }
>     ]
>   }
> }
>
> I added a host reservation with this command:
>
> {
>   "command": "reservation-add",
>   "arguments": {
>     "reservation": {
>       "subnet-id": 1,
>       "duid": "1a:1b:1c:1d:1e:0a",
>       "ip-addresses": [ "2001:db8::101" ]
>     }
>   }
> }
>
> and then another
>
> {
>   "command": "reservation-add",
>   "arguments": {
>     "reservation": {
>       "subnet-id": 1,
>       "duid": "1a:1b:1c:1d:1e:0b",
>       "ip-addresses": [ "2001:db8::102" ]
>     }
>   }
> }
>
> I then had two reservations:
>
> {
>   "arguments": {
>     "hosts": [
>       {
>         "client-classes": [],
>         "duid": "1a:1b:1c:1d:1e:0a",
>         "hostname": "",
>         "ip-addresses": [
>           "2001:db8::101"
>         ],
>         "option-data": [],
>         "prefixes": [],
>         "subnet-id": 1
>       },
>       {
>         "client-classes": [],
>         "duid": "1a:1b:1c:1d:1e:0b",
>         "hostname": "",
>         "ip-addresses": [
>           "2001:db8::102"
>         ],
>         "option-data": [],
>         "prefixes": [],
>         "subnet-id": 1
>       }
>     ]
>   },
>   "result": 0,
>   "text": "2 IPv6 host(s) found."
> }
>
> I then deleted one of them by IP address:
>
> {
>     "command": "reservation-del",
>     "arguments": {
>         "subnet-id": 1,
>         "ip-address": "2001:db8::101"
>     }
> }
>
> and still had one reservation left:
>
> {
>   "arguments": {
>     "hosts": [
>       {
>         "client-classes": [],
>         "duid": "1a:1b:1c:1d:1e:0b",
>         "hostname": "",
>         "ip-addresses": [
>           "2001:db8::102"
>         ],
>         "option-data": [],
>         "prefixes": [],
>         "subnet-id": 1
>       }
>     ]
>   },
>   "result": 0,
>   "text": "1 IPv6 host(s) found."
> }
>
>
> On Mon, Mar 11, 2024 at 11:19 AM Andrew Mulheirn via Kea-users <kea-users at lists.isc.org> wrote:
> >
> > Hi all,
> >
> >
> >
> > I've noticed that using reservation-del against dhcp6 removes *all* reservations, while doing the same against dhcp4 behaves as expected and removes just the reservation that was specified.   I can't see why they behave differently.
> >
> >
> >
> > I have made reservations for 2a00:e340:1102::3 and 2a00:e340:1102::4 and can see them both when I do a reservation-get-all.
> >
> >
> >
> > Then I try to delete one of them.  Here is the call I am making for v6:
> >
> > {
> >
> >     "command": "reservation-del",
> >
> >     "service": ["dhcp6"],
> >
> >     "arguments": {
> >
> >         "subnet-id": 1,
> >
> >         "ip-address": "2a00:e340:1102::3"
> >
> >     }
> >
> > }
> >
> >
> >
> >
> >
> > When I look at the debug, I see messages just deleting this one reservation:
> >
> > INFO  COMMAND_RECEIVED Received command 'reservation-del'
> >
> > DEBUG HOOKS_CALLOUTS_BEGIN begin all callouts for hook
> > $reservation_del
> >
> > INFO  HOST_CMDS_RESERV_DEL reservation-del command called (parameters:
> > { "ip-address": "2a00:e340:1102::3", "subnet-id": 1 })
> >
> > INFO  HOST_CMDS_RESERV_DEL_SUCCESS reservation-del command success
> > (parameters: { "ip-address": "2a00:e340:1102::3", "subnet-id": 1 })
> >
> > DEBUG HOOKS_CALLOUT_CALLED hooks library with index 2 has called a
> > callout on hook $reservation_del that has address 0x7ff2f67cecb0
> > (callout duration: 5.882 ms)
> >
> > DEBUG HOOKS_CALLOUTS_COMPLETE completed callouts for hook
> > $reservation_del (total callouts duration: 5.882 ms)
> >
> >
> >
> >
> >
> > However, when I do another reservation-get-all, the table is now empty:
> >
> > [
> >
> >     {
> >
> >         "arguments": {
> >
> >             "hosts": []
> >
> >         },
> >
> >         "result": 3,
> >
> >         "text": "0 IPv6 host(s) found."
> >
> >     }
> >
> > ]
> >
> >
> >
> >
> >
> > As I say, v4 works fine.   Any pointers would be most welcome,
> >
> >
> >
> > Cheers,
> >
> > Andy
> >
> >
> > Andrew Mulheirn
> >
> > Senior Network Architect
> >
> > M: +44 (0) 74 3654 8126
> >
> > E: andrew.mulheirn at vorboss.com
> >
> > vorboss.com
> >
> >
> > Not sure who currently provides your internet?
> > Find out here and take our speed test.
> >
> >
> > Disclaimer: This message is private and confidential. If you have received this message in error, please remove it from your system and notify us at sysadmin at vorboss.net or by telephone +44(0)20 3582 8500. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.   Privacy Note: Vorboss Limited may monitor email traffic data and also the content of email for the purposes of security. This email does not create or vary any contractual obligations between Vorboss Limited and the intended recipient.
> >
> > Vorboss Limited is a limited company registered in England and Wales. Registered number: 05678571. Registered Office: Vorboss Limited, Broadwalk House, 5 Appold Street, London, EC2A 2AG, UNITED KINGDOM.
> >
> > --
> > 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reservation-del-v6-test.json
Type: application/json
Size: 662 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20240314/d0643415/attachment.json>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reservation-add.json
Type: application/json
Size: 183 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20240314/d0643415/attachment-0001.json>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reservation-del.json
Type: application/json
Size: 125 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20240314/d0643415/attachment-0002.json>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reservation-get-all.json
Type: application/json
Size: 91 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20240314/d0643415/attachment-0003.json>


More information about the Kea-users mailing list