Try   HackMD

Virtual Router Redundancy Protocol (VRRP)

前言

隨著網路發展和應用的多樣化和即時串流服務日漸普及。而在這種情況下,網路斷開可能會影響許多服務並造成損失。因此,對於網路的基礎設施提供可靠性的需求仍在上升,而提高系統可靠性的最有效途徑即為提高系統的容錯能力,加快故障恢復的速度,以達成故障對於服務的影響。

VRRP 介紹

簡介

VRRP 主要是將多個路由設備組合成一個 Virtual Router,並使用 Virtual IP 來當作默認的 Virtual Gateway。當 Gateway 發生故障時,VRRP 會從其他路由設備中選擇一個新的 Gateway 來傳遞網路流量,以確保網路通訊可靠。

目的

因為同一個網段下的所有主機都配置相同的 Gateway 當作 Next Hop 的位置,所以主機都會使用此 Gateway 來發送封包,而 Gateway 會將這些封包轉送至其他網段。而當網段發生故障時,具有相同路由配置的主機將無法與外部交換封包。而傳統的方法是配置多個 Gateway,但是這樣會使 Gateway 的選擇成為一個問題。不過 VRRP 解決的此問題,VRRP可在不改變網路的情況下將多個路由設備虛擬化成一個 Virtual Router,Virtual IP 被設為 Default Gateway,當 Gateway 發生故障時,VRRP 會選擇出一個新的 Gateway 當作 Default Gateway,以確保可靠性,這樣的好處是,當出現故障時,我們無需修改主機和 Gateway 的配置,防止網路中斷。

運作原理

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

VRRP 應用場景

Next Hop 冗餘

用戶透過 Gateway 連接到外部網路,而為了保證網路服務不間斷,可以在 Gateway 上配置 VRRP 主Master-Backup,實現 Next Hop 的冗餘。

如下圖所示:
當 Router A 出現故障,會根據優先權從 Router B 與 Router C 之中選出新的 Master,然後由新的 Master 節點來接管之後的流量。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

負載平衡

創建多個 Virtual IP 的 VRRP Group,對於不同的用戶提供不同的 VRRP Group 作為 Gateway,以實現負載平衡。

如下圖所示:
VRRP group 1: Master (Router A), Backup (Router B)
VRRP group 2: Master (Router B), Backup (Router A)

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

tags: Protocol VRRP Reliability