+
+
+
+
+ {% if ipaddress_table.rows %}
+ {% render_table ipaddress_table 'inc/table.html' %}
+ {% else %}
+
None
+ {% endif %}
+
+
+
+
+
+ {% if ipaddress_table.rows %}
+ {% render_table members_table 'inc/table.html' %}
+ {% else %}
+
None
+ {% endif %}
+
+ {% plugin_full_width_page object %}
+
+
+{% endblock %}
diff --git a/netbox/templates/ipam/fhrpgroup_edit.html b/netbox/templates/ipam/fhrpgroup_edit.html
new file mode 100644
index 000000000..858d265ab
--- /dev/null
+++ b/netbox/templates/ipam/fhrpgroup_edit.html
@@ -0,0 +1,40 @@
+{% extends 'generic/object_edit.html' %}
+{% load form_helpers %}
+
+{% block form %}
+
+
+
FHRP Group
+
+ {% render_field form.protocol %}
+ {% render_field form.group_id %}
+ {% render_field form.description %}
+ {% render_field form.tags %}
+
+
+
+
+
Authentication
+
+ {% render_field form.auth_type %}
+ {% render_field form.auth_key %}
+
+
+ {% if not form.instance.pk %}
+
+
+
Virtual IP Address
+
+ {% render_field form.ip_vrf %}
+ {% render_field form.ip_address %}
+ {% render_field form.ip_status %}
+
+ {% endif %}
+
+ {% if form.custom_fields %}
+
+
Custom Fields
+
+ {% render_custom_fields form %}
+ {% endif %}
+{% endblock %}
diff --git a/netbox/templates/ipam/fhrpgroupassignment_edit.html b/netbox/templates/ipam/fhrpgroupassignment_edit.html
new file mode 100644
index 000000000..5801febca
--- /dev/null
+++ b/netbox/templates/ipam/fhrpgroupassignment_edit.html
@@ -0,0 +1,18 @@
+{% extends 'generic/object_edit.html' %}
+{% load form_helpers %}
+
+{% block form %}
+
+
+
FHRP Group Assignment
+
+
+ {% render_field form.group %}
+ {% render_field form.priority %}
+
+{% endblock %}
diff --git a/netbox/templates/ipam/inc/panels/fhrp_groups.html b/netbox/templates/ipam/inc/panels/fhrp_groups.html
new file mode 100644
index 000000000..e5cb26104
--- /dev/null
+++ b/netbox/templates/ipam/inc/panels/fhrp_groups.html
@@ -0,0 +1,54 @@
+{% load helpers %}
+
+
+
+
+
+
+
+ Group |
+ Protocol |
+ Virtual IPs |
+ Priority |
+
+
+
+ {% for assignment in object.fhrp_group_assignments.all %}
+
+
+ {{ assignment.group.group_id }}
+ |
+
+ {{ assignment.group.get_protocol_display }}
+ |
+
+ {% for ipaddress in assignment.group.ip_addresses.all %}
+ {{ ipaddress }}
+ {% if not forloop.last %} {% endif %}
+ {% endfor %}
+ |
+
+ {{ assignment.priority }}
+ |
+
+ {% empty %}
+
+ None |
+
+ {% endfor %}
+
+
+
+
+
diff --git a/netbox/templates/ipam/ipaddress.html b/netbox/templates/ipam/ipaddress.html
index 31782bdd7..c39f4398a 100644
--- a/netbox/templates/ipam/ipaddress.html
+++ b/netbox/templates/ipam/ipaddress.html
@@ -73,12 +73,14 @@
Assignment |
- {% if object.assigned_object %}
- {{ object.assigned_object.parent_object }} /
- {{ object.assigned_object }}
- {% else %}
- —
+ {% if object.assigned_object %}
+ {% if object.assigned_object.parent_object %}
+ {{ object.assigned_object.parent_object }} /
{% endif %}
+ {{ object.assigned_object }}
+ {% else %}
+ —
+ {% endif %}
|
diff --git a/netbox/templates/virtualization/vminterface.html b/netbox/templates/virtualization/vminterface.html
index 2646686e8..105adb6b7 100644
--- a/netbox/templates/virtualization/vminterface.html
+++ b/netbox/templates/virtualization/vminterface.html
@@ -76,11 +76,12 @@
+ {% include 'inc/panels/tags.html' %}
{% plugin_left_page object %}
{% include 'inc/panels/custom_fields.html' %}
- {% include 'inc/panels/tags.html' %}
+ {% include 'ipam/inc/panels/fhrp_groups.html' %}
{% plugin_right_page object %}
@@ -99,7 +100,7 @@
{% if perms.ipam.add_ipaddress %}
diff --git a/netbox/virtualization/models.py b/netbox/virtualization/models.py
index db2404546..08df36d4d 100644
--- a/netbox/virtualization/models.py
+++ b/netbox/virtualization/models.py
@@ -398,6 +398,12 @@ class VMInterface(PrimaryModel, BaseInterface):
object_id_field='assigned_object_id',
related_query_name='vminterface'
)
+ fhrp_group_assignments = GenericRelation(
+ to='ipam.FHRPGroupAssignment',
+ content_type_field='interface_type',
+ object_id_field='interface_id',
+ related_query_name='+'
+ )
objects = RestrictedQuerySet.as_manager()
diff --git a/netbox/virtualization/views.py b/netbox/virtualization/views.py
index 2294d2c38..5cb4f133a 100644
--- a/netbox/virtualization/views.py
+++ b/netbox/virtualization/views.py
@@ -8,7 +8,7 @@ from dcim.models import Device
from dcim.tables import DeviceTable
from extras.views import ObjectConfigContextView
from ipam.models import IPAddress, Service
-from ipam.tables import InterfaceIPAddressTable, InterfaceVLANTable
+from ipam.tables import AssignedIPAddressesTable, InterfaceVLANTable
from netbox.views import generic
from utilities.tables import paginate_table
from utilities.utils import count_related
@@ -421,7 +421,7 @@ class VMInterfaceView(generic.ObjectView):
def get_extra_context(self, request, instance):
# Get assigned IP addresses
- ipaddress_table = InterfaceIPAddressTable(
+ ipaddress_table = AssignedIPAddressesTable(
data=instance.ip_addresses.restrict(request.user, 'view').prefetch_related('vrf', 'tenant'),
orderable=False
)