Conditional File Include

Eugene Grosbein eugen at grosbein.net
Mon Aug 7 16:10:31 UTC 2017


07.08.2017 19:34, Norman Elton wrote:

> We keep our DHCP configuration in a git repository. In the case of
> failover pairs, they share a repository. This works great, since the
> vast majority of the configuration is identical.
> 
> Of course, the failover configuration is different between the two
> servers. To solve this, my dhcpd.conf file does an include on
> "dhcp-failover.conf", which doesn't actually exist in the repository.
> Instead, it's a symlink to either "dhcp-failover-01.conf" or
> "dhcp-failover-02.conf". This works, but I have to manually create the
> symlink when we check out the repository.

Why do you include different contents to main dhcpd.conf?

Just put all identical configuration to single included file
and include it to two distinct dhcpd.conf's each having own "failover peer"
statements and, perhaps, something other like "subnet".

And make your DHCP servers use such distinct dhcpd.conf's
Nothing makes you always use "dhcpd.conf", you may use any name
and just run the daemon with corresponding "-cf config-file" flag.



More information about the dhcp-users mailing list