Skip to main content
CloudEnterprise

Technical Information

Microsoft DHCP to NetBox Object Mapping

Object Type Mapping

Microsoft DHCP ObjectNetBox ObjectNotes
DHCP ScopePrefixOne prefix per scope; status = reserved; is_pool = true; mark_utilized = true
Exclusion RangeIPRangeOne IP range per exclusion range; status = reserved
ReservationIPAddressstatus = reserved; always synced
LeaseIPAddressstatus = dhcp; opt-in per scope via MSFT_DHCP_LEASE_SCOPE_IDS

Prefix Field Mapping (DHCP Scopes)

NetBox FieldSourceNotes
prefixScopeId + SubnetMaskCIDR calculated from scope network address and subnet mask
statusStaticAlways reserved
is_poolStaticAlways true
mark_utilizedStaticAlways true
descriptionStaticMicrosoft DHCP - DHCP Scope - {host}
custom_fieldsScope metadata + optionsSee custom fields table below

IP Range Field Mapping (Exclusion Ranges)

NetBox FieldSourceNotes
start_addressStartRangeCIDR notation using the prefix length from the parent scope
end_addressEndRangeCIDR notation using the prefix length from the parent scope
statusStaticAlways reserved
descriptionStaticMicrosoft DHCP - Exclusion range in scope \{scope_id\} - {host}

IP Address Field Mapping

Reservations

NetBox FieldSourceNotes
addressIPAddressCIDR notation derived from parent scope subnet mask
statusStaticAlways reserved
descriptionNameMicrosoft DHCP - \{host\}, Reservation for {Name}

Leases

NetBox FieldSourceNotes
addressIPAddressCIDR notation derived from parent scope subnet mask
statusStaticAlways dhcp
descriptionHostNameMicrosoft DHCP - \{host\}, Leased IP for {HostName}

Reservation vs. Lease Precedence

When a reservation and a lease exist for the same IP address, the reservation always takes precedence. The IP address is ingested with status reserved using the reservation data.


Custom Fields

The following custom fields are created during bootstrap mode and applied to Prefix objects:

Custom Field NameLabelTypeDescription
dhcp_serverDHCP ServertextSource DHCP server hostname or IP that this scope was synced from
msft_dhcp_scope_nameMS DHCP Scope NametextDHCP scope display name
msft_dhcp_scope_stateMS DHCP Scope StatetextScope state (e.g., Active, Inactive)
msft_dhcp_scope_start_rangeMS DHCP Scope Start RangetextFirst assignable address in the scope
msft_dhcp_scope_end_rangeMS DHCP Scope End RangetextLast assignable address in the scope
msft_dhcp_lease_duration_secondsMS DHCP Lease Duration (seconds)integerLease duration in seconds
msft_dhcp_optionsMS DHCP OptionsJSONScope-level DHCP option values as a JSON array of objects with OptionId, Name, Type, Value

All custom fields are read-only in the NetBox UI (ui_editable: no).

Example msft_dhcp_options Value

[
{"Name": "DNS Servers", "OptionId": 6, "Type": "IPv4Address", "Value": ["192.168.0.1"]},
{"Name": "Router", "OptionId": 3, "Type": "IPv4Address", "Value": ["192.168.0.254"]},
{"Name": "Lease", "OptionId": 51, "Type": "DWord", "Value": ["691200"]}
]

Tags

All entities ingested by the Microsoft DHCP integration are tagged with:

TagApplied ToDescription
microsoftAll entitiesApplied to all objects from this integration
dhcpAll entitiesIdentifies objects sourced from a DHCP server
discoveredAll entitiesStandard tag applied to all controller integration objects
msft-dhcp-{host}All entitiesUnique per-agent tag identifying the source DHCP server; e.g., msft-dhcp-dhcp-server.corp.example.com

Configuration Reference

ParameterTypeDefaultDescription
MSFT_DHCP_HOSTstringrequiredWindows DHCP Server hostname or IP address
MSFT_DHCP_USERNAMEstringrequiredWinRM service account (typically DOMAIN\username)
MSFT_DHCP_PASSWORDstringrequiredWinRM service account password
MSFT_DHCP_USE_SSLbooltrueUse HTTPS WinRM on port 5986; set false for HTTP on port 5985
MSFT_DHCP_PORTint5986 / 5985Override the default WinRM port
MSFT_DHCP_VERIFY_SSLboolfalseVerify the WinRM TLS certificate; off by default as Windows servers commonly use self-signed certificates
MSFT_DHCP_LEASE_SCOPE_IDSstringunsetComma-separated list of scope IDs (network addresses) for which leases are synced; e.g., 192.168.0.0,10.0.1.0
BOOTSTRAPboolfalseWhen true, emits only custom field definitions with no DHCP server connection required

Connection Details

The integration uses the pypsrp library to connect over WinRM/PSRP with NTLM authentication. The following PowerShell cmdlets are executed on the target server:

CmdletPurpose
Get-DhcpServerv4ScopeRetrieves all DHCP scopes
Get-DhcpServerv4LeaseRetrieves leases; called only for scopes listed in MSFT_DHCP_LEASE_SCOPE_IDS
Get-DhcpServerv4ReservationRetrieves all reservations across all scopes
Get-DhcpServerv4OptionValueRetrieves per-scope DHCP option values
Get-DhcpServerv4ExclusionRangeRetrieves exclusion ranges for each scope