首先,登录球机web端,依次进入
应用仓库->智能交通->规则配置界面,抓拍图片详细配置中,多张取证图间隔之和就是违停时间。
如取证图4张,4张图取证间隔分别为60 60 60 ,则违停取证总时长是180s
海康威视违停球机语音播报功能配置
请按如下步骤操作
1、外接语音播报设备
球机的audio_out输出线接扬声器/音柱的音频输入,球机的GND线接扬声器/音柱的地线

2、违停球机抓拍配置(点此参阅)
3、事件联动语音播报配置:
1)在应用仓库->智能交通->常用配置->球机规则配置->启用违停事件牌识,否则违停事件图无法识别车牌。每个场景独立配置,多个场景巡航检测时注意每个场景都需要勾选。
2)在智能交通->高级配置->高级参数界面,启用“违章事件数据上传”。
3)在智能交通->高级配置->语音联动界面,将语音播报默认【不联动】修改为【播报车牌】并选择播报次数,此时联动的是违停自带的播报音频,当事件图识别到车牌后播报内容为“违章停车,请xxxx尽快驶离”,事件图未识别到车牌,则播报“违章停车,请尽快驶离”。若希望播报自定义内容,可在配置界面下方导入音频文件,播报内容选择为上传的语音。上传文件要求小于512KB、单声道、采样率为8khz的WAV格式音频文件。音频上传后点【测试语音】确认导入文件播报正常后再联动测试。

海康威视违停球机掉头取证功能配置
首先,登录球机web端,依次进入
应用仓库->智能交通->常用配置->球机规则配置界面启用检测场景1,并按照实际填写场景名称和方向。如需多个检测场景则参考场景1后依次启用场景2、3、4并配置。

2、 控制球机云台转动及倍率调整到合适角度,使画面下边缘覆盖2~3车道宽度(最多不超过4车道,确保车辆在画面下边缘1/4处车牌横向不小于80像素)。且检测场景中包含掉头前后的行驶车道。此时球机倍率约4倍,垂直方向T值5~10范围,画面远处露出地平线即可。

3、选择车道区域检测并添加车道,在左测画面中调整车道线和实际车道线贴合,车道线上下延长覆盖需检测区域,注意车道规则要求包含掉头前后两个方向的车道。触发线是抓拍识别车牌位置,通常放在画面下1/4处,需保证触发线位置车牌横向80~100像素满足牌识要求。
4、 按照车道情况设置【方向】和【车道线属性】,注意相邻车道属性必须一致(如车道1右车道线/车道2左车道线,车道2右车道线/车道3左车道线),且掉头禁跨线必须设置为实线或者黄线;方向设置为车辆正常行驶的方向(车辆自上而下行驶称为下行);否则规则无法触发。

5、选择掉头检测功能并启用,勾选布防车道,灵敏度参数保持默认即可。

6、进入球机场景布防界面,启用巡航计划并将检测场景添加到布防时间中。
7、进入配置->图像->显示设置中,场景选择【道路】,默认抓拍快门上限为1/150适用于城市道路,拖车速较快或者高速公路,快门速度提升至1/250~1/350。
8、配置完成后测试验证是否有抓拍数据上传。
海康威视违停球机压线/变道/逆行/机占非等取证功能配置
首先,登录球机web端,依次进入
应用仓库->智能交通->常用配置->球机规则配置界面启用检测场景1,填写场景名称和方向。如需多个检测场景则参考场景1后依次启用场景2、3、4并配置。

2、 控制球机云台上下左右转动和倍率到合适角度:参考依据是画面下边缘覆盖2~3车道(400W分辨率覆盖3车道,200W覆盖2车道),此时球机倍率约2~3倍,垂直方向T值5~10范围,画面远处露出地平线即可。如图所示:

3、按照检测功能选择多边形区域或车道区域检测(推荐优先选车道区域)。按照道实际车道数添加车道,并在左右画面中调整车道线和实际车道线贴合,车道线上下延长覆盖检测区域。车道最低不少于2个,单个车道无法触发。
触发线是抓拍识别车牌位置,通常放在画面下1/4处,需保证触发线位置车牌横向80~100像素满足牌识要求
4、按照车道情况设置【方向】和【车道线属性】,注意相邻车道属性必须一致(如车道1右车道线/车道2左车道线,车道2右车道线/车道3左车道线),方向设置为车辆正常行驶的方向(车辆自上而下行驶称为下行)。否则规则无法正常触发。
5、选择需要使用的违章检测功能并启用,布防车道与布防多边形二选一(与绘制的规则对应),并勾选对应的车道或区域,否则检测功能不生效。灵敏度参数保持默认即可。各功能差异如下
压线:取证图抓拍张数可设置为3或4张,只支持车道区域检测。
变道:取证图只能设置为4张,需要包含变道前、中、后的状态以及车牌特写图。支持车道区域和多边形区域检测,推荐优先使用车道检测。
逆行:取证图抓拍张数可设置为3或4张,只支持车道区域检测。
机占非:取证图抓拍张数可设置为2~4张,可设置机占非的持续时间。同时支持根据车牌颜色过滤抓拍数据。只支持车道区域检测。

6、进入球机场景布防界面,启用巡航计划并将检测场景添加到布防时间中。

7、进入配置->图像->显示设置中,场景选择【道路】,默认抓拍快门上限为1/150适用于城市道路,拖车速较快或者高速公路,快门速度提升至1/250~1/350。

若违章不容易触发可修改配置模拟,如逆行检测修改车道方向与实际相反、变道检测修改车道线属性为实线来模拟触发。
海康威视违停球机违停检测抓拍配置指导
首先,登录球机web端

1、进入智能交通->球机规则配置界面,启用当前检测场景,控制云台转到到需要检测的区域。
2、单击右侧【绘制区域】在当前场景中绘制违停检测多边形区域,规则框通常画在路侧与路面保持平行,避免全屏绘制规则框。一个场景中支持绘制多个检测区域,单场景大检测距离100米,超过100米的路段需设置两个或多个场景轮训检测。区域框属性保持默认即可。
3、启用违停功能并设置【触发时间】参数。触发时间是指车辆停稳后时间达到设置值即开始抓拍事件报警图(也称为短信预警图),时间越长车辆越难触发,通常保持默认10s即可。在公交车容易停留的路段可适当延长时间避免频繁触发抓拍。
【违停事件牌识】来用设置违停事件报警图(也称为短信预警图)是否识别车牌。若不勾选,违停事件报警图在检测场景抓拍一张图上传,不识别车牌;若勾选则违停事件报警图将变倍拉近抓一张图上传,并识别车牌。保持默认勾选即可。
4、 在【违停抓拍图片配置】中设置违停取证图的类型和违停时长。违停取证图默认为四合一形式上传,每一张图类型和抓图时间点根据业务需求设置。违停总时长=多张取证图间隔总和,如下图配置间隔为是60 60 60,则违停时间是180s。即车辆停留超过180s被判定为违停,取证图抓拍完并上传。

image.png
5、根据需求选择布防的违停车辆类型和车牌颜色,默认全部勾选。最后需要勾选布防的多边形区域,保存配置参数。
6、设置完检测规则后切换到场景布防界面,单击蓝色布防时间条,选择设置,将需要检测的场景添加进布防时间内并设置停留时间,建议每个【场景停留时间】不小于取证时长,否则多场景交叉取证时,容易造成取证录像混乱。

7、勾选【启用巡航计划】并保存。巡航计划是布防的使能开关,即使只有一个检测场景也需要添加到布防时间段并启用巡航计划,否则检测功能不生效。配置完成后可用SDKdemo布防测试是否有违停抓拍数据上传。
H3C网管交换机 PVST生成树典型配置举例
一、组网需求
• Device A 和 Device B 为汇聚层设备,Device C 和 Device D 为接入层设备。
• 通过配置 PVST,使 VLAN 10、20、30 和 40 中的报文分别按照其各自 VLAN 所对应的生成树转发。
• 由于 VLAN 10、20 和 30 在汇聚层设备终结、VLAN 40 在接入层设备终结,因此配置 VLAN10 和 20 的根桥为 Device A,VLAN 30 的根桥为 Device B,VLAN 40 的根桥为 Device C。
二、 组网图

三、配置步骤
(1) 配置 VLAN 和端口
请按照上图 在 Device A 和 Device B 上分别创建 VLAN 10、20 和 30,在 Device C 上创建 VLAN10、20 和 40,在 Device D 上创建 VLAN 20、30 和 40;将各设备的各端口配置为 Trunk 端口并允许相应的 VLAN 通过,具体配置过程略。
(2) 配置 Device A
# 配置生成树的工作模式为 PVST 模式。
<DeviceA> system-view
[DeviceA] stp mode pvst
# 配置本设备为 VLAN 10 和 VLAN 20 的根桥。
[DeviceA] stp vlan 10 20 root primary
# 全局开启生成树协议,并开启 VLAN 10、20 和 30 中的生成树协议。
[DeviceA] stp global enable
[DeviceA] stp vlan 10 20 30 enable
(3) 配置 Device B
# 配置生成树的工作模式为 PVST 模式。
<DeviceB> system-view
[DeviceB] stp mode pvst
# 配置本设备为 VLAN 30 的根桥。
[DeviceB] stp vlan 30 root primary
# 全局开启生成树协议,并开启 VLAN 10、20 和 30 中的生成树协议。
[DeviceB] stp global enable
[DeviceB] stp vlan 10 20 30 enable
(4) 配置 Device C
# 配置生成树的工作模式为 PVST 模式。
<DeviceC> system-view
[DeviceC] stp mode pvst
# 配置本设备为生成树 VLAN 40 的根桥。
[DeviceC] stp vlan 40 root primary
# 全局开启生成树协议,并开启 VLAN 10、20 和 40 中的生成树协议。
[DeviceC] stp global enable
[DeviceC] stp vlan 10 20 40 enable
(5) 配置 Device D
# 配置生成树的工作模式为 PVST 模式。
<DeviceD> system-view
[DeviceD] stp mode pvst
# 全局开启生成树协议,并开启 VLAN 20、30 和 40 中的生成树协议。
[DeviceD] stp global enable
[DeviceD] stp vlan 20 30 40 enable
四、 验证配置
当网络拓扑稳定后,通过使用 display stp brief 命令可以查看各设备上生成树的简要信息。例如:
# 查看 Device A 上生成树的简要信息。
[DeviceA] display stp brief

# 查看 Device B 上生成树的简要信息。
[DeviceB] display stp brief

# 查看 Device C 上生成树的简要信息。
[DeviceC] display stp brief

# 查看 Device D 上生成树的简要信息。
[DeviceD] display stp brief

根据上述显示信息,可以绘出各 VLAN 所对应 MSTI 的拓扑,如下图所示。

H3C网管交换机 MSTP 生成树典型配置举例
一、组网需求
• 网络中所有设备都属于同一个 MST 域。Device A 和 Device B 为汇聚层设备,Device C 和Device D 为接入层设备。
• 通过配置 MSTP,使不同 VLAN 的报文按照不同的 MSTI 转发:VLAN 10 的报文沿 MSTI 1转发,VLAN 30 沿 MSTI 3 转发,VLAN 40 沿 MSTI 4 转发,VLAN 20 沿 MSTI 0 转发。
• 由于 VLAN 10 和 VLAN 30 在汇聚层设备终结、VLAN 40 在接入层设备终结,因此配置 MSTI 1 和 MSTI 3 的根桥分别为 Device A 和 Device B,MSTI 4 的根桥为 Device C。
二、 组网图

三、 配置准备
请在 VXLAN 网络内配置路由协议,确保 VTEP 之间路由可达。
四、配置步骤
(1) 配置 VLAN 和端口
请按照上图 在 Device A 和 Device B 上分别创建 VLAN 10、20 和 30,在 Device C 上创建 VLAN10、20 和 40,在 Device D 上创建 VLAN 20、30 和 40;将各设备的各端口配置为 Trunk 端口并允许相应的 VLAN 通过,具体配置过程略。
(2) 配置 Device A
# 配置 MST 域的域名为 example,将 VLAN 10、30、40 分别映射到 MSTI 1、3、4 上,并配置MSTP 的修订级别为 0。
<DeviceA> system-view
[DeviceA] stp region-configuration
[DeviceA-mst-region] region-name example
[DeviceA-mst-region] instance 1 vlan 10
[DeviceA-mst-region] instance 3 vlan 30
[DeviceA-mst-region] instance 4 vlan 40
[DeviceA-mst-region] revision-level 0
# 激活 MST 域的配置。
[DeviceA-mst-region] active region-configuration
[DeviceA-mst-region] quit
# 配置本设备为 MSTI 1 的根桥。
[DeviceA] stp instance 1 root primary
# 全局开启生成树协议。
[DeviceA] stp global enable
(3) 配置 Device B
# 配置 MST 域的域名为 example,将 VLAN 10、30、40 分别映射到 MSTI 1、3、4 上,并配置MSTP 的修订级别为 0。
<DeviceB> system-view
[DeviceB] stp region-configuration
[DeviceB-mst-region] region-name example
[DeviceB-mst-region] instance 1 vlan 10
[DeviceB-mst-region] instance 3 vlan 30
[DeviceB-mst-region] instance 4 vlan 40
[DeviceB-mst-region] revision-level 0
# 激活 MST 域的配置。
[DeviceB-mst-region] active region-configuration
[DeviceB-mst-region] quit
# 配置本设备为 MSTI 3 的根桥。
[DeviceB] stp instance 3 root primary
# 全局开启生成树协议。
[DeviceB] stp global enable
(4) 配置 Device C
# 配置 MST 域的域名为 example,将 VLAN 10、30、40 分别映射到 MSTI 1、3、4 上,并配置MSTP 的修订级别为 0。
<DeviceC> system-view
[DeviceC] stp region-configuration
[DeviceC-mst-region] region-name example
[DeviceC-mst-region] instance 1 vlan 10
[DeviceC-mst-region] instance 3 vlan 30
[DeviceC-mst-region] instance 4 vlan 40
[DeviceC-mst-region] revision-level 0
# 激活 MST 域的配置。
[DeviceC-mst-region] active region-configuration
[DeviceC-mst-region] quit
# 配置本设备为 MSTI 4 的根桥。
[DeviceC] stp instance 4 root primary
# 全局开启生成树协议。
[DeviceC] stp global enable
(5) 配置 Device D
# 配置 MST 域的域名为 example,将 VLAN 10、30、40 分别映射到 MSTI 1、3、4 上,并配置MSTP 的修订级别为 0。
<DeviceD> system-view
[DeviceD] stp region-configuration
[DeviceD-mst-region] region-name example
[DeviceD-mst-region] instance 1 vlan 10
[DeviceD-mst-region] instance 3 vlan 30
[DeviceD-mst-region] instance 4 vlan 40
[DeviceD-mst-region] revision-level 0
# 激活 MST 域的配置。
[DeviceD-mst-region] active region-configuration
[DeviceD-mst-region] quit
# 全局开启生成树协议。
[DeviceD] stp global enable
四、 验证配置
注:在本例中,假定 Device B 的根桥 ID 最小,因此该设备将在 MSTI 0 中被选举为根桥。当网络拓扑稳定后,通过使用 display stp brief 命令可以查看各设备上生成树的简要信息。例如:
# 查看 Device A 上生成树的简要信息。
[DeviceA] display stp brief

# 查看 Device B 上生成树的简要信息。
[DeviceB] display stp brief

# 查看 Device C 上生成树的简要信息。
[DeviceC] display stp brief

# 查看 Device D 上生成树的简要信息。
[DeviceD] display stp brief

根据上述显示信息,可以绘出各 VLAN 所对应 MSTI 的拓扑,如下图所示。

H3C网管交换机VXLAN网络下的环路检测典型配置举例
一、组网需求
Device A、Device B 作为 VXLAN 网络的 VTEP,在其上配置环路检测功能,使系统能够自动禁止出现环路的 AC 进行 MAC 地址学习同时将其阻塞,并通过打印日志信息来通知用户检查网络。
二、 组网图

三、 配置准备
请在 VXLAN 网络内配置路由协议,确保 VTEP 之间路由可达。
四、配置步骤
配置 Device A
# 配置 VSI,VXLAN ID 和 Tunnel。
<DeviceA> system-view
[DeviceA] l2vpn enable
[DeviceA] interface tunnel 0 mode vxlan
[DeviceA-Tunnel0] source 1.1.1.1
[DeviceA-Tunnel0] destination 2.2.2.2
[DeviceA-Tunnel0] quit
[DeviceA] vsi 1
[DeviceA-vsi-1] vxlan 1
[DeviceA-vsi-1-vxlan-1] tunnel 0
[DeviceA-vsi-1-vxlan-1] quit
# 关闭 STP 功能。
[DeviceA] undo stp global enable
# 配置 AC。
[DeviceA] interface ten-gigabitethernet 1/0/1
[DeviceA-Ten-GigabitEthernet1/0/1] service-instance 1
[DeviceA-Ten-GigabitEthernet1/0/1-srv1] encapsulation s-vid 10
[DeviceA-Ten-GigabitEthernet1/0/1-srv1] xconnect vsi 1
[DeviceA-Ten-GigabitEthernet1/0/1-srv1] quit
# 开启环路检测功能。
[DeviceA] vsi 1
[DeviceA-vsi-1] loopback-detection enable
# 配置环路检测的处理模式为 Block 模式。
[DeviceA-vsi-1] loopback-detection action block
# 配置环路检测的时间间隔为 35 秒。
[DeviceA-vsi-1] loopback-detection interval-time 35
# 配置环路检测的优先级为 1。
[DeviceA-vsi-1] loopback-detection priority 1
(2) 配置 Device B
# 配置 VSI,VXLAN ID 和 Tunnel。
<DeviceB> system-view
[DeviceB] l2vpn enable
[DeviceB] interface Tunnel 0 mode vxlan
[DeviceB-Tunnel0] source 2.2.2.2
[DeviceB-Tunnel0] destination 1.1.1.1
[DeviceB-Tunnel0] quit
[DeviceB] vsi 1
[DeviceB-vsi-1] vxlan 1
[DeviceB-vsi-1-vxlan-1] tunnel 0
[DeviceB-vsi-1-vxlan-1] quit
# 关闭 STP 功能。
[DeviceB] undo stp global enable
# 配置 AC。
[DeviceB] interface ten-gigabitethernet 1/0/1
[DeviceB-Ten-GigabitEthernet1/0/1] service-instance 1
[DeviceB-Ten-GigabitEthernet1/0/1-srv1] encapsulation s-vid 10
[DeviceB-Ten-GigabitEthernet1/0/1-srv1] xconnect vsi 1
[DeviceB-Ten-GigabitEthernet1/0/1-srv1] quit
# 开启环路检测功能。
[DeviceB] vsi 1
[DeviceB-vsi-1] loopback-detection enable
# 配置环路检测的处理模式为 Block 模式。
[DeviceB-vsi-1] loopback-detection action block
# 配置环路检测的时间间隔为 35 秒。
[DeviceB-vsi-1] loopback-detection interval-time 35
# 配置 VSI 的环路检测优先级值为 6。
[DeviceB-vsi-1] loopback-detection priority 6
四、 验证配置
配置完成后,Device A 的 AC(Ten-GigabitEthernet1/0/1 接口上的以太网服务实例 1)在一个环路
检测时间间隔内检测到了环路,打印了如下日志信息:

# 显示 Device A 上环路检测的配置和运行情况
[DeviceA] display loopback-detection

# 显示 Device B 上环路检测的配置和运行情况。
[DeviceB] display loopback-detection

由此可见,Device A 和 Device B 都在各自的 AC(Ten-GigabitEthernet1/0/1 接口上的以太网服务实例 1)上检测到了环路,并且 Device B 阻塞存在环路的 AC。这是由于 Device A 的优先级较高,所以仅显示环路信息,未触发环路保护动作(环路检测处理模式字段的显示有特殊标识“*”)。
H3C网管交换机 M-LAG 应用环路检测配置举例
一、组网需求
在 M-LAG 组网环境中部署环路检测,以便在网络中存在环路时设备可以自动关闭设备上出现环路的端口,并及时通知用户检查网络环境。如下图 所示,Device A 和 Device B 组成 M-LAG 系统,同时部署环路检测。Device C、M-LAG 系统、Device D 和 Device E 组成一个物理上的环路。
二、 组网图

三、配置步骤
(1) 配置 Device A# 创建 VLAN 100。
<DeviceA> system-view
[DeviceA] vlan 100
[DeviceA-vlan100] quit
# 配置 M-LAG 系统配置。
[DeviceA] m-lag system-mac 1-1-1
[DeviceA] m-lag system-number 1
[DeviceA] m-lag system-priority 123
# 配置 Keepalive 报文的目的 IP 地址和源 IP 地址。
[DeviceA] m-lag keepalive ip destination 1.1.1.1 source 1.1.1.2
# 配置端口 Ten-GigabitEthernet1/0/6 工作在三层模式,并配置 IP 地址为 Keepalive 报文的源 IP 地址。
[DeviceA] interface ten-gigabitethernet 1/0/6
[DeviceA-Ten-GigabitEthernet1/0/6] port link-mode route
[DeviceA-Ten-GigabitEthernet1/0/6] ip address 1.1.1.2 24
[DeviceA-Ten-GigabitEthernet1/0/6] quit
# 配置 Keepalive 链路接口为 M-LAG 保留接口。
[DeviceA] m-lag mad exclude interface ten-gigabitethernet 1/0/6
# 创建动态二层聚合接口 3,并配置该接口为 peer-link 口。
[DeviceA] interface bridge-aggregation 3
[DeviceA-Bridge-Aggregation3] link-aggregation mode dynamic
[DeviceA-Bridge-Aggregation3] port m-lag peer-link 1
[DeviceA-Bridge-Aggregation3] quit
# 将端口 Ten-GigabitEthernet1/0/5 加入到聚合组 3 中。
[DeviceA] interface ten-gigabitethernet 1/0/5
[DeviceA-Ten-GigabitEthernet1/0/5] port link-aggregation group 3
[DeviceA-Ten-GigabitEthernet1/0/5] quit
# 配置二层聚合接口 3 为 Trunk 端口,并允许 VLAN 100 的报文通过。
[DeviceA] interface bridge-aggregation 3
[DeviceA-Bridge-Aggregation3] port link-type trunk
[DeviceA-Bridge-Aggregation3] port trunk permit vlan 100
[DeviceA-Bridge-Aggregation3] quit
# 创建动态二层聚合接口 4,并配置该接口为 M-LAG 接口 4。
[DeviceA] interface bridge-aggregation 4
[DeviceA-Bridge-Aggregation4] link-aggregation mode dynamic
[DeviceA-Bridge-Aggregation4] port m-lag group 4
[DeviceA-Bridge-Aggregation4] quit
# 分别将端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 加入到聚合组 4 中。
[DeviceA] interface ten-gigabitethernet 1/0/1
[DeviceA-Ten-GigabitEthernet1/0/1] port link-aggregation group 4
[DeviceA-Ten-GigabitEthernet1/0/1] quit
[DeviceA] interface ten-gigabitethernet 1/0/2
[DeviceA-Ten-GigabitEthernet1/0/2] port link-aggregation group 4
[DeviceA-Ten-GigabitEthernet1/0/2] quit
# 配置二层聚合接口 4 为 Trunk 端口,并允许 VLAN 100 的报文通过。
[DeviceA] interface bridge-aggregation 4
[DeviceA-Bridge-Aggregation4] port link-type trunk
[DeviceA-Bridge-Aggregation4] port trunk permit vlan 100
[DeviceA-Bridge-Aggregation4] quit
# 创建动态二层聚合接口 5,并配置该接口为 M-LAG 接口 5。
[DeviceA] interface bridge-aggregation 5
[DeviceA-Bridge-Aggregation5] link-aggregation mode dynamic
[DeviceA-Bridge-Aggregation5] port m-lag group 5
[DeviceA-Bridge-Aggregation5] quit
# 分别将端口 Ten-GigabitEthernet1/0/3 和 Ten-GigabitEthernet1/0/4 加入到聚合组 5 中。
[DeviceA] interface ten-gigabitethernet 1/0/3
[DeviceA-Ten-GigabitEthernet1/0/3] port link-aggregation group 5
[DeviceA-Ten-GigabitEthernet1/0/3] quit
[DeviceA] interface ten-gigabitethernet 1/0/4
[DeviceA-Ten-GigabitEthernet1/0/4] port link-aggregation group 5
[DeviceA-Ten-GigabitEthernet1/0/4] quit
# 配置二层聚合接口 5 为 Trunk 端口,并允许 VLAN 100 的报文通过。
[DeviceA] interface bridge-aggregation 5
[DeviceA-Bridge-Aggregation5] port link-type trunk
[DeviceA-Bridge-Aggregation5] port trunk permit vlan 100
[DeviceA-Bridge-Aggregation5] quit
# 关闭 STP 功能。
[DeviceA] undo stp global enable
# 全局开启 VLAN 100 内的环路检测功能,配置环路检测处理模式为 shutdown,环路检测的时间间隔为 35 秒。
[DeviceA] loopback-detection global enable vlan 100
[DeviceA] loopback-detection global action shutdown
[DeviceA] loopback-detection interval-time 35
(2) 配置 Device B
配置Device B的M-LAG系统编号为2,Keepalive报文的目的IP地址为1.1.1.2,源IP地址为1.1.1.1。其他配置与 Device A 类似,不再赘述。
(3) 配置 Device C
# 关闭 STP 功能。
<DeviceC> system-view
[DeviceC] undo stp global enable
# 创建 VLAN 100。
[DeviceC] vlan 100
[DeviceC-vlan100] quit
# 创建二层聚合接口 4,并配置该接口为动态聚合模式。
[DeviceC] interface bridge-aggregation 4
[DeviceC-Bridge-Aggregation4] link-aggregation mode dynamic
[DeviceC-Bridge-Aggregation4] quit
# 分别将端口 Ten-GigabitEthernet1/0/1~Ten-GigabitEthernet1/0/4 加入到聚合组 4 中。
[DeviceC] interface range ten-gigabitethernet 1/0/1 to ten-gigabitethernet 1/0/4
[DeviceC-if-range] port link-aggregation group 4
[DeviceC-if-range] quit
# 配置二层聚合接口 4 为 Trunk 端口,并允许 VLAN 100 的报文通过。
[DeviceC] interface bridge-aggregation 4
[DeviceC-Bridge-Aggregation4] port link-type trunk
[DeviceC-Bridge-Aggregation4] port trunk permit vlan 100
[DeviceC-Bridge-Aggregation4] quit
# 配置端口 Ten-GigabitEthernet1/0/5 为 Trunk 端口,并允许 VLAN 100 的报文通过。
[DeviceC] interface ten-gigabitethernet 1/0/5
[DeviceC-Ten-GigabitEthernet1/0/5] port link-type trunk
[DeviceC-Ten-GigabitEthernet1/0/5] port trunk permit vlan 100
[DeviceC-Ten-GigabitEthernet1/0/5] quit
(4) 配置 Device D
# 关闭 STP 功能。
<DeviceD> system-view
[DeviceD] undo stp global enable
# 创建 VLAN 100。
[DeviceD] vlan 100
[DeviceD-vlan100] quit
# 创建二层聚合接口 5,并配置该接口为动态聚合模式。
[DeviceD] interface bridge-aggregation 5
[DeviceD-Bridge-Aggregation5] link-aggregation mode dynamic
[DeviceD-Bridge-Aggregation5] quit
# 分别将端口 Ten-GigabitEthernet1/0/1~Ten-GigabitEthernet1/0/4 加入到聚合组 5 中。
[DeviceD] interface range ten-gigabitethernet 1/0/1 to ten-gigabitethernet 1/0/4
[DeviceD-if-range] port link-aggregation group 5
[DeviceD-if-range] quit
# 配置二层聚合接口 5 为 Trunk 端口,并允许 VLAN 100 的报文通过。
[DeviceD] interface bridge-aggregation 5
[DeviceD-Bridge-Aggregation5] port link-type trunk
[DeviceD-Bridge-Aggregation5] port trunk permit vlan 100
[DeviceD-Bridge-Aggregation5] quit
# 配置端口 Ten-GigabitEthernet1/0/5 为 Trunk 端口,并允许 VLAN 100 的报文通过。
[DeviceD] interface ten-gigabitethernet 1/0/5
[DeviceD-Ten-GigabitEthernet1/0/5] port link-type trunk
[DeviceD-Ten-GigabitEthernet1/0/5] port trunk permit vlan 100
[DeviceD-Ten-GigabitEthernet1/0/5] quit
(5) 配置 Device E
# 关闭 STP 功能。
<DeviceE> system-view
[DeviceE] undo stp global enable
# 创建 VLAN 100。
[DeviceE] vlan 100
[DeviceE-vlan100] quit
# 配置端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 为 Trunk 端口,并允许 VLAN 100的报文通过。
[DeviceE] interface ten-gigabitethernet 1/0/1
[DeviceE-Ten-GigabitEthernet1/0/1] port link-type trunk
[DeviceE-Ten-GigabitEthernet1/0/1] port trunk permit vlan 100
[DeviceE-Ten-GigabitEthernet1/0/1] quit
[DeviceE] interface ten-gigabitethernet 1/0/2
[DeviceE-Ten-GigabitEthernet1/0/2] port link-type trunk
[DeviceE-Ten-GigabitEthernet1/0/2] port trunk permit vlan 100
[DeviceE-Ten-GigabitEthernet1/0/2] quit
四、 验证配置
当配置完成后,系统在一个环路检测时间间隔内在 Device A 的 M-LAG 接口 4 和 M-LAG 接口 5 上都检测到了环路,于是将这两个 M-LAG 接口自动关闭,并打印了如下日志信息:

使用 display loopback-detection 命令可以查看 Device A 上环路检测的配置和运行情况:
# 查看 Device A 上环路检测的配置和运行情况。

由此可见,Device A 上显示在聚合组 4 和聚合组 5 上检测到环路,由于环路检测功能运行在Shutdown 模式下,聚合组 4 和聚合组 5 上出现环路后均已被自动关闭,因此设备打印的日志信息显示这两个聚合组上的环路已消除。此时,使用 display interface 命令分别查看 Device A 上聚合组 4 和聚合组 5 的状态信息:
# 显示 Device A 上聚合组 4 的状态信息。
# 显示 Device A 上聚合组 5 的状态信息

由此可见,聚合组 4 和聚合组 5 均已被环路检测模块自动关闭。
Device B 上的现象和 Device A 上一致。
H3C网管交换机环路检测 VLAN-block 处理模式配置举例
一、组网需求
• 三台设备 Device A、Device B 和 Device C 组成一个物理上的环形网络。
• 通过在 Device A 上开启环路检测功能,并采用 VLAN-block 模式,使系统能够自动阻塞 Device A 上出现环路的 VLAN,并通过打印日志信息来通知用户检查网络。
二、 组网图

三、配置步骤
(1) 配置 Device A
# 创建 VLAN 100,指定 VLAN 100 为保护 VLAN,并全局开启该 VLAN 内的环路检测功能。
<DeviceA> system-view
[DeviceA] vlan 100
[DeviceA–vlan100] quit
[DeviceA] loopback-detection protected-vlan 100
[DeviceA] loopback-detection global enable vlan 100
# 配置端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 为 Trunk 类型,并允许VLAN 100 通过。
[DeviceA] interface ten-gigabitethernet 1/0/1
[DeviceA-Ten-GigabitEthernet1/0/1] port link-type trunk
[DeviceA-Ten-GigabitEthernet1/0/1] port trunk permit vlan 100
[DeviceA-Ten-GigabitEthernet1/0/1] quit
[DeviceA] interface ten-gigabitethernet 1/0/2
[DeviceA-Ten-GigabitEthernet1/0/2] port link-type trunk
[DeviceA-Ten-GigabitEthernet1/0/2] port trunk permit vlan 100
[DeviceA-Ten-GigabitEthernet1/0/2] quit
# 配置端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 的环路检测处理模式为VLAN-block 模式。
[DeviceA] interface ten-gigabitethernet 1/0/1
[DeviceA-Ten-GigabitEthernet1/0/1] undo stp enable
[DeviceA-Ten-GigabitEthernet1/0/1] loopback-detection action vlan-block
[DeviceA-Ten-GigabitEthernet1/0/1] quit
[DeviceA] interface ten-gigabitethernet 1/0/2
[DeviceA-Ten-GigabitEthernet1/0/2] undo stp enable
[DeviceA-Ten-GigabitEthernet1/0/2] loopback-detection action vlan-block
[DeviceA-Ten-GigabitEthernet1/0/2] quit
# 配置环路检测的时间间隔为 35 秒。
[DeviceA] loopback-detection interval-time 35
(2) 配置 Device B
# 创建 VLAN 100。
<DeviceB> system-view
[DeviceB] vlan 100
[DeviceB–vlan100] quit
# 配置端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 为 Trunk 类型,并允许VLAN 100 通过。
[DeviceB] interface ten-gigabitethernet 1/0/1
[DeviceB-Ten-GigabitEthernet1/0/1] port link-type trunk
[DeviceB-Ten-GigabitEthernet1/0/1] port trunk permit vlan 100
[DeviceB-Ten-GigabitEthernet1/0/1] quit
[DeviceB] interface ten-gigabitethernet 1/0/2
[DeviceB-Ten-GigabitEthernet1/0/2] port link-type trunk
[DeviceB-Ten-GigabitEthernet1/0/2] port trunk permit vlan 100
[DeviceB-Ten-GigabitEthernet1/0/2] quit
(3) 配置 Device C
# 创建 VLAN 100。
<DeviceC> system-view
[DeviceC] vlan 100
[DeviceC–vlan100] quit
# 配置端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 为 Trunk 类型,并允许VLAN 100 通过。
[DeviceC] interface ten-gigabitethernet 1/0/1
[DeviceC-Ten-GigabitEthernet1/0/1] port link-type trunk
[DeviceC-Ten-GigabitEthernet1/0/1] port trunk permit vlan 100
[DeviceC-Ten-GigabitEthernet1/0/1] quit
[DeviceC] interface ten-gigabitethernet 1/0/2
[DeviceC-Ten-GigabitEthernet1/0/2] port link-type trunk
[DeviceC-Ten-GigabitEthernet1/0/2] port trunk permit vlan 100
[DeviceC-Ten-GigabitEthernet1/0/2] quit
四、 验证配置
当配置完成后,系统在一个环路检测时间间隔内在 Device A 的端口 Ten-GigabitEthernet1/0/1 和Ten-GigabitEthernet1/0/2 上都检测到了环路,并打印了如下日志信息。

# 显示 Device A 上环路检测的配置和运行情况。

由此可见,Device A 在端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 上检测到环路。由于环路检测功能运行在 VLAN-block 模式下,端口 Ten-GigabitEthernet1/0/1 和Ten-GigabitEthernet1/0/2 上出现环路后 VLAN 100 均已被阻塞,因此设备打印的日志信息显示这两个端口上的环路已消除。


