1
00:00:00,000 --> 00:00:05,000
In a previous video, I configured this switches and routers in this topology

2
00:00:05,000 --> 00:00:11,000
with IP addresses as well as enabling the various ports.

3
00:00:11,000 --> 00:00:15,000
Let’s have a look at CDP or Cisco Discovery Protocol

4
00:00:15,000 --> 00:00:19,000
and LLDP or Link Layer Discovery Protocol

5
00:00:19,000 --> 00:00:22,000
and see if we can discover the links between the devices.

6
00:00:22,000 --> 00:00:30,000
So I'll start with switch 1, here's switch 1 type enable sh cdp neighbor

7
00:00:30,000 --> 00:00:36,000
In the output, we can see switch 2, switch 3 and switch 4

8
00:00:36,000 --> 00:00:42,000
switch 2 is connected on 2 ports gigabit 0/0

9
00:00:42,000 --> 00:00:48,000
this local interface as well as gigabit 0/1, this local interface.

10
00:00:48,000 --> 00:00:56,000
switch 2 is using gigabit 0/0 to connect to our local interface gigabit 0/0

11
00:00:56,000 --> 00:00:59,000
and that’s true in our GNS3 topology

12
00:00:59,000 --> 00:01:06,000
gigabit 0/0 on switch 2 is connected to gigabit 0/0 on switch 1

13
00:01:06,000 --> 00:01:10,000
and the same is true  for gigabit 0/1.

14
00:01:10,000 --> 00:01:17,000
Switch 3, this device over here is connected to switch 1 on gigabit0/2

15
00:01:17,000 --> 00:01:25,000
so this local interface gigabit0/2 is the interface that switch 3 is connected to

16
00:01:25,000 --> 00:01:29,000
and switch 3 is using gigabit 0/0, as you can see over here.

17
00:01:29,000 --> 00:01:32,000
By the same token switch 4

18
00:01:32,000 --> 00:01:37,000
this switch over here in the GNS3 topology is connected to switch 1

19
00:01:37,000 --> 00:01:42,000
on gigabit 0/3 and it's using gigabit 0/1.

20
00:01:42,000 --> 00:01:49,000
So Cisco Discovery Protocol or CDP runs by default on Cisco switches

21
00:01:49,000 --> 00:01:51,000
and routers and is a nice way to see

22
00:01:51,000 --> 00:01:54,000
how devices are connected in the topology.

23
00:01:54,000 --> 00:01:59,000
Notice, however, that you only see directly connected devices.

24
00:01:59,000 --> 00:02:05,000
So switch 1 over here doesn’t see router 1

25
00:02:05,000 --> 00:02:09,000
and doesn’t see router 3 it only sees the directly connected switches

26
00:02:09,000 --> 00:02:11,000
that are running CDP.

27
00:02:11,000 --> 00:02:13,000
Let’s have a look at switch 2.

28
00:02:13,000 --> 00:02:17,000
So switch 2 sh cdp neighbor

29
00:02:17,000 --> 00:02:20,000
the commands shows us the neighboring devices

30
00:02:20,000 --> 00:02:26,000
we can see switch 3, router 3, switch 1, switch 1 and switch 4

31
00:02:26,000 --> 00:02:29,000
so notice that on switch 2

32
00:02:29,000 --> 00:02:35,000
this switch, we can see router 3 being connected to gigabit 0/1

33
00:02:35,000 --> 00:02:39,000
using FastEthernet 0/0

34
00:02:39,000 --> 00:02:44,000
we can also see that it’s a 3725 router

35
00:02:44,000 --> 00:02:47,000
and we can see capabilities of that device

36
00:02:47,000 --> 00:02:50,000
in other words, its router, it can act as a switch

37
00:02:50,000 --> 00:02:56,000
and it supports IGMP which is used in multicast environments.

38
00:02:56,000 --> 00:02:58,000
So switch 2 can see router 3

39
00:02:58,000 --> 00:03:03,000
but switch 1 cannot because Cisco Discovery Protocol

40
00:03:03,000 --> 00:03:06,000
only shows you directly connected neighbors

41
00:03:06,000 --> 00:03:11,000
not devices connected behind a device running CDP.

42
00:03:11,000 --> 00:03:13,000
In other words, switch 1 can see switch 2

43
00:03:13,000 --> 00:03:16,000
but cannot see router 3

44
00:03:16,000 --> 00:03:19,000
where switch 2 is able to see router 3

45
00:03:19,000 --> 00:03:23,000
but by the same token switch 2 is not able to see router 2.

46
00:03:23,000 --> 00:03:27,000
To see router 2 we need to connect to switch 4.

47
00:03:27,000 --> 00:03:31,000
So here’s switch 4 sh cdp neighbor

48
00:03:31,000 --> 00:03:38,000
Notice switch 4 is able to see switch 2 up there

49
00:03:38,000 --> 00:03:40,000
it’s able to see switch 1 over there.

50
00:03:40,000 --> 00:03:43,000
And it’s able to see router 2.

51
00:03:43,000 --> 00:03:47,000
It can also see that router 2 using FastEthernet 0/0

52
00:03:47,000 --> 00:03:52,000
switch 1 is using gigabit 0/2 to connect to switch 4

53
00:03:52,000 --> 00:03:58,000
and switch 1 is using gigabit 0/3 to connect to switch 4.

54
00:03:58,000 --> 00:04:00,000
Lastly, let’s have a look at switch 3

55
00:04:00,000 --> 00:04:04,000
switch 3 is over here in our topology.

56
00:04:04,000 --> 00:04:07,000
sh cdp neighbor

57
00:04:07,000 --> 00:04:11,000
it can see router 1, it can see switch 1, as well as switch 2.

58
00:04:11,000 --> 00:04:15,000
So CDP is a very useful protocol once again

59
00:04:15,000 --> 00:04:17,000
to discover devices

60
00:04:17,000 --> 00:04:20,000
that are connected to your local router or switch.

61
00:04:20,000 --> 00:04:22,000
What about the routers?

62
00:04:22,000 --> 00:04:26,000
So on router 1 sh cdp neighbor

63
00:04:26,000 --> 00:04:30,000
Router 1 can only see switch 3

64
00:04:30,000 --> 00:04:32,000
as being directly connected to FastEthernet 0/0

65
00:04:32,000 --> 00:04:40,000
so its local interface and switch 3 is using gigabit 0/2 to connect to router 1.

66
00:04:40,000 --> 00:04:43,000
If you were connected to the console of 1 switch

67
00:04:43,000 --> 00:04:46,000
and you need it to discover your topology

68
00:04:46,000 --> 00:04:50,000
what you could do as an example is type sh cdp neighbors

69
00:04:50,000 --> 00:04:53,000
So like on switch 1 I can see my neighbors

70
00:04:53,000 --> 00:04:55,000
but then I can also do this option

71
00:04:55,000 --> 00:04:57,000
sh cdp neighbors detail

72
00:04:57,000 --> 00:05:03,000
so sh cdp neighbors detail

73
00:05:03,000 --> 00:05:07,000
shows that switch 3 is directly connected to switch 1

74
00:05:07,000 --> 00:05:12,000
but now I can also see the IP address of that switch

75
00:05:12,000 --> 00:05:16,000
so I could telnet from my local switch to that switch

76
00:05:16,000 --> 00:05:22,000
and then use CDP to see the neighbors connected to that device.

77
00:05:22,000 --> 00:05:27,000
Notice I can clean a lot of information about the neighboring device through CDP.

78
00:05:27,000 --> 00:05:30,000
So I can see that it’s a Cisco device

79
00:05:30,000 --> 00:05:33,000
that supports routing  and switching in IGMP

80
00:05:33,000 --> 00:05:40,000
I can see my local interface and the outgoing port of the neighboring device.

81
00:05:40,000 --> 00:05:44,000
I can see the version of operating system running on that device

82
00:05:44,000 --> 00:05:47,000
so version 152 as an example.

83
00:05:47,000 --> 00:05:51,000
I can see which version of CDP it's running, so it’s running version 2

84
00:05:51,000 --> 00:05:55,000
I can see its management IP address once again.

85
00:05:55,000 --> 00:05:57,000
See the native VLAN, see the duplex

86
00:05:57,000 --> 00:06:02,000
so a lot of information can be shown through CDP

87
00:06:02,000 --> 00:06:06,000
about neighboring devices and that’s why for security reasons

88
00:06:06,000 --> 00:06:12,000
company turn off CDP typically on Internet facing interfaces

89
00:06:12,000 --> 00:06:15,000
or interfaces facing the outside world.

90
00:06:15,000 --> 00:06:18,000
So on router 3 as an example

91
00:06:18,000 --> 00:06:21,000
sh cdp neighbors

92
00:06:21,000 --> 00:06:25,000
shows me that there is a core 3750 switch

93
00:06:25,000 --> 00:06:32,000
connected out of F0/1, that is a physical Cisco switch

94
00:06:32,000 --> 00:06:36,000
running in my local home network.

95
00:06:36,000 --> 00:06:43,000
So you might not want your networking devices to advertise themselves

96
00:06:43,000 --> 00:06:47,000
through Internet connected interfaces

97
00:06:47,000 --> 00:06:51,000
because now I can discover what IP address that device using.

98
00:06:51,000 --> 00:06:54,000
Now I can see what type of device it is.

99
00:06:54,000 --> 00:07:02,000
So it's 3750 but what I could do now is telnet to that device and try to access it.

100
00:07:02,000 --> 00:07:06,000
So I could log in now

101
00:07:06,000 --> 00:07:12,000
and notice now I’m connected to this physical Cisco switch.

102
00:07:12,000 --> 00:07:15,000
So from a security point of view

103
00:07:15,000 --> 00:07:20,000
you probably wanna hide your devices

104
00:07:20,000 --> 00:07:23,000
and therefore you wanna disable CDP

105
00:07:23,000 --> 00:07:28,000
on internet facing interfaces or interfaces that connects you to the outside world.
