玩转华为ENSP模拟器系列 | 配置LLDP基本功能示例

Posted COCOgsta

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了玩转华为ENSP模拟器系列 | 配置LLDP基本功能示例相关的知识,希望对你有一定的参考价值。

素材来源:华为路由器配置指南

一边学习一边整理试验笔记,并与大家分享,侵权即删,谢谢支持!

附上汇总贴:玩转华为ENSP模拟器系列 | 合集_COCOgsta的博客-CSDN博客_华为模拟器实验


目标

本举例介绍通过配置LLDP基本功能,使得NMS可以获取到网络的拓扑信息。

组网需求

如图1所示,DeviceA和DeviceB、DeviceC之间有可达链路,DeviceA、DeviceC与NMS之间有可达路由。在配置LLDP功能之前,DeviceA无法获取DeviceB和DeviceC的状态信息,NMS也不能通过SNMP报文获取DeviceA、DeviceB和DeviceC之间的拓扑结构信息。

配置LLDP功能之后,设备间可以通过交互LLDP报文获取彼此的状态信息。同时NMS可以通过LLDP管理IP地址查找DeviceA、DeviceB和DeviceC,获取它们之间的拓扑信息。

配置思路

  • 配置DeviceA、DeviceB和DeviceC的相关接口的IP地址和路由协议,使网络层路由可达。
  • 使能DeviceA、DeviceB和DeviceC的全局LLDP功能。
  • 配置DeviceA、DeviceB和DeviceC的管理IP地址,该IP地址用于在邻居节点中标识本端设备。
  • 配置DeviceA、DeviceB和DeviceC的LLDP相关参数,优化LLDP的性能。
  • 配置DeviceA、DeviceB和DeviceC的LLDP告警功能,合理配置设备发送LLDP告警的延迟时间,既能达到告警的目的,也能降低系统资源的消耗。

操作步骤

  1. 配置相关接口的IP地址和路由协议
  2. 使能DeviceA、DeviceB和DeviceC的全局LLDP功能。

配置DeviceA

DeviceA:
sysname DeviceA
lldp enable

配置DeviceB

DeviceB:
sysname DeviceB
lldp enable

配置DeviceC

DeviceC:
sysname DeviceC
lldp enable
  1. 配置DeviceA、DeviceB和DeviceC的管理IP地址。

配置DeviceA的管理IP地址为10.10.10.1。

DeviceA:
lldp management-address 10.10.10.1

配置DeviceB的管理IP地址为10.10.10.2。

DeviceB:
lldp management-address 10.10.10.2

配置DeviceC的管理IP地址为10.10.10.3。

DeviceC:
lldp management-address 10.10.10.3
  1. 配置DeviceA、DeviceB和DeviceC的LLDP相关参数,包括设备发送LLDP报文的周期和延迟时间。

配置DeviceA发送LLDP报文的周期和延迟时间。

DeviceA:
lldp message-transmission interval 60
lldp message-transmission delay 9

配置DeviceB和DeviceC发送LLDP报文的周期和延迟时间,参见DeviceA的配置。

  1. 使能DeviceA、DeviceB和DeviceC的LLDP告警功能,配置设备发送LLDP告警的延迟时间。

配置DeviceA

DeviceA:
snmp-agent trap enable feature-name lldp
lldp trap-interval 10

配置DeviceB和DeviceC,参见DeviceA的配置

  1. 检查配置结果

查看DeviceA的LLDP是否使能、LLDP管理地址是否配置、LLDP告警功能是否使能以及LLDP属性的值是否为所配置的值。

查看DeviceA的本地LLDP信息。

[~DeviceA] display lldp local
System information
--------------------------------------------------------------------------
Chassis type                       :macAddress
Chassis ID                         :707b-e820-49d4
System name                        :DeviceA                       
System description                 :Huawei Versatile Routing Platform Software
VRP (R) software, Version 8.180 (CX V800R011C00SPC607B607)
Copyright (C) 2012-2018 Huawei Technologies Co., Ltd.
HUAWEI CX
System capabilities supported      :bridge router
System capabilities enabled        :bridge router
LLDP Up time                       :2019-10-30 09:59:07
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, 32 minutes, 29 seconds
Remote Neighbors Added             :2
Remote Neighbors Deleted           :0
Remote Neighbors Dropped           :0
Remote Neighbors Aged              :0
Total Neighbors                    :2
Port information:
--------------------------------------------------------------------------
Interface Ethernet1/0/0:
LLDP Enable Status                 :txAndRx              (default is disabled)         
Total Neighbors                    :0
Port ID subtype                    :interfaceName
Port ID                            :Ethernet1/0/0
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           :Yes
OperMau                            :speed (100) /duplex (Auto)
Link aggregation supported         :Yes
Link aggregation enabled           :No
Aggregation port ID                :0
Maximum frame Size                 :9216
Device discovery protocol TLV
Serial number                      :--
Interface index                    :--
IPv4 address                       :--
MAC address                        :--
Interface Ethernet1/0/1:
LLDP Enable Status                 :txAndRx              (default is disabled)         
Total Neighbors                    :0
Port ID subtype                    :interfaceName
Port ID                            :Ethernet1/0/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           :Yes
OperMau                            :speed (100) /duplex (Auto)
Link aggregation supported         :Yes
Link aggregation enabled           :No
Aggregation port ID                :0
Maximum frame Size                 :9216
Device discovery protocol TLV
Serial number                      :--
Interface index                    :--
IPv4 address                       :--
MAC address                        :--
Interface Ethernet1/0/2:
LLDP Enable Status                 :txAndRx              (default is disabled)         
Total Neighbors                    :0
Port ID subtype                    :interfaceName
Port ID                            :Ethernet1/0/2
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           :Yes
OperMau                            :speed (100) /duplex (Auto)
Link aggregation supported         :Yes
Link aggregation enabled           :No
Aggregation port ID                :0
Maximum frame Size                 :9216
Device discovery protocol TLV
Serial number                      :--
Interface index                    :--
IPv4 address                       :--
MAC address                        :--
                
Interface Ethernet1/0/3:
LLDP Enable Status                 :txAndRx              (default is disabled)         
Total Neighbors                    :0
Port ID subtype                    :interfaceName
Port ID                            :Ethernet1/0/3
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           :Yes
OperMau                            :speed (100) /duplex (Auto)
Link aggregation supported         :Yes
Link aggregation enabled           :No
Aggregation port ID                :0
Maximum frame Size                 :9216
Device discovery protocol TLV
Serial number                      :--
Interface index                    :--
IPv4 address                       :--
MAC address                        :--
Interface Ethernet1/0/4:
LLDP Enable Status                 :txAndRx              (default is disabled)         
Total Neighbors                    :0
Port ID subtype                    :interfaceName
Port ID                            :Ethernet1/0/4
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           :Yes
OperMau                            :speed (100) /duplex (Auto)
Link aggregation supported         :Yes
Link aggregation enabled           :No
Aggregation port ID                :0
Maximum frame Size                 :9216
                
Device discovery protocol TLV
Serial number                      :--
Interface index                    :--
IPv4 address                       :--
MAC address                        :--
Interface Ethernet1/0/5:
LLDP Enable Status                 :txAndRx              (default is disabled)         
Total Neighbors                    :0
Port ID subtype                    :interfaceName
Port ID                            :Ethernet1/0/5
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           :Yes
OperMau                            :speed (100) /duplex (Auto)
Link aggregation supported         :Yes
Link aggregation enabled           :No
Aggregation port ID                :0
Maximum frame Size                 :9216
Device discovery protocol TLV
Serial number                      :--
Interface index                    :--
IPv4 address                       :--
MAC address                        :--
Interface Ethernet1/0/6:
LLDP Enable Status                 :txAndRx              (default is disabled)         
Total Neighbors                    :0
Port ID subtype                    :interfaceName
Port ID                            :Ethernet1/0/6
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           :Yes
OperMau                            :speed (100) /duplex (Auto)
Link aggregation supported         :Yes
Link aggregation enabled           :No
Aggregation port ID                :0
Maximum frame Size                 :9216
Device discovery protocol TLV
Serial number                      :--
Interface index                    :--
IPv4 address                       :--
MAC address                        :--
Interface Ethernet1/0/7:
LLDP Enable Status                 :txAndRx              (default is disabled)         
Total Neighbors                    :0
Port ID subtype                    :interfaceName
Port ID                            :Ethernet1/0/7
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           :Yes
OperMau                            :speed (100) /duplex (Auto)
Link aggregation supported         :Yes
Link aggregation enabled           :No
Aggregation port ID                :0
Maximum frame Size                 :9216
Device discovery protocol TLV
Serial number                      :--
Interface index                    :--
IPv4 address                       :--
MAC address                        :--
Interface Ethernet1/0/8:
LLDP Enable Status                 :txAndRx              (default is disabled)         
Total Neighbors                    :0
Port ID subtype                    :interfaceName
Port ID                            :Ethernet1/0/8
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           :Yes
OperMau                            :speed (100) /duplex (Auto)
Link aggregation supported         :Yes
Link aggregation enabled           :No
Aggregation port ID                :0
Maximum frame Size                 :9216
Device discovery protocol TLV
Serial number                      :--
Interface index                    :--
IPv4 address                       :--
MAC address                        :--
Interface Ethernet1/0/9:
LLDP Enable Status                 :txAndRx              (default is disabled)         
Total Neighbors                    :0
Port ID subtype                    :interfaceName
Port ID                            :Ethernet1/0/9
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           :Yes
OperMau                            :speed (100) /duplex (Auto)
Link aggregation supported         :Yes
Link aggregation enabled           :No
Aggregation port ID                :0
Maximum frame Size                 :9216
Device discovery protocol TLV
Serial number                      :--
Interface index                    :--
IPv4 address                       :--
MAC address                        :--
Interface GigabitEthernet0/0/0:
LLDP Enable Status                 :txAndRx              (default is disabled)         
Total Neighbors                    :2
Port ID subtype                    :interfaceName
Port ID                            :GigabitEthernet0/0/0
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         :No
Auto-negotiation enabled           :No
OperMau                            :speed (100) /duplex (Auto)
Link aggregation supported         :Yes
Link aggregation enabled           :No
Aggregation port ID                :0
Maximum frame Size                 :0
Device discovery protocol TLV
Serial number                      :--
Interface index                    :--
IPv4 address                       :--
MAC address                        :--
[~DeviceA]          

查看DeviceA的邻居设备的LLDP信息。

[~DeviceA]dis lldp neighbor interface GigabitEthernet 0/0/0
GigabitEthernet0/0/0 has 2 neighbor(s):
Neighbor index                     :1
Chassis type                       :macAddress
Chassis ID                         :707b-e8d4-4d26
Port ID type                       :interfaceName
Port ID                            :GigabitEthernet0/0/0
Port description                   :--
System name                        :DeviceB                       
System description                 :Huawei Versatile Routing Platform Software
VRP (R) software, Version 8.180 (CX V800R011C00SPC607B607)
Copyright (C) 2012-2018 Huawei Technologies Co., Ltd.
HUAWEI CX
System capabilities supported      :bridge router
System capabilities enabled        :bridge router
Management address type            :ipv4
Management address                 :10.10.10.2
Expired time                       :183s
Port VLAN ID(PVID)                 :--
Port and Protocol VLAN ID(PPVID)   :--
Port and Protocol VLAN supported   :--
Port and Protocol VLAN enabled     :--
VLAN name of VLAN                  :--
Protocol identity                  :--
Auto-negotiation supported         :--
Auto-negotiation enabled           :--
OperMau                            :speed (--) /duplex (--)
Link aggregation supported         :--
Link aggregation enabled           :--
Aggregation port ID                :--
Maximum frame Size                 :--
Discovered time                    :2019-10-30 09:58:51
Device discovery protocol TLV
Serial number                      :--
Interface index                    :--
IPv4 address                       :--
MAC address                        :--
Neighbor index                     :2
Chassis type                       :macAddress
Chassis ID                         :707b-e825-2640
Port ID type                       :interfaceName
Port ID                            :GigabitEthernet0/0/0
Port description                   :--
System name                        :DeviceC                       
System description                 :Huawei Versatile Routing Platform Software
VRP (R) software, Version 8.180 (CX V800R011C00SPC607B607)
Copyright (C) 2012-2018 Huawei Technologies Co., Ltd.
HUAWEI CX
System capabilities supported      :bridge router
System capabilities enabled        :bridge router
Management address type            :ipv4
Management address                 :10.10.10.3
Expired time                       :238s
Port VLAN ID(PVID)                 :--
Port and Protocol VLAN ID(PPVID)   :--
Port and Protocol VLAN supported   :--
Port and Protocol VLAN enabled     :--
VLAN name of VLAN                  :--
Protocol identity                  :--
Auto-negotiation supported         :--
Auto-negotiation enabled           :--
OperMau                            :speed (--) /duplex (--)
Link aggregation supported         :--
Link aggregation enabled           :--
Aggregation port ID                :--
Maximum frame Size                 :--
Discovered time                    :2019-10-30 10:31:17
Device discovery protocol TLV
Serial number                      :--
Interface index                    :--
IPv4 address                       :--
MAC address                        :--
[~DeviceA]  
[~DeviceA]

查看DeviceB和DeviceC的LLDP功能是否使能、LLDP管理地址是否配置,参见查看DeviceA的配置信息的过程。

 

以上是关于玩转华为ENSP模拟器系列 | 配置LLDP基本功能示例的主要内容,如果未能解决你的问题,请参考以下文章

玩转华为ENSP模拟器系列 | 配置IGMP基本功能示例

玩转华为ENSP模拟器系列 | 配置IS-IS基本功能示例

玩转华为ENSP模拟器系列 | 配置指定绝对标签的SR-BE的基本功能

玩转华为ENSP模拟器系列 | 配置IS-IS的DIS选择示例

玩转华为ENSP模拟器系列 | 配置动态BFD for IS-IS特性示例

玩转华为ENSP模拟器系列 | 配置OSPF多进程