12-14-2010 09:52 AM
Any one had any experience with writing expressions in CNR? I'm trying configure CNR so that it will only hand out IPs to certain devices (Set Top Boxes) and drop request for other devices. From what I'm reading it looks like you have create a client-class and reference an expression that matches the vendor class identifier in the dhcp discover from the STB. We do this all the time in linux and it is very easy. Below is an example in linux that I need to basically repeat in my CNR box. Any help is greatly appreciated.
class "sciatl"{
match if substring (option vendor-class-identifier, 0, 5) = "SAIPN"; class "entone"{
match if substring (option vendor-class-identifier,0,6)="ENTONE";
class "Amino"{
match if substring (option vendor-class-identifier,0,5)="Amino";
# Block 4
subnet 10.132.0.0 netmask 255.255.248.0 { option broadcast-address 10.132.7.255; option subnet-mask 255.255.248.0; option routers 10.132.0.1; option domain-name-servers 172.16.18.141; option root-path "CST"; option time-servers 172.16.18.141; option ntp-servers 172.16.18.141;
pool {
allow members of "sciatl";
allow members of "entone";
allow members of "Amino";
range 10.132.0.2 10.132.7.254;
}
}
12-15-2010 05:15 AM
Hi Charles,
I am not familiar with Linux DHCP server configuration and I have not tested the following config, but I think you are looking for something like the following. I am not sure why you are creating 3 classes (maybe for future use), in the example below, I follow your example:
nrcmd> dhcp set client-class-lookup-id="(try (or (if (equali (substring (request get dhcp-class-identifier) 0 5) \"SAIPN\" ) \"sciatl\" ) (if (equali (substring (request get dhcp-class-identifier) 0 6) \"ENTONE\" ) \"entone\" ) (if (equali (substring (request get dhcp-class-identifier) 0 5) \"Amino\" ) \"Amino\" )))"
nrcmd> client-class sciatl create selection-criteria=authorizedstb
nrcmd> client-class entone create selection-criteria=authorizedstb
nrcmd> client-class Amino create selection-criteria=authorizedstb
nrcmd> scope block4 create 10.132.0.0 255.255.248.0 selection-tag-list=authorizedstb
nrcmd> scope block4 addRange 10.132.0.2 10.132.7.254
You then need to create a policy to specify the other options and link the scope to the policy
Let us know how it goes,
Tom
12-15-2010 06:06 AM
Tom,
Thanks for the feedback and config. I will give this a try and let you know if it works. It will be a day or two before I can test. The reason I wanted 3 classes is because we have multiple vendors STB which all have unique class identifiers. If this can be accomplished with a single class, then that's fine. I just thought you needed a separate class for each unique class identifier.
Thanks,
Shane
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide