网关冗余技术(HSRP、VRRP、GLBP)Sniffer
网关冗余技术是大型网络中不可缺少的技术,当网络足够大的时候,我们要
考虑的不光是网络本身的性能问题,冗余技术也是必不可少的。
通过这个实验详细说明 HSRP、VRRP、GLBP 的配置以及它们的区别,并最后用
sniffer 分析一下包结构。
网络拓朴:
实验任务:
分别用 HSRP、VRRP、glbp 实现网关冗余
Sniffer 分析三种协议包结构
环境描述:
3 台 Cisco3640 + NE-4E 模块,该配置拥有 4 个 Ethernet
1 台 Cisco3640+NE-16ESW
R3 Lo1、lo2、lo3、sniffer pc 用来测试
地址分配:
接口
E0/0
E0/1
E0/0
E0/1
E0/1
E0/2
F0/0
F0/1
F0/10
NIC
IP 地址
描述
192.168.1.1/24
192.168.1.1/24
192.168.1.2/24
192.168.3.2/24
192.168.2.1/24
192.168.3.1/24
-
-
-
TO SW-F0/0
TO R3-E0/1
TO SW-F0/1
TO R3-E0/2
TO R1-E0/1
TO R2-E0/1
TO R1-E0/0
TO R2-E0/0
TO Sniffer
192.168.20.20/24
TO SW-F0/10
设备名称
R1
R2
R3
SW
SNiffer
详细配置:
1、IP 地址设置
R1 (config) #int e0/0
R1 (config-if) #ip add 192.168.1.1 255.255.255.0
R1 (config-if) #no sh
R1 (config) #int e0/1
R1 (config-if) #ip add 192.168.2.2 255.255.255.0
R1 (config-if) #no sh
R2 (config) #int e0/0
R2 (config-if) #ip add 192.168.1.2 255.255.255.0
R2 (config-if) #no sh
R2 (config) #int e0/1
R2 (config-if) #ip add 192.168.3.2 255.255.255.0
R2 (config-if) #no sh
R3 (config) #int e0/1
R3 (config-if) #ip add 192.168.2.1 255.255.255.0
R3 (config-if) #no sh
R3 (config) #int e0/2
R3 (config-if) #ip add 192.168.3.1 255.255.255.0
R3 (config-if) #no sh
2、路由
R1 (config) #router ospf 1
R1 (config-router) #net 192.168.1.1 0.0.0.0 a 10
R1 (config-router) #net 192.168.2.2 0.0.0.0 a 0
R2 (config) #router ospf 1
R2 (config-router) #net 192.168.1.2 0.0.0.0 a 10
R2 (config-router) #net 192.168.3.2 0.0.0.0 a 0
R3 (config) #router ospf 1
R3 (config-router) #net 0.0.0.0 255.255.255.255 a 0
3、HSRP (Hot Standby Router Protocal)
R1(config-if)# int e0/0
R1(config-if)# standby 10 mac-address 0000.1111.2222
手动更改 virtual address,缺省为 0000.0c07.acXX
R1(config-if)# standby 10 desciption test
描述
R1(config-if)# standby 10 ip 192.168.1.254
加入备份组 10
R1(config-if)# standby 10 priority 200
设置优先级 200,缺省为 100
R1(config-if)# standby 10 preempt
设置占先权,缺点没有启用
R1(config-if)# standby 10 authentication md5 key-string zhaogang
设置认证,md5
R1(config-if)# standby 10 name zg
设置备份组名称
R1(config-if)# standby 10 track Ethernet0/1 100
设置占端口跟踪 e0/1
R2(config-if)# int e0/0
R2(config-if)# standby 10 mac-address 0000.1111.2222
R1(config-if)# standby 10 ip 192.168.1.254
R2(config-if)# standby 10 priority 200
R2(config-if)# standby 10 preempt
R2(config-if)# standby 10 authentication md5 key-string zhaogang
R2(config-if)# standby 10 name zg
R2(config-if)# standby 10 track Ethernet0/1 100
3、VRRP (Virtual Router Redundancy Protocol)
R1(config)# track 1 int e0/1 line-protocol
定义跟踪组 1,跟踪 int e0/1 状态
R1(config-if)# vrrp 1 description test
描述
R1(config-if)# vrrp 1 ip 192.168.1.254
加入备份组 1
R1(config-if)# vrrp 1 timers advertise 2
设置通告时间
R1(config-if)# vrrp 1 timers learn
设置向 master learn timer set
R1(config-if)# vrrp 1 priority 200
设置优先级 200
R1(config-if)# vrrp 1 authentication md5 key-string zhaogang
设置认证 md5 类型
R1(config-if)# vrrp 1 track 1 decrement 100
跟踪接口
R2(config)# track 1 int e0/1 line-protocol
R2(config-if)# vrrp 1 description test
R2(config-if)# vrrp 1 ip 192.168.1.254
R2(config-if)# vrrp 1 timers advertise 2
R2(config-if)# vrrp 1 timers learn
master learn timer set
R2(config-if)# vrrp 1 priority 150
R2(config-if)# vrrp 1 authentication md5 key-string zhaogang
R1(config-if)# vrrp 1 track 1 decrement 100
附相关截图:
4、GLBP( Gateway Load Balance Protocol)
R1(config-if)# glbp 1 ip 192.168.1.254
R1(config-if)# glbp 1 priority 200
R1(config-if)# glbp 1 preempt delay minimum 1
设置抢占的最小延迟 1S
R1(config-if)# glbp 1 weighting 200 lower 120 up 200
设置 GLBP 加权最大值 200,门槛值最小 120,最大 200
当 GLBP 组成员加权值小于最小门槛值时,放弃 AVF(活动转发器)角色
R1(config-if)# glbp 1 weighting track 1 decrement 100
R1(config-if)# glbp 1 forwarder preempt delay minimum 2
转发最小延迟 2S
R2(config-if)# glbp 1 ip 192.168.1.254
R2(config-if)# glbp 1 priority 150
R2(config-if)# glbp 1 preempt delay minimum 1
设置抢占的最小延迟 1S
R2(config-if)# glbp 1 weighting 200 120 up 200
设置 GLBP 加权最大值 200,门槛值最小 120,最大 200
当 GLBP 组成员加权值小于最小门槛值时,放弃 AVF(活动转发器)角色
R2(config-if)# glbp 1 weighting track 1 decrement 100
R2(config-if)# glbp 1 forwarder preempt delay minimum 2
转发最小延迟 2S
附相关截图:
Sniffer 分析:
HSRP 包结构
HSRP hello 包 组播 00105E000002 224.0.0.2
Virgin 状态
Speek 状态
Listen 状态
VRRP 包结构