This guide explains how to model DHCP configurations in Nautobot for NVIDIA Config Manager’s automated DHCP reservation system.
The Config Manager DHCP config refresh job reads data from Nautobot and generates ISC Kea DHCP server configurations. The configuration includes:
To find existing tags in Nautobot, expand Organization in the left sidebar, scroll to the Metadata section,and click Tags. Enter “dhcp” in the search to show only DHCP-related tags.
Config Manager uses three specific tags to identify DHCP-related objects in Nautobot: dhcp-subnet, dhcp-pool, and dhcp-reserve.
The dhcp-subnet tag marks a prefix as a DHCP-managed subnet. Kea responds to DHCP requests on this network. All subnets that will serve DHCP must have this tag.
This tag applies to network prefixes, which are objects of type ipam.prefix.
You can also optionally specify a prefix-to-gateway relationship to specify the default gateway.
The resulting Kea configuration is similar to the following:
The dhcp-pool tag marks IP addresses as available for dynamic assignment. Kea leases these addresses to devices that do not have reservations.
This tag applies to individual IP addresses, which are objects of type ipam.ipaddress.
For example, tag IP addresses 10.1.100.10 through 10.1.100.100 with dhcp-pool to create a dynamic allocation range of 10.1.100.10 to 10.1.100.100.
If an IP tagged with dhcp-pool is assigned to an interface that has DHCP subnet options applied, those options will be applied to the DHCP pool subnet (see DHCP Options section below)
A few behaviors to note:
The resulting Kea configuration is similar to the following:
Do not assign both dhcp-pool and dhcp-reserve tags to the same IP address.
If an IP address has both tags, the dhcp-reserve tag is ignored, and the address is treated as a pool IP.
The dhcp-reserve tag creates static DHCP reservations for specific devices. The device with the matching MAC address or serial number will always receive this IP address.
This tag applies to individual IP addresses, which are objects of type ipam.ipaddress.
For example, tag IP address 10.1.100.5 with dhcp-reserve and assign it to interface eth0 on device switch-01.
An address tagged with dhcp-reserve must meet the following requirements:
dhcp-subnetclient-id template)The resulting Kea configuration is similar to the following:
Every DHCP subnet needs a default gateway. Config Manager uses an optional custom Nautobot relationship called prefix-to-gateway to associate prefixes with their gateway IP addresses.
If the relationship is not defined, the first usable IP address in the subnet is used as the default gateway.
Config contexts are JSON data structures in Nautobot that provide device-specific configuration data. For DHCP, config contexts control which DHCP options are included in reservations, and how devices are identified by the DHCP server.
You define DHCP options with config contexts. Config contexts can target devices based on their attributes:
Multiple contexts can apply to the same device, and are merged together. Contexts have weights; a lower weight value means that context has higher priority when resolving conflicts.
Within a config context’s dhcp.options section, you can specify DHCP options that apply to specific interfaces or interface roles:
interface_names - Exact Interface MatchApplies options when the DHCP reservation is for a specific interface name. This is the most specific filter.
Example: Options for interface eth0 on any device this context targets:
Use case: Management interfaces named eth0 need ZTP URLs, but data interfaces do not.
interface_roles - Role-Based MatchApplies options when the DHCP reservation is for an interface with a specific role. This is more general than interface_names.
Example: Options for any interface with role “management”:
Use case: All management interfaces across different device types (with varying interface names) need the same DHCP options.
When generating DHCP options for a reservation:
interface_names options override interface_roles options if both matchreservation_options from different contexts are combined (conflicts raise errors)subnet_options from different contexts are combined (conflicts raise errors)Example: A device with platform “Cumulus Linux” has two contexts applied:
interface_roles.management optionsinterface_names.eth0 optionsFor interface eth0 with role “management”: Both contexts apply, and options are merged with Context B’s interface_names.eth0 taking precedence over Context A’s interface_roles.management for any conflicting keys.
client_id_template (String, Jinja2 template)Defines how to generate the DHCP client-id from the device’s serial number. Used when the interface has no MAC address.
Available variables:
serial - Device serial numberFilters:
hex - Converts string to colon-separated hex (e.g., "ABC" → "41:42:43")Example:
Result (for serial MT2228X30294):
Within interface_names or interface_roles, you can specify three types of options:
Important: Custom DHCP options must be defined by the bundled nv-config-manager-site-dhcp-option-def config context schema before they can be used in reservation_options or subnet_options.
Schema reference (nv-config-manager-site-dhcp-option-def):
The bootstrap job bundles this schema as KEA Site DHCP Option Definition Schema and creates the NVIDIA Config Manager DHCP Custom Options config context against it. Use this JSON structure when adding custom DHCP options.
reservation_options (Dict)DHCP options applied to individual reservations only. These appear in the reservation’s option-data array.
Common use cases:
cumulus-provision-url, boot-file-namehostname, domain-nameJinja2 variables:
device_id - Nautobot device UUIDztp_server - Randomly selected from ztp.ipv4 or ztp.ipv6 listsubnet_options (Dict)DHCP options applied at the subnet level. These appear in the subnet’s option-data array and affect all clients on that subnet.
Common use cases:
domain-name-serversntp-serversdomain-nameNote: You cannot override the routers option (it comes from prefix-to-gateway).
subnet_config (Dict)Kea subnet-level configuration directives (not DHCP options). Control reservation behavior.
Common fields:
reservations-global: Boolean, whether reservations apply globally across subnetsreservations-in-subnet: Boolean, whether reservations are included in the subnet definitionDefault behavior (if not specified):
Use case: Set both to false to skip creating a reservation for specific interfaces.
The ztp section defines ZTP server IP addresses. Config Manager randomly selects one when rendering ZTP URLs in DHCP options.
ztp.ipv4 listztp.ipv6 listError handling: If a DHCP option references {{ ztp_server }} but the list is empty, config generation fails:
Here’s a complete config context data structure for Cumulus Linux switches with ZTP support. This JSON would be entered in the “Data” field of a Nautobot config context targeted to platform “Cumulus Linux”:
This config context:
eth0The ztp_enabled flag controls whether a device should receive ZTP-specific DHCP options, such as boot script URLs. This flag is part of the Config Manager Device Status extension in Nautobot.
Field location: device.configmanagerdevicestatus.ztp_enabled (boolean)
Query: Checked during DHCP config generation:
Behavior:
ztp_enabled = true or not present (default): Device reservations include ZTP-related DHCP options from config contextsztp_enabled = false: Device reservations are skipped entirely with a warning:When to Use:
ztp_enabled = true (or leave unset) for network switches that will bootstrap through ZTPztp_enabled = false for manually configured devices, devices outside Config Manager’s management scope, and legacy equipment that does not support ZTPRelationship to DHCP Reservations:
The ztp_enabled flag is separate from the dhcp-reserve tag:
dhcp-reserve tag (on IP address) controls whether a DHCP reservation is createdztp_enabled flag (on device) controls whether ZTP options are included in the reservationPossible combinations:
An IP address tagged with dhcp-reserve is not assigned to any device interface.
An IP address tagged with dhcp-reserve is assigned to more than one interface.
Remove the IP from all but one interface. DHCP reservations must be one-to-one.
A reserved IP’s interface lacks a MAC address, and the device also lacks a serial number or client_id_template.
The preferred solution is to add a MAC address to the interface in Nautobot.
The alternate solution is to add a serial number to the device and define client_id_template in the device’s config context.
The device has ztp_enabled set to false but its IP is tagged with dhcp-reserve.
If the device should have a DHCP reservation, set ztp_enabled to true (or leave it unset).
If the device should not have a DHCP reservation, remove the dhcp-reserve tag from the IP address.
DHCP option template references {{ ztp_server }} but no ZTP servers are defined in config context.
Add a ztp.ipv4 or ztp.ipv6 list to the device’s config context.
For example:
An IP address has both a dhcp-pool tag and a dhcp-reserve tag.
Remove one of the tags. Use dhcp-reserve for static assignments, or dhcp-pool for dynamic ranges. Never use both tags on the same IP address.