“show cdp neighbors” What is it ?

In Cisco devices, the “show cdp neighbors” command is used to display information about directly connected neighboring devices that are also running CDP (Cisco Discovery Protocol). The output provides details about neighboring devices, including their device ID, local interface, and platform.

Here’s an example of using the “show cdp neighbors” command on a Cisco switch:

Switch# show cdp neighbors

Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
Switch1          Gig 1/0/1         169        S I         WS-C3750X Gig 1/0/1
Router1          Gig 1/0/2         124        R S I       3945      Gig 0/1
Switch2          Gig 1/0/3         155        S I         WS-C3750X Gig 1/0/3

Explanation of the output:

  • Device ID: This column displays the hostname or device ID of the neighboring device running CDP.
  • Local Intrfce: This column shows the local interface through which the neighboring device is connected.
  • Holdtme: The holdtime indicates how long the neighbor information will be retained, in seconds.
  • Capability: The capability codes represent the type of device (e.g., router, switch, host).
  • Platform: This column displays the model or platform of the neighboring device.
  • Port ID: The port ID represents the interface on the neighboring device through which it is connected to the local device.

In the example above, the switch has discovered three neighboring devices:

  1. Device with the hostname “Switch1,” connected to the local interface “Gig 1/0/1” on the Cisco switch.
  2. Device with the hostname “Router1,” connected to the local interface “Gig 1/0/2” on the Cisco switch.
  3. Device with the hostname “Switch2,” connected to the local interface “Gig 1/0/3” on the Cisco switch.

The information displayed by the “show cdp neighbors” command can be valuable for understanding the network topology and verifying direct connections between Cisco devices.

Troubleshooting CDP (Cisco Discovery Protocol) involves identifying and resolving issues related to CDP operation on Cisco devices. Here are some common troubleshooting steps to help you diagnose and resolve CDP-related problems:

  1. Verify CDP Status:
    • Check if CDP is enabled on the interfaces of the Cisco devices. Use the following command on the device’s command-line interface (CLI) to verify CDP status:
show cdp interface

Check CDP Neighbor Information:

  • Use the following command to check the CDP neighbor information and verify if the device is receiving CDP advertisements from neighboring devices:
show cdp neighbors
  • Verify CDP Timers:
    • By default, CDP sends advertisements every 60 seconds. Ensure that CDP timers are correctly configured on both ends of the link to avoid issues related to mismatched timers.
  • Check for Disabled Interfaces:
    • If CDP is not working on a specific interface, check if the interface is administratively down or if it has been disabled for CDP:
show interfaces status
  1. Check for CDP Packet Drops:
    • Monitor the device’s system logs or console messages for any indications of CDP packet drops or errors.
  2. Interoperability with Non-Cisco Devices:
    • If CDP is not working between Cisco and non-Cisco devices, consider using the industry-standard Link Layer Discovery Protocol (LLDP) instead of CDP for interoperability.
  3. Check for Cabling and Connectivity Issues:
    • Ensure that the physical connections (cables and connectors) between the devices are secure and functioning properly.
  4. Verify VLAN Configuration:
    • CDP operates at the data link layer and is VLAN-aware. If devices are in different VLANs, CDP may not work across them. Check VLAN configurations to ensure proper communication.
  5. Verify Multicast Configuration:
    • CDP uses multicast packets for advertisement messages. Ensure that multicast is enabled and functioning correctly on the network.
  6. Check Security Policies:
    • If CDP is not working between certain segments, check if there are any security policies (such as access control lists) blocking CDP traffic.
  7. Update Firmware and Software:
    • Check for firmware or software updates on the Cisco devices. Outdated firmware or software can sometimes cause CDP-related issues.
  8. Restart CDP Service (if necessary):
    • In some cases, restarting the CDP service on a Cisco device may resolve issues related to CDP operation.

Remember that CDP is a Cisco proprietary protocol. If you are working with non-Cisco devices, consider using LLDP for network discovery and interoperability.

Always be cautious when troubleshooting network protocols, and avoid making changes during production hours. Document your troubleshooting steps and seek assistance from Cisco support or network experts if needed.

Leave a comment