交换机配置环路检测功能
· 三台设备Device A、Device B和Device C组成一个物理上的环形网络。
· 通过在Device A上配置环路检测功能,使系统能够自动关闭Device A上出现环路的端口,并通过打印日志信息来通知用户检查网络。
图1-3 环路检测基本功能配置组网图
缺省情况下,本设备的接口处于ADM(Administratively Down)状态,请根据实际需要在对应接口视图下使用undo shutdown命令开启接口。
(1) 配置Device A
# 创建VLAN 100,并全局开启该VLAN内的环路检测功能。
<DeviceA> system-view
[DeviceA] vlan 100
[DeviceA–vlan100] quit
[DeviceA] loopback-detection global enable vlan 100
# 配置端口HundredGigE1/0/1和HundredGigE1/0/2为Trunk类型,并允许VLAN 100通过。
[DeviceA] interface hundredgige 1/0/1
[DeviceA-HundredGigE1/0/1] port link-type trunk
[DeviceA-HundredGigE1/0/1] port trunk permit vlan 100
[DeviceA-HundredGigE1/0/1] quit
[DeviceA] interface hundredgige 1/0/2
[DeviceA-HundredGigE1/0/2] port link-type trunk
[DeviceA-HundredGigE1/0/2] port trunk permit vlan 100
[DeviceA-HundredGigE1/0/2] quit
# 全局配置环路检测的处理模式为Shutdown模式。
[DeviceA] loopback-detection global action shutdown
# 配置环路检测的时间间隔为35秒。
[DeviceA] loopback-detection interval-time 35
(2) 配置Device B
# 创建VLAN 100。
<DeviceB> system-view
[DeviceB] vlan 100
[DeviceB–vlan100] quit
# 配置端口HundredGigE1/0/1和HundredGigE1/0/2为Trunk类型,并允许VLAN 100通过。
[DeviceB] interface hundredgige 1/0/1
[DeviceB-HundredGigE1/0/1] port link-type trunk
[DeviceB-HundredGigE1/0/1] port trunk permit vlan 100
[DeviceB-HundredGigE1/0/1] quit
[DeviceB] interface hundredgige 1/0/2
[DeviceB-HundredGigE1/0/2] port link-type trunk
[DeviceB-HundredGigE1/0/2] port trunk permit vlan 100
[DeviceB-HundredGigE1/0/2] quit
(3) 配置Device C
# 创建VLAN 100。
<DeviceC> system-view
[DeviceC] vlan 100
[DeviceC–vlan100] quit
# 配置端口HundredGigE1/0/1和HundredGigE1/0/2为Trunk类型,并允许VLAN 100通过。
[DeviceC] interface hundredgige 1/0/1
[DeviceC-HundredGigE1/0/1] port link-type trunk
[DeviceC-HundredGigE1/0/1] port trunk permit vlan 100
[DeviceC-HundredGigE1/0/1] quit
[DeviceC] interface hundredgige 1/0/2
[DeviceC-HundredGigE1/0/2] port link-type trunk
[DeviceC-HundredGigE1/0/2] port trunk permit vlan 100
[DeviceC-HundredGigE1/0/2] quit
当配置完成后,系统在一个环路检测时间间隔内在Device A的端口HundredGigE1/0/1和HundredGigE1/0/2上都检测到了环路,于是将这两个端口自动关闭,并打印了如下日志信息:
[DeviceA]
%Feb 24 15:04:29:663 2013 DeviceA LPDT/4/LPDT_LOOPED: A loop was detected on HundredGigE1/0/1.
%Feb 24 15:04:29:664 2013 DeviceA LPDT/4/LPDT_VLAN_LOOPED: A loop was detected on HundredGigE1/0/1 in VLAN 100.
%Feb 24 15:04:29:667 2013 DeviceA LPDT/4/LPDT_LOOPED: A loop was detected on HundredGigE1/0/2.
%Feb 24 15:04:29:668 2013 DeviceA LPDT/4/LPDT_VLAN_LOOPED: A loop was detected on HundredGigE1/0/2 in VLAN 100.
%Feb 24 15:04:44:243 2013 DeviceA LPDT/5/LPDT_VLAN_RECOVERED: A loop was removed on HundredGigE1/0/1 in VLAN 100.
%Feb 24 15:04:44:243 2013 DeviceA LPDT/5/LPDT_RECOVERED: All loops were removed on HundredGigE1/0/1.
%Feb 24 15:04:44:248 2013 DeviceA LPDT/5/LPDT_VLAN_RECOVERED: A loop was removed on HundredGigE1/0/2 in VLAN 100.
%Feb 24 15:04:44:248 2013 DeviceA LPDT/5/LPDT_RECOVERED: All loops were removed on HundredGigE1/0/2.
使用display loopback-detection命令可以查看Device A上环路检测的配置和运行情况:
# 显示Device A上环路检测的配置和运行情况。
[DeviceA] display loopback-detection
Loop detection is enabled.
Loop detection interval is 35 second(s).
Loop is detected on following interfaces:
Interface Action mode VLANs
HundredGigE1/0/1 Shutdown 100
HundredGigE1/0/2 Shutdown 100
由此可见,Device A上显示在端口HundredGigE1/0/1和HundredGigE1/0/2上检测到环路,由于环路检测功能运行在Shutdown模式下,端口HundredGigE1/0/1和HundredGigE1/0/2上出现环路后均已被自动关闭,因此设备打印的日志信息显示这两个端口上的环路已消除。此时,使用display interface命令分别查看Device A上端口HundredGigE1/0/1和HundredGigE1/0/2的状态信息:
# 显示Device A上端口HundredGigE1/0/1的状态信息。
[DeviceA] display interface hundredgige 1/0/1
HundredGigE1/0/1 current state: DOWN (Loopback detection down)
...
# 显示Device A上端口HundredGigE1/0/2的状态信息。
[DeviceA] display interface hundredgige 1/0/2
HundredGigE1/0/2 current state: DOWN (Loopback detection down)
...
由此可见,端口HundredGigE1/0/1和HundredGigE1/0/2均已被环路检测模块自动关闭。
(0)
暂无评论
开启环路检测、如果有环路、端口会shutdown、或者查看日志;会有环路日志提示;
1.1适用产品系列
本案例适用于如S7000E、S7500E等的V7交换机,V5、V7交换机具体分类及型号可以参考“1.1 Comware V5、V7平台交换机分类说明”。
1.2配置需求及实现的效果
交换机SW2上的9口和10口连接成了环路,然后交换机SW1上的2口开启了环路检测。
当用户开启以太网2端口环回监测功能后,如果监测到端口存在环回,设备会根据环回监测动作对报文的接收端口进行shutdown。用户可以在系统视图下全局配置环路检测的处理模式,也可以在接口视图下配置当前端口的环路检测处理模式。系统视图下的配置对所有端口都有效,接口视图下的配置则只对当前端口有效,且接口视图下的配置优先级较高。
方法一、【全局视图下开启环路检测】
#在SW1开启全局视图下所有vlan的环路检测
<H3C>system-view //进入系统视图
System View: return to User View with Ctrl+Z.
[H3C]loopback-detection global enable vlan all //开启全局视图下所有vlan的环路检测
#全局配置环路检测处理的模式为端口shutdown
[H3C]loopback-detection global action shutdown //全局配置环路检测处理的模式为端口shutdown
#保存配置
[H3C]save force //保存配置
方法二、【端口视图下开启环路检测】
#进入接口二,在SW1开启接口视图下所有vlan的环路检测。
<H3C>system-view //进入系统视图
[H3C]interface gigabitethernet 1/0/2 //进入g1/0/2接口
[H3C-GigabitEthernet1/0/2] loopback-detection global enable vlan all //开启接口视图下所有vlan的环路检测
#接口二下配置环路检测处理的模式为端口shutdown。
[H3C-GigabitEthernet1/0/2] loopback-detection global action shutdown //配置环路检测处理的模式为端口shutdown
[H3C-GigabitEthernet1/0/2]quit //退出当前视图
#保存配置
[H3C]save force //保存配置
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论