H3C网管交换机环路检测 VLAN-block 处理模式配置举例

一、组网需求
• 三台设备 Device A、Device B 和 Device C 组成一个物理上的环形网络。
• 通过在 Device A 上开启环路检测功能,并采用 VLAN-block 模式,使系统能够自动阻塞 Device  A 上出现环路的 VLAN,并通过打印日志信息来通知用户检查网络。

二、 组网图
环路检测 VLAN-block 处理模式配置组网图

三、配置步骤
(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 上环路检测的配置和运行情况
由此可见,Device A 在端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 上检测到环路。由于环路检测功能运行在 VLAN-block 模式下,端口 Ten-GigabitEthernet1/0/1 和Ten-GigabitEthernet1/0/2 上出现环路后 VLAN 100 均已被阻塞,因此设备打印的日志信息显示这两个端口上的环路已消除。

ICP备案号:晋ICP备18007549号-1
站长微信:15534641008