In a previous video, I configured this switches and routers in this topology
with IP addresses as well as enabling the various ports.
Let’s have a look at CDP or Cisco Discovery Protocol
and LLDP or Link Layer Discovery Protocol
and see if we can discover the links between the devices.
So I'll start with switch 1, here's switch 1 type enable sh cdp neighbor
In the output, we can see switch 2, switch 3 and switch 4
switch 2 is connected on 2 ports gigabit 0/0
this local interface as well as gigabit 0/1, this local interface.
switch 2 is using gigabit 0/0 to connect to our local interface gigabit 0/0
and that’s true in our GNS3 topology
gigabit 0/0 on switch 2 is connected to gigabit 0/0 on switch 1
and the same is true for gigabit 0/1.
Switch 3, this device over here is connected to switch 1 on gigabit0/2
so this local interface gigabit0/2 is the interface that switch 3 is connected to
and switch 3 is using gigabit 0/0, as you can see over here.
By the same token switch 4
this switch over here in the GNS3 topology is connected to switch 1
on gigabit 0/3 and it's using gigabit 0/1.
So Cisco Discovery Protocol or CDP runs by default on Cisco switches
and routers and is a nice way to see
how devices are connected in the topology.
Notice, however, that you only see directly connected devices.
So switch 1 over here doesn’t see router 1
and doesn’t see router 3 it only sees the directly connected switches
that are running CDP.
Let’s have a look at switch 2.
So switch 2 sh cdp neighbor
the commands shows us the neighboring devices
we can see switch 3, router 3, switch 1, switch 1 and switch 4
so notice that on switch 2
this switch, we can see router 3 being connected to gigabit 0/1
using FastEthernet 0/0
we can also see that it’s a 3725 router
and we can see capabilities of that device
in other words, its router, it can act as a switch
and it supports IGMP which is used in multicast environments.
So switch 2 can see router 3
but switch 1 cannot because Cisco Discovery Protocol
only shows you directly connected neighbors
not devices connected behind a device running CDP.
In other words, switch 1 can see switch 2
but cannot see router 3
where switch 2 is able to see router 3
but by the same token switch 2 is not able to see router 2.
To see router 2 we need to connect to switch 4.
So here’s switch 4 sh cdp neighbor
Notice switch 4 is able to see switch 2 up there
it’s able to see switch 1 over there.
And it’s able to see router 2.
It can also see that router 2 using FastEthernet 0/0
switch 1 is using gigabit 0/2 to connect to switch 4
and switch 1 is using gigabit 0/3 to connect to switch 4.
Lastly, let’s have a look at switch 3
switch 3 is over here in our topology.
sh cdp neighbor
it can see router 1, it can see switch 1, as well as switch 2.
So CDP is a very useful protocol once again
to discover devices
that are connected to your local router or switch.
What about the routers?
So on router 1 sh cdp neighbor
Router 1 can only see switch 3
as being directly connected to FastEthernet 0/0
so its local interface and switch 3 is using gigabit 0/2 to connect to router 1.
If you were connected to the console of 1 switch
and you need it to discover your topology
what you could do as an example is type sh cdp neighbors
So like on switch 1 I can see my neighbors
but then I can also do this option
sh cdp neighbors detail
so sh cdp neighbors detail
shows that switch 3 is directly connected to switch 1
but now I can also see the IP address of that switch
so I could telnet from my local switch to that switch
and then use CDP to see the neighbors connected to that device.
Notice I can clean a lot of information about the neighboring device through CDP.
So I can see that it’s a Cisco device
that supports routing and switching in IGMP
I can see my local interface and the outgoing port of the neighboring device.
I can see the version of operating system running on that device
so version 152 as an example.
I can see which version of CDP it's running, so it’s running version 2
I can see its management IP address once again.
See the native VLAN, see the duplex
so a lot of information can be shown through CDP
about neighboring devices and that’s why for security reasons
company turn off CDP typically on Internet facing interfaces
or interfaces facing the outside world.
So on router 3 as an example
sh cdp neighbors
shows me that there is a core 3750 switch
connected out of F0/1, that is a physical Cisco switch
running in my local home network.
So you might not want your networking devices to advertise themselves
through Internet connected interfaces
because now I can discover what IP address that device using.
Now I can see what type of device it is.
So it's 3750 but what I could do now is telnet to that device and try to access it.
So I could log in now
and notice now I’m connected to this physical Cisco switch.
So from a security point of view
you probably wanna hide your devices
and therefore you wanna disable CDP
on internet facing interfaces or interfaces that connects you to the outside world.