CDP(Cisco Discovery Protocol) Tutorial

Posted: May 31, 2015 in CCNA
Tags: , , ,

CDP stands for Cisco Discovery Protocol Designed by Cisco Company to help the network administartors.Using CDP admins used to collect information about both locally attached devices and remote devices.Today here in this this article we learn how to turn on or turn off cdp advertisement on routers as well as see the information of directly and indirectly connected devices.We will also learn how to see ios version of neighbor routers and directly connected routers.CDP also helps us to see the status of router interface or switch ports.To understand CDP i have designed a topology diagram in cisco packet tracer.As you can see below i have taken 5 router R1 R2 R3 R4 and R5 in below topology diagram.

cdp

First Design the above topology diagram and then assign ip address on each interface of routers.

 

Configuration on Router R1:

Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#int se0/0/0
R1(config-if)#ip address 1.0.0.1 255.0.0.0
R1(config-if)#clock rate 64000
R1(config-if)#no shut

R1(config-if)#exit

R1(config)#int se0/1/0

R1(config-if)#ip address 2.0.0.1 255.0.0.0
R1(config-if)#no shut

R1(config-if)#exit
R1(config)#int se0/0/1
R1(config-if)#ip address 3.0.0.1 255.0.0.0
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#int se0/1/1
R1(config-if)#ip address 4.0.0.1 255.0.0.0
R1(config-if)#clock rate 64000
R1(config-if)#no shut

 

Configuration on Router R2:

Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2
R2(config)#int se0/0/0
R2(config-if)#ip address 1.0.0.2 255.0.0.0
R2(config-if)#no shut

 

Configuration on Router R3:

Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R3
R3(config)#int se0/0/0
R3(config-if)#ip address 4.0.0.2 255.0.0.0
R3(config-if)#no shut

Configuration on Router R4:

Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R4
R4(config)#int se0/0/0
R4(config-if)#ip address 2.0.0.2 255.0.0.0
R4(config-if)#clock rate 64000
R4(config-if)#no shut

 

Configuration on Router R5:

Router>enable

Router#config t

Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R5
R5(config)#int se0/0/0
R5(config-if)#ip address 3.0.0.2 255.0.0.0
R5(config-if)#clock rate 64000
R5(config-if)#no shut

 

HOW TO SEE CDP GLOBAL PARAMETERS?

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

Explanation:CDP TIMERS and CDP HOLDTIME are two CDP Global Parameters.

CDP TIMER:is how often CDP Packets are transmitted out all active interfaces.

CDP HOLDTIME:is the amount of time the device will hold the packets received from neighbor devices.

 

How to view or see the information of directly connected devices?

 

R1#show cdp nei
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 Ser 0/0/0 167 R C1841 Ser 0/0/0
R3 Ser 0/1/1 151 R C1841 Ser 0/0/0
R4 Ser 0/1/0 131 R C1841 Ser 0/0/0
R5 Ser 0/0/1 138 R C1841 Ser 0/0/0

 

How to see information of neighbor routers in detail?

R1#show cdp neighbors detail

Device ID: R2
Entry address(es):
IP address : 1.0.0.2
Platform: cisco C1841, Capabilities: Router
Interface: Serial0/0/0, Port ID (outgoing port): Serial0/0/0
Holdtime: 123

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 : 4.0.0.2
Platform: cisco C1841, Capabilities: Router
Interface: Serial0/1/1, Port ID (outgoing port): Serial0/0/0
Holdtime: 167

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: R4
Entry address(es):
IP address : 2.0.0.2
Platform: cisco C1841, Capabilities: Router
Interface: Serial0/1/0, Port ID (outgoing port): Serial0/0/0
Holdtime: 147

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: R5
Entry address(es):
IP address : 3.0.0.2
Platform: cisco C1841, Capabilities: Router
Interface: Serial0/0/1, Port ID (outgoing port): Serial0/0/0
Holdtime: 154

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#show cdp entry *

Device ID: R2
Entry address(es):
IP address : 1.0.0.2
Platform: cisco C1841, Capabilities: Router
Interface: Serial0/0/0, Port ID (outgoing port): Serial0/0/0
Holdtime: 140

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 : 4.0.0.2
Platform: cisco C1841, Capabilities: Router
Interface: Serial0/1/1, Port ID (outgoing port): Serial0/0/0
Holdtime: 124

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: R4
Entry address(es):
IP address : 2.0.0.2
Platform: cisco C1841, Capabilities: Router
Interface: Serial0/1/0, Port ID (outgoing port): Serial0/0/0
Holdtime: 163

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: R5
Entry address(es):
IP address : 3.0.0.2
Platform: cisco C1841, Capabilities: Router
Interface: Serial0/0/1, Port ID (outgoing port): Serial0/0/0
Holdtime: 171

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

 

How to see the ip address of each directly connected neighbour?
R1#show cdp entry * protocol

Protocol information for R2 :
IP Address: 1.0.0.2
—————————

Protocol information for R3 :
IP Address: 4.0.0.2
—————————

Protocol information for R4 :
IP Address: 2.0.0.2
—————————

Protocol information for R5 :
IP Address: 3.0.0.2

 

How to see the IOS Version of directly connected neighbours?

R1#show cdp entry * version

Version information for R2 :
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
—————————

Version information for R3 :
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
—————————

Version information for R4 :
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
—————————

Version information for R5 :
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

 

How to see the CDP Status of Router Interface or switch port?

R1#show cdp interface

Vlan1 is administratively down, line protocol is down
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
FastEthernet0/0 is administratively down, line protocol is down
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
FastEthernet0/1 is administratively down, line protocol is down
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
Serial0/1/0 is up, line protocol is up
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
Serial0/1/1 is up, line protocol is up
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
Serial0/0/0 is up, line protocol is up
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
Serial0/0/1 is up, line protocol is up
Sending CDP packets every 60 seconds
Holdtime is 180 seconds

 

How to see the CDP status of any particular interface of routers?
R1#show cdp interface serial 0/0/0
Serial0/0/0 is up, line protocol is up
Sending CDP packets every 60 seconds
Holdtime is 180 seconds

 

How to turn on CDP Adverstisement on Router?

R3(config)#cdp run

How to turn OFF CDP Adverstisement on Router?

R3(config)#no cdp run

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s