2.8 Configure and verify Layer 2 protocols

2.8.a Cisco Discovery Protocol

! check if CDP is enabled:
R2#show cdp
% CDP is not enabled
R2#
*Jun 2 21:30:46.407: %SYS-5-CONFIG_I: Configured from console by console
R2#show cdp
% CDP is not enabled
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
! to enable CDP:
R2(config)#cdp run
R2(config)#^Z
R2#
*Jun 2 21:31:01.239: %SYS-5-CONFIG_I: Configured from console by console
R2#show cdp
Global CDP information:
 Sending CDP packets every 60 seconds
 Sending a holdtime value of 180 seconds
 Sending CDPv2 advertisements is enabled
R2#

The above snipped show “global” CDP configuration. CDP can be disabled on a per interface basis – but can not be enabled on an interface if it is globally disabled:

R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#int g0/0
R2(config-if)#cdp enable
% Cannot enable CDP on this interface, since CDP is not running
R2(config-if)#

To disable CDP on an interface:

R2(config-if)#no cdp enable

Here are some various “show” commands:

  
R2#show cdp
Global CDP information:
	Sending CDP packets every 60 seconds
	Sending a holdtime value of 180 seconds
	Sending CDPv2 advertisements is  enabled
R2#show cdp neighbors 
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
R1               Gig 0/0            89            R       7206VXR   Gig 0/0
R2#show cdp traffic 
CDP counters :
	Total packets output: 9, Input: 5
	Hdr syntax: 0, Chksum error: 0, Encaps failed: 0
	No memory: 0, Invalid packet: 0, Fragmented: 0
	CDP version 1 advertisements output: 0, Input: 0
	CDP version 2 advertisements output: 9, Input: 5
R2#show cdp interface g0/0
GigabitEthernet0/0 is up, line protocol is up
  Encapsulation ARPA
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
R2#

As a note – CDP is a layer 2 protocol and does not require that the communicating devices have a working layer 3 address. CDP messages are sent to a multi-cast mac address. See the below packet capture.

Screenshot_2018-06-02_21-42-48.png

2.8.b LLDP

CDP is a Cisco proprietary protocol. LLDP is a similar protocol that is not proprietary and is covered by IEEE standard 802.1AB. The commands and functionality are similar. LLDP is also a Layer 2 protocol.

Router(config)#lldp run
Router(config)#^Z
Router#
*Jun  2 11:55:40.002: %SYS-5-CONFIG_I: Configured from console by console  
Router#show lldp neighbors 
Capability codes:
    (R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device
    (W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other

Device ID           Local Intf     Hold-time  Capability      Port ID
Router              Et0/0          120        R               Et0/0

Total entries displayed: 1

Router#show lldp entry Router

Capability codes:
    (R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device
    (W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other
------------------------------------------------
Chassis id: aabb.cc00.0100
Port id: Et0/0
Port Description: Ethernet0/0
System Name: Router

System Description: 
Cisco IOS Software, Linux Software (I86BI_LINUX-ADVENTERPRISEK9-M), Version 15.4(1)T, DEVELOPMENT TEST SOFTWARE
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2013 by Cisco Systems, Inc.
Compiled Sat 23-Nov-13 03:28 by prod_rel_tea

Time remaining: 106 seconds
System Capabilities: B,R
Enabled Capabilities: R
Management Addresses - not advertised
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised


Total entries displayed: 1
Router#

 
Here is a packet capture. As you can see LLDP also broadcast to a multi-cast ethernet mac address and therefore is a Layer 2 protocol.
Screenshot_2018-06-02_21-58-06

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s