Skip to content

Network Discovery

Knowing what's on your network is the foundation of good management — and of good troubleshooting. Documentation is ideal for this, but in practice it's rarely fully accurate. Network discovery protocols help map the network from the devices themselves.

Two protocols present by default on most routers and switches: CDP (Cisco) and LLDP (open standard).


Benefits of Discovery Protocols

Benefit Description
Device discovery Devices can announce themselves and their neighbors
Simplified management Devices in multi-vendor environments can exchange info to align with each other
Troubleshooting An accurate network overview = faster problem solving
Network mapping Configuration info about neighbors available without manual inventory
Integration Works together with SNMP

CDP — Cisco Discovery Protocol

Cisco-proprietary L2 protocol. Periodically sends out CDP advertisements to neighbors to introduce itself. Exchanged info: device type, name, interfaces, capabilities, ...

Enabled by default on Cisco devices.

Handy when documentation is missing — show cdp neighbors immediately shows which devices are connected to which ports, and show cdp neighbors detail gives extra info such as IP addresses and IOS version.

CDP commands

show cdp                    → global CDP info (intervals, hold time)
show cdp neighbors          → overview of all neighbors
show cdp neighbors detail   → detailed info per neighbor (IP, IOS version, ...)
show cdp interface          → which interfaces have CDP active

Configuring CDP

! Enable or disable globally
Router(config)# cdp run
Router(config)# no cdp run

! Per interface
Switch(config-if)# cdp enable
Switch(config-if)# no cdp enable

Security

CDP shares internal device info — disable it on access ports facing clients and on WAN ports. See L2 Threats for context.

Building the Topology Step by Step

  1. Start on a known device → show cdp neighbors
  2. Note the neighbors (Device ID, local and remote port, platform)
  3. Go to each neighboring device → repeat show cdp neighbors
  4. Keep going until no new neighbors turn up

Vendor-neutral open standard (IEEE 802.1AB) — also works in mixed environments with non-Cisco hardware. Operation and purpose identical to CDP.

Not enabled by default — must be explicitly turned on.

Configuring LLDP

! Enable globally
Switch(config)# lldp run
Switch(config)# no lldp run

! Per interface (transmit and receive can be controlled separately)
Switch(config-if)# lldp transmit
Switch(config-if)# lldp receive

Verifying LLDP

show lldp                    → global LLDP status
show lldp neighbors          → neighbor overview
show lldp neighbors detail   → detailed info per neighbor