Neighbor Discovery

This guide shows how to use Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP) to discover directly connected neighbors.

Cisco Discovery Protocol (CDP)

CDP is a proprietary protocol developed by Cisco Systems that is used to discover information about other Cisco devices on a network. It is used by Cisco devices to advertise their presence on the network and to share information about other directly connected Cisco equipment, including device type, uptime, IOS version, and IP address. CDP is enabled on switches by default.

Description
Enter into global configuration mode
Enable CDP
Disable CDP
Exit from the configuration mode
Display connected Cisco device neighbors
Display more details of connected Cisco device neighbors
CLI Commands
configure terminal
cdp run
no cdp run
end
show cdp neighbors
show cdp neighbors detail
cdp run

LABSWITCH01#conf t
LABSWITCH01(config)#cdp run
LABSWITCH01(config)#end
LABSWITCH01#
show cdp neighbors

LABSWITCH01#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
                  D - Remote, C - CVTA, M - Two-port Mac Relay

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
LABSWITCH02
                 Gig 1/1/1         172              S I   C9300-24P Gig 1/1/1

Total cdp entries displayed : 1
LABSWITCH01#
show cdp neighbors detail

LABSWITCH01#show cdp neighbors detail
-------------------------
Device ID: LABSWITCH02
Entry address(es):
  IP address: 192.20.8.2
Platform: cisco C9300-24P,  Capabilities: Switch IGMP
Interface: GigabitEthernet1/1/1,  Port ID (outgoing port): GigabitEthernet1/1/1
Holdtime : 158 sec

Version :
Cisco IOS Software [Bengaluru], Catalyst L3 Switch Software (CAT9K_IOSXE), Version 17.6.5, RELEASE SOFTWA            RE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2023 by Cisco Systems, Inc.
Compiled Wed 25-Jan-23 16:15 by mcpre

advertisement version: 2
VTP Management Domain: ''
Native VLAN: 1
Duplex: full
Management address(es):
  IP address: 192.20.8.2


Total cdp entries displayed : 1
LABSWITCH01#
show cdp neighbors ?

LABSWITCH01#show cdp neighbors ?
  AccessTunnel          Access Tunnel interface
  AppGigabitEthernet    App-hosting Gigabit Ethernet
  Auto-Template         Auto-Template interface
  BDI                   Bridge-Domain interface
  Bluetooth             Bluetooth interface
  CEM-PG                Circuit Emulation interface with Protection group
  FortyGigabitEthernet  Forty Gigabit Ethernet
  GMPLS                 MPLS interface
  GigabitEthernet       GigabitEthernet IEEE 802.3z
  InternalInterface     Internal Interface
  LISP                  Locator/ID Separation Protocol Virtual Interface
  Lspvif                LSP virtual interface
  PROTECTION_GROUP      Protection-group controller
  Port-channel          Ethernet Channel of interfaces
  SDH_ACR               Virtual SDH-ACR controller
  SERIAL-ACR            Serial interface with ACR
  Serial-PG             Serial interface with Protection Group
  TLS-VIF               TLS Virtual Interface
  TenGigabitEthernet    Ten Gigabit Ethernet
  Tunnel                Tunnel interface
  Tunnel-tp             MPLS Transport Profile interface
  TwentyFiveGigE        Twenty Five Gigabit Ethernet
  VirtualPortGroup      Virtual Port Group
  detail                Show detailed information
  nve                   Network virtualization endpoint interface
  |                     Output modifiers
show cdp ?

LABSWITCH01#show cdp ?
  entry      Information for specific neighbor entry
  interface  CDP interface status and configuration
  neighbors  CDP neighbor entries
  tlv        CDP optional TLVs
  tlv-list   Information  about specific tlv list
  traffic    CDP statistics
  vlan       Limit CDP info to interfaces on a given vlan
  |          Output modifiers

Premium Access

Log in or register - Premium members can access all content without restrictions.

Get Premium

0 Comments

Submit a Comment