variables in configuration

Nenad Tomasevic Nenad.Tomasevic at
Tue Jun 30 12:31:06 UTC 2009


I'm trying to get configuration file which will be assigning config files to clients based on predefined variables, more precise based on option 82 parameters in the dhcp request, so, if in dhcp request the option agent.circuit-id is "switch01" and option agent.remote-id is "01", the bootfile-name in dhcp offer will be "switch01.01.cfg".

here is my lame attempt to do that, dhcpd.conf;

agent-id="option agent.remote-id";
circuit-id="option agent.circuit-id";

#local subnet
subnet netmask {

  option subnet-mask;
  option routers;
  option tftp-server-name "";
  option bootfile-name "$circuit-id.$agent-id.cfg";

  default-lease-time 259200;
  max-lease-time  518400;

and that don't work, dhcp offer takes $circuit-id.$agent-id.cfg as bootfile-name, suprise, suprise (actually, i'm showing you the file only to make my idea more understandable)... :))

question is, is it possible to make such thing and if it is, in which direction I must look to achieve that?
point of the hole thing is to make dhcp server with 100% uptime because it wont need restart every time when configuration is changed.



More information about the dhcp-users mailing list