Are global directives needed in additional dhcpd conf files?
Thomas Markwalder
tmark at isc.org
Mon Sep 10 14:10:55 UTC 2018
You may test parse a dhcpd config file by using the command line options:
-t Test the configuration file. The server tests the
configuration
file for correct syntax, but will not attempt to
perform any
network operations. This can be used to test a new
configura‐
tion file automatically before installing it.
-T Test the lease file. The server tests the lease file
for cor‐
rect syntax, but will not attempt to perform any network
opera‐
tions. In addition to reading the lease file it will
also write
the leases to a temporary lease file. The current
lease file
will not be modified and the temporary lease file
will be
removed upon completion of the test. This can be used to
test a
new lease file automatically before installing it.
In either case dhcpd will attempt to parse the file(s) and then exit.
Any errors
will be logged.
Regards,
Thomas Markwalder
ISC Software Engineering
On 09/10/2018 10:07 AM, Peter Rathlev wrote:
> On Mon, 2018-08-20 at 14:31 -0400, Bob Harold wrote:
>> 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 ?
> I'm not aware of any built in, but we wrote a small shell script that
> recursively parses the configuration and dumps with line numbers in the
> order things are included.
>
> https://kelvin.rathlev.dk/dhcpd-dump-config
>
> It's probably not the most efficient but for our current ~10000 line
> configuration it's good enough, about half a second on our servers.
>
> If you need the configuration without file names and line numbers then
> just replace "-n" with "-h" in the grep command.
>
More information about the dhcp-users
mailing list