diff --git a/netbox/dcim/tables/devices.py b/netbox/dcim/tables/devices.py
index f01a3ed2f..859c5d573 100644
--- a/netbox/dcim/tables/devices.py
+++ b/netbox/dcim/tables/devices.py
@@ -27,6 +27,7 @@ __all__ = (
'DeviceTable',
'FrontPortTable',
'InterfaceTable',
+ 'InterfaceLAGMemberTable',
'InventoryItemRoleTable',
'InventoryItemTable',
'MACAddressTable',
@@ -689,6 +690,33 @@ class InterfaceTable(BaseInterfaceTable, ModularDeviceComponentTable, PathEndpoi
default_columns = ('pk', 'name', 'device', 'label', 'enabled', 'type', 'description')
+class InterfaceLAGMemberTable(PathEndpointTable, NetBoxTable):
+ parent = tables.Column(
+ verbose_name=_('Parent'),
+ accessor=Accessor('device'),
+ linkify=True,
+ )
+ name = tables.Column(
+ verbose_name=_('Name'),
+ linkify=True,
+ order_by=('_name',),
+ )
+ connection = columns.TemplateColumn(
+ accessor='connected_endpoints',
+ template_code=INTERFACE_LAG_MEMBERS_LINKTERMINATION,
+ verbose_name=_('Peer'),
+ orderable=False,
+ )
+ tags = columns.TagColumn(
+ url_name='dcim:interface_list'
+ )
+
+ class Meta(NetBoxTable.Meta):
+ model = models.Interface
+ fields = ('pk', 'parent', 'name', 'type', 'connection')
+ default_columns = ('pk', 'parent', 'name', 'type', 'connection')
+
+
class DeviceInterfaceTable(InterfaceTable):
name = tables.TemplateColumn(
verbose_name=_('Name'),
diff --git a/netbox/dcim/tables/template_code.py b/netbox/dcim/tables/template_code.py
index 356f76750..3675a18cc 100644
--- a/netbox/dcim/tables/template_code.py
+++ b/netbox/dcim/tables/template_code.py
@@ -24,6 +24,24 @@ INTERFACE_LINKTERMINATION = """
{% else %}""" + LINKTERMINATION + """{% endif %}
"""
+INTERFACE_LAG_MEMBERS_LINKTERMINATION = """
+{% for termination in value %}
+ {% if termination.parent_object %}
+ {{ termination.parent_object }}
+
+ {% endif %}
+ {{ termination }}
+ {% if termination.lag %}
+
+ {{ termination.lag }}
+ (LAG)
+ {% endif %}
+ {% if not forloop.last %}
{% endif %}
+{% empty %}
+ {{ ''|placeholder }}
+{% endfor %}
+"""
+
CABLE_LENGTH = """
{% load helpers %}
{% if record.length %}{{ record.length|floatformat:"-2" }} {{ record.length_unit }}{% endif %}
diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py
index d12bd9f1c..35f3b90c1 100644
--- a/netbox/dcim/views.py
+++ b/netbox/dcim/views.py
@@ -3135,6 +3135,14 @@ class InterfaceView(generic.ObjectView):
)
child_interfaces_table.configure(request)
+ # Get LAG interfaces
+ lag_interfaces = Interface.objects.restrict(request.user, 'view').filter(lag=instance)
+ lag_interfaces_table = tables.InterfaceLAGMemberTable(
+ lag_interfaces,
+ orderable=False
+ )
+ lag_interfaces_table.configure(request)
+
# Get assigned VLANs and annotate whether each is tagged or untagged
vlans = []
if instance.untagged_vlan is not None:
@@ -3164,6 +3172,7 @@ class InterfaceView(generic.ObjectView):
'bridge_interfaces': bridge_interfaces,
'bridge_interfaces_table': bridge_interfaces_table,
'child_interfaces_table': child_interfaces_table,
+ 'lag_interfaces_table': lag_interfaces_table,
'vlan_table': vlan_table,
'vlan_translation_table': vlan_translation_table,
}
diff --git a/netbox/templates/dcim/interface.html b/netbox/templates/dcim/interface.html
index b53d239b4..dc873a89f 100644
--- a/netbox/templates/dcim/interface.html
+++ b/netbox/templates/dcim/interface.html
@@ -370,33 +370,6 @@
{% endif %}
- {% if object.is_lag %}
-
| {% trans "Parent" %} | -{% trans "Interface" %} | -{% trans "Type" %} | -
|---|---|---|
| {{ member.device|linkify }} | -{{ member|linkify }} | -{{ member.get_type_display }} | -
| {% trans "No member interfaces" %} | -||