cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1104
Views
0
Helpful
2
Replies

CNR Expressions

CHARLES HEUPEL
Level 1
Level 1

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;

  }

}

2 Replies 2

Tom Debruyne
Cisco Employee
Cisco Employee

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

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