SV: Allow statement in pool

Lars Jacobsen lj at sydfynsel.dk
Thu Mar 1 09:50:57 UTC 2007


> Randy Grimshaw 
> 
> typically you need to look at the logic as statement resolutions
> so something like
> allow ( (member of ch1) AND (member of stb) )
> is closer to what you mean.
> 
> <><Randy

 
I tried that and similar expressions and it wont work. 
I gues that the problem is the expression is then evaluated to the
values "true" or "null". And these two parameters are not valid
statements in the allow statement within a pool. Only
Known-clients;
Unknown-clients; 
Members of "class"
Dynamic bootp clients;
Authenticated clients;
All clients;
Are valid statements after the allow/deny keywords. :-/

Off cource I can do the validation and then classify them to a 3. class,
but that is a hell off a job, as I already have over 1.000 classes like
"ch1"

Another question to the list:
What is the difference of using {brackets} vs. (parenthesis) in the conf
?


/Lars
 


> 
> 
> >>> lj at sydfynsel.dk 2/28/2007 10:15:37 AM >>>
> Hi
> 
> Having a bit of trouble matching the right syntax.
> I want to assign a client to a specific scope (IP-TV) if two
> parameters
> is true:
> 
> 1 - is member of class "ch1"
> 2 - is member of class "stb"
> 
> So both has to be true, not just one of them.
> 
> 
> So I need something like:
> 
> allow members of "ch1" AND allow members of "stb";
> 
> in my pool declaration, but that syntax wont work.
> 
> Any ideas ?
> 
> 
> Btw allow/deny syntax in #ch1 works as expectet.
> 
> 
> Thanks
> /Lars
> 
> 
> 
> 
> 
> 
> Snip from my dhcp.conf:
> 
> 
> class "1130022" {
>          match if  substring ( (option agent.circuit-id) , 0,7)=
> "1130022";
> lease limit 1;
> }
> 
> class "stb" {
>             match substring(hardware, 1, 3);
>                     }
>         subclass "db-stb" 00:02:9B;      #   Kreatel
> 
> 
> class "ch1" {
>          match if  substring ( (option agent.circuit-id) , 0,4)=
> "1130"
> AND (substring ( (option agent.circuit-id) , 4,2)= "01" OR
> substring ( (option agent.circuit-id) , 4,2)= "02" OR
> substring ( (option agent.circuit-id) , 4,2)= "03" OR
> substring ( (option agent.circuit-id) , 4,2)= "04" OR
> substring ( (option agent.circuit-id) , 4,2)= "05" OR
> substring ( (option agent.circuit-id) , 4,2)= "06" OR
> substring ( (option agent.circuit-id) , 4,2)= "07" OR
> substring ( (option agent.circuit-id) , 4,2)= "08" OR
> substring ( (option agent.circuit-id) , 4,2)= "09" OR
> substring ( (option agent.circuit-id) , 4,2)= "10" OR
> substring ( (option agent.circuit-id) , 4,2)= "11" OR
> substring ( (option agent.circuit-id) , 4,2)= "12" OR
> substring ( (option agent.circuit-id) , 4,2)= "13" OR
> substring ( (option agent.circuit-id) , 4,2)= "14" OR
> substring ( (option agent.circuit-id) , 4,2)= "15" OR
> substring ( (option agent.circuit-id) , 4,2)= "16");
> spawn with option agent.circuit-id;
> lease limit 1;
> }
> 
> # ch1
> 	subnet 85.27.128.224 netmask 255.255.255.224 {
> 		option routers 85.27.128.225;
> 		option subnet-mask 255.255.255.224;
>                 pool {
> 			allow members of "1130022";
> 			range 85.27.128.226 85.27.128.226;
> 			}
> 		pool {
> 			deny members of "stb";
> 			deny members of "1130022";
> 			allow members of "ch1";
> 			range 85.27.128.227 85.27.128.254;
> 			}
> 		}
> 
> # IP-TV
> 	subnet 10.228.0.0 netmask 255.252.0.0 {
> 		option subnet-mask 255.255.255.240;
> 		option routers 10.228.0.1;
> 		pool {
> 			range 10.228.0.11 10.228.0.30;
> 			allow members of "ch1";
>                                  allow members of "stb";
> 			}
> 		}
> 
> 



More information about the dhcp-users mailing list