SV: Class selection ekspression
lj at sydfynsel.dk
Wed Mar 15 12:26:56 UTC 2006
I read the man pages several times without luck...
But now i found out how to use AN/OR:
match if (subbstring (option agent.circuit-id,5,2) = 01)OR(subbstring (option agent.circuit-id,5,2) = 16) ;
Now how do I change the equal signs to greather than and less than (> <) so that I don't have to make 16 OR´s
And yes I would like to use subclasses (or the spawn with function) Just cant figure out how....
Now I tried the:
subclass "Class1" agent.circuit-id;
That didn't work. So I tried this instead:
subclass "Class1" (match if subbstring (option agent.circuit-id,5,2) = 01);
That didn't work either. The
subclass "Class1" 01;
Does seem to work (at least the server will start without errors) but does it match the criteria ?
Fra: dhcp-users-bounce at isc.org [mailto:dhcp-users-bounce at isc.org] På vegne af Simon Hobson
Sendt: 15. marts 2006 10:12
Til: dhcp-users at isc.org
Emne: Re: Class selection ekspression
Lars Jacobsen wrote:
>Thanks but this still does not give me answer on how to make a class
>match where two (or more) conditions is true.
>My RID/CID is also unique but part of it is sequential and that is
>what I want to make a (sub)class selection on.
>RID/CID = 2102011 or 2102021 or 2102031 ... 2102161 all have to end
>up in class one.
>RID/CID = 2102171 or 2102181 or 2102191 ... 2102321 all have to end
>up in class two.
>RID/CID = 2102331 or 2102341 or 2102351 ... 2102481 all have to end
>up in class tree.
>I have no problem making an exact match based on the RID/CID.
You can use logical operators (ie AND, OR) in expressions, I think
it's in 'man dhcp-eval'.
Also, have you considered subclassing ? There's a section (including
example) in 'man dhcpd.conf' - just replace all references to MAC
addresses with RID/CID. IIRC, it's said to be more efficient than
large "if x or y or z or ..." constructs due to hashing.
More information about the dhcp-users