在二层网络中,为了提高网络可靠性,一般通过冗余方式进行组网,这种方式又会带来环路问题,为了解决环路问题,除了采用STP技术,华为还提出了Smart Link解决方案。
在网络中,两条上行链路在正常情况下,只有一条处于连通状态,而另一条处于阻塞状态,避免了环路引起的广播风暴,当主用链路发生故障后,流量会在毫秒级的时间内切换到备用链路上,保证了数据的正常转发。默认情况下,当原主用链路故障恢复时,将维持在阻塞状态,不进行抢占,从而维持网络稳定性,可手工配置回切功能,使流量切换回原主用链路。
Smart Link缺陷:能够保证设备在本设备上行链路发生故障后快速进行倒换,但对于跨设备的链路故障不能提供有效保护。
为此,可采用Monitor Link用于扩展Smart Link的链路备份范围,通过监控上游设备的上行链路,达到上行链路故障迅速传达给下游设备,从而触发Smart Link的主备链路切换。
SW4作为公司出口设备连接外网,SW1是接入侧交换机,SW1通过两台交换机SW2与SW3双上行连接到SW4,针对此双上行组网。
为了实现主备链路冗余备份及故障后的快速迁移,部署Smart Link技术,为了进一步扩展Smart Link的备份范围,使用Monitor Link联动方式监控上游设备的上行链路来完善Smart Link。
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SW1
[SW1]smart-link group 1 #创建Smart Link组1,并开启Smart Link组功能
[SW1-smlk-group1]smart-link enable
[SW1-smlk-group1]quit
[SW1]interface ethernet 0/0/3
[SW1-Ethernet0/0/3]stp disable #配置Smart Link时,需要在运行Smart Link的接口下关闭STP
[SW1-Ethernet0/0/3]quit
[SW1]interface ethernet 0/0/4
[SW1-Ethernet0/0/4]stp disable
[SW1-Ethernet0/0/4]quit
[SW1]smart-link group 1
[SW1-smlk-group1]port ethernet 0/0/3 master #配置GE0/0/3为主接口
[SW1-smlk-group1]port ethernet 0/0/4 slave #配置GE0/0/4为备份接口
[SW1-smlk-group1]quit
[SW1]display smart-link group 1 #查看主备状态
Smart Link group 1 information :
Smart Link group was enabled
There is no Load-Balance
There is no protected-vlan reference-instance
DeviceID: 4c1f-ccb2-56c3
Member Role State Flush Count Last-Flush-Time
----------------------------------------------------------------------
#E0/0/3为主端口,状态为Active,E0/0/4为备份端口,状态为Inactive
Ethernet0/0/3 Master Active 0 0000/00/00 00:00:00 UTC+00
:00
Ethernet0/0/4 Slave Inactive 0 0000/00/00 00:00:00 UTC+00
:00
当SW1上主接口出现故障时,备份端口会立即切换为Active状态,并且,默认情况下,原主接口恢复时,主接口不会自动切回Active状态,需手工配置回切功能。
将SW2交换机E0/0/3接口关闭,模拟故障发生,回到SW1观察Smart Link组1的主备情况。
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SW2
[SW2]interface ethernet 0/0/3
[SW2-Ethernet0/0/3]shutdown
[SW2-Ethernet0/0/3]quit
SW1的主备状态已自动切换,
重新开启SW2的E0/0/3接口,再次在S1上观察Smart Link组1的主备状态,但是主备状态默认是不切换的,需要在SW1上开启回切功能。
[SW2]interface ethernet 0/0/3
[SW2-Ethernet0/0/3]undo shutdown
[SW1]smart-link group 1
[SW1-smlk-group1]restore enable #开启回切功能
[SW1-smlk-group1]timer wtr 30 #回切时间设置为30
模拟SW2的G0/0/1接口关闭,并查看Smart Link组1的主备状态
[SW2]interface GigabitEthernet 0/0/1
[SW2-GigabitEthernet0/0/1]shutdown
#主备仍然没有切换,E0/0/3还是主接口,这样会导致交换机1无法正常通信
[SW1]display smart-link group 1
Smart Link group 1 information :
Smart Link group was enabled
Wtr-time is: 30 sec.
There is no Load-Balance
There is no protected-vlan reference-instance
DeviceID: 4c1f-ccb2-56c3
Member Role State Flush Count Last-Flush-Time
----------------------------------------------------------------------
Ethernet0/0/3 Master Active 0 0000/00/00 00:00:00 UTC+00
:00
Ethernet0/0/4 Slave Inactive 0 0000/00/00 00:00:00 UTC+00
:00
SW2启用Monitor Link组1,配置上行接口为GE0/0/1,下行接口为0/0/3,
[SW2]monitor-link group 1
[SW2-mtlk-group1]port g
[SW2-mtlk-group1]port GigabitEthernet 0/0/1
[SW2-mtlk-group1]port GigabitEthernet 0/0/1 uplink
[SW2-mtlk-group1]port Ethernet 0/0/3
[SW2-mtlk-group1]port Ethernet 0/0/3 downlink
[SW2-mtlk-group1]quit
再次查看S1的Smart Link组1 的主备状态,E0/0/3是Inactive,E0/0/4是Active,流量已经被切换到E0/0/4接口,保证了流量正常转发
[SW1]display smart-link group 1
Smart Link group 1 information :
Smart Link group was enabled
Wtr-time is: 30 sec.
There is no Load-Balance
There is no protected-vlan reference-instance
DeviceID: 4c1f-ccb2-56c3
Member Role State Flush Count Last-Flush-Time
----------------------------------------------------------------------
Ethernet0/0/3 Master Inactive 0 0000/00/00 00:00:00 UTC+00
:00
Ethernet0/0/4 Slave Active 0 0000/00/00 00:00:00 UTC+00
:00
修改Monitor Link组的回切时间为10s(默认为3秒),当SW2的上行链路重新恢复后,下行链路Smart Link组将在时间到期后,重新切回主链路。
[SW2]monitor-link group 1
[SW2-mtlk-group1]timer recover-time 10
[SW2]monitor-link group 1
[SW2-mtlk-group1]timer recover-time 10
[SW2-mtlk-group1]quit
[SW2]interface GigabitEthernet 0/0/1
[SW2-GigabitEthernet0/0/1]disp this
#
interface GigabitEthernet0/0/1
shutdown
#
return
[SW2-GigabitEthernet0/0/1]undo shutdown
等待40s左右,查看S1的Smart Link组1的主备状态
[SW1]disp smart-link group 1
Smart Link group 1 information :
Smart Link group was enabled
Wtr-time is: 30 sec.
There is no Load-Balance
There is no protected-vlan reference-instance
DeviceID: 4c1f-ccb2-56c3
Member Role State Flush Count Last-Flush-Time
----------------------------------------------------------------------
Ethernet0/0/3 Master Active 0 0000/00/00 00:00:00 UTC+00
:00
Ethernet0/0/4 Slave Inactive 0 0000/00/00 00:00:00 UTC+00
:00