[Kea-users] able to DROP both Windows 8.x and Windows 7 clients?

Darren Ankney darren.ankney at gmail.com
Tue Sep 5 11:04:17 UTC 2023


Hi,

You can combine the substring in the test line using an "or" to match
both cases simultaneously:

{
    "Dhcp4": {
        "interfaces-config": {
            "interfaces": [
                "ens256"
            ]
        },
        "lease-database": {
            "type": "memfile",
            "persist": false
        },
        "client-classes": [
            {
                "name": "DROP",
                "comment": "Windows7-8",
                "test": "substring(option[55].hex,0,12) ==
0x010f03062c2e2f1f2179f92b or substring(option[55].hex,0,13) ==
0x010f03062c2e2f1f2179f9fc2b"
            }
        ],
        "calculate-tee-times": true,
        "loggers": [
            {
                "name": "kea-dhcp4",
                "severity": "INFO",
                "output_options": [
                    {
                        "output": "stdout"
                    }
                ]
            }
        ]
    }
}

Thank you,

Darren Ankney

On Tue, Sep 5, 2023 at 6:23 AM wildgrass <wildgrass at gmail.com> wrote:
>
> Dear all,
>
> I'm using kea 2.5.
>
> Showing config snippets for brevity. If I have just one DROP class
> definition with one test condition it works fine.
>
> My aim : to DROP both Windows 8.x and Windows 7 clients
>
> Tried the following with no joy. Can anyone tell me if my aim is
> achievable in kea 2.5 and if so, what am I missing. I searched through
> the ARM but have no luck finding something that has been helpful so
> far.
>
>
>     "client-classes": [
>       {
>         "name": "DROP",
>         "comment": "Windows7".
>         "test": "substring(option[55].hex,0,12) == 0x010f03062c2e2f1f2179f92b"
>       },
>       {
>         "name": "DROP",
>         "comment": "Windows8",
>         "test": "substring(option[55].hex,0,13) == 0x010f03062c2e2f1f2179f9fc2b"
>       },
>
> Error messsage:
> Can't add class: Client Class: DROP has already been defined
> (/etc/kea/kea-dhcp4.conf:9:7)
>
> -------------------------------------------------------
>
>       {
>         "name": "DROP",
>         "comment": "Windows7and8",
>         "test": "substring(option[55].hex,0,12) ==
> 0x010f03062c2e2f1f2179f92b" or "substring(option[55].hex,0,13) ==
> 0x010f03062c2e2f1f2179f9fc2b"
>       },
>
> Error message:
> Error using file '/etc/kea/kea-dhcp4.conf':
> /etc/kea/kea-dhcp4.conf:7.80: Invalid character: o
>
> -------------------------------------------------------
>
>       {
>         "name": "DROP",
>         "comment": "Windows7and8",
>         "test": ("substring(option[55].hex,0,12) ==
> 0x010f03062c2e2f1f2179f92b" or "substring(option[55].hex,0,13) ==
> 0x010f03062c2e2f1f2179f9fc2b")
>       },
>
> Error message:
> Error using file '/etc/kea/kea-dhcp4.conf':
> /etc/kea/kea-dhcp4.conf:7.17: Invalid character: (
> --
> 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