adm@rtr2:~$ show dhcpv6 server leases
IPv6 address MAC address State Last communication Lease expiration Remaining Pool Hostname Type DUID
------------------ ----------------- ------- ------------------------- ------------------------- ----------- ------ ---------- ------ -----------------------------------------------------
2001:0db8::::/64 00:15:5d:31:00:25 active 2026-05-19 13:22:48+00:00 2026-05-19 15:22:48+00:00 1:35:03 VLAN62 - IA_PD 00:04:b8:ec:53:72:7e:32:4e:5c:b0:db:02:fe:58:7b:c6:46
xantion-adm@rtr2:~$ clear dhcpv6-server lease
Possible completions:
<text> DHCPv6 server lease
adm@rtr2:~$ clear dhcpv6-server lease 2001:0db8::::/64
Lease not found on DHCPv6 server
adm@rtr2:~$ clear dhcpv6-server lease 00:15:5d:31:00:25
Lease not found on DHCPv6 server
adm@rtr2:~$ clear dhcpv6-server lease 00:04:b8:ec:53:72:7e:32:4e:5c:b0:db:02:fe:58:7b:c6:46
Lease not found on DHCPv6 server
In the example there, the following pool is defined: set service dhcpv6-server shared-network-name ‘PD-NET’ subnet 2001:db8::/64 range 1 start 2001:db8::100 set service dhcpv6-server shared-network-name ‘PD-NET’ subnet 2001:db8::/64 range 1 stop 2001:db8::199
Which means DHCP v6 will assign an address (not a subnet) between 2001:db8::100and 2001:db8::199.
So I expect “show dhcpv6 server leases” to show the address issued (like the table header says), not a subnet with a prefix.
It then compares the value of the “ip-address” element with whatever you typed.
As you can see in the API result, the ip address for a range is returned without prefix, which suggests the correct command is clear dhcpv6-server lease 2001:0db8::::
adm@rtr2:~$ show dhcpv6 server leases
IPv6 address MAC address State Last communication Lease expiration Remaining Pool Hostname Type DUID
2001:0db8::/64 00:15:5d:31:00:25 active 2026-05-21 08:14:40+00:00 2026-05-21 10:14:40+00:00 1:54:09 VLAN62 IA_PD 00:04:b8:ec:53:72:7e:32:4e:5c:b0:db:02:fe:58:7b:c6:46
adm@rtr2:~$ clear dhc
dhcp-server dhcpv6-server
adm@rtr2:~$ clear dhcpv6 lease 2001:0db8::
Failed to clear lease for “2001:0db8::”
At least we’ve now found the correct value for the clear command.
The code now calls the lease-del() API function. The kea docs say:
The IPv6 address leases are deleted the same way, but using lease6-del. The IPv6 prefix leases are also deleted using lease6-del, but with some extra steps. The prefix should be referenced by its address and prefix length should be ignored. For example, to delete 2001:db8:1::/48, the following command can be used. The subnet-id parameter is optional.
{
“command”: “lease6-del”,
“arguments”: {
“ip-address”: “2001:db8:1::”,
“type”: “IA_PD”,
“subnet-id”: 1
}
}
If I look in the code, it only passes the “ip-address” field, so the check for a PD address, and if detected adding the additional arguments to the API call, is missing.