{% load helpers %} {# Checkbox #} {% if perms.virtualization.change_interface or perms.virtualization.delete_interface %} {% endif %} {# Name #} {{ iface }} {# MAC address #} {{ iface.mac_address|default:"—" }} {# MTU #} {{ iface.mtu|default:"—" }} {# 802.1Q mode #} {{ iface.get_mode_display|default:"—" }} {# Description/tags #} {% if iface.description %} {{ iface.description }}
{% endif %} {% for tag in iface.tags.all %} {% tag tag %} {% empty %} {% if not iface.description %}—{% endif %} {% endfor %} {# Buttons #} {% if perms.ipam.add_ipaddress %} {% endif %} {% if perms.virtualization.change_interface %} {% endif %} {% if perms.virtualization.delete_interface %} {% endif %} {% with ipaddresses=iface.ip_addresses.all %} {% if ipaddresses %} {# Placeholder #} {% if perms.virtualization.change_interface or perms.virtualization.delete_interface %} {% endif %} {# IP addresses table #} {% for ip in iface.ip_addresses.all %} {# IP address #} {# Primary/status/role #} {# VRF #} {# Description #} {# Buttons #} {% endfor %}
IP Address Status/Role VRF Description
{{ ip }} {% if virtualmachine.primary_ip4 == ip or virtualmachine.primary_ip6 == ip %} Primary {% endif %} {{ ip.get_status_display }} {% if ip.role %} {{ ip.get_role_display }} {% endif %} {% if ip.vrf %} {{ ip.vrf.name }} {% else %} Global {% endif %} {% if ip.description %} {{ ip.description }} {% else %} {% endif %} {% if perms.ipam.change_ipaddress %} {% endif %} {% if perms.ipam.delete_ipaddress %} {% endif %}
{% endif %} {% endwith %}