Disable "Virtual Interface" types from displaying in "LLDP Neighbors" tab of device #1169

Closed
opened 2025-12-29 16:29:41 +01:00 by adam · 2 comments
Owner

Originally created by @bdlamprecht on GitHub (Aug 11, 2017).

Issue type:

Bug

NetBox version:
2.1.2

With the recent integration of NAPALM, LLDP information is displayed on the "LLDP Neighbors" tab of a device. Currently all interfaces are displayed on the that tab (including "Virtual" interfaces that will never have a neighbor.

This request is to exclude those all "virtual" and "lag" interfaces from being displayed on that tab.

Originally created by @bdlamprecht on GitHub (Aug 11, 2017). ### Issue type: Bug **NetBox version:** 2.1.2 With the recent integration of NAPALM, LLDP information is displayed on the "LLDP Neighbors" tab of a device. Currently *all* interfaces are displayed on the that tab (including "Virtual" interfaces that will _never_ have a neighbor. This request is to exclude those all "virtual" and "lag" interfaces from being displayed on that tab.
adam added the type: bug label 2025-12-29 16:29:41 +01:00
adam closed this issue 2025-12-29 16:29:41 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 14, 2017):

Calling this a bug since the current behavior doesn't really make sense.

@jeremystretch commented on GitHub (Aug 14, 2017): Calling this a bug since the current behavior doesn't really make sense.
Author
Owner

@huzichunjohn commented on GitHub (Aug 15, 2017):

--- a/netbox/dcim/views.py
+++ b/netbox/dcim/views.py
@@ -32,6 +32,7 @@ from .models import (
     Manufacturer, InventoryItem, Platform, PowerOutlet, PowerOutletTemplate, PowerPort, PowerPortTemplate, Rack,
     RackGroup, RackReservation, RackRole, Region, Site,
 )
+from .constants import *
 
 
 EXPANSION_PATTERN = '\[(\d+-\d+)\]'
@@ -937,8 +938,10 @@ class DeviceLLDPNeighborsView(PermissionRequiredMixin, View):
         interfaces = Interface.objects.order_naturally(
             device.device_type.interface_ordering
         ).filter(
-            device=device
-        ).select_related(
+            device=device,
+       ).exclude(
+           form_factor__in=VIRTUAL_IFACE_TYPES
+       ).select_related(
             'connected_as_a', 'connected_as_b'
         )
@huzichunjohn commented on GitHub (Aug 15, 2017): ```diff --- a/netbox/dcim/views.py +++ b/netbox/dcim/views.py @@ -32,6 +32,7 @@ from .models import ( Manufacturer, InventoryItem, Platform, PowerOutlet, PowerOutletTemplate, PowerPort, PowerPortTemplate, Rack, RackGroup, RackReservation, RackRole, Region, Site, ) +from .constants import * EXPANSION_PATTERN = '\[(\d+-\d+)\]' @@ -937,8 +938,10 @@ class DeviceLLDPNeighborsView(PermissionRequiredMixin, View): interfaces = Interface.objects.order_naturally( device.device_type.interface_ordering ).filter( - device=device - ).select_related( + device=device, + ).exclude( + form_factor__in=VIRTUAL_IFACE_TYPES + ).select_related( 'connected_as_a', 'connected_as_b' ) ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1169