Courseiva
CDP / LLDPGlobal Config

cdp run

Enables Cisco Discovery Protocol (CDP) globally on the device to discover directly connected Cisco devices and gather information about them.

Definition: cdp run is a Cisco IOS global config command. Enables Cisco Discovery Protocol (CDP) globally on the device to discover directly connected Cisco devices and gather information about them.

Overview

The `cdp run` command is a global configuration command that enables Cisco Discovery Protocol (CDP) on a Cisco IOS device. CDP is a proprietary Layer 2 protocol used by Cisco devices to advertise their identity, capabilities, and neighbors to directly connected Cisco devices. It operates at the data link layer and uses multicast frames to share information such as device hostname, hardware platform, software version, and IP addresses.

This command is essential for network discovery, documentation, and troubleshooting in environments where Cisco devices are interconnected. When enabled globally, CDP is active on all interfaces that support it (e.g., Ethernet, FastEthernet, GigabitEthernet, Serial) unless explicitly disabled per interface with `no cdp enable`. The primary use case is to automatically build a topology map of directly connected Cisco devices, which is invaluable for network engineers during initial deployment, expansion, or fault isolation.

Alternatives include LLDP (Link Layer Discovery Protocol), which is an IEEE standard (802.1AB) and works with multivendor equipment. CDP is preferred in all-Cisco environments because it provides richer Cisco-specific information (e.g., native VLAN, duplex mode, VTP domain). In a broader workflow, `cdp run` is typically one of the first commands configured on a new device to enable neighbor discovery.

It is often combined with `show cdp neighbors` and `show cdp neighbors detail` to gather detailed information. The command has no parameters; it simply toggles CDP globally. Important IOS behaviors: CDP is enabled by default on most Cisco IOS versions (12.x and later), so `cdp run` is often unnecessary unless it was previously disabled with `no cdp run`.

The command takes effect immediately and is saved to the running configuration. There is no buffered output; the command executes silently. Privilege level 15 (privileged EXEC) is required to enter global configuration mode.

Disabling CDP globally can reduce control plane traffic and improve security in untrusted environments, but it also removes the ability to discover neighbors automatically. The command does not impact data plane forwarding; it only affects CDP advertisements and processing. In summary, `cdp run` is a foundational command for network discovery in Cisco environments, enabling a protocol that simplifies network management and troubleshooting.

Syntax·Global Config
cdp run

When to Use This Command

  • Enable CDP on a new router to automatically discover neighboring Cisco devices and verify Layer 2 connectivity.
  • Re-enable CDP after it was globally disabled for security hardening, to assist in network troubleshooting.
  • Enable CDP on a switch to map the network topology and identify connected devices before configuring interfaces.
  • Enable CDP temporarily during a network audit to collect neighbor information for documentation.

Command Examples

Enable CDP globally

Router(config)# cdp run
Router(config)#

No output is displayed upon successful execution. The command simply enables CDP globally. Use 'show cdp' to verify that CDP is running.

Verify CDP is enabled

Router# show cdp
Global CDP information:
	Sending CDP packets every 60 seconds
	Sending a holdtime value of 180 seconds
	Sending CDPv2 advertisements is enabled

The output confirms CDP is globally enabled. 'Sending CDP packets every 60 seconds' shows the default update interval. 'Holdtime value of 180 seconds' indicates how long a neighbor is kept before being removed. 'Sending CDPv2 advertisements is enabled' means CDP version 2 is active, which provides more detailed information.

Understanding the Output

The 'cdp run' command itself produces no output. To verify that CDP is enabled, use 'show cdp'. The output shows global CDP parameters: the update interval (default 60 seconds), holdtime (default 180 seconds), and CDP version (v2).

A holdtime of 180 seconds means a neighbor is considered down if no update is received for 180 seconds. If CDP is disabled, 'show cdp' will indicate 'CDP is not enabled'. In a real network, ensure CDP is enabled on devices that need to discover neighbors; if security policies require disabling CDP, use 'no cdp run' globally or 'no cdp enable' per interface.

Configuration Scenarios

Enable CDP on a new router for network discovery

A network engineer has just deployed a new Cisco router (R1) in a branch office. The router is connected to a core switch (SW1) and a WAN router (R2). The engineer wants to enable CDP globally to automatically discover these neighbors and gather device information for documentation.

Topology

R1(Gi0/0)---10.0.12.0/30---(Gi0/0)R2 R1(Gi0/1)---192.168.1.0/24---(Gi0/1)SW1

Steps

  1. 1.Step 1: Enter privileged EXEC mode: R1> enable
  2. 2.Step 2: Enter global configuration mode: R1# configure terminal
  3. 3.Step 3: Enable CDP globally: R1(config)# cdp run
  4. 4.Step 4: (Optional) Verify CDP is enabled: R1(config)# do show cdp
  5. 5.Step 5: Exit configuration mode: R1(config)# end
  6. 6.Step 6: View CDP neighbors: R1# show cdp neighbors
Configuration
! Enable CDP globally
R1(config)# cdp run
! Verify
R1# show cdp
Global CDP information:
	Sending CDP packets every 60 seconds
	Sending a holdtime value of 180 seconds
R1# show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
R2               Gig 0/0           172         R          ISR4331   Gig 0/0
SW1              Gig 0/1           162         S          WS-C2960  Gig 0/1

Verify: Use `show cdp neighbors` to list directly connected neighbors. Expected output shows R2 and SW1 with their capabilities, platform, and port IDs.

Watch out: CDP is enabled by default on most IOS versions. If you previously disabled it with `no cdp run`, re-enabling with `cdp run` restores it. However, if CDP is disabled per interface with `no cdp enable`, the global `cdp run` does not override that; you must re-enable CDP on each interface individually.

Disable CDP globally for security reasons

A security audit reveals that CDP can leak sensitive device information (e.g., hostnames, software versions, IP addresses) to potential attackers. The network team decides to disable CDP globally on all edge routers connecting to untrusted networks (e.g., internet-facing routers).

Topology

Edge-Router(Gi0/0)---Internet Edge-Router(Gi0/1)---10.0.0.0/30---(Gi0/1)Core-Router

Steps

  1. 1.Step 1: Enter privileged EXEC mode: Edge-Router> enable
  2. 2.Step 2: Enter global configuration mode: Edge-Router# configure terminal
  3. 3.Step 3: Disable CDP globally: Edge-Router(config)# no cdp run
  4. 4.Step 4: (Optional) Verify CDP is disabled: Edge-Router(config)# do show cdp
  5. 5.Step 5: Exit configuration mode: Edge-Router(config)# end
Configuration
! Disable CDP globally
Edge-Router(config)# no cdp run
! Verify
Edge-Router# show cdp
% CDP is not enabled

Verify: Use `show cdp` to confirm CDP is not enabled. The output should indicate that CDP is disabled.

Watch out: Disabling CDP globally also disables it on all interfaces. If you need CDP on specific internal interfaces, you must enable it per interface with `cdp enable` after globally disabling it. However, note that `cdp enable` requires CDP to be globally enabled; if CDP is globally disabled, per-interface enable commands are ignored. A better approach for selective disabling is to keep CDP globally enabled and disable it on specific interfaces with `no cdp enable`.

Troubleshooting with This Command

When troubleshooting CDP issues, the `cdp run` command itself is not directly used for diagnostics; instead, you use `show cdp` to verify global status and `show cdp neighbors` to check neighbor relationships. Healthy output from `show cdp` shows 'Global CDP information' with timers (default: 60-second update, 180-second holdtime). If CDP is disabled, the output shows '% CDP is not enabled'.

Problem indicators include: no neighbors appearing in `show cdp neighbors` despite physical connectivity; incomplete or missing device details; or CDP packets being dropped. Common symptoms this command helps diagnose: 1) **No CDP neighbors**: Check if CDP is globally enabled with `show cdp`. If disabled, enable it with `cdp run`.

Also verify that CDP is enabled on the interface (`show cdp interface`). 2) **Inconsistent neighbor information**: Ensure both devices have CDP enabled and are running compatible IOS versions. CDP version 2 is default; version 1 is used for older devices. 3) **High CPU due to CDP**: In large networks, CDP can cause CPU spikes. Adjust timers with `cdp timer` and `cdp holdtime` to reduce frequency. 4) **Security concerns**: If CDP is leaking information to untrusted networks, disable it globally or per interface.

A step-by-step diagnostic flow: 1) Verify global CDP status: `show cdp`. 2) If disabled, enable with `cdp run`. 3) Check interface status: `show cdp interface` to see which interfaces are CDP-enabled. 4) View neighbors: `show cdp neighbors` to see device IDs and local interfaces. 5) If no neighbors, check physical connectivity and that the neighbor also has CDP enabled. 6) Use `show cdp neighbors detail` to get IP addresses and platform details. 7) For deeper troubleshooting, use `debug cdp packets` (caution: can be CPU-intensive) to see CDP advertisements being sent and received. Correlate CDP output with `show lldp neighbors` if LLDP is also enabled, as both protocols can coexist. Also, check `show running-config | include cdp` to see CDP configuration.

In summary, `cdp run` is the enabler; troubleshooting revolves around verifying its status and interpreting neighbor data to resolve connectivity or discovery issues.

CCNA Exam Tips

1.

CCNA exam tip: CDP is enabled by default on Cisco devices; you may need to disable it for security. Know that 'cdp run' enables it globally.

2.

CCNA exam tip: CDP is Cisco proprietary; for multi-vendor environments, use LLDP (IEEE 802.1AB) instead.

3.

CCNA exam tip: CDP operates at Layer 2 and discovers only directly connected neighbors; it does not traverse routers.

4.

CCNA exam tip: The 'show cdp neighbors' command is commonly tested; remember it shows Device ID, Local Interface, Holdtime, Capability, Platform, and Port ID.

Common Mistakes

Mistake 1: Using 'cdp run' in interface configuration mode instead of global configuration mode. This will result in an invalid command error.

Mistake 2: Forgetting to use 'no cdp run' to disable CDP globally; instead, operators may disable it per interface, which is less efficient.

Mistake 3: Confusing 'cdp run' with 'cdp enable'; 'cdp run' is global, while 'cdp enable' is per interface.

cdp run vs no cdp run

The commands 'cdp run' and 'no cdp run' are direct opposites that globally enable or disable CDP. They are often compared when deciding whether to allow or block CDP advertisements, which impact device discovery and network security.

Aspectcdp runno cdp run
ScopeGlobal (entire device)Global (entire device)
Configuration ModeGlobal configurationGlobal configuration
PersistencePersists across reboots (saved in running-config)Persists across reboots (saved in running-config)
PrecedenceOverridden by per-interface 'no cdp enable'Overrides per-interface 'cdp enable'
Typical UseEnable CDP for network discovery and topology mappingDisable CDP to reduce traffic or enhance security
Default StateDefault is enabled on most devicesNot default; explicitly disables CDP

Use cdp run when you need CDP for discovering directly connected Cisco devices, building network topology, or troubleshooting Layer 2 connectivity.

Use no cdp run when you want to globally disable CDP to reduce control plane traffic, prevent device information leakage, or meet security policy requirements.

Platform Notes

In IOS-XE (e.g., Catalyst 9000 switches, ISR 4000 routers), the `cdp run` command syntax and behavior are identical to classic IOS. However, IOS-XE also supports LLDP, and CDP is still enabled by default. The output format of `show cdp neighbors` may be slightly different in newer versions (e.g., additional fields like 'Platform' or 'Port ID' formatting).

In NX-OS (e.g., Nexus switches), the equivalent command is `cdp enable` at the global configuration level, but note that NX-OS uses a different default: CDP is enabled by default on all interfaces. To disable globally, use `no cdp enable`. To verify, use `show cdp` or `show running-config cdp`.

NX-OS also supports `feature cdp` to enable the CDP feature if it has been disabled. On Cisco ASA firewalls, CDP is not supported; ASA uses a different discovery mechanism (e.g., ARP or static neighbor definitions). In IOS-XR (e.g., ASR 9000, CRS), CDP is not available; instead, LLDP is the standard discovery protocol.

The command `cdp run` does not exist in IOS-XR. For IOS versions: In 12.x, CDP is enabled by default; in 15.x and 16.x, the same applies. There are no significant syntax differences between these versions.

However, in very old IOS (11.x), CDP might be disabled by default. Always check the specific platform documentation. In summary, `cdp run` is consistent across IOS and IOS-XE, but NX-OS uses `cdp enable`, and ASA/IOS-XR do not support CDP.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with practice questions covering all CCNA 200-301 exam domains.

Practice CCNA 200-301 Questions