Classifying traffic according to options passed in a host statement

Simon Hobson dhcp1 at thehobsons.co.uk
Wed Oct 24 20:42:37 UTC 2007


Brian Raaen wrote:
>I am trying to work with our cable modem provisioning system to set up a way
>that docsis 1.0, 1.1, and 2.0 would get the correct config files without
>having to be statically assigned.  Currently we provision cable modems using
>host statements like the following
>
>host 0000cac6eb42 {filename "153651202sc.cfg"; hardware ethernet
>00:00:ca:c6:eb:42;}
>host 000103B17FD6 {filename "51212802s.cfg";      hardware ethernet
>00:01:03:B1:7F:D6;}
>
>I need to give it an option other than filename, that the server will use to
>evaluate the option.  I tried creating an option called modem-conf like the
>following
>
>host 0000cac6eb42       {option modem-config "153651202sc.cfg"; hardware
>ethernet 00:00:ca:c6:eb:42;}
>host 000103B17FD6       {option modem-config "51212802s.cfg";   hardware
>ethernet 00:01:03:B1:7F:D6;}
>
>and then apply different configs in the subnet using the following code
>
>if substring (option modem-config, 0, 15)  = "153651202sc.cfg" {
>
>	if substring (option vendor-class-identifier, 0 , 9) = "docsis2.0" {
>		filename = "153651202sc20.cfg";
>
>	} else if substring (option vendor-class-identifier, 0 , 9) = 
>"docsis1.1" {
>		filename = "153651202sc11.cfg";
>
>	} else {
>		filename = "153651202sc10.cfg";
>
>	}
>}
>
>
>however all the modems are getting the subnet default file. instead to getting
>the different speed files.  I am not sure how I can read the host options to
>make assignment decisions.  I would appreciate any help I can get.

OK, do you NEED the host statements ?

Would the classes and subclasses by mac address example in the man 
page (man dhcpd.conf) work for you ? Specifically, if all you use the 
host statements for is to passing options (such as filename) to a 
client, then this could be done through a class. For each client, you 
specify which class it should be in, and it gets the options 
specified in the class definition.


More information about the dhcp-users mailing list