HSRP,VRRP,GLBP完全配置

Lab1:HSRP的配置:
一:實驗拓撲:
 


二:實驗要求:
 Down掉R1和R3中的任何一臺路由器主機都能上網。
三:實驗配置:
1:基本接口的配置:(見圖)
2:路由的配置:

R1:

router rip

ver 2

net 192.168.1.0

net 12.0.0.0

no auto-summary

exit

R2:

router rip

ver 2

net 2.2.2.0

net 12.0.0.0

net 23.0.0.0

no auto-summary

exit

R3

router rip

ver 2

net 23.0.0.0

net 192.168.1.0

no auto-summary

exit

3:HSRP的配置:

 R1:
int f0/0
standby 10 ip 192.168.1.254
standby 10 priority 120
standby 10 preempt
standby track f1/0 50
exit

R3:
int f1/0
standby 10 ip 192.168.1.254
standby 10 preempt
exit

4:測試:

在R4模擬的PC1和R5模擬的PC2上將網關改爲192.168.1.254.

在PC上擴展1W次的ping,然後頻繁的down和up活躍路由器的接口,查看通信狀態。

R5#ping

Protocol [ip]: 

Target IP address: 2.2.2.2

Repeat count [5]: 10000

Datagram size [100]:

Timeout in seconds [2]:

Extended commands [n]:

Sweep range of sizes [n]:

Type escape sequence to abort.

Sending 10000, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!...

.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.

 5:相關調試命令:

R1#sho standby

FastEthernet0/0 - Group 10

  State is Active

    10 state changes, last state change 00:03:52

  Virtual IP address is 192.168.1.253

  Active virtual MAC address is 0000.0c07.ac0a

    Local virtual MAC address is 0000.0c07.ac0a (v1 default)

  Hello time 3 sec, hold time 10 sec

    Next hello sent in 1.768 secs

  Preemption enabled

  Active router is local

  Standby router is 192.168.1.2, priority 100 (expires in 9.940 sec)

  Priority 120 (configured 120)

    Track interface FastEthernet1/0 state Up decrement 50

  IP redundancy name is "hsrp-Fa0/0-10" (default)

R1#sho standby brief

                     P indicates configured to preempt.

                     |

Interface   Grp Prio P State    Active          Standby         Virtual IP    

Fa0/0       10  120  P Active   local           192.168.1.2     192.168.1.253
Lab2:VRRP的配置:
1:拓撲,基本接口,和路由的配置保持不變。將HSRP的配置刪掉,改爲VRRP.在R1 f0/0和R3 f1/0接口模式下no standby 10將HSRP的配置刪掉。

R1(config)#int f0/0

R2(config-if)#no standby 10 

R3(config)#int f1/0

R3(config-if)#no standby 10

改爲VRRP

R1(config)#track 100 interface f1/0 line-protocol

R1(config)#int f0/0

R1(config-if)#vrrp 10 ip 192.168.1.254

R1(config-if)#vrrp 10 priority 120

R1(config-if)#vrrp 10 preempt

R1(config-if)#vrrp 10 track 100 decrement 50

R3(config)#int f1/0

R3(config-if)#vrrp 10 ip 192.168.1.254

R3(config-if)#vrrp 10 preempt

2:測試VRRP(跟HSRP一樣測試)
3:調試VRRP.

R1#sho vrrp

FastEthernet0/0 - Group 10

  State is Master 

  Virtual IP address is 192.168.1.254

  Virtual MAC address is 0000.5e00.010a

  Advertisement interval is 1.000 sec

  Preemption enabled

  Priority is 120

    Track object 100 state Up decrement 50

  Master Router is 192.168.1.1 (local), priority is 120

  Master Advertisement interval is 1.000 sec

  Master Down interval is 3.531 sec

 

R1#sho vrrp brief

Interface          Grp Pri Time  Own Pre State   Master addr     Group addr

Fa0/0              10  120 3531       Y  Master  192.168.1.1     192.168.1.2


Lab3:GLBP的配置:
1:
拓撲,基本接口,和路由的配置保持不變。將VRRP的配置刪掉,改爲GLBP.

在R1 f0/0和R3 f1/0接口模式下no standby 10將HSRP的配置刪掉。

R1(config)#int f0/0

R1(config-if)#no vrrp 10

 

R3(config)#int f1/0

R3(config-if)#no vrrp 10

 

改爲GLBP

R1(config)#track 100 interface FastEthernet1/0 line-protocol

R1(config)#int f0/0

R1(config-if)#glbp 10 ip 192.168.1.252

R1(config-if)#glbp 10 priority 120

R1(config-if)#glbp 10 preempt

R1(config-if)#glbp 10 weighting track 100 decrement 50

 

R3(config)#int f1/0

R3(config-if)#glbp 10 ip 192.168.1.252

R3(config-if)#glbp 10 preempt


2:測試GLBP(跟HSRP一樣測試)
R4(config)#ip default-gateway 192.168.1.252
3:調試GLBP.

R1#sho glbp

FastEthernet0/0 - Group 10

  State is Active

    4 state changes, last state change 00:00:46

  Virtual IP address is 192.168.1.252

  Hello time 3 sec, hold time 10 sec

    Next hello sent in 1.816 secs

  Redirect time 600 sec, forwarder time-out 14400 sec

  Preemption enabled, min delay 0 sec

  Active is local

  Standby is 192.168.1.2, priority 100 (expires in 9.896 sec)

  Priority 120 (configured)

  Weighting 100 (default 100), thresholds: lower 1, upper 100

    Track object 100 state Up decrement 50

  Load balancing: round-robin

  Group members:

    cc00.0a50.0000 (192.168.1.1) local

    cc00.0dfc.0010 (192.168.1.2)

  There are 2 forwarders (1 active)

  Forwarder 1

    State is Active

      3 state changes, last state change 00:00:18

    MAC address is 0007.b400.0a01 (default)

    Owner ID is cc00.0a50.0000

    Redirection enabled

    Preemption enabled, min delay 30 sec

    Active is local, weighting 100

    Arp replies sent: 1

  Forwarder 2

    State is Listen

    MAC address is 0007.b400.0a02 (learnt)

    Owner ID is cc00.0dfc.0010

    Redirection enabled, 599.304 sec remaining (maximum 600 sec)

    Time to live: 14399.304 sec (maximum 14400 sec)

    Preemption enabled, min delay 30 sec

    Active is 192.168.1.2 (primary), weighting 100 (expires in 9.304 sec)

R1#sho glbp brief

Interface   Grp  Fwd Pri State    Address         Active router   Standby router

Fa0/0       10   -   120 Active   192.168.1.252   local           192.168.1.2

Fa0/0       10   1   -   Active   0007.b400.0a01  local           -

Fa0/0       10   2   -   Listen   0007.b400.0a02  192.168.1.2     -

 

:總結:HSRP,VRRP,GLBP都只能實現網關的冗餘,也就是說下一跳冗餘,沒有其它作用。目的相同,但實現原理稍有區別:

 

HSRP

VRRP

GLBP

工作原理

虛擬接口地址不能是物理接口地址

虛擬接口地址可以是物理接口地址

不能爲物理接口地址

虛擬mac

0000.0c07.acxx

1個組號

0000.5e00.01xx

1個組號

根據組成員數有多少個mac,最多4個組成員4mac

發送目標地址

UDP端口:1985

目標IP:224.0.0.2

IP協議號:112

目標IP:224.0.0.18

 

目標:224.0.0.102

計時器

Hello:3s

Holdtime:10s

Hello:1s

Holdtime:3s

Hello:3s

Holdtime:10s

路由器角色

Active,standby

其它listen

Master,backup-listen

AVG active,standby

AVG-所有路由器

搶佔功能

默認關閉

默認開啓

默認關閉

鏈路追蹤

可直接追蹤接口

只支持track object

只支持track object

負載均衡

可實現,但需多組

可實現,但需多組

1組就可實現,默認組中所有路由器負載均衡

負載均衡算法

 

 

輪詢,加權輪詢,基於主機的負載均衡

協議特性

Cisco私有

公有

Cisco私有



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