Are global directives needed in additional dhcpd conf files?

Bob Harold rharolde at umich.edu
Mon Aug 20 18:31:23 UTC 2018


On Mon, Aug 20, 2018 at 11:43 AM Dave C <Dhcp at gvtc.drakkar.org> wrote:

> I've been leveraging include files for what seems like forever.
>
> Think of an include file as if you dropped whatever was pointed to it into
> your config at that
> exact point.
>
> So, to answer your question, if you have a "global" type directive above
> that point in your
> config file "stream", then it's still active until it is overwritten with
> a later directive.
>
> You can even set an include into the middle of a config construct, for
> example, you can open a
> shared-network configuration, then include individual files for different
> aspects of the
> configuration, then close the shared-network and continue your config
> stream. I heavily leverage
> this so that I can have tools like dhcpd-pools run against a filtered
> version of my "master
> dhcp" config that removes the private subnets that are included in a
> shared network (for our
> internal devices). Otherwise those massive private subs would mask a
> public pool from showing
> it's empty of IPs or about to run out.
>
> The privates are used for things like video set top boxes etc and need to
> co-exist in the same
> shared network, but don't need to have external public IPs.
>
> Hope this helps... includes simply insert a big set of text into the
> stream at their location.
> Period.
>
> Dave
>

That brings to mind a question - for DNS (BIND) I can use "named-checkconf
-p" to print out a 'named.conf' file that has all the 'includes' processed,
and comes out as one big file, so I can verify that it is actually getting
what I expected.

Is there an equivalent of "named-checkconf -p" for dhcpd ?

-- 
Bob Harold

On 8/20/18 09:25, project722 wrote:
> > Hi guys!
> >
> > We are about to start using multiple config files for our dhcp markets.
> >
> > I've created a folder called "include.d". The path is:
> >
> > /etc/dhcp/include.d/
> >
> > In my main dhcpd conf I've added the "include" directive:
> >
> > include "/etc/dhcp/include.d/another-config.conf";
> >
> > Inside the "anotherconfig" file I have started off the file with the
> "subnet" directive.
> >
> > subnet 192.168.100.0 netmask 255.255.255.0 {
> >
> > etc..,etc..
> >
> > I have no global config. Things such as:
> >
> > authoritative;
> > ddns-update-style none;
> > option domain-name-servers x.x.x.x x.x.x.x;
> > default-lease-time 604800;
> >
> > Do I need to define these in my "anotherconfig" conf file? Or will it
> inherit the global
> > directives by design?
> >
> > TIA!
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20180820/3a51fc3d/attachment.html>


More information about the dhcp-users mailing list