[Kea-users] Globally cut circuit id option

perl-list perl-list at network1.net
Wed Jan 26 13:22:25 UTC 2022


You can use substring to do that.  Here is an example of it in use:

match if substring (option dhcp-client-identifier, 1, 3) = "RAS";

see also `man dhcp-eval`

substring (data-expr, offset, length)

         The substring operator evaluates the data expression and returns the substring of the result of that evaluation that starts offset bytes from
         the  beginning,  continuing  for  length  bytes.  Offset and length are both numeric expressions.  If data-expr, offset or length evaluate to
         null, then the result is also null.  If offset is greater than or equal to the length of the evaluated data, then a zero-length  data  string
         is  returned.  If length is greater then the remaining length of the evaluated data after offset, then a data string containing all data from
         offset to the end of the evaluated data is returned.

----- Original Message -----
> From: "egor grijuc" <egor.grijuc at orange.com>
> To: "kea-users" <kea-users at lists.isc.org>
> Sent: Wednesday, January 26, 2022 4:40:26 AM
> Subject: [Kea-users] Globally cut circuit id option

> Hello.

> We faced a problem with some old equipment.

> We use host database for host reservation

> We make reservation via API.

> In table “host” we use dhcp_identifier_type =2 to match circuit id.

> It works but we have some old equipment that adds some kind of prefix to circuit
> id option.

> For example, on switch circuit id was configured to “CHN540579” but on packet
> capture we see that switch adds some “prefix”

> Part from capture:

> Agent-Information Option 82, length 23:

> Circuit-ID SubOption 1, length 11: ^A^ICHN540579

> Question: is it possible to globally cut circuit id optin from end to 9
> characters?
> _________________________________________________________________________________________________________________________

> Ce message et ses pieces jointes peuvent contenir des informations
> confidentielles ou privilegiees et ne doivent donc
> pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce
> message par erreur, veuillez le signaler
> a l'expediteur et le detruire ainsi que les pieces jointes. Les messages
> electroniques etant susceptibles d'alteration,
> Orange decline toute responsabilite si ce message a ete altere, deforme ou
> falsifie. Merci.

> This message and its attachments may contain confidential or privileged
> information that may be protected by law;
> they should not be distributed, used or copied without authorisation.
> If you have received this email in error, please notify the sender and delete
> this message and its attachments.
> As emails may be altered, Orange is not liable for messages that have been
> modified, changed or falsified.
> Thank you.

> _______________________________________________
> ISC funds the development of this software with paid support subscriptions.
> Contact us at https://www.isc.org/contact/ for more information.

> To unsubscribe visit 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