[Kea-users] Need help assigning subnets by class with host reservations

Maxime Lareo maxime.lareo at infomaniak.com
Wed Nov 9 14:18:51 UTC 2016


Hi,

Have you tried the "interface' option into your subnet ?

Try something like this :

------- cur here ---------
"client-classes": [
  {
    "name": "test",
    "test": "(pkt4.mac == 0x001122334455)"
  }
 ],

"subnet4": [
{
  "client-class": "test",
  "interface": "eth0",
  "subnet": "192.168.1.0/24",
  "pools": [ { "pool": "192.168.1.10 - 192.168.1.20" } ]
}
------- cur here ---------

Use your network interface name instead of eth0 in the interface option
of course !

Because if the subnet you tried to manage is not the same as your DHCP
server ip subnet, KEA will not consider this subnet as a local subnet
and will not try to select this subnet.

Hope that helps.

On 09/11/2016 10:20, mrobti at insiberia.net wrote:
> On 2016-11-08 15:44, mrobti at insiberia.net wrote:
>> I want to assign a client-class using hwaddr, from MySQL backend, and
>> restrict a subnet for that client-class. In other words, only allow
>> clients with known MAC addresses to use the subnet they are trying to
>> connect to.
>>
>> DB hosts table has an entry for the client:
>> dhcp4_subnet_id = 1
>> dhcp_identifier_type = 0
>> dhcp_identifier = UNHEX(REPLACE('aa:bb:cc:dd:ee:ff', ':', ''))
>> hostname = test.local
>> dhcp4_client_classes = test_class
>>
>> Config file has:
>> "client-classes": [ {
>>   "name": "test_class"
>> } ],
>> "subnet4": [ {
>>   "id": 1,
>>   "subnet": "192.168.1.0/24",
>>   "pools": [ { "pool": "192.168.1.10 - 192.168.1.20" } ],
>>   "client-class": "test_class"
>> } ],
>>
>> But Kea says (debug level 50):
>> : client packet has been assigned to the following class(es):
>> VENDOR_CLASS_MSFT 5.0
>> : failed to select subnet for the client
>> : no suitable subnet configured for a direct client
>>
>> It works if I remove "client-class" from the subnet definition, so
>> something is not synchronizing the class somewhere.
>>
>> Could it be a problem that the DB hosts entry has no ipv4_address
>> listed? (that column is NULL)  I don't have any other ideas.
> 
> I've found this in the logs:
> 
> : HOSTS_CFG_GET_ALL_IDENTIFIER get all hosts with reservations using
> identifier: hwaddr=aa:bb:cc:dd:ee:ff
> : HOSTS_CFG_GET_ALL_IDENTIFIER_COUNT using identifier
> hwaddr=aa:bb:cc:dd:ee:ff, found 0 host(s)
> 
> Why would this happen? Yes, I double checked the MAC address. I enabled
> MySQL logging, and I can't match up timestamps exactly, but I do find a
> query:
> 
> SELECT host_id, dhcp_identifier, dhcp_identifier_type, dhcp4_subnet_id,
> dhcp6_subnet_id, ipv4_address, hostname, dhcp4_client_classes,
> dhcp6_client_classes FROM hosts WHERE dhcp4_subnet_id = ? AND
> dhcp_identifier_type = ?    AND dhcp_identifier = ?
> 
> I don't know if it's possible to see the executed version of this
> prepared query(?). Is it possible that the value Kea is placing in the
> query is not the correct binary string?
> _______________________________________________
> 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: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20161109/5dba4f5b/attachment.bin>


More information about the Kea-users mailing list