Courseiva
CDP / LLDPInterface Config

cdp enable

Enables Cisco Discovery Protocol (CDP) on a specific interface to allow the device to advertise itself and discover neighboring Cisco devices.

Definition: cdp enable is a Cisco IOS interface config command. Enables Cisco Discovery Protocol (CDP) on a specific interface to allow the device to advertise itself and discover neighboring Cisco devices.

Overview

The `cdp enable` command, issued in interface configuration mode, activates Cisco Discovery Protocol (CDP) on a specific interface. CDP is a Layer 2, media- and protocol-independent protocol that runs on all Cisco devices (routers, switches, access points, etc.) to share information with directly connected neighbors. When enabled, the interface sends periodic CDP advertisements (default every 60 seconds) containing device identifier, address list, port identifier, platform, capabilities, and software version.

This allows a network engineer to discover the topology, verify connectivity, and troubleshoot without needing direct access to neighboring devices. CDP is a Cisco proprietary protocol, so it only works between Cisco devices; for multi-vendor environments, the IEEE standard LLDP (Link Layer Discovery Protocol) is the alternative. The command is typically used when you need to enable CDP on a specific interface after globally disabling it with `no cdp run`, or when you want to selectively disable CDP on certain interfaces (using `no cdp enable`) while keeping it active on others.

It is also useful in scenarios where CDP is needed for network discovery tools (e.g., Cisco Network Assistant, Cisco Prime) or for troubleshooting Layer 2 connectivity issues. The command is available in all IOS privilege levels (user EXEC, privileged EXEC, global config, interface config) but the configuration change takes effect immediately and is saved to the running-config. Note that CDP advertisements are sent untagged (native VLAN) on trunk ports, and the protocol is enabled by default on all interfaces in most IOS versions.

However, best practices often recommend disabling CDP on interfaces facing untrusted networks (e.g., internet-facing) to reduce security risks, as CDP information can be exploited. The `cdp enable` command is the granular control to re-enable it where needed. Understanding CDP behavior is fundamental for CCNA/CCNP candidates as it appears in troubleshooting scenarios, network discovery, and automation tasks.

Syntax·Interface Config
cdp enable

When to Use This Command

  • Enable CDP on a newly configured interface to quickly verify connectivity and discover directly connected Cisco devices.
  • Re-enable CDP on an interface after it was disabled globally or per-interface for troubleshooting network topology.
  • Enable CDP on a trunk port to identify neighboring switches and verify VLAN configurations.
  • Enable CDP on a WAN interface to discover the remote router's platform and IP address for inventory management.

Command Examples

Enable CDP on a GigabitEthernet interface

interface GigabitEthernet0/1 cdp enable
Router(config-if)# cdp enable
Router(config-if)#

No output is displayed upon successful execution. The command is entered in interface configuration mode. Use 'show cdp interface' to verify CDP is enabled on the interface.

Enable CDP on a Serial interface

interface Serial0/0/0 cdp enable
Router(config-if)# cdp enable
Router(config-if)#

Same as above; no output confirms the command was accepted. Verify with 'show cdp neighbors' to see discovered devices on this interface.

Understanding the Output

The 'cdp enable' command itself produces no output. To verify CDP is enabled on an interface, use 'show cdp interface [interface-id]'. The output shows CDP status (administratively up/down), packet frequency (default 60 seconds), holdtime (default 180 seconds), and version.

A 'good' status shows 'Sending CDP packets every 60 seconds' and 'Holdtime is 180 seconds'. If CDP is disabled, you'll see 'CDP is not enabled on the interface'. Watch for 'CDP is not enabled' which indicates the interface is not participating in CDP.

Also, 'show cdp neighbors' lists discovered devices; an empty output may indicate CDP is disabled or no neighbors are present.

Configuration Scenarios

Enable CDP on a specific interface after global disable

A network administrator has globally disabled CDP on a router for security reasons, but needs to enable it on the management interface (GigabitEthernet0/0) to allow network monitoring tools to discover the device.

Topology

R1(Gi0/0)---10.0.12.0/30---(Gi0/0)R2

Steps

  1. 1.Step 1: Enter global configuration mode: R1# configure terminal
  2. 2.Step 2: Globally disable CDP (if not already done): R1(config)# no cdp run
  3. 3.Step 3: Enter interface configuration mode for Gi0/0: R1(config)# interface GigabitEthernet0/0
  4. 4.Step 4: Enable CDP on this interface: R1(config-if)# cdp enable
  5. 5.Step 5: Exit and verify: R1(config-if)# end; R1# show cdp interface GigabitEthernet0/0
Configuration
! Global disable of CDP
no cdp run
!
interface GigabitEthernet0/0
 cdp enable
!

Verify: R1# show cdp interface GigabitEthernet0/0 GigabitEthernet0/0 is up, line protocol is up Encapsulation ARPA Sending CDP packets every 60 seconds Holdtime 180 seconds

Watch out: If CDP is globally disabled with `no cdp run`, the `cdp enable` command on an interface will not work; the interface will remain CDP-disabled. You must first globally enable CDP with `cdp run` (or not disable it) for `cdp enable` to take effect.

Selectively disable CDP on a public-facing interface and re-enable on internal interfaces

A switch has CDP enabled globally, but the security policy requires CDP to be disabled on the uplink interface to the internet (GigabitEthernet1/0/1) while keeping it enabled on internal interfaces for network discovery.

Topology

SW1(Gi1/0/1)---Internet; SW1(Gi1/0/2)---192.168.1.0/24---PC

Steps

  1. 1.Step 1: Enter global configuration mode: SW1# configure terminal
  2. 2.Step 2: Enter the uplink interface: SW1(config)# interface GigabitEthernet1/0/1
  3. 3.Step 3: Disable CDP on this interface: SW1(config-if)# no cdp enable
  4. 4.Step 4: Verify CDP status on the interface: SW1(config-if)# do show cdp interface GigabitEthernet1/0/1
  5. 5.Step 5: For internal interfaces, ensure CDP is enabled (default): SW1(config)# interface GigabitEthernet1/0/2; SW1(config-if)# cdp enable (if previously disabled)
Configuration
! By default CDP is globally enabled
interface GigabitEthernet1/0/1
 no cdp enable
!
interface GigabitEthernet1/0/2
 cdp enable
!

Verify: SW1# show cdp interface GigabitEthernet1/0/1 GigabitEthernet1/0/1 is up, line protocol is up Encapsulation ARPA CDP is not enabled on this interface SW1# show cdp interface GigabitEthernet1/0/2 GigabitEthernet1/0/2 is up, line protocol is up Encapsulation ARPA Sending CDP packets every 60 seconds Holdtime 180 seconds

Watch out: If you disable CDP globally with `no cdp run`, all interfaces stop sending CDP packets regardless of the `cdp enable` setting on individual interfaces. Always check global CDP status with `show cdp` before troubleshooting interface-level CDP issues.

Troubleshooting with This Command

When troubleshooting CDP issues, the `cdp enable` command is often used to ensure CDP is active on an interface. Healthy output from `show cdp interface` shows 'Sending CDP packets every 60 seconds' and 'Holdtime 180 seconds'. If the output says 'CDP is not enabled on this interface', then `cdp enable` is needed.

Common symptoms that CDP is disabled include: `show cdp neighbors` returns no output even though directly connected Cisco devices exist, or network management tools cannot discover the device. A step-by-step diagnostic flow: 1) Check global CDP status with `show cdp` – if 'Global CDP information: Sending CDP packets every 60 seconds' is missing, enable globally with `cdp run`. 2) Check interface-specific CDP status with `show cdp interface [interface]`. If disabled, enter interface config mode and issue `cdp enable`. 3) Verify that the interface is up/up – CDP only sends packets on interfaces that are in the up/up state. 4) Check for ACLs or port security that might block CDP packets (CDP uses multicast address 01:00:0c:cc:cc:cc). 5) On trunk ports, ensure the native VLAN is consistent; CDP is sent untagged on the native VLAN. 6) Use `debug cdp packets` (with caution in production) to see if CDP packets are being sent/received.

Correlate with `show lldp neighbors` if LLDP is also enabled – CDP and LLDP can coexist. If CDP neighbors are not seen, also check the holdtime: the default is 180 seconds, so if a neighbor goes down, it takes up to 180 seconds to be removed from the CDP table. Focus on the 'Device ID', 'Platform', and 'Port ID' fields in `show cdp neighbors detail` to verify correct neighbor information.

If the output shows incorrect or missing entries, verify that both ends have CDP enabled and are Cisco devices.

CCNA Exam Tips

1.

CDP is enabled globally by default on Cisco devices; you only need 'cdp enable' on an interface if CDP was globally disabled with 'no cdp run'.

2.

CDP is a Layer 2 protocol and works only on directly connected Cisco devices; it does not cross routers or switches.

3.

The CCNA exam may test that CDP is Cisco proprietary and can be disabled per interface for security reasons.

4.

Remember that 'cdp enable' is an interface command, while 'cdp run' is global; disabling globally overrides per-interface settings.

Common Mistakes

Mistake: Applying 'cdp enable' in global configuration mode instead of interface configuration mode — results in '% Invalid input detected' error.

Mistake: Forgetting that CDP is enabled by default; unnecessary use of 'cdp enable' when it's already active.

Mistake: Assuming 'cdp enable' on an interface will enable CDP globally — it only affects that specific interface.

cdp enable vs cdp run

Both commands enable CDP but at different levels; 'cdp run' globally enables CDP on the device, while 'cdp enable' activates it on a specific interface. They are commonly confused because interface-level CDP requires global CDP to be on, and disabling globally overrides interface settings.

Aspectcdp enablecdp run
ScopePer interfaceGlobal (all interfaces)
Configuration modeInterface configurationGlobal configuration
PersistenceTakes effect only if CDP is globally enabledRequired for any interface-level CDP operation
PrecedenceOverridden by 'no cdp run'Overrides interface-level 'no cdp enable'
Typical useEnable CDP on a specific uplink or trunkEnable CDP globally to discover all neighbors
Default stateDisabled on each interface until enabledEnabled by default on most Cisco IOS images

Use cdp enable when you want CDP active only on specific interfaces (e.g., management VLAN) while keeping it disabled on others.

Use cdp run when you need CDP active on all interfaces by default, typically for network discovery and topology mapping.

Platform Notes

In IOS-XE (e.g., Catalyst 9000 switches), the `cdp enable` command syntax and behavior are identical to classic IOS. However, IOS-XE may have additional CDP-related features like CDP timer and holdtime configuration per interface (though not common). The output of `show cdp interface` in IOS-XE includes additional fields like 'CDP version' and 'TTL'.

In NX-OS (e.g., Nexus switches), the equivalent command is `cdp enable` under interface configuration mode as well, but NX-OS uses a different default: CDP is enabled globally by default, but on some platforms (e.g., Nexus 9000), it may be disabled by default; use `feature cdp` to enable globally. The NX-OS syntax for interface-level is identical: `interface ethernet 1/1 ; cdp enable`. For ASA firewalls, CDP is not supported; instead, use LLDP or manual configuration.

In IOS-XR (e.g., ASR 9000), CDP is not supported; the equivalent is LLDP. Between IOS versions (12.x vs 15.x vs 16.x), the `cdp enable` command has remained consistent. However, in IOS 12.x, CDP was enabled by default on all interfaces; in later versions, this default persists.

One notable difference: in IOS 15.x and later, the `cdp run` command is still used globally, but some platforms introduced a 'cdp advertise-v2' command to enable CDPv2. The `cdp enable` command itself is unchanged. Always verify with `show cdp` to confirm the global state before troubleshooting interface-level issues.

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