Network: LLDP, CDP

CDP придуман Cisco еще в 1994! Другие вендоры могут его использовать с разрешения Cisco.

LLDP-MED (Media Endpoint Discovery) – по сути, стандартизация реализованного давно функционала в Cisco как Voice VLAN (device info, vlan, qos, poe).

Функционал LLDP-MED используется для:
- определения типа подключенного устройства (IP-телефон или коммутатор и др.),
- отображения информации о модели и серийном номере оборудования, версии программного обеспечения на оборудовании,
- динамической настройки метки VLAN и QoS (Quality of Service) на порте для передачи трафика IP-телефонии,
- динамической настройки электропитания PoE (Power over Ethernet) на порте.

CDP использует LLC подуровень Ethernet, а LLDP инкапсулируется в Ethernet со своим type (как IPv4/6, ARP, etc).

В перечне девайсов легко можно обнаружить не только транспортные сетевые устройства (роутеры, свичи, файрволы), но и конечные хосты – телефоны, сервера. Причем это касается как lldp, так и cdp.

config

CDP

cdp run
cdp holdtime 180 # default 180; <10-255>  Length of time (in sec) that receiver must keep this packet
cdp timer 60 # default 60; Rate at which CDP packets are sent (in sec)
interface <name>
cdp enable

LLDP

lldp run
lldp holdtime 120 # default 120; <0-65535> Length of time (in sec) that receiver must keep this packet
lldp timer 30 # default 30; <5-65534> Rate at which LLDP packets are sent (in sec)
interface <name>
lldp receive
lldp transmit

 

show

CDP

Switch#show cdp neighbors 
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone, 
                  D - Remote, C - CVTA, M - Two-port Mac Relay 

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
Switch           Gig 3/0           165             R S I            Gig 3/0
R2               Gig 3/3           171               R    7206VXR   Fas 1/0
Total cdp entries displayed : 2

Switch#show cdp entry R2 # same output as detail, * for all, name for special device
...

Switch#show cdp neighbors detail 
-------------------------
Device ID: Switch
Entry address(es): 
  IP address: 1.1.1.1
Platform: Cisco ,  Capabilities: Router Switch IGMP 
Interface: GigabitEthernet3/0,  Port ID (outgoing port): GigabitEthernet3/0
Holdtime : 160 sec

Version :
Cisco IOS Software, vios_l2 Software (vios_l2-ADVENTERPRISEK9-M), Version 15.2(CML_NIGHTLY_20180619)FLO_DSGS7, EARLY DEPLOYMENT DEVELOPMENT BUILD, synced to  V152_6_0_81_E
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2018 by Cisco Systems, Inc.
Compiled Tue 19-Jun-18 06:06 by mmen

advertisement version: 2
VTP Management Domain: ''
Native VLAN: 1
Duplex: full
Management address(es): 
  IP address: 1.1.1.1

-------------------------
Device ID: R2
Entry address(es): 
  IP address: 10.1.2.1
Platform: Cisco 7206VXR,  Capabilities: Router 
Interface: GigabitEthernet3/3,  Port ID (outgoing port): FastEthernet1/0
Holdtime : 167 sec

Version :
Cisco IOS Software, 7200 Software (C7200-ADVENTERPRISEK9-M), Version 15.2(4)S7, RELEASE SOFTWARE (fc4)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2015 by Cisco Systems, Inc.
Compiled Wed 01-Apr-15 20:30 by prod_rel_team

advertisement version: 2
Duplex: full
Management address(es): 
  IP address: 10.1.2.1

Total cdp entries displayed : 2
Switch#show cdp traffic CDP counters : Total packets output: 95, Input: 51 Hdr syntax: 0, Chksum error: 0, Encaps failed: 0 No memory: 0, Invalid packet: 0, CDP version 1 advertisements output: 0, Input: 0 CDP version 2 advertisements output: 95, Input: 51

Switch#show cdp interface gigabitEthernet 3/0
GigabitEthernet3/0 is up, line protocol is up
Encapsulation ARPA
Sending CDP packets every 60 seconds
Holdtime is 180 seconds

Switch#show cdp
Global CDP information:
Sending CDP packets every 60 seconds
Sending a holdtime value of 180 seconds
Sending CDPv2 advertisements is enabled

LLDP

Switch#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
Switch              Gi3/0          120        R               Gi3/0
Total entries displayed: 1

Switch#show lldp entry Switch # same output as detail, * for all, name for special device
...

Switch#show lldp neighbors detail
------------------------------------------------
Local Intf: Gi3/0
Chassis id: 0c53.0fd4.7e00
Port id: Gi3/0
Port Description: GigabitEthernet3/0
System Name: Switch
System Description:
Cisco IOS Software, vios_l2 Software (vios_l2-ADVENTERPRISEK9-M), Version 15.2(CML_NIGHTLY_20180619)FLO_DSGS7, EARLY DEPLOYMENT DEVELOPMENT BUILD, synced to  V152_6_0_81_E
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2018 by Cisc
Time remaining: 113 seconds
System Capabilities: B,R
Enabled Capabilities: R
Management Addresses:
    IP: 1.1.1.1
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised          
Total entries displayed: 1 Switch#show lldp traffic LLDP traffic statistics: Total frames out: 96 Total entries aged: 0 Total frames in: 32 Total frames received in error: 0 Total frames discarded: 0 Total TLVs discarded: 0 Total TLVs unrecognized: 0

Switch#show lldp interface gigabitEthernet 3/0
GigabitEthernet3/0:
Tx: enabled
Rx: enabled
Tx state: IDLE
Rx state: WAIT FOR FRAME

Switch#show lldp
Global LLDP Information:
Status: ACTIVE
LLDP advertisements are sent every 30 seconds
LLDP hold time advertised is 120 seconds
LLDP interface reinitialisation delay is 2 seconds

 

Дамп

cdp-lldp.pcapng

stp cdp dtp default cisco.pcapng

Leave a Reply