Configure CDP Cisco Discovery Protocol in Cisco Packet Tracer

cisco discovery protocol and its use

CDP (Cisco Discovery Protocol)  is a propriety protocol of cisco, the main function of CDP is to get IP Addresses of the neighboring devices and collect information about the platforms used by neighboring devices. You can also use CDP cisco protocol to show the information about the router interfaces which are currently in use. CDP runs on all the devices and equipment manufactured by cisco including switches, routers, bridges and access servers.

In order to demonstrate the functionality and working of CDP cisco protocol we will configure three routers, namely Upaae1, Upaae2 and Upaae3.

We will use three different subnets in our network of three routers, and will configure two serial interfaces on each router.


Ip Adressses for Routers:

Router Upaae1 serial interface s0/1/0 will have 12.1.1.1 and s0/1/1 will have 13.1.1.1 ip address.

Router Upaae2 serial interface s0/1/0 will have 12.1.1.2 and s0/1/1 will have 23.1.1.2 ip address.

Router Upaae1 serial interface s0/1/0 will have 13.1.1.3 and s0/1/1 will have 23.1.1.3 ip address.


Basic configuration of Upaae1 router:

Router>enable
Router#config terminal
Router(config)# hostname Upaae1
Enter configuration commands, one per line. End with CNTL/Z.
Upaae1(config)#
Upaae1(config)#
Upaae1(config)#
Upaae1(config)#
Upaae1(config)#interface serial 0/1/0
Upaae1(config-if)#ip address 12.1.1.1 255.0.0.0
Upaae1(config-if)#clock rate 64000
Upaae1(config-if)#encapsulation hdlc
Upaae1(config-if)#no shutdown
Upaae1(config-if)#exit
Upaae1(config)#interface serial 0/1/1
Upaae1(config-if)#ip address 13.1.1.1 255.0.0.0
Upaae1(config-if)#clock rate 64000
Upaae1(config-if)#encapsulation hdlc
Upaae1(config-if)#no shutdown

Cisco discovery protocol Router1 configuration

Basic configuration of Upaae2 router:

Router>enable
Router#config terminal
Router(config)# hostname Upaae2
Enter configuration commands, one per line. End with CNTL/Z.
Upaae2 (config)#
Upaae2 (config)#interface serial 0/1/0
Upaae2 (config-if)#ip address 12.1.1.2 255.0.0.0
Upaae2 (config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/1/0, changed state to down
Upaae2 (config-if)#exit
Upaae2 (config)#interface serial 0/1/1
Upaae2 (config-if)#ip address 23.1.1.2 255.0.0.0
Upaae2(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/1/1, changed state to down
Upaae2 (config-if)#

Cisco discovery protocol Router2 configuration

Basic Configuration of Upaae3 Router:

Router>enable
Router#config terminal
Router(config)# hostname Upaae3
Enter configuration commands, one per line. End with CNTL/Z.
Upaae3(config)#
Upaae3(config)#interface serial 0/1/0
Upaae3(config-if)#ip address 13.1.1.3 255.0.0.0
Upaae3(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/1/0, changed state to down
Upaae3(config-if)#exit
Upaae3(config)#interface serial 0/1/1
Upaae3(config-if)#ip address 23.1.1.3 255.0.0.0
Upaae3(config-if)#clock rate 64000
Upaae3(config-if)#encapsulation hdlc
Upaae3(config-if)#no shutdown

Cisco discovery protocol Router3 configuration

All the 3 routers are connected and the concerned router interfaces are configured, now it is time to check whether CDP is working or not.


As CDP is to obtain information about the neighbor devices, we will use show cdp neighbors command from each router to confirm if the neighbors are connected and accessible. In order to run CDP commands the router should be in enable mode.

First we will confirm CDP functionality at Upaae1 router and then at Upaae2 and Upaae3 routers.

Checking CDP Neighbors on Upaae1 router:

Checking CDP neighbors on Upaae1 router

Upaae1>enable
Upaae1#show cdp neighbors

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

Upaae2            Ser 0/1/0          156                 R                     C1841             Ser 0/1/0

Upaae3            Ser 0/1/1           146                 R                    C1841             Ser 0/1/0


In the above table Device ID column represent the routers connected to Upaae1. Local Intrfce means the interfaces of Upaae1 router and Port ID means the interfaces of the connected devices and their interface numbers. The Capability column lists the devices capability, in this case both the devices are routers and represented by R.

Serial interface of Upaae2(Ser 0/1/0) is connected to Upaae1 router through interface Ser 0/1/0, and Ser 0/1/0 interface of Upaae3 router is connected to Ser 0/1/1 of Upaae1 router.

Show CDP Neighbors on Upaae2 Router:

For showing cdp neighbors on cisco router we will switch to enable mode and use the command “show cdp neighbors“.

Checking CDP neighbors on Upaae2 router


Upaae2>enable
Upaae2#show cdp neighbors

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

Upaae1            Ser 0/1/0          140                  R                     C1841                         Ser 0/1/0


Upaae3            Ser 0/1/1          167                  R                     C1841                         Ser 0/1/1

Serial interface of Upaae1(Ser 0/1/0) is connected to Upaae2 router through interface Ser 0/1/0, and Ser 0/1/1 interface of Upaae3 router is connected to Ser 0/1/1 of Upaae2 router.

Checking CDP Neighbors on Upaae3 Router:

Checking CDP neighbors on Upaae3 cisco router

Upaae3>enable
Upaae3#show cdp neighbors

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

Upaae2            Ser 0/1/1          144                  R                     C1841             Ser 0/1/1

Upaae1            Ser 0/1/0          166                  R                     C1841                         Ser 0/1/1


Serial interface of Upaae2(Ser 0/1/1) is connected to Upaae3 router through interface Ser 0/1/1, and Ser 0/1/0 interface of Upaae1 router is connected to Ser 0/1/1 of Upaae3 router.

If CDP commands are not working, enable CDP on the desired interface of Cisco router by running the following commands.

R1(config)#interface serial 0/1/0
R1(config-if)# cdp enable
R1(config-if)# end

Do Ask in comments for any queries.

 


We will be happy to hear your thoughts

Leave a reply