簡介
本文說明如何通過功能模板、配置組和CLI在Cisco IOS® XE Catalyst SD-WAN邊緣上配置服務端VRRP。
必要條件
需求
思科建議您瞭解以下主題:
- Cisco Catalyst軟體定義廣域網路(SD-WAN)
- 虛擬路由器備援通訊協定(VRRP)基本運作
- 管理員圖形使用者介面(GUI)
- 配置組
採用元件
- Cisco IOS® XE Catalyst SD-WAN邊緣17.9.4a
- Cisco Catalyst SD-WAN管理員20.12.4
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
背景資訊
虛擬路由器備援通訊協定(VRRP)是一種LAN端通訊協定,可為交換器及其他IP終端站提供備援閘道服務。在Cisco SD-WAN軟體中,您可以在虛擬專用網路(VPN)內的介面(通常在子介面)上配置VRRP。
只有服務端VPN支援VRRP(VPN 0和512不支援VRRP)。
設定
網路圖表
網路圖表
組態
這可以通過三種方式實現:
1 — 通過裝置功能模板:
在SD-WAN Manager中,導航到Configuration > Templates > Feature templates。
如果已為服務端介面建立功能模板,請搜尋模板名稱,然後按一下Edit。
如果沒有為服務端介面建立功能模板,請按一下Add template,搜尋裝置型號,然後選擇Cisco VPN Interface Ethernet。
按一下VRRP頁籤和新建VRRP。
VRRP頁籤
配置VRRP引數:
組ID:範圍1到255。
優先順序機制:範圍:1 - 254。路由器的優先順序級別。具有最高優先順序的路由器被選為主VRRP路由器。如果兩台路由器的優先順序相同,則具有較高IP地址的路由器被選為主VRRP路由器。
計時器(毫秒):範圍100到40950毫秒。指定主VRRP路由器傳送VRRP通告消息的頻率。如果從屬路由器丟失三個連續的VRRP通告,它們會選擇新的主VRRP路由器。建議使用1000ms作為預設值。
跟蹤OMP(可選)
跟蹤字首清單(可選)
IP 位址:虛擬IP地址必須與兩個路由器介面不同,但位於同一子網(本地和對等)中。
附註:當Cisco IOS® XE Catalyst SD-WAN裝置上的VRRP功能模板的計時器為100毫秒時,如果LAN介面上的流量高,則VRRP將失敗。建議設定預設計時器1000ms或更高。
VRRP配置示例主裝置
按一下「Add」,然後「Save」。
對VRRP對等體/備用體繼續相同處理(除VRRP優先順序外,所有值都必須匹配)。
VRRP配置示例備用裝置
將VPN介面乙太網功能模板新增到所需服務VPN下的裝置模板中,然後按一下儲存。
螢幕顯示將更改推送到裝置以完成此過程。
等效的CLI
主要:
interface GigabitEthernet0/0/1
<snipped>
vrf forwarding 10
ip address 192.168.23.2 255.255.255.0
no ip redirects
ip mtu 1496
vrrp 1 address-family ipv4
timers advertise 1000
priority 200
vrrpv2
address 192.168.23.1 primary
exit-vrrp
arp timeout 1200
end
待機:
interface GigabitEthernet0/0/1
<snipped>
vrf forwarding 10
ip address 192.168.23.3 255.255.255.0
no ip redirects
ip mtu 1496
vrrp 1 address-family ipv4
timers advertise 1000
priority 150
vrrpv2
address 192.168.23.1 primary
exit-vrrp
arp timeout 1200
end
2 — 通過配置組:
導覽至Configuration > Configuration Groups。
導航到現有配置組,然後選擇編輯。
導覽至服務設定檔區段,並尋找功能LAN介面。
服務配置檔案部分
按一下Edit Feature。
編輯功能部分
在新頁籤中,按一下VRRP部分,然後按一下Add VRRP IPv4。
VRRP部分配置組
配置VRRP引數:
組ID:範圍1到255。
優先順序機制:範圍:1 - 254。路由器的優先順序級別。具有最高優先順序的路由器被選為主VRRP路由器。如果兩台路由器的優先順序相同,則具有較高IP地址的路由器被選為主VRRP路由器。
計時器(毫秒):範圍100到40950毫秒。指定主VRRP路由器傳送VRRP通告消息的頻率。如果從屬路由器丟失三個連續的VRRP通告,它們會選擇新的主VRRP路由器。建議使用1000ms作為預設值。
跟蹤OMP(可選)
跟蹤字首清單(可選)
IP 位址:虛擬IP地址必須與兩個路由器介面不同,但位於同一子網(本地和對等)中。
附註:當Cisco IOS XE Catalyst SD-WAN裝置上VRRP功能模板的計時器為100毫秒時,如果LAN介面上的流量高,則VRRP將失敗。建議設定預設計時器1000ms或更高。
VRRP配置示例主要
然後,按一下Add按鈕。
驗證配置是否已新增,然後按一下Save。
儲存VRRP配置
然後,在主裝置中部署更改。
對VRRP對等體/備用體繼續相同處理(除VRRP優先順序外,所有值都必須匹配)。
VRRP配置示例待命
3 — 通過CLI:
CLI配置示例。
主要
Device# config-transaction
Device (config)# interface GigabitEthernet0/0/1
Device (config-if)# vrrp 1 address-family ipv4
Device (config-if-vrrp)# timers advertise 1000
Device (config-if-vrrp)# priority 200
Device (config-if-vrrp)# vrrpv2
Device (config-if-vrrp)# address 192.168.23.1 primary
Device (config-if-vrrp)# commit
待機:
Device# config-transaction
Device (config)# interface GigabitEthernet0/0/1
Device (config-if)# vrrp 1 address-family ipv4
Device (config-if-vrrp)# timers advertise 1000
Device (config-if-vrrp)# priority 150
Device (config-if-vrrp)# vrrpv2
Device (config-if-vrrp)# address 192.168.23.1 primary
Device (config-if-vrrp)# commit
驗證
Device# show vrrp all
Vlan10 - Group 1 - Address-Family IPv4
State is MASTER
State duration 2 hours 0 mins 49 secs
Virtual IP address is 192.168.23.1
Virtual MAC address is 0000.5E00.0164
Advertisement interval is 1000 msec
Preemption enabled
Priority is 200
Master Router is 192.168.23.2 (local), priority is 200
Master Advertisement interval is 1000 msec (expires in 256 msec)
Master Down interval is unknown
FLAGS: 1/1
Device# show vrrp detail
Vlan10 - Group 1 - Address-Family IPv4
State is MASTER
State duration 2 hours 0 mins 55 secs
Virtual IP address is 192.168.23.1
Virtual MAC address is 0000.5E00.0164
Advertisement interval is 1000 msec
Preemption enabled
Priority is 200
Master Router is 192.168.23.2 (local), priority is 200
Master Advertisement interval is 1000 msec (expires in 717 msec)
Master Down interval is unknown
FLAGS: 1/1
VRRPv3 Advertisements: sent 27392 (errors 0) - rcvd 1220
VRRPv2 Advertisements: sent 27392 (errors 0) - rcvd 4
Group Discarded Packets: 0
VRRPv2 incompatibility: 0
IP Address Owner conflicts: 0
Invalid address count: 0
IP address configuration mismatch : 0
Invalid Advert Interval: 0
Adverts received in Init state: 0
Invalid group other reason: 0
Group State transition:
Init to master: 1 (Last change Mon Nov 27 11:04:00.406)
Init to backup: 3 (Last change Mon Nov 27 15:29:29.265)
Backup to master: 5 (Last change Mon Nov 27 15:29:32.914)
Master to backup: 3 (Last change Mon Nov 27 10:38:15.722)
Master to init: 2 (Last change Mon Nov 27 15:25:12.248)
Backup to init: 1 (Last change Mon Nov 27 10:35:32.215)
Device# show vrrp internal
GroupId:100 AF:IPv4 Interface:Vlan10
ref_cnt:3 flags:0 vrrs_hdl:1
mac_programmed:1 vrrp_mcast_join_v4:1
if_ctx_:0x7F43DE017178
if_oper_state:1
system_ctx_:0x7F43DE029FA0
primary address: 192.168.23.1
operational:1 is_active:1 match_addr:1 compatv2:1
shutdown:0 cfg_shutdown:0 priority:200 cfg_priority:200
state_ctx_:0x7F43DE02A040
hybernation:0 preempt:enabled state_time:2 hours 0 mins 59 secs
preempt_delay:0 secs master_priority:0
ready_to_preempt:90 master_reason:0
timer_ctx_:0x7F43DE02A0B8
master_down_timer:0 msec use_learned_timer:0
master_adv_interval:1000 cfg_adv_interval:1000 master_down_interval:0
comms_ctx_:0x7F43DE02A0F8
v2rtr_valid:1 listen:1
track_ctx_:0x7F43DE02A178
track_count:0 decrement:0 force_shutdown:0
Device# show vrrp statistics
VRRP Global Statistics:
Dropped Packets : 0
VRRP Statistics for Vlan10
Header Discarded Packets: 0
Invalid TTL/Hop Limit: 0
Invalid Checksum: 0
Invalid Version: 0
Invalid Msg Type: 0
Invalid length/Incomplete packet: 0
Invalid group no: 0
Invalid packet other reason: 0
VRRP Statistics for Vlan10 - Group 1 - Address-Family IPv4
State is MASTER
State duration 2 hours 1 mins 3 secs
VRRPv3 Advertisements: sent 27401 (errors 0) - rcvd 1220
VRRPv2 Advertisements: sent 27401 (errors 0) - rcvd 4
Group Discarded Packets: 0
VRRPv2 incompatibility: 0
IP Address Owner conflicts: 0
Invalid address count: 0
IP address configuration mismatch : 0
Invalid Advert Interval: 0
Adverts received in Init state: 0
Invalid group other reason: 0
Group State transition:
Init to master: 1 (Last change Mon Nov 27 11:04:00.406)
Init to backup: 3 (Last change Mon Nov 27 15:29:29.265)
Backup to master: 5 (Last change Mon Nov 27 15:29:32.914)
Master to backup: 3 (Last change Mon Nov 27 10:38:15.722)
Master to init: 2 (Last change Mon Nov 27 15:25:12.248)
Backup to init: 1 (Last change Mon Nov 27 10:35:32.215)
有用的調試:
debug vrrp all detail
debug vrrp error
debug vrrp packet
debug vrrp process
debug vrrp state