<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p style="line-height: 100%; margin-bottom: 0cm">
Dear list,</p>
<p style="line-height: 100%; margin-bottom: 0cm">we are trying to
match multiple combinations of Agent Remote-ID and Circuit-ID for
host reservations with the flex_id hook.</p>
<p style="line-height: 100%; margin-bottom: 0cm">This is meant to
match end customers over a whole bunch of solutions and hardware
platforms where we can’t streamline the available DHCP options to
one common expression.</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br>
</p>
<p>Possible Remote-ID/Circuit-ID combinations:</p>
<p> 1)<br>
Remote-ID: 58:ac:78:cf:3a:c0<br>
Circuit-ID:
01:9f:02:17<br>
Concatenated String for Host Reservations:
58:ac:78:cf:3a:c0:01:9f:02:17<br>
"identifier-expression":
"concat(relay4[2].hex,relay4[1].hex)" </p>
<p>2)<br>
Remote-ID: NAME_DEU.LINED.0000012345<br>
Circuit-ID:
olt1.lhn-004:1-1-01-09-16.414<br>
Concateanted String for Host
Reservations: NAME_DEU.LINED.0000012345-414<br>
"identifier-expression":
"concat(concat(relay4[2].hex,'-'), substring(relay4[1].hex, -3,
3))"</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br>
</p>
<p style="line-height: 100%; margin-bottom: 0cm">We then tried
several options to get that working with the
„identifier-expression“
parameter:</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br>
</p>
<p style="line-height: 100%; margin-bottom: 0cm">Using „or“ to
differentiate between the two possibilities according to
<a
href="https://kea.readthedocs.io/en/kea-3.0.1/arm/classify.html#classification-using-expressions"
class="moz-txt-link-freetext">https://kea.readthedocs.io/en/kea-3.0.1/arm/classify.html#classification-using-expressions</a></p>
<p style="line-height: 100%; margin-bottom: 0cm">"identifier-expression":
"concat(concat(relay4[2].hex,'-'), substring(relay4[1].hex, -3,
3)) or concat(relay4[2].hex,relay4[1].hex)"</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br>
</p>
<p style="line-height: 100%; margin-bottom: 0cm">by specifying
multiple expression in separate lines:</p>
<p style="line-height: 100%; margin-bottom: 0cm">"identifier-expression":
"concat(concat(relay4[2].hex,'-'), substring(relay4[1].hex, -3,
3))“,</p>
<p style="line-height: 100%; margin-bottom: 0cm">"identifier-expression":
"concat(relay4[2].hex,relay4[1].hex)"</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br>
</p>
<p style="line-height: 100%; margin-bottom: 0cm">and then by adding
the hook library two times:</p>
<p style="line-height: 100%; margin-bottom: 0cm">{</p>
<p style="line-height: 100%; margin-bottom: 0cm"> "library":
"/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_flex_id.so",</p>
<p style="line-height: 100%; margin-bottom: 0cm"> "parameters":
{</p>
<p style="line-height: 100%; margin-bottom: 0cm">
"identifier-expression":
"concat(relay4[2].hex,relay4[1].hex)"</p>
<p style="line-height: 100%; margin-bottom: 0cm"> }</p>
<p style="line-height: 100%; margin-bottom: 0cm">},</p>
<p style="line-height: 100%; margin-bottom: 0cm">{</p>
<p style="line-height: 100%; margin-bottom: 0cm"> "library":
"/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_flex_id.so",</p>
<p style="line-height: 100%; margin-bottom: 0cm"> "parameters":
{</p>
<p style="line-height: 100%; margin-bottom: 0cm">
"identifier-expression": "concat(concat(relay4[2].hex,'-'),
substring(relay4[1].hex, -3, 3))“</p>
<p style="line-height: 100%; margin-bottom: 0cm"> }</p>
<p style="line-height: 100%; margin-bottom: 0cm">},</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br>
</p>
<p style="line-height: 100%; margin-bottom: 0cm">For the last two
possible solutions kea only used the last definition of the hook
or
the „identifier-expression" parameter. And for the first one
it simply doesn’t match.</p>
<p style="line-height: 100%; margin-bottom: 0cm">Are there any ways
to specify multiple expressions to match with the flex_id hook?</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br>
</p>
<p style="line-height: 100%; margin-bottom: 0cm">Thanks in advance</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br>
</p>
<p style="line-height: 100%; margin-bottom: 0cm">BR</p>
<p style="line-height: 100%; margin-bottom: 0cm">Andreas</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br>
</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br>
</p>
</body>
</html>