{# SPDX-FileCopyrightText: 2026 Marcin Zieba #} {# SPDX-FileCopyrightText: 2026 Andrew Backeby #} {# SPDX-License-Identifier: Apache-2.0 #} {% extends "netbox_kea/server_workspace.html" %} {% load form_helpers %} {% load kea_options %} {% block content %} {% kea_option_datalist dhcp_version %} {% include "netbox_kea/includes/persist_config_warning.html" %}
{{ action }} DHCPv{{ dhcp_version }} Reservation
{% if not mutation_available %} {% endif %} {% if not subnet_cmds_available %} {% endif %}
{% csrf_token %} {% for field in form.hidden_fields %}{{ field }}{% endfor %} {% if dhcp_version == 4 %}{% firstof "#id_ip_address" as address_field %}{% else %}{% firstof "#id_ip_addresses" as address_field %}{% endif %} {% for field in form.visible_fields %} {% render_field field %} {% if field.name == "hostname" %} {# The server computes the preview; a disabled Subnet field is not sent, so the edit URL carries it. #}
{% endif %} {% endfor %} {# Advisory NetBox IPAM conflict check (Add mode only) — populated on IP blur. #}
{# DHCP Options section #}
{% if dhcp_version == 4 %}
DHCP Options (optional)

Common ZTP / vendor options

NameExample valueUse case
boot-file-namehttp://10.0.0.1/ztp.pyCisco IOS XE / NX-OS / Junos bootstrap URL (option 67)
tftp-server-name10.0.0.1TFTP server for legacy IOS (option 66)
vendor-encapsulated-options0117687474703a2f2f31302e302e302e312f706f61702e7079Cisco POAP / Aruba Central (option 43, hex TLV)

Option 43 value is a hex string encoding TLV sub-options — see Kea docs for full reference.

{% else %}
DHCP Options (optional)
{% endif %} {{ options_formset.management_form }} {% if options_formset.non_form_errors %}
{% for error in options_formset.non_form_errors %}
{{ error }}
{% endfor %}
{% endif %} {% for opt_form in options_formset %} {% endfor %}
Option NameValueAlways SendDelete
{{ opt_form.original_index }}{{ opt_form.name }}{% for err in opt_form.name.errors %}
{{ err }}
{% endfor %}
{{ opt_form.data }}{% for err in opt_form.data.errors %}
{{ err }}
{% endfor %}
{{ opt_form.always_send }} {{ opt_form.DELETE }}
Cancel
{% include "netbox_kea/inc/formset_add_row.html" %} {% if action == "Add" %} {% comment %} Live NetBox IPAM conflict advisory: on blur of the IP field, fetch a small HTML fragment and show it under the field. Plain fetch, no HTMX dependency. Only attached in Add mode — the IP field is disabled (read-only) when editing. {% endcomment %} {% endif %} {% endblock %}