Assign subnets to multiple classes with substring match expressions

Michele Vetturi mvetturi at yahoo.it
Tue May 8 11:12:26 UTC 2007


Sorry, I was meaning vendor-class-identifier instead of
dhcp-client-identifier..... :)

Bye again



On 5/8/07, Michele Vetturi <mvetturi at yahoo.it> wrote:
> Good day all.
>
> I am a newbie of advanced DHCP configuration. So don't chastise me, please... :D
>
> I want to match clients using a standardization of the
> dhcp-client-identifier and classes.
>
> Ex:    "Internal;Prod_;BuildA;"
>          "Internal;QAEnv;BuildB;"
>
> So, I wish to distinguish internal systems assigning them to a class "Internal"
>
> class "Internal" {
>    match if (
>       ( substring ( option dhcp-client-identifier, 0, 9) = "Internal;" )
>    );
>
>    option ip-forwarding off;
> }
>
> Notebooks of customers will be so assigned to a different pool
> associated with a Guest VLAN.
>
> My idea, then, was categorize Internal machines differentiating them
> by the second field of the option dhcp-client-identifier, so...
>
> class "Production" {
>    match if (
>       ( substring ( option dhcp-client-identifier, 0, 9) = "Internal;" ) and
>       ( substring ( option dhcp-client-identifier, 10, 6) = "Prod_;" )
>    );
> }
>
> class "QA-Environment" {
>    match if (
>       ( substring ( option dhcp-client-identifier, 0, 9) = "Internal;" ) and
>       ( substring ( option dhcp-client-identifier, 10, 6) = "QAEnv;" )
>    );
> }
>
> May this work, in your opinion? Will the system be part of both
> classes? Could I write the following instead (or something similar)?
>
> class "QA-Environment" {
>    match if (
>       ( member of = "Internal;" ) and
>       ( substring ( option dhcp-client-identifier, 10, 6) = "QAEnv;" )
>    );
> }
>
> Last stupid question (sorry :) ... Is the syntax of my second
> substring expression correct? What does the last parameter mean - the
> length of the resulting string or the last char to include?
>
> Thank you very much for your response and sorry for my broken english.
> Great list!
>
> --
> Michele Vetturi
>


-- 
Michele Vetturi


More information about the dhcp-users mailing list