use include statement in a nested block
Loris Boillet
lb at locatel.dk
Thu Apr 29 15:25:51 UTC 2010
(please keep CC as I am not subscribed to this list)
Hi,
I would like to use the include statement to move the range declaration of a subnet to a separate file:
in dhcpd.conf:
...
pool {
max-lease-time 7200;
default-lease-time 7200;
#range 192.168.21.0 192.168.21.10;
include "/home/nice/etc/dhcpd.range";
get-lease-hostnames true;
}
...
in the included file:
range 192.168.21.0 192.168.21.10;
but then configuration file parsing fails (see below).
Including the whole subnet works but it does not match my needs. Should the include statement work in a nested block? Is there a way to move the range declaration without including the whole subnet?
Thanks,
Loris
# /etc/init.d/dhcp3-server restart
dhcpd self-test failed. Please fix the config file.
The error was:
Internet Systems Consortium DHCP Server V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
/home/nice/etc/dhcpd.range line 11: range declaration not allowed here.
range
^
/etc/dhcp3/dhcpd.conf line 15: /home/nice/etc/dhcpd.range: bad parse.
include "/home/nice/etc/dhcpd.range"
^
/etc/dhcp3/dhcpd.conf line 17: Pool declaration with no address range.
}
^
Pool declarations must always contain at least
one range statement.
Configuration file errors encountered -- exiting
More information about the dhcp-users
mailing list