HSRP To GLBP Migration

HSRP To GLBP Migration


最近按排一間國內著名物流公司於香港300多間地舖的network topology migration,原network是使用HSRP active/standby topology,他們希望將其變為active/active topologyHSRP 一般都使用active/standby,其實他也可以使用use-bia command另其變成active/active,可是它有其技術上的ARP天生缺陷問題,standby router 會失去proxy ARP 而造失不準確的route,所以一般會選擇由HSRP migrate GLBP

Current network topology:
Headquarter primary & secondary router 利用IPVPN 建立GRE Tunnel connection branch office primary & secondary router 建立連線
兩邊router都是使用HSRP,透過floating static route 指向primary router先,若primary router 不存在便指向secondary router
由於active/standby HSRP,故一半的router internet線路都是idel,沒效率


Lab Topology:  利用GNS3 建立了模擬測試場
由於店舖接近300間之多,很難一下子要求下屬將所有router HSRP 轉行GLBP,因此會有一段時過渡期,headquarter office router HSRP 運作,branch office 則使用GLBP。首先逐步將branch office 轉成GLBP如下圖測試的topology

R1 Tunnel Interface

R2 Tunnel Interface

R3 Tunnel Interface

R4 Tunnel Interface

建立好network topology 後嘗試trace route 一下,可以看到一邊行HSRP而另一邊行GLBP,兩者都可以正常運作。你可以看到左邊的PC1 & PC3 只走HSRP primary router (192.168.12.252),右邊PC2 & PC4已開始可以load balance traffic,與此同時HSRP GLBP 都可以共存。



測試1: Shutdown R1 WAN Interface
1.      HSRP 設定
R1: 設定VIPpriority 120enable preempt (即如果自己的priority neighbor 高時,會爭active router 的角色來做)track (monitor FastEthernet0/0 的狀態,假設interface down便會自行將自己的priority 減去60)

R2: 簡單setup IP preempt便可以,default priority 100

2.      嘗試shutdown R1 WAN interface,你會收到一大推資訊,其中包括 :
1)     Interface down
2)     HSRP status Active 轉變成 Speak
3)     Tunne1 & 2 down
4)     HSRP status Active 轉變成 Standby
Peempt流程是由Active > Speak > Standby,經談判而知道自己priority 較低便變成Standby

3.      順提HSRP 是共享同一個virtual MAC address,當Standby Active 轉換時Virtual Mac Address不變。

4.      R1可以看到現在狀態為Standby,由於現在Priority 60R2(192.168.12.253) default priority 100取勝而已變為Active router

5.      Trace 一下,符合預期地headquarter 全都經R2(192.168.12.253) 走,另一邊還是load balance

6.      其後將R1 WAN interface 還原(no shutdown),一切亦還原正常。


測試2: Shutdown R3 WAN Interface
1.      GLBP 設定
R3: 設定VIP enable preemptweighting( weighting 決定AVF,若低過90 便不會參與AVF)
R4: 基本上跟R3一樣
2.      AVG & AVF
AVGActive Virtual Gateway),其協調方法為將優先權(Priority)最高或IP位址(Address)最高者選擇為AVG 在完成協調之後,AVG所屬的介面為Active,其他介面為Standby GLBP priority 可以決定誰是active AVG,但在一般都並不重要,重點在AVF

AVG 的用途是分配virtual Mac Address 給每個AVF(Active Virtual Forwarder),如下圖Fwd便是指Forwarder group,而group 1 group 2都是用不同的virtual mac addressR3 host Group 1 active role Group 2 listenR4 host Group 2 Active role Group 1 listen

end devices 上查看ARP,便會顯示不同PC會學到不同的mac address

3.      Load balance 方法
GLBP load balance 的方法有分Round Robin(default)Host Dependent Weighted

Round Robin: 平均配,第一個ARP request 會給group 1 virtual mac address,第二個ARP request 會給group 2 virtual mac address,如此例推

Host Dependent: 會根據end device source mac address 而給予virtual mac address,同時會根據記錄而長期給多同一個mac address。可以感覺上有點隨機,在測試4PC,但只有其中一部取得Group 2 virtual mac address,其他都是拿到group 1 virtual mac address,所以有點不穩定。

Weighted: 根據weight的設定而按比例而派發virtual mac address,若設定相同便會與Round Robin 相同。

4.      R3 WAN Interface Down
GLBP 的重點在於weight lower,當track interface downweight value 低於lower valueR3Active Fwd 1 便會由Active 變為Listen


5.      show glbp時可以看到現時的Weighting已變為10

6.      R3 & R4 show glbp brief時,R3 Fwd 1 & 2 都是listen,而R4則是active

7.      PC2 & PC4 學到的virtual mac address 保持不變,而trace 一下便會發現都走到R4(192.168.34.253) 去了,這亦是符合預期。

8.      R3 還原,一切亦回復正常。

測試3: Headquarter routerHSRP較換成GLBP
1.      先輸入no standby 1 移除所有R1 & R2 HSRP 的設定,不然GLBP HSRP VIP 相同而不給予你設定GLBPVIP


2.      然後設定R1 interface 如下。

3.      設定R2 interface 如下。

4.      雖然設定好了,但還是不能ping VIP 192.168.0.254重點是不要忘記HSRPGLBPvirtual mac address 是不同的,所以必須clear ARP cache後才能ping 通。因此在migration的時候必須留意ARP cache 的保留時間和需要多久才能renew,可否有clear cache 的方法。

5.      ARP clear 完之後,Trace 一下便可看到兩邊的traffic 都可以load balance,把active/standby 轉變成active/active,盡可能地將兩邊的internet link 投入運作。

6.      其中當然也要測試像R1 WAN interface shutdown,再觀察routing 都符合預期。


後記:
HSRP 較多人熟識,但一般人對GLBP較為沒那麼熟練。曾看過公司設定了GLBP,但AVF 都沒設定好,結果其中一條internet link 時,routing 會出錯而出現network outage,要改善後才能做到active/active且沒network outage。在整個migration 當中,主要是測試HSRP GLBP 能共存,還有在migration時要多留意ARP cache 的問題。

Windows   Delete ARP Cache
打開CMD 輸入以下指令: (需要run   as    admin)
arp -a       /      netsh interface ip delete arpcache

留言