思科閘道器冗餘協議配置

2021-10-10 10:41:07 字數 4631 閱讀 4294

虛擬路由冗餘協議(virtual router redundancy protocol,簡稱vrrp),是乙個ip協議族,我們知道ip協議族裡面有icmp、ospf,vrrp也是ip協議族的一員,協議號為112。在vrrp裡面,裝置有兩種角色master,backup),其中master負責跑業務流量,而backup負責備份,當master掛掉之後,backup自動搶占為master,然後所有的資料從master上走 。vrrp主要是用來做出口鏈路的冗餘備份的,可以有多個閘道器裝置加入乙個備份組,但是只能有乙個master裝置,當master裝置掛掉之後,其他的backup裝置自動搶占為master裝置,保障網路的可靠性。

要求:sw1為vlan10的主閘道器,vlan20的備份閘道器

sw2為vlan20的主閘道器,vlan10的備份閘道器

vlan10

sw1配置

inte***ce vlan10

ip address 10.10

.10.3

255.255

.255

.0 vrrp 1 ip 10.10

.10.1

vrrp 1 preempt delay minimum 5

vrrp 1 priority 120

vrrp 1 track 1 decrement 20

!sw2配置

inte***ce vlan10

ip address 10.10

.10.4

255.255

.255

.0 vrrp 1 ip 10.10

.10.1

vrrp 1 preempt delay minimum 5

vrrp 1 priority 150

!

vlan20

sw1配置

inte***ce vlan20

ip address 10.10

.20.3

255.255

.255

.0 vrrp 2 ip 10.10

.20.1

vrrp 2 preempt delay minimum 5

!sw2配置

track 2 inte***ce ethernet0/

2 line-protocol //追蹤上聯埠

inte***ce vlan20

ip address 10.10

.20.4

255.255

.255

.0 vrrp 2 ip 10.10

.20.1

vrrp 2 preempt delay minimum 5

vrrp 2 priority 120

vrrp 2 track 2 decrement 40

!

在sw1上檢視

switch#show vrrp

vlan10 - group 1

state is backup

virtual ip address is 10.10

.10.1

virtual mac address is 0000.5e00

.0101

advertisement interval is 1.000 sec

preemption enabled, delay min 5 secs

priority is 120

track object 1 state up decrement 20

master router is 10.10

.10.4

, priority is 150

master advertisement interval is 1.000 sec

master down interval is 3.531 sec (expires in 3.431 sec)

vlan20 - group 2

state is backup

virtual ip address is 10.10

.20.1

virtual mac address is 0000.5e00

.0102

advertisement interval is 1.000 sec

preemption enabled, delay min 5 secs

priority is 100

master router is 10.10

.20.4

, priority is 120

master advertisement interval is 1.000 sec

master down interval is 3.609 sec (expires in 2.994 sec)

在sw2上檢視

switch#show vrrp

vlan10 - group 1

state is master

virtual ip address is 10.10

.10.1

virtual mac address is 0000.5e00

.0101

advertisement interval is 1.000 sec

preemption enabled, delay min 5 secs

priority is 150

master router is 10.10

.10.4

(local)

, priority is 150

master advertisement interval is 1.000 sec

master down interval is 3.414 sec

vlan20 - group 2

state is master

virtual ip address is 10.10

.20.1

virtual mac address is 0000.5e00

.0102

advertisement interval is 1.000 sec

preemption enabled, delay min 5 secs

priority is 120

track object 2 state up decrement 40

master router is 10.10

.20.4

(local)

, priority is 120

master advertisement interval is 1.000 sec

master down interval is 3.531 sec

關閉sw2的上聯埠e0/2

sw1切換為vlan20的主閘道器

switch(config)

#int e 0/2

switch(config-if)

#shswitch(config-if)

#*nov 11 06:13:48.928: %track-6-state: 2 inte***ce et0/2 line-protocol up -> down

switch(config-if)

#*nov 11 06:13:50.933: %link-5-changed: inte***ce ethernet0/2, changed state to administratively down

*nov 11 06:13:51.935: %lineproto-5-updown: line protocol on inte***ce ethernet0/2, changed state to down

switch(config-if)

#*nov 11 06:13:54.461: %vrrp-6-statechange: vl20 grp 2 state master -> backup

sw2開啟上聯埠e0/2

sw2恢復為vlan20的主閘道器

switch(config-if)

#no sh

switch(config-if)

#*nov 11 06:14:05.361: %link-3-updown: inte***ce ethernet0/2, changed state to up

switch(config-if)

#*nov 11 06:14:06.699: %track-6-state: 2 inte***ce et0/2 line-protocol down -> up

switch(config-if)

#*nov 11 06:14:07.373: %lineproto-5-updown: line protocol on inte***ce ethernet0/2, changed state to up

switch(config-if)

#*nov 11 06:14:12.035: %vrrp-6-statechange: vl20 grp 2 state backup -> master

閘道器冗餘協議

hsrp 思科私有 vrrp 公有標準 經過前面內容的學習,我們已經完全掌握了乙個網段中的通訊過程,熟悉了交換機的工作原理,以及在2層裝置上如何區分不同的廣播域 vlan 並且不同的 vlan 之間的簡單通訊,也有所了解。不同vlan之間通訊,我們稱之為路由,得用到閘道器的概念。為了提高網路的穩定性...

VRRP閘道器冗餘

實驗要求 1 r1建立環迴口,模擬外網 2 r2,r3使用vrrp技術 3 路由器之間使用eigrp路由協議 實驗拓撲 實驗配置 r1 config inte ce loopback 0 r1 config if ip address 1.1.1.1 255.255.255.0 r1 config ...

思科RIP協議基礎配置

步驟一 如圖拓撲 驗證有路由條目及server1 ping通server0 步驟二 1 server1配置 ip 192.168.1.8 24 閘道器 192.168.1.252 2 三層裝置ms1配置 ms1 config int vlan 1 ms1 config if ip add 192.1...