Common settings

Simon Hobson dhcp1 at thehobsons.co.uk
Wed Nov 30 09:46:59 UTC 2016


Mike Richardson <mike.richardson at manchester.ac.uk> wrote:

> An enhancement along the lines of 'force option blah' would be nice, which
> takes precedent over other ones when its section matches a client.

It's not clear what you are looking to do here.

You mention "matches a client", but earlier you talk about options for each subnet.

Your first message had me thinking that you are wanting to reduce the amount of this in the config :
subnet blah... {
  option dns_servers ...;
  option ...
  option ...
  ...
}

As stated, there isn't really a great scope for reducing that.
You can see the most common options globally, so for example if 80% of your subnets use the same DNS servers, you could set that option globally and only set it per-subnet where it's different.
Or, as you hint at, if you have a small number of common sets of options, you can set them in include files :
subnet blah... {
  $INCLUDE user_subnet_options ;
  ...
}

The only other construct I can think of (and I don't know if this would work) is the group { ... } structure. Eg :
#User subnets
group {
  option blah...;
  option blah...;
  subnet blah...{
    ...
  }
  subnet blah...{
    ...
  }
  ...
}
According to The DHCP Handbook, "You can use the group declaration to provide a common scope for whatever is declared within it. For example, if several host declarations require the same set of parameters ..."
There doesn't seem to be any suggestion it can't be used for subnets.



More information about the dhcp-users mailing list