Use it to find what is at the other end of a cable, document a network, or set up and check remote access to a device.
Discovery & Device Management
1. show cdp neighbors — is the expected device on the expected port?
2. Nothing → show cdp interface: CDP off, or the neighbour speaks LLDP only (lldp run).
3. Cannot SSH → show ip ssh: enabled? Keys generated?
4. show running-config | section line vty — transport input ssh and login local?
5. Reachable only from its own subnet → the default gateway on the switch.
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show ip interface briefShow Commands
Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.
show ip interface briefShowCompact IPv4 interface/address/protocol state.
Use when: Use as the prior manifest-approved bounded observation/validation surface for this exact Topic.
Quick note: Restores exact/ ownership only; this authored guidance is not observed production Evidence.
Cisco IOS XE · stateshow cdp neighbors detailShowDisplay Cisco neighbor information.
Use when: Topology discovery.
Quick note: Cisco-specific discovery.
IOS/IOS XE · mixedshow lldp neighbors detailShowDisplay LLDP neighbor information.
Use when: Vendor-neutral topology discovery.
Quick note: Useful with mixed vendors.
IOS/IOS XE · mixedVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Commands & verification Verify boundary
| Command | Shows |
|---|---|
show cdp neighbors | One line per neighbour: name, local port, hold time, capability, platform, remote port |
show cdp neighbors detail | Also the neighbour's address, software version and native VLAN |
show lldp neighbors / show lldp neighbors detail | The same from LLDP |
show cdp interface | Where CDP is enabled, with timers |
show ip ssh | Whether SSH is enabled, and the version |
show line vty 0 4 | The vty lines and their settings |
show users | Current sessions |
show ip interface brief | The management address and its state |
Step 2 Troubleshooting workflow Narrow the fault
A neighbour is missing.
1. show cdp interface — is CDP running on that interface? Globally (cdp run)?
2. The neighbour is not Cisco, or has CDP off → use LLDP: lldp run on both.
3. Is the link up at all? An entry lingers for the hold time after a link fails, then disappears.
4. A device in between — an unmanaged switch, a media converter — may pass or swallow the advertisements; what you see is then not the directly connected device.
Cannot connect with SSH.
1. Can the management address be pinged? If only from its own subnet: the switch lacks ip default-gateway.
2. show ip ssh — enabled? "Disabled" usually means no RSA key: set hostname and domain name, generate the key.
3. show running-config | section line vty — transport input ssh and login local present? Is an access-class limiting the source addresses?
4. Does a local user exist — or, with AAA, is the server reachable?
5. Connection opens and is refused at login → credentials or the authentication method.
Step 3 Common mistakes Narrow the fault
- "CDP shows the whole network." Only the directly connected neighbours.
- "LLDP is on by default like CDP." On Cisco IOS it must be enabled.
- "Discovery protocols are harmless." They reveal model, software version and addresses; disable them on untrusted ports.
- "SSH is enabled once a password is set." It also needs a hostname, a domain name and an RSA key.
- "
transport input allis fine." It leaves Telnet open, sending passwords in clear text. - "A Layer 2 switch needs no gateway." It needs one to be managed from another network.
- "The neighbour entry is still there, so the link is up." Entries remain for the hold time after the last advertisement.
CDP and LLDP see only the direct neighbour and run per interface; LLDP is often off by default on Cisco. Both reveal information — disable them on ports facing outside. SSH needs a hostname, a domain name, an RSA key, a local user and transport input ssh on the vty lines. A Layer 2 switch needs a management SVI and a default gateway.
show cdp neighbors/show cdp neighbors detail— neighbour, local port, remote port, platform, address.show lldp neighbors/show lldp neighbors detail— the same by LLDP.show cdp interface— where CDP runs.show ip ssh— SSH enabled and version.show line vty 0 4andshow running-config | section line vty— allowed protocols and login method.show users— who is logged on.
ReferenceWhat it is1 section · depth on demand
Concept overview
ReferenceWhy it matters1 section · depth on demand
Why it matters
Neighbour information is the quickest way to learn or confirm how a network is cabled — which device and port is at the other end of each link — without tracing cables. Secure remote access is what makes a device manageable at all; the handful of commands it requires are among the first configured on any switch or router.
ReferenceHow it works1 section · depth on demand
How it works
Discovery. Each device periodically sends an advertisement out of every enabled interface. The neighbour stores it and does not forward it, so only directly connected devices are seen.
| CDP | LLDP | |
|---|---|---|
| Standard | Cisco proprietary | IEEE 802.1AB |
| Default on Cisco IOS | Enabled | Disabled |
| Advertisement interval | 60 seconds | 30 seconds |
| Hold time | 180 seconds | 120 seconds |
| Enable globally | cdp run | lldp run |
| Per interface | cdp enable | lldp transmit, lldp receive |
An advertisement carries the device name, the sending port, the platform, capabilities (router, switch, phone), the software version, a management address and — in CDP — the native VLAN and duplex, which is how mismatches get reported in the log.
IP phones and access points use these protocols to learn their voice VLAN and negotiate power.
Security. The same information is useful to an attacker. Turn the protocols off on interfaces facing users you do not trust, providers and the internet: no cdp enable, no lldp transmit.
Management access.
| Method | Notes |
|---|---|
| Console | Physical port; works without any network configuration |
| SSH | Encrypted remote access; the standard |
| Telnet | Clear text; should be disabled |
| HTTPS | Web interface or API |
Enabling SSH takes a name, a key and an account:
hostname SW1
ip domain name example.com
crypto key generate rsa modulus 2048
ip ssh version 2
username admin secret <password>
line vty 0 15
transport input ssh
login local
The management address. A router is reached on any of its interface addresses, preferably a loopback. A Layer 2 switch needs an address on a VLAN interface and a default gateway to be reachable from other networks:
interface Vlan99
ip address 10.0.99.11 255.255.255.0
no shutdown
ip default-gateway 10.0.99.1
ReferenceImportant terms & boundaries3 sections · depth on demand
Important terms & boundaries
| Term | Meaning |
|---|---|
| Device ID | The neighbour's hostname |
| Local interface | The port on this device |
| Port ID | The port on the neighbour |
| Hold time | Seconds until the entry expires without a new advertisement |
| Capability | R router, S switch, T bridge, P phone, H host |
| vty lines | The virtual lines that remote sessions use |
| SVI | A VLAN interface; holds a switch's management address |
In depth
Discovery and device management
Managing a network starts with knowing what is connected where and being able to reach each device safely. Cisco's IOS XE system management guide describes the main discovery tool, CDP:
- Each device advertises its device ID, addresses, port, capabilities, software version and platform.
- Advertisements go to a multicast address every 60 seconds by default.
- Neighbours keep the information for 180 seconds.
show cdp neighbors [detail]lists them.show cdp trafficshows packet and checksum-error counts.
Discovery and management building blocks
| Need | Tools |
|---|---|
| Who is connected to this port? | CDP, LLDP |
| Where is a MAC or IP address? | MAC address table, ARP, DHCP snooping bindings |
| Reach the device | SSH (in-band), console or out-of-band network |
| Know what's installed | show inventory, show version |
| Keep it consistent | Templates, configuration archive, Catalyst Center |
| Find devices at scale | Catalyst Center discovery (CDP/LLDP and IP ranges) |
Tracing a host to its switch port
| Step | Command |
|---|---|
| 1. Find the MAC for the IP on the gateway | show ip arp 10.110.0.64 |
| 2. Find where that MAC is learned | show mac address-table address <mac> |
| 3. If it is learned on an uplink, find the neighbour | show cdp neighbors <uplink> |
| 4. Repeat on the next switch | Until the MAC appears on an access port |
dist1# show ip arp 10.110.0.64
Internet 10.110.0.64 2 a4bb.6d55.0164 ARPA Vlan110
dist1# show mac address-table address a4bb.6d55.0164
110 a4bb.6d55.0164 DYNAMIC Te1/0/5
dist1# show cdp neighbors TenGigabitEthernet1/0/5 | include acc
acc-2f-01 Ten 1/0/5 151 S I C9300-48P Ten 1/1/1
acc-2f-01# show mac address-table address a4bb.6d55.0164
110 a4bb.6d55.0164 DYNAMIC Gi1/0/14
acc-2f-01# show interfaces GigabitEthernet1/0/14 description
Device management essentials
| Item | Practice |
|---|---|
| Management access | SSH v2 only, AAA, management ACLs |
| Time | NTP everywhere |
| Logs | Central syslog |
| Backups | Automatic configuration archives |
| Inventory | Serial numbers and software versions recorded centrally |
The guide notes that a neighbour without an IP address on the link may report another interface's address. Check the detail output before using that address for management.
Documented example, not captured output.
Quick reference
Discovery protocols let devices tell their directly connected neighbours who they are. CDP (Cisco) and LLDP (standard) advertise the device name, model, port and management address, which engineers use to trace cabling and management systems use to build inventories and topology maps. Because the same information is useful to attackers, discovery should be turned off on ports facing untrusted networks.
Device discovery and management basics: CDP (Cisco) and LLDP (IEEE 802.1AB) advertise device name, platform, port and management address to neighbours; NMS and Catalyst Center use them plus IP ranges to build inventory.
show cdp neighbors detail
show lldp neighbors detail
lldp run
no cdp enable ! on untrusted/edge ports
Disable CDP/LLDP towards the internet and untrusted ports (information disclosure), but keep LLDP-MED on access ports for IP phones (voice VLAN, PoE negotiation).
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Network Access → Discovery & Device Management. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%