HSRP與VRRP雙主雙備,均衡負載

HSRPVRRP雙主雙備均衡負載

HSRP配置命令

m1(config-if)#standby 1 ip 192.168.10.200    配置虛擬網關

m1(config-if)#standby 1 priority 120         配置優先級,默認爲100

m1(config-if)#standby 1 preempt            配置搶佔權

m1(config-if)#standby 1 timers 3 10          配置hello時間

m1(config-if)#standby 1 track fastEthernet 0/1   配置端口跟蹤

m1#show standby           查看HSRP信息

m1#show standby brief       查看HSRP摘要信息

VRRP配置命令

m1(config-if)#vrrp 1 ip 192.168.10.200  配置虛擬網關

m1(config-if)#vrrp 1 priority 120       配置優先級,默認爲100

m1(config-if)#vrrp 1 preempt          配置搶佔權

m1(config)#track 3 interface fastEthernet 1/0 line-protocol    配置端口跟蹤索引

m1(config-if)#vrrp 1 track 3   配置端口跟蹤

m1#show vrrp           查看vrrp信息

m1#show vrrp brief       查看vrrp摘要信息

例:

HRRPVRRP綜合實驗

實驗要求:

1.c1c2c3c4、分別屬於vlan10vlan20vlan30vlan40

2.vlan10vlan30流量默認從sw1通過,vlan20vlan40流量默認從sw2經過,當鏈路出故障,實現流量倒換

3.vlan10valn20vlan30配置HSRP思科私有協議,vlan40配置VRRP標準協議

wKiom1MIg3awsuohAAI7eXTBZ10940.jpg

 

Sw1配置

!

interface FastEthernet1/1

 switchport access vlan 10

!

interface FastEthernet1/2

 switchport access vlan 20

!

interface FastEthernet1/5

 switchport mode trunk

!

interface FastEthernet1/15

 switchport mode trunk

!

Sw2配置

!

interface FastEthernet1/3

 switchport access vlan 30

!

interface FastEthernet1/4

 switchport access vlan 40

!

interface FastEthernet1/6

 switchport mode trunk

!

interface FastEthernet1/15

 switchport mode trunk

!

M1配置

!

interface FastEthernet1/0

 no switchport

 ip address 202.106.1.1 255.255.255.252

!

interface FastEthernet1/5

 switchport mode trunk

!

!

interface Vlan10

 ip address 192.168.10.1 255.255.255.0

 standby 10 ip 192.168.10.200

 standby 10 priority 120

 standby 10 preempt

 standby 10 track FastEthernet1/0

 standby 10 track FastEthernet1/5

!

interface Vlan20

 ip address 192.168.20.100 255.255.255.0

 standby 2 ip 192.168.20.200

 standby 2 priority 115

 standby 2 preempt

!

interface Vlan30

 ip address 192.168.30.1 255.255.255.0

 standby 3 ip 192.168.30.200

 standby 3 priority 120

 standby 3 preempt

 standby 3 track FastEthernet1/0

 standby 3 track FastEthernet1/5

!

interface Vlan40

 ip address 192.168.4.100 255.255.255.0

 vrrp 4 ip 192.168.40.200

!

ip route 0.0.0.0 0.0.0.0 202.106.1.2

!

 

M2配置

!

track 3 interface FastEthernet1/0 line-protocol

!

track 4 interface FastEthernet1/6 line-protocol

!

interface FastEthernet1/0

 no switchport

 ip address 202.106.1.6 255.255.255.0

!

interface FastEthernet1/6

 switchport mode trunk

!

interface Vlan10

 ip address 192.168.10.100 255.255.255.0

 standby 10 ip 192.168.10.200

 standby 10 priority 115

 standby 10 preempt

!

interface Vlan20

 ip address 192.168.20.1 255.255.255.0

 standby 2 ip 192.168.20.200

 standby 2 priority 120

 standby 2 preempt

 standby 2 track FastEthernet1/0

 standby 2 track FastEthernet1/6

!

interface Vlan30

 ip address 192.168.30.100 255.255.255.0

 standby 3 ip 192.168.30.200

 standby 3 priority 115

 standby 3 preempt

!

interface Vlan40

 ip address 192.168.40.1 255.255.255.0

 vrrp 4 ip 192.168.40.200

 vrrp 4 priority 120

 vrrp 4 track 3

 vrrp 4 track 4

!

ip route 0.0.0.0 0.0.0.0 202.106.1.5

!

R1配置

!

interface Loopback0

 ip address 1.1.1.1 255.255.255.255

!

interface FastEthernet0/0

 ip address 202.106.1.2 255.255.255.252

!

!

interface FastEthernet0/1

 ip address 202.106.1.5 255.255.255.252

!

ip route 192.168.10.0 255.255.255.0 202.106.1.1

ip route 192.168.10.0 255.255.255.0 202.106.1.6 2

ip route 192.168.20.0 255.255.255.0 202.106.1.1

ip route 192.168.30.0 255.255.255.0 202.106.1.6

ip route 192.168.40.0 255.255.255.0 202.106.1.6

!

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章