SV: Matching in a class based upon a variable

Þórhallur Hálfdánarson tolli at tol.li
Fri Oct 20 11:05:06 UTC 2006


Hi,

-*- Lars Jacobsen <lars-jacobsen at newmail.dk> [ 2006-10-19 18:52 ]:
> 
> 
> > Þórhallur Hálfdánarson 19. oktober 2006 16:05
> >
> > # Group 1 declaration and hosts belonging to the group
> > group {
> >  set AccessGroup = "Group1"
> >  host Host1 { hardware ethernet 00:11:22:33:77:66:55:44; set ExpCID =
> > "A/B/C"; }
> > }
> > 
> 
> Here you set the variable "ExpCID" to the text string "A/B/C". This means A,
> B and C are not values that change, but part of a constant string.
> And for the match 

Yes, that's what I want.  I only want Host1 to be recognized when the CID of the request matches the string "A/B/C".

> >  match if AccessGroup = "Group1" and option agent.circuit-id = ExpCID;
> > }
> 
> to be true you need to be sure that the CID is equal to the text string
> "A/B/C".
> 
> 
> If A, B and C are variables that can have different values, then you need a
> different "group match" statement.

My problem is, that when the conditions are fulfilled, the match if line does not work correctly.

When I use the following statement, however, it works correctly:
match if "Group1" = "Group1" and option agent.circuit-id = "A/B/C";


Br,
Tolli



More information about the dhcp-users mailing list