diff --git a/CHANGELOG.md b/CHANGELOG.md index 4078200e..2ed0c725 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Removed partial support for regex searches in node and profile lists. #1635 +### Changed + +- DHCP template generates as much of the subnet and range definition as possible. #1469 + ## v4.6.0rc2, 2025-02-07 ### Added diff --git a/overlays/host/rootfs/etc/dhcp/dhcpd.conf.ww b/overlays/host/rootfs/etc/dhcp/dhcpd.conf.ww index d9cd43b2..fecb1fed 100644 --- a/overlays/host/rootfs/etc/dhcp/dhcpd.conf.ww +++ b/overlays/host/rootfs/etc/dhcp/dhcpd.conf.ww @@ -46,11 +46,15 @@ if exists user-class and option user-class = "iPXE" { } {{- end }} -{{- if and .Network .Netmask .Dhcp.RangeStart .Dhcp.RangeEnd }} +{{- if and .Network .Netmask }} subnet {{.Network}} netmask {{.Netmask}} { max-lease-time 120; +{{- if and .Dhcp.RangeStart .Dhcp.RangeEnd }} range {{.Dhcp.RangeStart}} {{.Dhcp.RangeEnd}}; +{{- end }} +{{- if .Ipaddr }} next-server {{.Ipaddr}}; +{{- end }} } {{- end }}