How to use CDP(Cisco Discovery Protocol) on cisco routers


This article is all about how to use CDP(Cisco Discovery Protocol) on cisco routers. CDP stands for cisco discovery protocol designed by Cisco company to help the network administrators. In this tutorial, we learn about how to turn on or turn off CDP advertisement on the routers, why we use CDP and as well as see the information of directly and indirectly connected devices. By using CDP you can collect information about both locally attached devices and remote devices. CDP is used to share information about other directly connected Cisco equipment, such as the operating system version and IP address also. CDP can also be used for On-Demand Routing, which is a method of including routing information in CDP announcements so that dynamic routing protocols do not need to be used in simple networks. In this article, we will also learn about how to see ios version of neighbor routers and directly connected routers. So let’s start here how to configure CDP(Cisco Discovery Protocol) on cisco routers.

Now to understand this configuration we take a lab in cisco packet tracer. In this lab, we take five routers having serial routers in it to understand CDP on cisco routers.

Cisco discovery protocol tutorial

We do this whole lab in two parts. In the first part, we assign IP address on all the interfaces of the routers and also configure CDP on cisco routers. In the second part, we run troubleshooting commands and check CDP configuration on the router.

Now to assign IP address use given below command on the routers

For router R1

— System Configuration Dialog —

Continue with configuration dialog? [yes/no]: no

Press RETURN to get started!

Router>enable

Router#configure terminal

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

Router(config)#hostname R1

R1(config)#interface Serial0/0/0

R1(config-if)#ip address 30.0.0.1 255.0.0.0

R1(config-if)#clock rate 64000

R1(config-if)#no shutdown

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

R1(config-if)#exit

R1(config)#interface Serial0/0/1

R1(config-if)#ip address 50.0.0.1 255.0.0.0

R1(config-if)#clock rate 64000

R1(config-if)#no shutdown

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

R1(config-if)#exit

R1(config)#interface Serial0/1/0

R1(config-if)#ip address 10.0.0.1 255.0.0.0

R1(config-if)#clock rate 64000

R1(config-if)#no shutdown

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

R1(config-if)#exit

R1(config)#interface Serial0/1/1

R1(config-if)#ip address 70.0.0.1 255.0.0.0

R1(config-if)#clock rate 64000

R1(config-if)#no shutdown

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

R1(config-if)#exit

 

For router R2
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2
R2(config)#
R2(config)#interface Serial0/0/0
R2(config-if)#ip address 10.0.0.2 255.0.0.0
R2(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up

R2(config-if)#exit

For router R3

Router>enable

 

Router#configure terminal

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

Router(config)#hostname R3

R3(config)#interface Serial0/0/0

R3(config-if)#ip address 30.0.0.2 255.0.0.0

R3(config-if)#no shutdown

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

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up

R3(config-if)#exit

 

For router R4

Router>enable

Router#configure terminal

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

Router(config)#hostname R4

R4(config)#interface Serial0/0/0

R4(config-if)#ip address 50.0.0.2 255.0.0.0

R4(config-if)#no shutdown

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

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up

R4(config-if)#exit

 

For router R5

Router>enable

Router#configure terminal

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

Router(config)#hostname R5

R5(config)#interface Serial0/0/0

R5(config-if)#ip address 70.0.0.2 255.0.0.0

R5(config-if)#no shutdown

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

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up

R5(config-if)#exit

 

Now to see CDP(Cisco Discovery Protocol) global parameters use given below command on router R1

R1#show cdp

Global CDP information:

Sending CDP packets every 60 seconds

Sending a holdtime value of 180 seconds

Sending CDPv2 advertisements is enabled

Here in this result we saw that there are two CDP global parameters are present that is CDP TIMERS and CDP HOLDTIME

Here, CDP TIMER is telling about how often CDP packets are transmitted out all active interfaces.

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

 

Now to see information about the directly connected devices then use given below command

R1#show cdp neighbor

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/1/0 129 R C1841 Ser 0/0/0

R3 Ser 0/0/0 126 R C1841 Ser 0/0/0

R4 Ser 0/0/1 177 R C1841 Ser 0/0/0

R5 Ser 0/1/1 170 R C1841 Ser 0/0/0

 

Now to see the information of all the neighbor routers in detail use given below command

R1#show cdp neighbor detail

Device ID: R2

Entry address(es):

IP address : 10.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: R3

Entry address(es):

IP address : 30.0.0.2

Platform: cisco C1841, Capabilities: Router

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

Holdtime: 160

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 : 50.0.0.2

Platform: cisco C1841, Capabilities: Router

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

Holdtime: 151

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 : 70.0.0.2

Platform: cisco C1841, Capabilities: Router

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

Holdtime: 144

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

If this command does not wor on your system you can also use given below command

 

R1#show cdp entry *

Device ID: R2

Entry address(es):

IP address : 10.0.0.2

Platform: cisco C1841, Capabilities: Router

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

Holdtime: 139

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 : 30.0.0.2

Platform: cisco C1841, Capabilities: Router

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

Holdtime: 136

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 : 50.0.0.2

Platform: cisco C1841, Capabilities: Router

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

Holdtime: 127

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 : 70.0.0.2

Platform: cisco C1841, Capabilities: Router

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

Holdtime: 120

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

 

Now to see the IP address of each directly connected neighbor use given below command

R1#show cdp entry * protocol

Protocol information for R2 :

IP Address: 10.0.0.2


Protocol information for R3 :

IP Address: 30.0.0.2


Protocol information for R4 :

IP Address: 50.0.0.2


Protocol information for R5 :

IP Address: 70.0.0.2

 

Now to see ios version of all the directly connected neighbors use given below command

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

 

Now to see CDP status of router interface use given below command

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/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

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

 

Now to see cdp status of a particular interface use given below command

R1#show cdp interface serial0/1/0

Serial0/1/0 is up, line protocol is up

Sending CDP packets every 60 seconds

Holdtime is 180 seconds

 

Now to turn on CDP advertisement on the routers use given below command on each router

R5(config)#cdp run

Now to turn off CDP advertisement on the routers use given below command on each router

R5(config)#no cdp run

THAT’S IT

This is the whole lab on CDP(Cisco Discovery Protocole) to learn uses of CDP. If you have any queries regarding this you can be solved out through the comment section and also provide feedback to us because your feedback is valuable for us.

Leave a Reply

Fill in your details below or click an icon to log in:

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