设为首页收藏本站language 语言切换
查看: 2023|回复: 0
收起左侧

[分享] 思科设备新手篇--LLDP(Link Layer Discovery Protocol,链路层发现协议)

[复制链接]
 成长值: 63775
发表于 2020-5-18 15:31:03 | 显示全部楼层 |阅读模式
随着网络技术的发展,接入网络的设备的种类越来越多,配置越来越复杂,来自不同设备厂商的设备也往往会增加自己特有的功能,这就导致在一个网络中往往会有很多具有不同特性的、来自不同厂商的设备,为了方便对这样的网络进行管理,就需要使得不同厂商的设备能够在网络中相互发现并交互各自的系统及配置信息。
LLDP(Link Layer Discovery Protocol,链路层发现协议)就是用于这个目的的协议。
它提供了一种标准的链路层发现方式,可以将本端设备的的主要能力、管理地址、设备标识、接口标识等信息组织成不同的TLV(Type/Length/Value,类型/长度/值),并封装在LLDPDU(Link Layer Discovery Protocol Data Unit,链路层发现协议数据单元)中发布给与自己直连的邻居,邻居收到这些信息后将其以标准MIB(Management Information Base,管理信息库)的形式保存起来,以供网络管理系统查询及判断链路的通信状况。
LLDP是允许非Cisco设备发布关于他们自己的信息到在网络的其它设备的邻居发现协议。允许非Cisco设备其它设备之间的互通性的Cisco交换机支持IEEE 802.1AB LLDP。LLDP运行允许用不同的网络层协议的两个设备得知彼此的数据链路层。
LLDP发现邻接设备通过使用包含类型、长度和值说明的一套属性。这些属性指TLV。LLDP支持的设备能使用TLV获得和发送信息对他们的邻居。此协议能通告详细信息例如配置信息、设备功能和设备标识。
交换机支持这些基本管理TLV,是必须LLDP TLV :
Port description TLV
System name TLV
System description TLV
System capabilities TLV
Management address TLV
These organizationally-specific LLDP TLVs are also advertised to support LLDP-MED:
Port VLAN ID TLV (IEEE 802.1 organizationally specific TLVs)
MAC/PHY configuration/status TLV (IEEE 802.3 organizationally-specific TLVs)
1.jpg
配置命令:
Switch#configure terminal
!--- Enable LLDP globally on the switch.
Switch(config)#lldp run
!--- Specify time for the device to hold LLDP information.
Switch(config)#lldp holdtime 180
!--- Set the time for sending frequency of LLDP updates.
Switch(config)#lldp timer 50
!--- Enable LLDP specific to an interface.
Switch(config)#interface gigabitethernet 1/0/1
!--- Enable the interface to send LLDP.
Switch(config-if)#lldp transmit
!--- Enable the interface to receive LLDP.
Switch(config-if)#lldp receive
!--- Return to privileged EXEC mode.
Switch(config-if)#end
!--- Save the configurations in the device.
switch(config)#copy running-config startup-config
Switch(config)#exit
!--- Disable LLDP feature on the switch.
Switch(config)#no lldp run
Switch(config)#end

使用show lldp接口[interface-id]命令为了显示关于接口的信息与启用的LLDP。
例如:
Switch#show lldp interface gigabitethernet1/0/1
GigabitEthernet1/0/1:
    Tx: enabled
    Rx: enabled
    Tx state: IDLE
    Rx state: WAIT FOR FRAME

使用neighbors命令的show 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
Nortel IP Phone     Gi1/0/1        180        T               0019.e1e7.018d
Polycom SoundPoint IGi1/0/19       180        T               0004.f22f.88b7
Baseline Switch 2426Gi1/0/18       180        P,B             Ethernet0/26
Baseline Switch 2426Gi1/0/22       180        P,B             Ethernet0/26
Total entries displayed: 4

使用detail命令show lldp的邻居为了详细显示关于邻居的信息。
例如:
Switch#show lldp neig detail
Chassis id: 47.11.133.116
Port id: 0019.e1e7.018d
Port Description: Nortel IP Phone
System Name - not advertised
System Description:
Nortel IP Telephone 1230E, Firmware:062AC53
Time remaining: 166 seconds
System Capabilities: B,T
Enabled Capabilities: T
Management Addresses - not advertised
Auto Negotiation - supported, enabled
Physical media capabilities:
    Other/unknown
    10base-T(HD)
    Symm Pause(FD)
    Symm, Asym Pause(FD)
    1000baseX(FD)
    1000baseT(HD)
Media Attachment Unit type: 16
MED Information:
    MED Codes:
          (NP) Network Policy, (LI) Location Identification
          (PS) Power Source Entity, (PD) Power Device
          (IN) Inventory
    F/W revision: 062AC53
    Manufacturer: Nortel-05
    Model: IP Phone 1230E
    Capabilities: NP, LI, PD, IN
    Device type: Endpoint Class III
    Network Policy(Voice): Unknown
    PD device, Power source: Unknown, Power Priority: High, Wattage: 6.0

使用traffic命令的show lldp为了显示LLDP计数器。
例如:
Switch#show lldp traffic
LLDP traffic statistics:
   Total frames out: 560
   Total entries aged: 0
   Total frames in: 211
   Total frames received in error: 0
   Total frames discarded: 0
   Total TLVs discarded: 208
   Total TLVs unrecognized: 208

使用show lldp错误命令为了显示LLDP错误计数器。
例如:
Switch#show lldp errors
LLDP errors/overflows:
    Total memory allocation failures: 0
    Total encapsulation failures: 0
    Total input queue overflows: 0
    Total table overflows: 0

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-2-27 21:43 , Processed in 0.057459 second(s), 23 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表