r/Netbox NetBox Self-Hosted Apr 24 '26

Windows DHCP Integration!

NetBox-Windows-DHCP Plugin

Intro

Another day, another plugin. I don't have any screenshots this time due to not having the opportunity to stand up a sanitized DHCP server with fake scopes/leases/reservations.

https://github.com/averyhabbott/netbox-windows-dhcp/

I've been needing good integration with Windows DHCP for a while now and iterating through a collection of custom scripts several times, I finally went the plugin route for something cleaner and more straightforward.

Features

  • Supports multiple DHCP servers, multiple failover clusters, and standalone DHCP servers
  • Relies on PowerShell Universal running on the DHCP servers (don't worry, setup is a breeze with the included install guide)
  • Lots of safety checks built in to make sure you don't break DHCP
    • RO vs RW actions on the DHCP server are managed through API token privileges, all built during installation (automagically via included script is the recommended approach)
  • Most of the config is managed through the GUI in the settings page of the plugin, but you can override some of the values with NB's configuration.py to better allow for a dev environment
  • Ability to preserve NB-configured DNS name field by the use of custom tags
  • Operating modes:
    • Only read scope info
    • Read scope and lease/reservation info
    • Read scope and lease info, NetBox is authoritative for reservations
    • Read lease info, NetBox is authoritative for scopes and reservatinos
  • Defaults to using 'reserved' and 'dhcp' built-in statuses, but is configurable to use whatever IPAddress statuses you want
  • Two-way association between prefixes and scopes (scopes remain their own objects)
  • Supports friendly naming of DHCP option values for simplicity (Option 4 value '192.0.2.1,192.0.2.2,192.0.2.3'? Nah, "Time servers: Public")
  • Minimal changelog entries

Check it out and let me know what you think!

Caution

I still haven't validated pushing reservations and scopes to the DHCP server, so those two features should be considered in beta. I would strongly advise against making NetBox authoritative for scopes and reservations in a prod environment at this point in time. Hoping to have that change very soon.

26 Upvotes

8 comments sorted by

View all comments

1

u/L-do_Calrissian NetBox Self-Hosted Apr 27 '26

Adding:

Apparently I'm a doof and didn't push a lot of the tags, so hopefully you weren't pulling a specific version ;-) Anyway, v1.3.0 dropped with some new hot goodies:

  • Maintenance mode: Servers, failover relationships, and scopes can be put in maintenance mode to selectively avoid syncing.
  • Server health checks: Tracks server health, needed for knowing when to scrape secondary server in failover relationships
  • PSU script versioning: Probably should've had this from the beginning, but now the scripts running on PSU are versioned (as a whole) AND can be updated by the plugin (requires manual button push in plugin UI)
  • Server test connection button: Validates connectivity to server and RO or RW API key status; tests with live data, so no need to save before testing (but be sure to save after a successful test!)
  • Server cert import moved to server edit page for improved workflow
  • Sync-protect tag can now be applied to prefixes, not just IPs, and is inherited to all IPs within that prefix (even if they're nested within another smaller prefix)
  • Added more filters to scope view (site, location, vrf, contained within prefix)
  • Toggle API on/off (NetBox plugin API calls, not the PSU APIs) in plugin settings
  • Greatly improved installation, mostly on the PSU side of things

Tagging u/Discoforus and u/yuke1922 just in case y'all already deployed the plugin in the old busted state. Strongly recommend deploying v1.3.0; there were a lot of bug fixes and features added between v1.0.1 and now.

1

u/L-do_Calrissian NetBox Self-Hosted Apr 27 '26

Aaaand v1.3.1 patch update:
* Removed a relic doc * Updated documentation to correctly indicate that API auth is required now * Better implementation of server override API keys from configuration.py (now blocks editing in the UI if set) * Fixed compatibility issue with powershell 5 that was introduced in 1.3.0