I am setting up a DHCP server on RHEL where some entries in the file are generated at a later stage and may be regenerated often. I was looking at the dhcpd config guide and the include ; guideline seems to be the best approach for this.
But it looks like the DHCP server doesn't load the external file at all.
Here's me dhcpd.conf:
default-lease-time 86400; # 24 hours in seconds
max-lease-time 604800; # 7 days in seconds
authoritative;
include "/opt/demo/deploy/extdhcp.conf"; #EXTERNAL FILE
subnet 192.200.1.0 netmask 255.255.255.0 {
option routers 192.200.1.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.200.1.255;
host ANSIBLE-01 {
hardware ethernet 00:50:56:8c:5e:47;
fixed-address 192.200.1.10;
}
}
Here's the external config file:
subnet 10.64.0.0 netmask 255.255.255.0 {
range 10.64.0.1 10.64.0.100;
option routers 10.64.0.254;
option subnet-mask 255.255.255.0;
option broadcast-address 10.64.0.255;
host ILO-1 {
hardware ethernet 00:50:56:8c:0e:fd;
fixed-address 10.64.0.55;
}
}
This is what I see in the logs, that tells me that the external file hasn't been loaded in dhcpd.
2019-02-09T15:19:07.493576+00:00 dhcp-01.erewhon.com <daemon.err> dhcpd: DHCPDISCOVER from 00:50:56:8c:0e:fd via eth0: network 192.200.1.0/24: no free leases
2019-02-09T15:19:19.671670+00:00 dhcp-01.erewhon.com <daemon.err> dhcpd: message repeated 3 times: [ DHCPDISCOVER from 00:50:56:8c:0e:fd via eth0: network 192.200.1.0/24: no free leases]
2019-02-09T15:19:26.657147+00:00 dhcp-01.erewhon.com <daemon.err> dhcpd: DHCPDISCOVER from 00:50:56:8c:0e:fd via eth0: network 192.200.1.0/24: no free leases
2019-02-09T15:21:04.257982+00:00 dhcp-01.erewhon.com <daemon.err> dhcpd: message repeated 7 times: [ DHCPDISCOVER from 00:50:56:8c:0e:fd via eth0: network 192.200.1.0/24: no free leases]
2019-02-09T15:21:18.419381+00:00 dhcp-01.erewhon.com <daemon.err> dhcpd: DHCPDISCOVER from 00:50:56:8c:0e:fd via eth0: network 192.200.1.0/24: no free leases
As you see from the logs, the DHCP seems to connect the MAC to the network defined in dhcpd.conf and not the external file.
Is my understanding of the include guideline wrong?