Skip to main content

Cisco IOS Discovery Protocol

Network Topology

image.png

Premise

When you have a detailed topology map like the one above it is easy to know what interfaces and what devices you are working with.  However, a topology map like this is often not readily available.  Instead, you are on one end of the equation in a wiring closet or data center removed from the far side equipment and you are staring at a console screen like this.

image.png

And it is left to you to figure out what is connected to your device on the other end.  What can you use to figure this out? Cisco provides some help by the way of the Cisco Discovery Protocol (CDP). CDP is enabled by default on Cisco devices and works on directly connected interfaces. The CDP messages are configured to broadcast every 60 seconds by default.  This interval can be modified. When a device receives a CDP broadcast the information is stored in a table.  Using the show CDP neighbors will display information about directly connected Cisco devices.

Now suppose instead of a nice all-filled-in topology diagram you have this. You have been told that there are routers connected to the other end of the Router0 interfaces.  One router is a Cisco 1841 but the technician is not sure what the other router is.  The interface connected to the 1841 is in the 192.168.10.0/24 network.  The other interface should be configured within the 192.168.20.0/24 network.

image.png

Solution

Router0 Commands

Router0>enable
Router0#configure terminal
Router0(config)#interface fastEthernet 0/0
Router0(config-if)#no shutdown
Router0(config)#interface fastEthernet 0/1
Router0(config-if)#no shutdown
Router0(config-if)#end
Router0#show ip interface brief

image.png

As can be seen by the show ip interface brief command, the interfaces are up but there are no L3 IP addresses configured.  This is something that will need to be addressed later.  But for now, we can find out more about which devices are connected to which interfaces by using the show CDP commands.  First, we will check that CDP protocol is configured and working on Router0

Router0#show cdp interface

image.png

Yes, CDP is configured and sending packets every 60 seconds as is the default behavior. No let's see if there are any CDP packets coming from Cisco devices on the other in of the ethernet connections.

Router0#show cdp neighbors

image.png

The results of the show cdp neighbors command indicates that there are Cisco attached devices.  On the fast Ethernet 0/1 port the Cisco 1841 router is connected just as the technician had stated.  On the fast Ethernet port 0/0 there is a Cisco 2900 router.  In addition, we can see from the output that on the 1841 the connection is on fast Ethernet 0/0 while on the 2900 we are connected to gigabit Ethernet 0/2.  If we want more details, we can use the command show cdp entry *

Router0#show cdp entry *

image.png

From this we can see the configured IP addresses of the two connected devices.  We can verify that the connected device types are in fact routers. We can even see the Cisco IOS version installed on the routers.  Finally, we can see that the CDP type is version 2 as shown by the 'advertisement version'.

Let's jump back into Router0 and configure some IP addressing now that we know the IP addresses on the far side of the connections.

Router0(config)#interface fastEthernet 0/0
Router0(config-if)#ip address 192.168.20.2 255.255.255.0
Router0(config)#interface fastEthernet 0/1
Router0(config-if)#ip address 192.168.10.2 255.255.255.0
Router0(config-if)#end
Router0#show ip interface brief

image.png

Router0#ping 192.168.10.1

image.png

Router0#ping 192.168.20.1

image.png

Success!

Cisco Packet Tracer File

net10 cdp neighbors.pkt