配置LLDP基本功能示例
本举例介绍通过配置LLDP基本功能,使得NMS可以获取到网络的拓扑信息。
组网需求
如图4-3所示,DeviceA和DeviceB、DeviceC之间有可达链路,DeviceA、DeviceC与NMS之间有可达路由。在配置LLDP功能之前,DeviceA无法获取DeviceB和DeviceC的状态信息,NMS也不能通过SNMP报文获取DeviceA、DeviceB和DeviceC之间的拓扑结构信息。
本例中interface1代表GE0/1/1。
配置思路
采用如下的思路配置LLDP基本功能:
- 配置DeviceA、DeviceB和DeviceC的相关接口的IP地址和路由协议,使网络层路由可达。
- 使能DeviceA、DeviceB和DeviceC的全局LLDP功能。
- 配置DeviceA、DeviceB和DeviceC的管理IP地址,该IP地址用于在邻居节点中标识本端设备。
- 配置DeviceA、DeviceB和DeviceC的LLDP相关参数,优化LLDP的性能。
- 配置DeviceA、DeviceB和DeviceC的LLDP告警功能,合理配置设备发送LLDP告警的延迟时间,既能达到告警的目的,也能降低系统资源的消耗。
数据准备
为完成此配置例,需准备如下的数据:
- DeviceA、DeviceB和DeviceC的管理IP地址为10.10.10.1、10.10.10.2和10.10.10.3。
- 发送LLDP报文的周期为60秒、延迟时间为9秒,发送LLDP告警的延迟时间为10秒。
操作步骤
- 如图4-3所示,配置相关接口的IP地址和路由协议,具体的配置过程略。
- 使能DeviceA、DeviceB和DeviceC的全局LLDP功能。
# 配置DeviceA。
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] lldp enable
[*DeviceA] commit
# 配置DeviceB。
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] lldp enable
[*DeviceB] commit
# 配置DeviceC。
<HUAWEI> system-view
[~HUAWEI] sysname DeviceC
[*HUAWEI] commit
[~DeviceC] lldp enable
[*DeviceC] commit
- 配置DeviceA、DeviceB和DeviceC的管理IP地址。
# 配置DeviceA的管理IP地址为10.10.10.1。
[~DeviceA] lldp management-address 10.10.10.1
[*DeviceA] commit
# 配置DeviceB的管理IP地址为10.10.10.2。
[~DeviceB] lldp management-address 10.10.10.2
[*DeviceB] commit
# 配置DeviceC的管理IP地址为10.10.10.3。
[~DeviceC] lldp management-address 10.10.10.3
[*DeviceC] commit
- 配置DeviceA、DeviceB和DeviceC的LLDP相关参数,包括设备发送LLDP报文的周期和延迟时间。
# 配置DeviceA发送LLDP报文的周期和延迟时间。
[~DeviceA] lldp message-transmission interval 60
[*DeviceA] lldp message-transmission delay 9
[*DeviceA] commit
# 配置DeviceB和DeviceC发送LLDP报文的周期和延迟时间。
请参见DeviceA的配置。
- 使能DeviceA、DeviceB和DeviceC的LLDP告警功能,配置设备发送LLDP告警的延迟时间。
# 配置DeviceA。
[~DeviceA] snmp-agent trap enable feature-name lldp
[*DeviceA] lldp trap interval 10
[*DeviceA] commit
# 配置DeviceB和DeviceC。
请参见DeviceA的配置。
- 检查配置结果
# 查看DeviceA的LLDP是否使能、LLDP管理地址是否配置、LLDP告警功能是否使能以及LLDP属性的值是否为所配置的值。
查看DeviceA的本地LLDP信息。
<DeviceA> display lldp local
System information -------------------------------------------------------------------------- Chassis type :macAddress Chassis ID :00e0-fc21-1220 System name :DeviceA System description :Huawei Versatile Routing Platform Software VRP (R) software, Version 8.190 (NE40E V800R011C10) Copyright (C) 2012-2015 Huawei Technologies Co., Ltd. HUAWEI NE40E System capabilities supported :bridge router System capabilities enabled :bridge router LLDP Up time :2015/02/26 15:08:28 System configuration -------------------------------------------------------------------------- LLDP Status :enabled (default is disabled) LLDP Message Tx Interval :60 (default is 30s) LLDP Message Tx Hold Multiplier :4 (default is 4) LLDP Refresh Delay :2 (default is 2s) LLDP Tx Delay :9 (default is 2s) LLDP Notification Interval :10 (default is 5s) LLDP Notification Enable :enabled (default is disabled) Management Address :ipv4: 10.10.10.1 LLDP Fast Message Count :4 (default is 4) Remote Table Statistics: -------------------------------------------------------------------------- Remote Table Last Change Time :0 days,0 hours, 11 minutes,49 seconds Remote Neighbors Added :0 Remote Neighbors Deleted :0 Remote Neighbors Dropped :0 Remote Neighbors Aged :0 Total Neighbors :2 Port information: -------------------------------------------------------------------------- Interface Gigabitethernet 0/1/1: LLDP Enable Status :txAndRx (default is disabled) Total Neighbors :2 Port ID subtype :interfaceName Port ID :Gigabitethernet 0/1/1 Port description : Port and Protocol VLAN ID(PPVID) :unsupported Port VLAN ID(PVID) :0 VLAN name of VLAN :-- Protocol identity :STP RSTP/MSTP LACP EthOAM Auto-negotiation supported :Yes Auto-negotiation enabled :No OperMau :speed (10000) /duplex (Full) Link aggregation supported :Yes Link aggregation enabled :No Aggregation port ID :0 Maximum frame Size :9216
查看DeviceA的邻居设备的LLDP信息。
<DeviceA> display lldp neighbor interface gigabitethernet 0/1/1
Gigabitethernet 0/1/1 has 2 neighbor(s): Neighbor index :1 Chassis type :macAddress Chassis ID :00e0-fc11-1220 Port ID type :interfaceName Port ID :Gigabitethernet 0/1/1 Port description :-- System name :DeviceB System description :Huawei Versatile Routing Platform Software VRP (R) software, Version 8.190 (NE40E V800R011C10) Copyright (C) 2012-2015 Huawei Technologies Co., Ltd. HUAWEI NE40E System capabilities supported :bridge router System capabilities enabled :bridge router Management address type :ipv4 Management address : 10.10.10.2 Expired time :104 (s) Port VLAN ID(PVID) :0 Port And Protocol VLAN ID(PPVID) :unsupported VLAN name of VLAN :-- Protocol identity :-- Auto-negotiation supported :Yes Auto-negotiation enabled :No OperMau :speed (10000) /duplex (Full) Link aggregation supported :Yes Link aggregation enabled :No Aggregation port ID :0 Maximum frame Size :0 Discovered time :2015-02-21 11:09:15 Neighbor index :2 Chassis type :macAddress Chassis ID :00e0-fc33-0013 Port ID type :interfaceName Port ID :Gigabitethernet 0/1/1 Port description :-- System name :DeviceC System description :Huawei Versatile Routing Platform Software VRP (R) software, Version 8.190 (NE40E V800R011C10) Copyright (C) 2012-2015 Huawei Technologies Co., Ltd. HUAWEI NE40E System capabilities supported :bridge router System capabilities enabled :bridge router Management address type :ipv4 Management address : 10.10.10.3 Expired time :104 (s) Port VLAN ID(PVID) :0 Port And Protocol VLAN ID(PPVID) :unsupported VLAN name of VLAN :-- Protocol identity :-- Auto-negotiation supported :Yes Auto-negotiation enabled :No OperMau :speed (10000) /duplex (Full) Link aggregation supported :Yes Link aggregation enabled :No Aggregation port ID :0 Maximum frame Size :0 Discovered time :2015-02-21 11:09:15
# 查看DeviceB和DeviceC的LLDP功能是否使能、LLDP管理地址是否配置。
请参见查看DeviceA的配置信息的过程。
配置文件
DeviceA的配置文件
# sysname DeviceA # lldp enable lldp message-transmission interval 60 lldp message-transmission delay 9 lldp restart-delay 3 lldp fast-count 3 # interface GigabitEthernet0/1/1 ip address 10.10.10.1 255.255.255.0 # lldp management-address 10.10.10.1 # return
DeviceB的配置文件
# sysname DeviceB # lldp enable lldp message-transmission interval 60 lldp message-transmission delay 9 lldp restart-delay 3 lldp fast-count 3 # interface GigabitEthernet0/1/1 ip address 10.10.10.2 255.255.255.0 # lldp management-address 10.10.10.2 # return
DeviceC的配置文件
# sysname DeviceC # lldp enable lldp message-transmission interval 60 lldp message-transmission delay 9 lldp restart-delay 3 lldp fast-count 3 # interface GigabitEthernet0/1/1 ip address 10.10.10.3 255.255.255.0 # lldp management-address 10.10.10.3 # return