您好,欢迎访问三七文档
VRRP实验实验目的:通过实验了解VRRP协议的操作机制,掌握VRRP协议的基本配置、多VRRP组的配置以及接口跟踪功能的使用。实验拓扑:@2005steve6307.Allrightsreserved.CCNP+多VRRP组实验(讲师演示)SiSiSiSiVRRPgroup1VRRPgroup2VRRPgroup1VRRPgroup2R3R3R4R4IP=172.16.1.3/24GW=172.16.1.100IP=172.16.1.3/24GW=172.16.1.100IP=172.16.1.4/24GW=172.16.1.200IP=172.16.1.4/24GW=172.16.1.200F0/0172.16.1.1/24F0/0172.16.1.1/24F0/0172.16.1.2/24F0/0172.16.1.2/24Virtualrouterofgroup1172.16.1.100/24Virtualrouterofgroup1172.16.1.100/24Virtualrouterofgroup2172.16.1.200/24Virtualrouterofgroup2172.16.1.200/24R1R1R2R2PriorityinGroup1:200Group2:100PriorityinGroup1:200Group2:100PriorityinGroup1:100Group2:200PriorityinGroup1:100Group2:200S0/0S0/0S0/0S0/010.1.1.1/3010.1.1.1/3010.1.1.2/3010.1.1.2/3010.1.1.5/3010.1.1.5/3010.1.1.6/3010.1.1.6/30s1s1s2s2R7R7Loopback0:192.168.1.1/24Loopback0:192.168.1.1/24xxPriorityingroup2-105Priorityingroup2-105实验步骤:1,按图示配置好各台路由器的各个接口,注意R3和R4的网关指向;2,分别在R1和R2上配置静态路由指向192.168.1.0/24,在R7上配置两条静态路由指向172.16.1.0/24,分别以R1和R2作为下一跳:R1(config)#iproute192.168.1.0255.255.255.010.1.1.2R2(config)#iproute192.168.1.0255.255.255.010.1.1.6R7(config)#iproute172.16.1.0255.255.255.010.1.1.1R7(config)#iproute172.16.1.0255.255.255.010.1.1.53,在R1和R2的Fa0/0口上配置VRRP协议,注意分别在组1和组2中的优先级(红色部分),并设置抢占位:R1(config)#interfacefastEthernet0/0R1(config-if)#vrrp1ip172.16.1.100R1(config-if)#vrrp1priority200R1(config-if)#vrrp1preemptR1(config-if)#vrrp2ip172.16.1.200R1(config-if)#vrrp2priority150R1(config-if)#vrrp2preemptR2(config)#interfacefastEthernet0/0R2(config-if)#vrrp1ip172.16.1.100R2(config-if)#vrrp1priority150R2(config-if)#vrrp1preemptR2(config-if)#vrrp2ip172.16.1.200R2(config-if)#vrrp2priority200R2(config-if)#vrrp2preempt4,此时从R3和R4已可ping通192.168.1.1,查看R1和R2的VRRP协议信息,可以看出R1是组1的Master、组2的Backup,而R2是组1的Backup、组2的Master,这当然是由优先级决定的(红色部分):R1#showvrrpbriefInterfaceGrpPriTimeOwnPreStateMasteraddrGroupaddrFa0/012003218YMaster172.16.1.1172.16.1.100Fa0/021503414YBackup172.16.1.2172.16.1.200R2#showvrrpbriefInterfaceGrpPriTimeOwnPreStateMasteraddrGroupaddrFa0/011503414YBackup172.16.1.1172.16.1.100Fa0/022003218YMaster172.16.1.2172.16.1.2005,在R4上使用扩展ping命令持续ping192.168.1.1,其间将R2的S0/0接口ShutDown,可以看出之后就ping不通了:R4#pingProtocol[ip]:TargetIPaddress:192.168.1.1Repeatcount[5]:100Datagramsize[100]:Timeoutinseconds[2]:Extendedcommands[n]:Sweeprangeofsizes[n]:Typeescapesequencetoabort.Sending100,100-byteICMPEchosto192.168.1.1,timeoutis2seconds:!!!!!!!!!!!!!!!!!!!!!!!!!!!!....U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U..USuccessrateis28percent(28/100),round-tripmin/avg/max=28/30/36ms6,这当然是因为R2仍然作为组2的Master,R4用它作为网关,但由于R2的S0/0口down掉所以ping不通192.168.1.1了,与HSRP协议同样的道理,我们必须在R2上配置接口跟踪功能,让它在S0/0口down掉时自动将自己的VRRP优先级降低55,从而让出组2中的Master地位,注意VRRP的接口跟踪配置与HSRP的稍有不同:R2(config)#track1interfaceserial0/0line-protocolR2(config-track)#exitR2(config)#interfacefastEthernet0/0R2(config-if)#vrrp2track1decrement557,再次重复步骤5,在R4持续ping192.168.1.1的同时将R2的S0/0接口ShutDown,看看这次的结果:R4#pingProtocol[ip]:TargetIPaddress:192.168.1.1Repeatcount[5]:100Datagramsize[100]:Timeoutinseconds[2]:Extendedcommands[n]:Sweeprangeofsizes[n]:Typeescapesequencetoabort.Sending100,100-byteICMPEchosto192.168.1.1,timeoutis2seconds:!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!U.U.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Successrateis96percent(96/100),round-tripmin/avg/max=28/30/52ms8,这次中途只丢了3、4个包就继续能够ping通了,这当然是由于在R2上配置了接口跟踪功能的结果,R2的S0/0口down掉之后它在组2中的VRRP优先级就降为了145,因此R1成为了组2中的Master(红色部分):R1#showvrrpbriefInterfaceGrpPriTimeOwnPreStateMasteraddrGroupaddrFa0/012003218YMaster172.16.1.1172.16.1.100Fa0/021503414YMaster172.16.1.1172.16.1.200R2#showvrrpbriefInterfaceGrpPriTimeOwnPreStateMasteraddrGroupaddrFa0/011503414YBackup172.16.1.1172.16.1.100Fa0/021453218YBackup172.16.1.1172.16.1.200最后提醒:实验完毕请不要忘记自觉重启路由器,多谢~
本文标题:VRRP实验
链接地址:https://www.777doc.com/doc-25383 .html