[Kea-users] Adding a lease via the API

Munroe Sollog mus3 at lehigh.edu
Thu Nov 30 15:57:12 UTC 2017


Maybe my 'service' is wrong?  lease4-add is implemented via a hook library

 "hooks-libraries": [
            // Hook libraries list may contain more than one library.
            {
                // The only necessary parameter is the library filename.
                "library": "/usr/local/lib/hooks/libdhcp_lease_cmds.so"
                // Some libraries may support parameters. Make sure you
                // type this section carefully, as the CA does not validate
                // it (because the format is library specific).
            }
        ]


On Thu, Nov 30, 2017 at 9:21 AM, Munroe Sollog <mus3 at lehigh.edu> wrote:

> I added a dummy interface on a dead-end subnet and enabled a pool for that
> subnet, still the same result.
>
> On Thu, Nov 30, 2017 at 9:07 AM, Munroe Sollog <mus3 at lehigh.edu> wrote:
>
>> I don't want to add a pool because I really don't want it handing out any
>> addresses at the moment.
>>
>> On Thu, Nov 30, 2017 at 9:06 AM, Zayer, Sebastian <
>> Sebastian.Zayer at takko.de> wrote:
>>
>>> Hi Munroe,
>>>
>>>
>>>
>>> to me it seems that the subnet is not working without any possible IPs
>>> in it’s pool.
>>>
>>> Did you already try that with some IPs in “pools”: [], ?
>>>
>>>
>>>
>>>
>>>
>>> With kind regards
>>>
>>>
>>>
>>> Sebastian
>>>
>>>
>>>
>>>
>>>
>>> *From:* Kea-users [mailto:kea-users-bounces at lists.isc.org] *On Behalf
>>> Of *Munroe Sollog
>>> *Sent:* Thursday, November 30, 2017 2:25 PM
>>> *To:* KEA-Users (kea-users at lists.isc.org) <kea-users at lists.isc.org>
>>> *Subject:* [Kea-users] Adding a lease via the API
>>>
>>>
>>>
>>> when I run:
>>>
>>>
>>>
>>> curl -X POST -H "Content-Type: application/json" -d '{ "command":
>>> "config-get", "service": ["dhcp4"] }' http://localhost:8000/
>>>
>>>
>>>
>>> I get:
>>>
>>>
>>>
>>> https://paste.debian.net/hidden/a5ae1e53/
>>>
>>>
>>>
>>> It seems to me that subnet-id=1 is configured.  However when I run:
>>>
>>>
>>>
>>> curl -X POST -H "Content-Type: application/json" -d '{ "command":
>>> "lease4-add","service": ["dhcp4"], "arguments": { "subnet-id": 1,
>>> "ip-address": "172.31.32.12", "hw-address": "1a:1b:1c:1d:1e:1f" } }'
>>> http://localhost:8000/
>>>
>>> [ { "result": 1, "text": "Invalid subnet-id: No IPv4 subnet with
>>> subnet-id=1 currently configured." } ]
>>>
>>>
>>>
>>> It says that subnet-id=1 doesn't exist?  What am I missing?
>>>
>>>
>>>
>>> --
>>>
>>> Munroe Sollog
>>>
>>> Senior Network Engineer
>>>
>>> munroe at lehigh.edu
>>>
>>> _______________________________________________
>>> Kea-users mailing list
>>> Kea-users at lists.isc.org
>>> https://lists.isc.org/mailman/listinfo/kea-users
>>>
>>>
>>
>>
>> --
>> Munroe Sollog
>> Senior Network Engineer
>> munroe at lehigh.edu
>>
>
>
>
> --
> Munroe Sollog
> Senior Network Engineer
> munroe at lehigh.edu
>



-- 
Munroe Sollog
Senior Network Engineer
munroe at lehigh.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20171130/dab55afd/attachment.htm>


More information about the Kea-users mailing list