{% extends "base.html" %}{% from "_inventory_forms.html" import field, allocation_form, remove %} {% block title %}{{ subnet.name if subnet else 'Add subnet' }} · Keywright{% endblock %}{% block body %} {% include "_infrastructure_nav.html" %}

{{ subnet.name if subnet else 'Add subnet' }}

All subnets

Record the network’s allocation plan. Changes here do not configure your router or DHCP server.

{{ 'Network settings · ' ~ subnet.cidr if subnet else 'Network settings' }}
{{ field('name','Network name',values,subnet.name if subnet else '',required=true) }} {{ field('cidr','Subnet (CIDR)',values,subnet.cidr if subnet else '',required=true,help='IPv4 or IPv6, for example 192.168.1.0/24.') }} {{ field('scope','Address space',values,subnet.scope if subnet else 'default',help='Use a separate name for isolated networks that reuse the same IP range.') }} {{ field('site','Site / location',values,subnet.site if subnet else '') }} {{ field('vlan','VLAN (optional)',values,subnet.vlan if subnet else '',type='number') }} {{ field('gateway','Gateway (optional)',values,subnet.gateway if subnet else '') }} {{ field('dhcp_start','DHCP pool start (optional)',values,subnet.dhcp_start if subnet else '') }} {{ field('dhcp_end','DHCP pool end (optional)',values,subnet.dhcp_end if subnet else '') }}
{% if subnet %}{% set back='/ui/inventory/networks/' ~ subnet.id %}
Usable addresses {{ summary.capacity }}Allocations {{ summary.recorded }}DHCP pool {{ summary.pool_size if subnet.dhcp_start else 'Not recorded' }}Unrecorded outside pool {{ summary.unrecorded }}
Unrecorded does not mean available. Confirm DHCP reservations and active leases before assigning an address. Offline devices retain their allocations.

Recorded allocations

{% if subnet.gateway %}

Gateway {{ subnet.gateway }} · excluded from unrecorded ranges

{% endif %} {% if subnet.dhcp_start %}

DHCP pool {{ subnet.dhcp_start }} – {{ subnet.dhcp_end }} · live leases not imported

{% endif %} {% if summary.rows %} {% for allocation in summary.rows %}{% endfor %}
AddressAllocationDevice / interfaceOwner / purposeUpdated
{{ allocation.address }}{{ states[allocation.state] }}{% if allocation.interface_id %}{% set iface=interface_map[allocation.interface_id] %}{{ asset_map[iface.asset_id].name }}{{ iface.name }}{% else %}Not linked{% endif %}{{ allocation.label or '—' }}{% if allocation.notes %}{{ allocation.notes }}{% endif %}{{ allocation.updated_at.strftime('%Y-%m-%d %H:%M') }} UTC
{% else %}

No individual allocations recorded.

{% endif %}
Add allocation{{ allocation_form(subnet,none,allocation_values if allocation_values and not allocation_values.get('id') else {},interfaces,asset_map,states) }}
{% if summary.rows %}
Edit or release an allocation
{% for allocation in summary.rows %}
{{ allocation.address }} · {{ states[allocation.state] }}{% if allocation.label %} · {{ allocation.label }}{% endif %} {{ allocation_form(subnet,allocation,allocation_values if allocation_values and allocation_values.get('id')==allocation.id else {},interfaces,asset_map,states) }}
{{ remove('allocation',allocation.id,back,'Release allocation record') }}

Only release this record after the address has been released on the device or DHCP server.

{% endfor %}
{% endif %}
Unrecorded address ranges ({{ summary.unrecorded }} addresses)

Excludes recorded allocations, gateway, DHCP pool, and protocol-reserved addresses. Availability is unverified.

{% for start,end in summary.gaps %}
{{ start }}{% if start!=end %} – {{ end }}{% endif %}
{% else %}

No unrecorded ranges outside the DHCP pool.

{% endfor %}
{{ remove('subnet',subnet.id,back,'Remove subnet') }}

Remove its allocations first. This does not change the network configuration.

{% endif %} {% endblock %}