Configure CDP

Table 1. Feature History

Feature Name

Release Information

Feature Description

CDP Support

Cisco IOS XR Release 7.10.1

Cisco Discovery Protocol (CDP) support is introduced on NCS 1010. CDP is a Layer 2 network discovery protocol for learning about directly connected Cisco devices. This protocol lets you easily view peer Cisco device information such as IP address, version number, platform type, connected ports, and so on for network planning and troubleshooting.

CDP is a Cisco proprietary layer 2 protocol used to obtain information about peer Cisco devices. It exchanges CDP packets with its neighbors to discover the platform type and capabilities of the peer device.

Each device configured for CDP sends periodic messages, known as advertisements, to a multicast address. Each device advertises at least one address at which it can receive messages. The advertisements also contain time-to-live or hold-time information which indicates the length of time a receiving device holds CDP information (180 seconds by default) before discarding it. Each device also listens to the periodic CDP messages sent by others (every 60 seconds by default) to learn about neighboring devices and determine when their interfaces go up or down.


Note


CDP feature is available by installing the following RPMs:

  • xr-cdp-7.10.1.19Iv1.0.0-1.x86_64.rpm

  • xr-cdp-82eb6a4d2fa15d0e-7.10.1.19Iv1.0.0-1.x86_64.rpm

  • xr-cdp-ncs1010-7.10.1.19Iv1.0.0-1.x86_64.rpm


Enable CDP Globally

To enable CDP globally, use the following commands:

configure

cdp

commit

Disable CDP Globally

To disable CDP globally, use the following commands:

configure

no cdp

commit

Enable CDP on Interfaces

To enable CDP on the management interface, use the following commands:

configure

interface mgmtEth rack/slot/instance/port

cdp

commit

The following example enables CDP on the management interface.


RP/0/RP0/CPU0:ios#configure
RP/0/RP0/CPU0:ios(config)#interface mgmtEth 0/RP0/CPU0/1
RP/0/RP0/CPU0:ios(config-if)#cdp
RP/0/RP0/CPU0:ios(config-if)#commit

To enable CDP on the Gigabit Ethernet (GE) interface, use the following commands:

configure

interface gigabitEthernet rack/slot/instance/port

cdp

commit

The following example enables CDP on the Gigabit Ethernet (GE) interface.


RP/0/RP0/CPU0:ios#configure
RP/0/RP0/CPU0:ios(config)#interface gigabitEthernet 0/0/0/0
RP/0/RP0/CPU0:ios(config-if)#cdp
RP/0/RP0/CPU0:ios(config-if)#commit

Modify CDP Default Settings

Use this task to modify CDP parameters such as the default version, holdtime, and timer.

Procedure


Step 1

configure

Example:

RP/0/RP0/CPU0:ios#configure

Enters global configuration mode.

Step 2

cdp advertise v1

Example:

RP/0/RP0/CPU0:ios(config)#cdp advertise v1

Configures CDP to use only version 1 (CDPv1) in communicating with neighboring devices.

By default, when CDP is enabled, the device sends CDPv2 packets. CDP also sends and receives CDPv1 packets if the device with which CDP is interacting does not process CDPv2 packets.

In this example, the device is configured to send and receive only CDPv1 packets.

To disable CDP v1, use the no cdp advertise v1 form of this command.

Step 3

cdp holdtime seconds

Example:

RP/0/RP0/CPU0:ios(config)#cdp holdtime 120

Specifies the amount of time that the receiving device holds a CDP packet sent from another device before discarding it.

By default, when CDP is enabled, the receiving device holds a CDP packet for 180 seconds before discarding it. The range of holdtime parameter is 10 to 255 seconds.

Note

 

The CDP hold time must be set to a higher number of seconds than the time between CDP transmissions, which is set with the cdp timer command.

Step 4

cdp timer seconds

Example:

RP/0/RP0/CPU0:ios(config)#cdp timer 65

Specifies the frequency at which CDP update packets are sent.

By default, when CDP is enabled, CDP update packets are sent at a frequency of once every 60 seconds. The range of timer parameter is 5 to 254 seconds.

Note

 

A lower timer setting causes CDP update packets to be sent more frequently.

Step 5

commit

Example:

RP/0/RP0/CPU0:ios(config)#commit

Saves the configuration changes and remains within the configuration session.


Monitor CDP

Use the show cdp command to display global CDP information.


RP/0/RP0/CPU0:ios#show cdp
Tue Feb 14 16:59:38.255 UTC
Global CDP information:
        Sending CDP packets every 60 seconds
        Sending a holdtime value of 180 seconds
        Sending CDPv2 advertisements is enabled

Use the show cdp neighbors command to display detailed information about neighboring devices discovered using CDP.


RP/0/RP0/CPU0:ios#show cdp neighbors mgmtEth 0/RP0/CPU0/1 
Mon Apr 10 12:30:30.902 UTC
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
R1              Mg0/RP0/CPU0/1   172     R          NCS1010   Mg0/RP0/CPU0/1  
RP/0/RP0/CPU0:R2#show cdp neighbors 
Mon Apr 10 12:30:39.251 UTC
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
R1              Mg0/RP0/CPU0/1   164     R          NCS1010   Mg0/RP0/CPU0/1

RP/0/RP0/CPU0:ios#show cdp neighbors mgmtEth 0/RP0/CPU0/1 detail 
Mon Apr 10 12:31:23.622 UTC

-------------------------
Device ID: R1
SysName : R1
Entry address(es): 
  IPv4 address: 192.168.0.2
  IPv6 address: 2000:110::1
Platform: cisco NCS1010,  Capabilities: Router 
Interface: MgmtEth0/RP0/CPU0/1
Port ID (outgoing port): MgmtEth0/RP0/CPU0/1
Holdtime : 120 sec

Version :
7.10.1.19I

advertisement version: 2
Duplex: full

Use the show cdp entry entry-name command to display information about a specific neighboring device or all the neighboring devices discovered using CDP.


RP/0/RP0/CPU0:ios#show cdp entry R1
Mon Apr 10 12:22:22.564 UTC

-------------------------
Device ID: R1
SysName : R1
Entry address(es): 
  IPv4 address: 192.168.0.2
  IPv6 address: 2000:110::1
Platform: cisco NCS1010,  Capabilities: Router 
Interface: MgmtEth0/RP0/CPU0/1
Port ID (outgoing port): MgmtEth0/RP0/CPU0/1
Holdtime : 121 sec

Version :
7.10.1.19I

advertisement version: 2
Duplex: full

RP/0/RP0/CPU0:ios#show cdp entry *                 
Mon Apr 10 12:24:59.927 UTC

-------------------------
Device ID: R1
SysName : R1
Entry address(es): 
  IPv4 address: 192.168.0.2
  IPv6 address: 2000:110::1
Platform: cisco NCS1010,  Capabilities: Router 
Interface: MgmtEth0/RP0/CPU0/1
Port ID (outgoing port): MgmtEth0/RP0/CPU0/1
Holdtime : 143 sec

Version :
7.10.1.19I

advertisement version: 2
Duplex: full

Use the show cdp interface [interface-name] command to display information about the interfaces on which CDP is enabled.


RP/0/RP0/CPU0:ios#show cdp interface Mg0/RP0/CPU0/1
Mon Apr 10 12:24:27.253 UTC
MgmtEth0/RP0/CPU0/1 is Up
  Encapsulation ether
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds

Use the show cdp traffic command to display information about the traffic gathered between devices using CDP.


RP/0/RP0/CPU0:ios#show cdp traffic 
Mon Apr 10 12:32:09.247 UTC

CDP counters :
        Packets output: 11, Input: 5
        Hdr syntax: 0, Chksum error: 0, Encaps failed: 0
        No memory: 0, Invalid packet: 0, Truncated: 0
        CDP version 1 advertisements output: 0, Input: 0
        CDP version 2 advertisements output: 11, Input: 5
        Unrecognize Hdr version: 0, File open failed: 0