This script validates a Microsoft DHCP XML export and checks whether each DHCP scope has all critical DHCP options defined.
It reports any missing options per scope.
./check_dhcp-options.sh <path_to_dhcp_xml_file>Example:
./check_dhcp-options.sh dhcp_export.xml- 1 → Subnet Mask
- 3 → Router (Default Gateway)
- 6 → DNS Servers
- 15 → DNS Domain Name
- 51 → Lease Time
- Extracts all
ScopeIdvalues from the XML. - Iterates through each scope and checks for the required DHCP options.
- Special handling for Option 1 (Subnet Mask), which may not appear as an
OptionValue. - Reports per-scope status:
has all critical options.is missing critical options: <list>
- Console output, for example:
10.0.0.0 is missing critical options: 6 15 192.168.1.0 has all critical options. # check complete #
- Bash
xmllint(from libxml2-utils)
- Input must be a valid Microsoft DHCP XML export.
- Useful for auditing DHCP scopes after migration or export.
This script is covered under the repository’s main MIT License.