VRRP原理及配置

2022-09-09 10:39:18 字數 4333 閱讀 1125

vrrp能夠在不改變組網的情況下,將多台路由器虛擬成乙個虛擬路由器,通過配置虛擬路由器的ip位址為預設閘道器,實現閘道器的備份。

協議版本:vrrpv2 和vrrpv3

vrrpv2僅適用於ipv4網路,vrrpv3適用於ipv4和ipv6網路

開啟vrrp的裝置有三種狀態:

##sw3##

[sw3]vlan bat 10 20

info: this operation may take a few seconds. please wait for a moment...done.

[sw3]int e0/0/1

[sw3-ethernet0/0/1]p l a

[sw3-ethernet0/0/1]p d v 10

[sw3-ethernet0/0/1]un sh

info: inte***ce ethernet0/0/1 is not shutdown.

[sw3-ethernet0/0/1]int e0/0/2

[sw3-ethernet0/0/2]p l a

[sw3-ethernet0/0/2]p d v 20

[sw3-ethernet0/0/2]un sh

info: inte***ce ethernet0/0/2 is not shutdown.

[sw3-ethernet0/0/2]int g0/0/1

[sw3-gigabitethernet0/0/1]p l t

[sw3-gigabitethernet0/0/1]p t a v 10 20

[sw3-gigabitethernet0/0/1]un sh

info: inte***ce gigabitethernet0/0/1 is not shutdown.

[sw3-gigabitethernet0/0/1]int g0/0/2

[sw3-gigabitethernet0/0/2]p l t

[sw3-gigabitethernet0/0/2]p t a v 10 20

[sw3-gigabitethernet0/0/2]un sh

info: inte***ce gigabitethernet0/0/2 is not shutdown.

##sw1##

[sw1]vlan bat 10 20 100

info: this operation may take a few seconds. please wait for a moment...done.

[sw1]int g0/0/1

[sw1-gigabitethernet0/0/1]p l a

[sw1-gigabitethernet0/0/1]p d v 100

[sw1-gigabitethernet0/0/1]un sh

info: inte***ce gigabitethernet0/0/1 is not shutdown.

[sw1-gigabitethernet0/0/1]int g0/0/2

[sw1-gigabitethernet0/0/2]p l t

[sw1-gigabitethernet0/0/2]p t a v 10 20

[sw1-gigabitethernet0/0/2]un sh

info: inte***ce gigabitethernet0/0/2 is not shutdown.

[sw1-gigabitethernet0/0/2]int vlanif10

[sw1-vlanif10]ip add 192.168.10.10 24

[sw1-vlanif10]vrrp vrid 1 virtual

[sw1-vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1

[sw1-vlanif10]vrrp vrid 1 priority 120

[sw1-vlanif10]vrrp vrid 1 track inte***ce g0/0/1

[sw1-vlanif10]vrrp vrid 1 track inte***ce g0/0/2

[sw1-vlanif10]int vlanif20

[sw1-vlanif20]ip add 192.168.20.10 24

[sw1-vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1

[sw1-vlanif20]vrrp vrid 2 priority 115

[sw1-vlanif20]int vlanif 100

[sw1-vlanif100]ip add 11.0.0.2 30

[sw1-vlanif100]q

[sw1]ip route-static 0.0.0.0 0.0.0.0 11.0.0.1

##sw2##

[sw2]vlan bat 10 20 100

info: this operation may take a few seconds. please wait for a moment...done.

[sw2]int g0/0/1

[sw2-gigabitethernet0/0/1]p l a

[sw2-gigabitethernet0/0/1]p d v 100

[sw2-gigabitethernet0/0/1]un sh

info: inte***ce gigabitethernet0/0/1 is not shutdown.

[sw2-gigabitethernet0/0/1]int g0/0/2

[sw2-gigabitethernet0/0/2]p l t

[sw2-gigabitethernet0/0/2]p t a v 10 20

[sw2-gigabitethernet0/0/2]un sh

info: inte***ce gigabitethernet0/0/2 is not shutdown.

[sw2-gigabitethernet0/0/2]int vlanif 10

[sw2-vlanif10]ip add 192.168.10.20 24

[sw2-vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1

[sw2-vlanif10]vrrp vrid 1 priority 115

[sw2-vlanif10]int vlanif20

[sw2-vlanif20]ip add 192.168.20.20 24

[sw2-vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1

[sw2-vlanif20]vrrp vrid 2 priority 120

[sw2-vlanif20]vrrp vrid 2 track inte***ce g0/0/1

[sw2-vlanif20]vrrp vrid 2 track inte***ce g0/0/2

[sw2-vlanif20]int vlanif100

[sw2-vlanif100]ip add 12.0.0.2 30

[sw2-vlanif100]q

[sw2]ip route-static 0.0.0.0 0.0.0.0 12.0.0.1

##r1##

[r1]int g0/0/0

[r1-gigabitethernet0/0/0]ip add 11.0.0.1 30

[r1-gigabitethernet0/0/0]int g0/0/1

[r1-gigabitethernet0/0/1]ip add 12.0.0.1 30

[r1-gigabitethernet0/0/1]int loo 0

[r1-loopback0]ip add 1.1.1.1 24

[r1]ip route-static 192.168.10.0 24 11.0.0.2

[r1]ip route-static 192.168.10.0 24 12.0.0.2 pre 70

[r1]ip route-static 192.168.20.0 24 12.0.0.2

[r1]ip route-static 192.168.20.0 24 11.0.0.2 pre 70

VRRP配置及多備份VRRP配置例項

1 vrrp概念介紹 vrrp全稱是虛擬路由器冗餘協議 virtual router redundancy protocol 為了理解vrrp,首先需要確定下列術語 vrrp路由器 執行vrrp協議的路由器。該路由器可以是乙個或多個虛擬路由器。虛擬路由器 乙個由vrrp協議管理的抽象物件,作為乙個共...

VRRP筆記及相關配置

虛擬路由器備份協議 vrrp 描述了乙個動態選舉協議 作用 為了解決閘道器的手動切換 工作原理 將同網段的物理介面虛擬成乙個邏輯介面發往該邏輯介面的資料會 到主 master 物理口上,當主故障會 到備 backup 物理介面上,ip協議號是 112 特殊值的priority值 255 虛擬ip與物...

VRRP原理與實驗

vrrp工作時會在網路中加入乙個含有虛擬ip和虛擬mac位址的虛擬路由器,該路由器充當網路使用者的閘道器,使得網路上的主機與虛擬路由器通訊無需了解這個網路上物理路由器的任何資訊。master報文的傳送 當master正常工作時,它會每隔一段時間 預設為一秒 向組內backup裝置傳送vrrp通告報文...