28-VRRP快速配置指南
本章節下載 (221.90 KB)
VRRP快速配置指南
Copyright © 2024 bobty下载软件 版權所有,保留一切權利。
非經本公司書麵許可,任何單位和個人不得擅自摘抄、複製本文檔內容的部分或全部,並不得以任何形式傳播。
除bobty下载软件 的商標外,本手冊中出現的其它公司的商標、產品標識及商品名稱,由各自權利人擁有。
本文檔中的信息可能變動,恕不另行通知。
本案例介紹IPv4 VRRP單備份組的配置方法。
如圖1所示,Host A需要訪問Internet上的Host B,Host A所在網絡的出口處部署了兩台設備。現要求使用VRRP單備份組功能,將這兩台設備組成一台虛擬路由器,作為Host A的缺省網關。具體應用需求如下:
· 在正常情況下,由Device A承擔網關功能,轉發Host A發送至外網的流量;
· 當Device A或者Device A的上行接口出現故障時,由Device B接替Device A承擔網關功能;
· 當Device A或者Device A的上行接口故障恢複後,由Device A繼續承擔網關功能。
圖1 VRRP單備份組配置組網圖
· 備份組的虛擬IP地址不能為全零地址(0.0.0.0)、廣播地址(255.255.255.255)、環回地址、非A/B/C類地址和其它非法IP地址(如0.0.0.1)。
· IPv4 VRRP既可以使用VRRPv2版本,也可以使用VRRPv3版本(缺省情況使用VRRPv3)。請確保IPv4 VRRP備份組中的所有設備上配置的IPv4 VRRP版本一致,否則備份組無法正常工作。
· 建議將備份組的虛擬IP地址和備份組中設備下行接口的IP地址配置為同一網段,否則可能導致局域網內的主機無法訪問外部網絡。
· 對於同一個VRRP備份組的成員設備,必須保證虛擬路由器的IP地址配置完全一樣。
· 用戶在配置降低優先級幅度時,需要確保降低後的優先級比備份組內其他設備的優先級要低,確保備份組內有其他設備被選為Master。
# 創建VLAN 2,並將接口GigabitEthernet1/0/1加入到VLAN 2中
<DeviceA> system-view
[DeviceA] vlan 2
[DeviceA-vlan2] port gigabitethernet 1/0/1
[DeviceA-vlan2] quit
# 創建VLAN接口2,並將接口IP地址配置為10.1.1.1/24。
[DeviceA] interface vlan-interface 2
[DeviceA-Vlan-interface2] ip address 10.1.1.1 255.255.255.0
# 創建VRRP備份組1,並配置備份組1的虛擬IP地址為10.1.1.111。
[DeviceA-Vlan-interface2] vrrp vrid 1 virtual-ip 10.1.1.111
# 設置Device A在備份組1中的優先級為110,高於Device B的優先級100,以保證Device A成為Master負責轉發流量。
[DeviceA-Vlan-interface2] vrrp vrid 1 priority 110
# 設置Device A工作在搶占方式,以保證Device A故障恢複後,能再次搶占成為Master,即隻要Device A正常工作,就由Device A負責轉發流量。為了避免頻繁地進行狀態切換,配置搶占延遲時間為5000厘秒。
[DeviceA-Vlan-interface2] vrrp vrid 1 preempt-mode delay 5000
[DeviceA-Vlan-interface2] quit
# 創建和上行端口GigabitEthernet1/0/2關聯的Track項1。
[DeviceA] track 1 interface gigabitethernet 1/0/2
[DeviceA-track-1] quit
# 配置監視Track項1,Track項的狀態為Negative時,Device A在VRRP備份組中的優先級降低的數值為50。
[DeviceA] interface vlan-interface 2
[DeviceA-Vlan-interface2] vrrp vrid 1 track 1 priority reduced 50
[DeviceA-Vlan-interface2] quit
# 配置VLAN2。
<DeviceB> system-view
[DeviceB] vlan 2
[DeviceB-Vlan2] port gigabitethernet 1/0/1
[DeviceB-vlan2] quit
[DeviceB] interface vlan-interface 2
[DeviceB-Vlan-interface2] ip address 10.1.1.2 255.255.255.0
# 創建備份組1,並配置備份組1的虛擬IP地址為10.1.1.111。
[DeviceB-Vlan-interface2] vrrp vrid 1 virtual-ip 10.1.1.111
# 設置Device B在備份組1中的優先級為100。
[DeviceB-Vlan-interface2] vrrp vrid 1 priority 100
# 配置完成後,在Host A上可以ping通Host B。
# 通過display vrrp verbose命令查看配置後的結果,顯示Device A上VRRP備份組1的詳細信息。
[DeviceA-Vlan-interface2] display vrrp verbose
IPv4 Virtual Router Information:
Running mode : Standard
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5000
Auth Type : Not supported
Version : 3
Virtual IP : 10.1.1.111
Virtual MAC : 0000-5e00-0101
Master IP : 10.1.1.1
VRRP Track Information:
Track Object : 1 State : Positive Pri Reduced : 50
# 通過display vrrp verbose命令查看配置後的結果,顯示Device B上VRRP備份組1的詳細信息。
[DeviceB-Vlan-interface2] display vrrp verbose
IPv4 Virtual Router Information:
Running mode : Standard
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 0
Become Master : 401ms left
Auth Type : Not supported
Version : 3
Virtual IP : 10.1.1.111
Master IP : 10.1.1.1
以上顯示信息表示在VRRP備份組1中Device A為Master,Device B為Backup,Host A發送給Host B的報文通過Device A轉發。
# Device A出現故障後,在Host A上仍然可以ping通Host B。
# 通過display vrrp verbose命令查看Device B上VRRP備份組的詳細信息,Device A出現故障後,顯示Device B上VRRP備份組1的詳細信息。
[DeviceB-Vlan-interface2] display vrrp verbose
IPv4 Virtual Router Information:
Running Mode : Standard
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 0
Auth Type : Not supported
Version : 3
Virtual IP : 10.1.1.111
Master IP : 10.1.1.2
以上顯示信息表示Device A出現故障後,Device B成為Master,Host A發送給Host B的報文通過Device B轉發。
# Device A故障恢複後,顯示Device A上VRRP備份組1的詳細信息。
[DeviceA-Vlan-interface2] display vrrp verbose
IPv4 Virtual Router Information:
Running Mode : Standard
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5000
Auth Type : Not supported
Version : 3
Virtual IP : 10.1.1.111
Virtual MAC : 0000-5e00-0101
Master IP : 10.1.1.1
VRRP Track Information:
Track Object : 1 State : Positive Pri Reduced : 50
以上顯示信息表示Device A故障恢複後,Device A會搶占成為Master,Host A發送給Host B的報文仍然通過Device A轉發。
· Device A:
#
vlan 2
#
interface Vlan-interface2
ip address 10.1.1.1 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.111
vrrp vrid 1 priority 110
vrrp vrid 1 preempt-mode delay 5000
vrrp vrid 1 track 1 priority reduced 50
#
interface GigabitEthernet1/0/1
port link-mode bridge
port access vlan 2
#
track 1 interface Ten-GigabitEthernet1/0/2
#
· Device B的配置文件:
#
vlan 2
#
interface Vlan-interface2
ip address 10.1.1.2 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.111
vrrp vrid 1 priority 100
#
interface Ten-GigabitEthernet1/0/1
port link-mode bridge
port access vlan 2
#
· 產品配套“可靠性配置指導”中的“VRRP”。
· 產品配套“可靠性命令參考”中的“VRRP”。
不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!