So once again in this example
we can see that the device connected to router 3
is a Cisco 3750 switch with this IP address.
This is the platform and this is the version of software
that the switch is running.
So from a security point of view
what you may wanna do is type no cdp run
which disables CDP on the entire router or switch.
Now when I type sh cdp neighbors notice CDP is not enabled on the device.
On switch 2 sh cdp neighbors
still shows router 3 in the list because of the timers.
If I type sh cdp enter
I can see that CDP is sending updates every 60 seconds
and we have a whole timer of a 180 seconds
so there are 2 things that you need to remember here
when you start up a device for the first time
it may take 60 seconds before the device appears in the list of neighbors.
So don’t make the mistake that others have made
where they enabled an interface on a switch or a router
and then use CDP to check if the neighboring devices connected
and they see nothing and assume that there’s a problem on the link.
Wait at least 60 seconds for the CDP updates to be sent
before you assume that there’s a problem.
It can take 60 seconds for a device appear in the list
when you use the command sh cdp neighbors
It can also take 180 seconds for entries to disappear.
So we’ve disabled CDP on router 3
but it's showing up in the list
because it takes a while for these entries to be removed.
Notice at the moment, that the whole time is 46 seconds
now 38, now 35 and that’s decrementing down from 180.
If we type sh cdp once again, notice the holdtime is 180 seconds.
this other values are being reset constantly through the CDP updates
but router 3 entry is decrementing
and will now timeout in a few seconds
because of the 180 second timer
so there’s 1 second, there’s 0 seconds
and now after while that entry will be removed from the local switch.
Where other entries are constantly being reset.
So notice switch 4 was a 139 seconds but is now 175 seconds.
But router 3 has now been removed from the table
we've shown previously but it’s now not available in the CDP table.
So the commands no cdp run disable CDP globally on a device.
cdp run enables it
sh cdp neighbors
allows the device to start discovering neighbors
and notice now we have router 3 back again on switch 2.
On router 3 we might want to keep CDP enabled globally .
but then disable it
on the Internet facing interface.
So now we can type no cdp enable
Previously, we were seeing the 3750 switch
connected on FatEthernet 0/1 and the switch was using FatEthernet 1/1
s cdp neighbor now still shows that entry
but our router is not advertising itself to that neighbor.
So let’s look at details and telnet to the switch.
I'll login shows cdp neighbors
notice it sees various physical Cisco routers
and it also sees router 3
and what you’ll notice here is the whole time is also decrementing
and will eventually time out
because router 3 is not advertising itself to the Cisco switch.
I’ll use CTRL shift 6X to jump back to router 3
sh cdp neighbor
Notice the core 3750, timeout is also decrementing.
So eventually, I won't bore you by making you wait
this amount of time, I'll speed up the video
but eventually, those 2 entries will disappear.
In other words, router 3 will no longer see the Cisco switch
and the Cisco switch will no longer see router 3 in the list.
So sh cdp neighbors
notice we have 5 seconds now
on router 3 as shown on the Cisco switch
now it's set 0 second and now router 3 is no longer shown
in the list of available devices on the 3750
I’ll jump back to router 3, sh cdp neighbors
Notice router 3 sees switch 2
but no longer sees the Cisco 3750 switch on F0/1
and once again that’s because I disabled CDP on that interface
so I'll enable it again by typing cdp enable
I have to do that on the interface so cdp enable
sh cdp neighbor I’ve just enabled CDP.
I’m starting to see other devices I can now see the 3750 switch on F0/1.
Now the router is seeing itself
and that’s because other switches in the topology that are non-Cisco switches
which are allowing CDP through.
So CDP is the Cisco propriety protocol
and maybe forwarded through other devices and hence the router can see itself.
So what about non-Cisco devices? Let's now discuss LLDP.