How to Configure CDP

How to Configure CDP

What is CDP

Cisco Discovery Protocol (CDP) is a proprietary protocol that is used to discover the basic information about neighboring switches and Routers without knowing the passwords of the neighboring devices. The Switches and Routers send CDP messages out to each of their interfaces to discover information. The Messages announce the information about the device that sent the CDP message.

The devices that support CDP learn information about others by listening to the advertisement sent by other devices. CDP runs over the Data-Link layer (Layer 2) on all Cisco routers, switches, access servers, and bridges.

CDP
Configuring CDP with Packet Tracer

CDP discovers several details from the neighboring devices.

CDP Discovery
CDP Discovery Details

How to Configure CDP

Configuring the Router R1 Serial Interface

Router> enable

Router# configure terminal

Enter configuration commands, one per line. End with CNTL / Z.

Router (config) # hostname R1

R1 (config) # interface serial 0/1//0

R1 (config-if) # ip address 1.1.1.1 255.0.0.0

R1 (config-if) # encapsulation ppp

R1 (config-if) # clock rate 64000

R1 (config-if) # keepalive 10

R1 (config-if) #no shutdown

%LINK-5-CHANGED: Interface Serial0/1/0, changed state to down

R1 (config-if) #end

R1 (config) # interface serial 0/1//1

R1 (config-if) # ip address 2.1.1.1 255.0.0.0

R1 (config-if) # encapsulation ppp

R1 (config-if) # clock rate 64000

R1 (config-if) # keepalive 10

R1 (config-if) #no shutdown

%LINK-5-CHANGED: Interface Serial0/1/1, changed state to down

R1 (config-if) #end

Configuring the Router R1 Interface FastEthernet

R1# configure terminal

R1 (config) #int fa0/0

R1 (config-if) #ip add 4.1.1.100 255.0.0.0

R1 (config-if) #no sh

R1 (config-if) #

Interface Status
Interface Status up

R1 (config-if) #exit


Configuring the Router R2 Serial Interface

Router> enable

Router# configure terminal

Enter configuration commands, one per line. End with CNTL / Z.

Router (config) # hostname R2

R2 (config) # interface serial 0/1//0

R2 (config-if) # ip address 1.1.1.2 255.0.0.0

R2 (config-if) # encapsulation ppp

R2 (config-if) # keepalive 10

R2 (config-if) #no shutdown

Interface Status
Interface Status up

R2 (config-if) # exit

R2 (config) # interface serial 0/1//1

R2 (config-if) # ip address 3.1.1.2 255.0.0.0

R2 (config-if) # encapsulation ppp

R2 (config-if) # keepalive 10

R2 (config-if) #no shutdown

R2 (config-if) # exit

%LINK-5-CHANGED: Interface Serial0/1/1, changed state to down

Configuring the Router R2 Interface FastEthernet

R2 (config) #int fa0/0

R2 (config-if) #ip add 6.1.1.100 255.0.0.0

R2 (config-if) #no sh

R2 (config-if) #

Interface Status

R2 (config-if) #exit

 Configuring the Router R3 Serial Interface

Router> enable

Router# configure terminal

Enter configuration commands, one per line. End with CNTL / Z.

Router (config) # hostname R3

R3 (config) # interface serial 0/1//1

R3 (config-if) # ip address 2.1.1.2 255.0.0.0

R3 (config-if) # encapsulation ppp

R3 (config-if) # keepalive 10

R3 (config-if) #no shutdown

R3 (config-if) #exit

Interface Status
Interface Status up

R3 (config) # interface serial 0/1//0

R3 (config-if) # ip address 3.1.1.1 255.0.0.0

R3 (config-if) # encapsulation ppp

R3 (config-if) # clock rate 64000

R3 (config-if) # keepalive 10

R3 (config-if) #no shutdown

R3 (config-if) #

R3 (config-if) # exit

Interface Status
Interface Status up


Configuring the Router R3 Interface FastEthernet

R3 (config) #int fa0/0

R3 (config-if) #ip add 5.1.1.100 255.0.0.0

R3 (config-if) #no sh

R3 (config-if) #

Interface Status
Interface Status up

R3 (config-if) #exit

R3#

Configure Enable and Line Passwords on Router R1, R2,

 and R3

Router R1

R1 (config) # line vty 0?

<0-15> 

R1 (config) # line vty 0 4

R1 (config-line) # password Networking123

R1 (config-line) #login

R1 (config-line) #exit

R1 (config) #enable password Ithome

Router R2

R2 (config) # line vty 0?

<0-15> 

R2 (config) # line vty 0 4

R2 (config-line) # password Networking1232

R2 (config-line) #login

R2 (config-line) #exit

R2 (config) #enable password Ithome2

Router R3

R3 (config) # line vty 0?

<0-15> 

R3 (config) # line vty 0 4

R3 (config-line) # password Networking1233

R3 (config-line) #login

R3 (config-line) #exit

R3 (config) #enable password Ithome3

Note:  How to Telnet into a Router see the whole details with configuration


------->How to Telnet into a Router


CDP Summary

R1#sh cdp

OR

R1#show cdp

CDP
CDP Summary

1.     CDP Timer

After every 60 seconds each device sends periodic messages that are configured for CDP, and this process is known as advertisement, and these messages are sent to a Multicast Address (01-00-0c-cc-cc-cc). All those Interfaces that support SNAP (Subnetwork Access Protocol) will receive the announcements.

R1#configure terminal

R1 (config) # cdp timer?

 <5-254> Rate at which CDP packets is sent (in a sec)

R1 (config) # cdp timer 80

R1 (config) #

Note: Now after every 80 seconds the router R1 will advertise its CDP packets.

2.     CDP Holdtime

CDP runs on all interfaces that support SNAP (Subnetwork Access Protocol), including Frame Relay, ATM (Asynchronous Transfer Mode) physical media, and LAN (Local Area Network). Therefore, two systems with different network-layer protocols can learn about each other. At least one address at each device advertises at which it can receive SNMP messages. The advertisements also contain the holdtime information, or the time-o-live, which indicates the time length a receiving device should hold CDP information before discarding it. 

R1 (config) # cdp holdtime?

 <10-255>Length of time (in a sec) that receiver must keep this packet.

R1 (config) # cdp holdtime 130

R1 (config) #

CDP
CDP HoldTime

3.     CDP Version

CDPv2 (CDP Version 2) is the recent release protocol that provides more intelligent device tracking features. The reporting mechanism which allows for more rapid tracking of errors, thereby reducing costly downtime is included with this feature. Reported error messages can be sent to a logging Server or the console and it covers instances of unmatching VLAN IDs (IEEE 802.1Q) on connecting ports, and unmatching port duplex states between connecting devices.

R1#sh cdp neighbors

CDP Neighbor
CDP Neighbor Status

CDP Neighbor Details

Device ID Column shows the neighbor device name. In the above picture R1 is a local device and the remaining devices R2 and R3are neighbor devices.

Local Intrfce Column shows Local device interfaces and in the above picture is R1.

Holdtme Column shows the Length of time (in a sec) that the receiver must keep this packet.

Capability Column the symbol “R” shows that the device is a router and these symbols are given in the above picture. Like R - Router, T - Trans Bridge, B - Source Route Bridge.

The Platform Column shows the device platform.

Port ID Column shows the neighbor device interfaces, in the above picture Serial 0/1/0 is the R2 interface, and Serial 0/1/1 is theR3 interface.


Now understanding the above output, the interface Serial0/1/0 on the router R1 is connected to router R2 interface Serial0/1/0. Similarly, interface Serial0/1/1 on router R1 is connected to R3 interface Serial0/1/1.

Note: Type the command R1#show cdp entry * or show cdp neighbors detail to show the detailed information about the neighbored devices of R1.


CDP Details on Router R1, R2, and R3

 Router R1

R1#show cdp neighbors detail


Device ID: R2

Entry address (es):

  IP address: 1.1.1.2

Platform: Cisco C1841, Capabilities: Router

Interface: Serial0/1/0, Port ID (outgoing port): Serial0/1/0

Holdtime: 149


Version:

Cisco IOS Software, 1841 Software (C1841-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2)

Technical Support: http://www.cisco.com/techsupport

Copyright (c) 1986-2007 by Cisco Systems, Inc.

Compiled Wed 18-Jul-07 04:52 by pt_team

 

advertisement version: 2

Duplex: full

---------------------------

 

Device ID: R3

Entry address (es):

  IP address: 2.1.1.2

Platform: Cisco C1841, Capabilities: Router

Interface: Serial0/1/1, Port ID (outgoing port): Serial0/1/1

Holdtime: 149

 

Version:

Cisco IOS Software, 1841 Software (C1841-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2)

Technical Support: http://www.cisco.com/techsupport

Copyright (c) 1986-2007 by Cisco Systems, Inc.

Compiled Wed 18-Jul-07 04:52 by pt_team

 

advertisement version: 2

Duplex: full

 

R1#

Router R2

R2#show cdp neighbors

CDP Neighbor
CDP Neighbor Status

 Router R3

R3#show cdp neighbors

CDP Neighbor
CDP Neighbor Status

Enabling CDP Globally

By default, CDP is enabled on all Cisco devices. One can use the following command for the entire device if it is disabled by the administrator:

R1 (config) # cdp run

R1 (config) #end

R1#

Note: This command enables CDP on all device interfaces.


Disabling CDP Globally

R1 (config) # no cdp run

R1 (config) #end

R1#show cdp neighbor

%CDP is not enabled

R1#

Note: This command disables CDP on all device interfaces.

Disabling CDP on Interface

By default, CDP is enabled on all devices, and in some cases, you can stop packets on one of the interfaces.

R1 (config) # int s0/1/0

R1 (config-if) # no cdp enable

R1 (config-if) # end

R1#

Note: This command disables CDP on interface Serial 0/1/0 of device R1.

Enabling CDP on Interface

R1 (config) # int s0/1/0

R1 (config-if) # cdp enable

R1 (config-if) # end

R1#

Note: This command enables CDP on interface Serial 0/1/0 of device R1.


Search Tags

  1. What is the purpose of CDP
  2. How to Configure CDP
  3. CDP Configuration with Packet Tracer
  4. Configuring CDP

Get Packet Tracer Lab 

If you want to configure and Practical Lab of Static and Dynamic Routing then visit below link: ðŸ‘‡

How to Configure Static Routing

Dynamic Routing

Redistribution of Routes in Dynamic Routing

How to Configure OSPF Multi-area

How to Configure OSPF Single-area

How to Configure EIGRP

How to Configure IGRP

How to Configure RIPv2

How to Configure RIPv1

Post a Comment

0 Comments