華爲Smart Link與Monitor Link原理與配置

原理概述

在二層網絡中,爲了提高網絡可靠性,一般通過冗餘方式進行組網,這種方式又會帶來環路問題,爲了解決環路問題,除了採用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。

實驗拓撲

在這裏插入圖片描述

SW1

<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的主備情況。

SW2

<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

在這裏插入圖片描述

Monitor Link配置

模擬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 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章