My sample configuration is below:


"reservations": [
    {
       "flex-id": "'0x4857544394969D21d4:cf:f9:ff:dd:bb'",
       "ip-address": "10.215.160.101"
   }


 ],

   "hooks-libraries": [
       {
           "library": "/usr/local/lib/hooks/libdhcp_flex_id.so",
           "parameters": {
                "identifier-expression": "concat(relay4[1].hex, 
hexstring(pkt4.mac, ':'))"
            }
       }
   ],



Kea log is below:

INFO  [kea-dhcp4.flex-id-hooks/21510] FLEX_ID_EXPRESSION_EVALUATED Expression 
evaluated for packet to "4857544394969D21d4:cf:f9:ff:dd:bb" (size: 33)

INFO  [kea-dhcp4.leases/21510] DHCP4_LEASE_ALLOC [hwtype=1 d4:cf:f9:ff:dd:bb], 
cid=[01:d4:cf:f9:ff:dd:bb], tid=0x5545542e: lease 10.215.160.50 has been 
allocated

If reservation works correctly, the host should have address 10.215.160.101.
But it's not reserved, but getting lease from pool.
what am I missing here, pls correct me.

BR,

________________________________
From: agiimaa.b
Sent: Thursday, November 21, 2019 10:26 AM
To: [email protected]
Subject: using flex_id for combined reservation identifiers


Hello,


I'm trying to identify and reserve a host by combination of "mac address AND 
circuit id" with no luck.

How should I express it? Any reply would be appreciated, Thank you


MAC address: e8:37:7a:00:00:00

Circuit ID: 4857544394969D21


...

  "reservations": [

     {
        "flex-id": "0x4857544394969D21 0xe8377a000000",
        "ip-address": "10.215.160.101"
    } ],
...

   "hooks-libraries": [
        {
            "library": "/usr/local/lib/hooks/libdhcp_flex_id.so",
            "parameters": {
                //"identifier-expression": "concat(relay4[1].hex, 
substring(pkt4.mac, ':'))",
                "identifier-expression": "concat(relay4[1].hex, 
hexstring(pkt4.mac, ':'))",
                "replace-client-id": "false"
            }
        }
    ],


The information transmitted, including attachments, is intended only for the 
person(s) or entity to which it is addressed and may contain confidential 
and/or privileged material. Any review, re-transmission, 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. If you received this 
in error, please contact the sender and destroy any copies of this information.

-------------------------------------------------------------------------------------------------------------------------------------

Энэхүү и-мэйл болон хавсралт дахь мэдээлэл нь тодорхой хүнд хаяглагдсан бөгөөд 
нууцлалтай мэдээлэл агуулж байж болзошгүй тул бусдад дамжуулах, олон нийтэд 
тараах, өөр бусад зорилгоор ашиглахыг хориглоно. Хэрэв та уг и-мэйлийг 
санамсаргүй байдлаар хүлээн авсан бол и-мэйл илгээгчид мэдэгдэж, хуулбар баримт 
үлдээлгүй устгана уу.
_______________________________________________
Kea-users mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/kea-users

Reply via email to