[Kea-users] FW: Subnet mask selection

kea at jack.fr.eu.org kea at jack.fr.eu.org
Thu Jun 8 08:48:10 UTC 2017


FYI, I fixed my issue using a hook (override subnet4_select)

On 26/05/2017 10:02, kea at jack.fr.eu.org wrote:
> Hi,
> 
> Thanks for the answer,
> 
> We such configuration, any host reservation for subnet_id 1002 will get
> a "failed to allocate an IPv4 address after 0 attempt(s)"
> 
> Here the configuration:
> "interfaces-config": {
>     "dhcp-socket-type": "raw",
>     "interfaces": [
>         "*"
>     ]
> },
> "subnet4": [
>     {
>         "id": 1024,
>         "subnet": "10.0.0.0/24"
>     },
>     {
>         "id": 1025,
>         "subnet": "12.0.0.0/25"
>     }
> ],
> 
> My host reservation from SQL:
> MariaDB [kea]> select dhcp4_subnet_id from hosts where dhcp_identifier =
> unhex('aa0000f14782');
> +-----------------+
> | dhcp4_subnet_id |
> +-----------------+
> |            1024 |
> +-----------------+
> 
> This works.
> 
> If I swap the host reservation:
> MariaDB [kea]> select dhcp4_subnet_id from hosts where dhcp_identifier =
> unhex('aa0000f14782');
> +-----------------+
> | dhcp4_subnet_id |
> +-----------------+
> |            1025 |
> +-----------------+
> 
> 2017-05-26 10:01:42.654 WARN  [kea-dhcp4.alloc-engine/15173]
> ALLOC_ENGINE_V4_ALLOC_FAIL [hwtype=1 aa:00:00:f1:47:82], cid=[no info],
> tid=0xc08be943: failed to allocate an IPv4 address after 0 attempt(s)
> 
> Best regards,
> Jack
> 
> On 23/05/2017 22:02, Wessel, Sebastian wrote:
>> Hi (what is your name?),
>>
>> i'm wondering why you are writing your interface to each of the subnets.
>> Where did you get that configuration from?
>>
>> In our config file the interface is defined once at the beginning like this:
>>
>>     "interfaces-config" :
>>     {
>>       "dhcp-socket-type" : "udp",
>>       "interfaces" :
>>       [
>>         "ens160"
>>       ]
>>     },
>>
>> See http://kea.isc.org/docs/kea-guide.html#dhcp4-interface-configuration
>> (the udp is because of the relayed traffic)
>>
>> The subnets look like this:
>>
>>     "subnet4" :
>>     [
>>       {
>>         "subnet": "10.1.0.0/28",
>>         "id"    : 1001,
>>         "option-data": [ { "name": "routers", "data": "10.0.0.1" } ],
>>         "pools" : [ { "pool" : "10.1.0.2 - 10.1.0.10" } ]
>>       },
>>       {
>>         "subnet": "10.2.0.0/28",
>>         "id"    : 1002,
>>         "option-data": [ { "name": "routers", "data": "10.2.0.1" } ],
>>         "pools" : [ { "pool" : "10.2.0.2 - 10.2.0.10" } ]
>>       },
>>
>> So there is no need to set the subnet mask.
>>
>>
>>
>>
>>
>>
>>
>> Mit freundlichen Grüßen / With kind regards
>>
>> Sebastian Wessel
>> Specialist IT Systems
>> _________________________________________________________________________________________________________________________
>>
>> Sebastian Wessel
>> Takko Holding GmbH
>> Alfred-Krupp-Straße 21, 48291 Telgte, Germany
>> Phone +49 2504 923 865 Mobile +49 152 21811579 Fax +49 2504 923 797
>> www.takko.com
>> _________________________________________________________________________________________________________________________
>>
>> Bitte prüfen Sie der Umwelt zuliebe, ob der Ausdruck dieser Mail erforderlich ist.
>>
>> Geschäftsführer: Ulrich Eickmann, Thomas Helmreich, Alexander Mattschull, Arnold Mattschull
>> Amtsgericht Münster HRB Nr. 8939,
>> Ust.-Id. Nr. DE209094382-----Original Message-----
>> From: Kea-users [mailto:kea-users-bounces at lists.isc.org] On Behalf Of kea at jack.fr.eu.org
>> Sent: Tuesday, May 23, 2017 2:00 PM
>> To: kea-users at lists.isc.org
>> Subject: [Kea-users] Subnet mask selection
>>
>> Hi,
>>
>> tl;dr: can I set option 1 (subnet mask) on a per-host basis ?
>>
>> I am using Kea dhcp4 1.1.0
>> I have the following setup:
>> - a single interface (eth0)
>> - clients are directly connected (no relay)
>> - two subnets (a /24, a /25), each defined with a specific subnet_id :
>> {'id': 1024, 'subnet': '10.0.0.0/24'} and {'id': 1025, 'subnet':
>> 10.1.0.0/25'}
>> - a sql database which contains, for all trusted hosts, the allocated IP address, the corresponding subnet_id, and an option 3 (routers)
>>
>>
>> Sadly, as-is, I cannot make it works
>> If a bind each subnet to the interface eth0, it works for the first defined subnet, not for the other Config sample:
>> {
>>     "id": 1024,
>>     "interface": "eth0",
>>     "subnet": "10.0.0.0/24"
>> },
>> {
>>     "id": 1025,
>>     "interface": "eth0",
>>     "subnet": "10.1.0.0/25"
>> }
>>
>> -> OK for hosts in 1024, "failed to advertise a lease" for hosts in 1025
>>
>> If I remove the interface binding, same behavior:
>> -> OK for hosts in 1024, "failed to advertise a lease" for hosts in 1025
>>
>> If I put all hosts in 1024, and add an option 1 (subnet mask) in the configuration, or inside the sql database : all host gets a /24 (aka, option 1 is ignored)
>>
>> Is there a way to solve my case ?
>>
>> Best regards,
>> _______________________________________________
>> Kea-users mailing list
>> Kea-users at lists.isc.org
>> 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