Conditional evaluation question.

Stewart Walters stw at
Wed Apr 7 09:00:12 UTC 2010


I'm trying to work out what's the best way to configure dhcpd using some 
form of evaluation to send different vendor encapsulated options to our 
Sunray thin clients.

We currently have a server which provides a Production Sunray desktop 
environment to our userbase.

If it helps - here is an example of how to set up dhcpd for passing a 
single Sunray environment to 100% of Sunray clients 

As shown in that example, 100% of Sunray clients can be evaluated via 
the vendor-class-identifier = "SUNW.NewT.SUNW"; statement.

But I want to create a Test Sunray desktop evironment and move 10% of 
our users (determined by MAC address) to a different Testing 
environment.  If the conditional evaluation doesn't qualify in the 10%, 
I want the remaining 90% of our Sunray clients to receive the Production 
environment options.

I've been reading through dhcp-options(5), dhcpd.conf(5) and 
dhcp-eval(5), as well as several online posts relating to this.

But I'm a little perplexed about what the best approach for this kind of 
setup would be.

Would it be better to go, for example:

--- snip ---
class "TestingSunray" {
  match <some match criteria here>
  <insert Testing vendor encapsulated options here>

subclass "TestingSunray" 1:xx:xx:xx:xx:xx:xx;
subclass "TestingSunray" 1:yy:yy:yy:yy:yy:yy;
subclass "TestingSunray" 1:zz:zz:zz:zz:zz:zz;

class "ProductionSunray" {
  match if vendor-class-identifier = "SUNW.NewT.SUNW";
  <insert Production vendor encapsulated options here>
--- snip ---

Does dhcpd even process class matching in the order in which it's listed 
in dhcpd.conf?  Am I guaranteed in that configuration that a Test Sunray 
wont be classified as Production just because the Testing class is 
defined first?

Or is it better to do this?

--- snip ---
class "Sunray" {
  match if substring(hardware,1,3)=xx:xx:xx:xx:xx:xx or
  elsif substring(hardware,1,3)=yy:yy:yy:yy:yy:yy or
  elsif substring(hardware,1,3)=zz:zz:zz:zz:zz:zz;
  <insert Testing vendor encapsulated options here>
    match if option vendor-class-identifier = "SUNW.NewT.SUNW";
    <insert Production vendor encapsulated options here>
--- snip ---
(I probably made a bunch of minor syntax errors above, but I can work 
those out later)

Or should I be doing some complicated if and else statements as shown in 
the example at

As you can see, I'm not exactly sure to which way might be best for me.  
Let me say thanks in advance for any assistance you can provide on the 

Kind Regards,


More information about the dhcp-users mailing list