Problem with custom variable in bootfile-name

Peter Rathlev peter at rathlev.dk
Tue Jun 23 17:15:31 UTC 2015


On Tue, 2015-06-23 at 11:39 +0000, Thomas Novin wrote:
> If I use the variable in a execute-statement, it works having a mix of
> variables and text. Without using concat. But that does not work in an
> option.
> 
> For example:
>  
>    execute ("/usr/local/bin/create_instruction", model);
> 
> I have tested skipping concat in bootfile-name but that did not work.
> But why is it not possible to use a set variable in an
> option-statement.. if anyone can answer this I’d be thankful!

You should be able to do it this way:

  option X-model code 254 = string;

  if option vendor-class-identifier ~= "OS6450-48" {
      option X-model "6450-48";
  }
  
  option bootfile-name = concat("instruction/", config-option X-model, ".alu”);

This is what we're using to hand out subnet specific bootfile-names. In
our case the config-option is set in each subnet and the option value is
set in a global class that matches on vendor-class-identifier.

The code points 224 through 254 are "private use". Beware that certain
systems make use of these, e.g. Windows using code 252 for WPAD related
configuration.

-- 
Peter




More information about the dhcp-users mailing list