I did also try with some dummy option like:<br>if substring (option vendor-class-identifier, 0, 4) = "MSFT" {<br>option nds-context "1";<br>} elsif substring (option dhcp-option-overload, 0, 4) = "MSFT" {<br>

option nds-context "2";<br>} elsif not exists dhcp-option-overload {<br>option nds-context "21";<br>}<br>and then using <br>class "Crule1" {<br>match if config-option nds-context = "1";<br>

}<br>And it didn't work!<br><br><div class="gmail_quote">On Tue, Oct 20, 2009 at 5:41 PM, Ashmath Khan <span dir="ltr"><<a href="mailto:hashmat.email@gmail.com">hashmat.email@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><br>
rule 1: If its red, use the red pool, else<br>
rule 2: If its fat, use the fat pool, else<br>
rule 3: If its tall, use the tall pool, else<br>
rule 4: Use the cold pool<br>
<br></div>
You'd express this in terms of :<br>
If it's Red, then set kind:=red<br>
Elseif it's fat, then set kind:=fat<br>
Elseif it's tall, then set kind:=tall<br>
Else, set kind:=cold<br>
<br>
Then you'd have classes like this :<br>
Class "red" { match if kind="red" ; ...}<br>
Class "fat" { match if kind="fat" ; ...}<br>
Class "tall" { match if kind="tall" ; ...}<br>
Class "cold" { match if kind="cold" ; ...}<br>
<br>
You now have four classes that are mutually exclusive and so you just have to "allow member of ..." a single class in each pool.<br>
<br>
It's not something I've ever tried. I'd hope that the expression and conditionals would be evaluated before evaluating the class memberships - if not then it can't ever hope to work.<div><br></div>
</blockquote></div><div>This seems to be a good idea. I tried and it didn't work. I tried many possibilities with having quotes, removing quotes etc. The dhcpd didn't respond with dhcp offer which means it didn't hit any class. Here is the last version i tried:<div class="im">

<br>
subnet 192.168.1.0 netmask 255.255.255.0 {<br><br></div><div class="im">default-lease-time 86500;<br>max-lease-time 86500;<br></div><div class="im">option routers 192.168.1.254;<br><br></div>set kind = 0;<br>    <br>if substring (option vendor-class-identifier, 0, 4) = "MSFT" {<br>


set kind = 1;<br>} elsif substring (option dhcp-option-overload, 0, 4) = "MSFT" {<br>set kind = 2;<br>} elsif not exists dhcp-option-overload {<br>set kind = 21;<br>}<br><br><br>class "Crule1" {<br>match if kind = "1";<div class="im">

<br>
}<br><br>pool {<br>option router-discovery off;<br></div>option domain-name-servers 192.168.1.254, 192.168.1.202;<br>range 192.168.1.87;<br>allow members of "Crule1";<br>}<br><br>class "Crule2" {<br>match if kind = "2";<div class="im">

<br>
}<br><br>pool {<br>option router-discovery off;<br>option domain-name-servers 192.168.1.111;<br></div>range 192.168.1.117;<br>allow members of "Crule2";<br>}<br><br>class "Crule2A" {<br>match if kind = "0";<br>


}<br><br>pool {<div class="im"><br>option router-discovery on;<br>option domain-name-servers 192.168.1.222;<br>option boot-size 512;<br></div>range 192.168.1.237;<br>allow members of "Crule2A";<br>}<br><br><br>

}<br><br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div class="im">
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



Finally - what are you actually trying to achieve ?<br>
</blockquote></blockquote></div>My objective is to classify clients! To allow some clients certain pools, to block some clients etc.The application could be a router running dhcp server for some organisation.<br></div></blockquote>


</div>
</blockquote></div><br>