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个组成员4个mac |
发送目标地址 |
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私有 |