关于HSRP的介绍(英文的)
冗余
2)HSRP(Hot Standby Routing Protocol)(私有协议)(在三层交换机与路由器上可以做)·HSRP是一种网关冗余协议,它通过在冗余网关之间共享协议和MAC,提供不间断的IP路径冗余。
·HSRP在2个或多个路由器间创建虚拟MAC和虚拟IP,其实就是将多台物理的路由器组合成一台虚拟路由器。
主机的网关设为此虚拟IP就可以了。
·HSRP的hello包包含priority(默认100),hello间隔(默认3S),holdtime(默认10S),虚拟网关IP·HSRP的hello包发向组播地址224.0.0.2(所有路由器)·HSRP路由器的默认优先级是100,优先级相同的情况下比较IP地址,越大越优。
·一个HSRP组可以包含多台路由器,在一个稳定的组里面只有两台路由器发送hello 包,一台是active路由器,一台是备份路由器,其它路由器不发送hello包,但都处于监听状态。
·HSRP可以配置多个组,配多个组的目地是为了做负载分担·虚拟MAC地址:前40位固定(0000.0c),将HSRP的组标识符换成十六进制,接到最后就可以了例如:HSRP组为47,换成十六进制是2fMAC地址前40位为0000.0c07.ac最后得到:0000.0c07.ac2f·HSRP状态:1、Initial All routers begin in the initial state, when HSRP is not running (初始状态,如果手动配置虚拟IP,直接跳到Listen状态)2、learn (没有收到hello包,没有虚拟ip地址,等待收到hello包)3、listen(收到hello包,有了虚拟ip地址,除了active和standby,其它路由器都是这个状态)4、speak (周期发送hello包,开始选active和standby router)5、Standby (没选到active的,除了active外优先级最高的router,会继续发hello包,只有一个)6、active (选到的转发的router,会继续发hello包,只有一个)例:R1、R2、R3运行路由协议,宣告所有接口。
hsrp作用(一)
hsrp作用(一)HSRP作用什么是HSRP?HSRP,全称为Hot Standby Router Protocol,是一种用于提供冗余路由器的协议。
它可以在一个局域网内创建一个逻辑上的虚拟路由器,包含一个主路由器和一个或多个备用路由器。
HSRP的作用•提高网络可靠性:通过使用多个备用路由器,HSRP可以确保即使主路由器发生故障,网络仍然保持可用。
备用路由器会立即接管主路由器的功能,保证网络的连通性。
•实现无缝切换:当主路由器失效时,备用路由器会自动接管主路由器的MAC地址和IP地址,确保网络连接的无缝切换,使用户感知不到任何网络中断。
•负载均衡:HSRP允许多个备用路由器平衡处理网络流量,提高网络的处理能力和吞吐量。
当主路由器负载过高时,备用路由器可以分担部分流量压力,确保网络的正常运行。
•简化管理:HSRP允许配置一个虚拟路由器,用户只需关注虚拟路由器的IP地址,无需关心具体的物理路由器。
这样大大简化了路由器的管理工作,提高了网络管理的效率。
如何配置HSRP?要配置HSRP,需要进行以下步骤:1.在网络设备上启用HSRP功能。
2.配置虚拟路由器的参数,包括虚拟路由器的IP地址、优先级、预共享密钥等。
3.配置主备路由器的参数,包括路由器的IP地址、优先级、HSRP组等。
4.验证HSRP配置是否生效,可以使用show命令查看虚拟路由器和路由器的状态信息。
HSRP的工作原理HSRP使用了一组协议来实现主备路由器的冗余功能。
主要的协议包括:•Hello协议:主备路由器通过Hello协议进行通信,用于检测对方的活动状态。
•状态机:主备路由器根据不同的状态进行切换,包括初始化状态、学习状态、监听状态和活动状态等。
•虚拟MAC地址:虚拟路由器使用一个虚拟的MAC地址,主备路由器通过切换虚拟MAC地址来实现网络的无缝切换。
•选举机制:主备路由器通过选举机制确定主路由器,选举依据包括优先级、IP地址等。
结论HSRP是一种用于提供冗余路由器的协议,可以提高网络的可靠性、实现无缝切换、负载均衡以及简化路由器的管理工作。
hsrp工作原理
hsrp工作原理HSRP(Hot Standby Router Protocol)是一种冗余路由器协议,用于提供网络设备的冗余和可靠性。
它的工作原理如下:1. HSRP定义了一个虚拟IP地址(Virtual IP Address),所有的冗余路由器共享该虚拟IP地址。
虚拟IP地址是网络中的一个互不连接的地址,用作默认网关。
客户端设备将其配置为默认网关,所有数据包都将通过虚拟IP地址转发。
2. 所有的冗余路由器形成一个组,其中一个被选为活动(Active)路由器,其余的为备份(Standby)路由器。
活动路由器负责转发所有从网络中发出的数据包,而备份路由器处于待命状态。
3. 活动路由器通过向组播地址发送Hello消息来维持与备份路由器之间的通信。
备份路由器检测到活动路由器故障后,将接收到的Hello消息中的优先级和预先配置的优先级进行比较。
如果备份路由器的优先级高于或等于活动路由器,则备份路由器将接管虚拟IP地址并成为活动路由器。
4. 如果备份路由器成为活动路由器,它将通过发送Gratuitous ARP消息来更新网络中的所有设备的ARP缓存。
这样,网络中的所有客户端设备将更新其ARP缓存并将数据包发送到新的活动路由器。
5. 一旦活动路由器恢复正常,它将发送Hello消息来通知备份路由器。
备份路由器收到Hello消息后,将放弃虚拟IP地址,并恢复到待命状态,等待下一次故障发生。
总结起来,HSRP基于虚拟IP地址和组播通信的方式实现冗余路由器的工作。
它通过监测活动路由器的状态,并在故障发生时自动切换到备份路由器,确保网络的连通性和可靠性。
HSRP的配置
热备份路由协议是HSRP(Hot standby router protocol)是cisco平台所特有的一种技术,它确保了当网络边缘设备或接入链路出现故障时,用户通信迅速并透明地恢复,并以此为IP网络提供冗余性,通过应用HSRP,可使网络的正常运行时间接近100%,从而满足用户对网络可靠性的要求。
热备份路由协议为IP我网络提供了容错和增强的路由选择功能。
通过使用同一个虚拟IP地址和虚拟MAC 地址,LAN网络上的两台或多台路由器可以作为一台“虚拟”路由器而对外提供服务。
HSRP使组内cisco 路由器能互相监视对方的运行状态:(1) 虚拟路由器组的成员通过HSRP消息不断地交换状态信息。
(2) 如果其中一台出现故障,另一台就能接替它,继续完成路由功能。
LAN 网段上的主机都配置只用同一个虚拟路由器作为默认网关,并不断将IP包发往同一个IP和MAC地址。
因此,理由设备的切换对主机就是透明的。
绝大多数主机路由表相对简单,并且以默认网关作为唯一的吓一跳IP和MAC地址。
HSRP向主机提供了默认网关的冗余性,减少了主机维护路由表的任务。
另外通过多个热备份组,路由器可以提供冗余备份,并在不同的IP子网实现负载分担。
具体配置:RA:Router>enableRouter#config tRouter(config)#hostname RARA(config)#no ip domain-lookupRA(config)#line con 0RA(config-line)#no exec-tRA(config-line)#exitRA(config)#interface e0/2RA(config-if)#ip address 10.10.10.1 255.255.255.0RA(config-if)#no shRA(config-if)#du fuRA(config-if)#standby 10 ip 10.10.10.254RA(config-if)#standby 10 priority 110RA(config-if)#standby 10 preemptRA(config-if)#exitRA(config)#interface e0/1RA(config-if)#ip address 172.16.10.1 255.255.255.0 RA(config-if)#no shRA(config-if)#du fuRA(config-if)#standby 172 ip 172.16.10.254RA(config-if)#standby 172 priority 120RA(config-if)#standby 172 preemptRA(config-if)#no shRA(config-if)#endRA#RB:Router>enableRouter#config terRouter(config)#hostname RBRB(config)#no ip domain-lookupRB(config)#line con 0RB(config-line)#no exec-tRB(config-line)#exitRB(config)#interface e0/2RB(config-if)#ip address 10.10.10.2 255.255.255.0 RB(config-if)#no shRB(config-if)#du fuRB(config-if)#standby 10 track ethernet 0/1 100RB(config-if)#standby 10 ip 10.10.10.254RB(config-if)#standby 10 priority 120RB(config-if)#standby 10 preemptRB(config-if)#no shRB(config-if)#exitRB(config)#interface e0/1RB(config-if)#ip address 172.16.10.2 255.255.255.0 RB(config-if)#no shRB(config-if)#du fuRB(config-if)#standby 172 ip 172.16.10.254RB(config-if)#standby 172 priority 110RB(config-if)#standby 172 preempt。
hsrp作用
HSRP(Hot Standby Router Protocol)是一种网络协议,用于提供高可用性和冗余性的路由器解决方案。
它的作用包括以下几个方面:
故障恢复:HSRP允许多个路由器组成一个冗余组,其中一个路由器被选为活动路由器,而其他路由器则处于备份状态。
如果活动路由器发生故障或失效,备份路由器可以迅速接管其功能,实现无缝切换,从而实现快速的故障恢复。
高可用性:通过HSRP,网络可以具备高可用性,即使某个路由器发生故障,网络仍然可以保持正常运行。
活动路由器和备份路由器之间进行状态监测和通信,确保备份路由器可以随时接管活动路由器的任务,保证网络的连通性和可达性。
负载均衡:HSRP还可以用于实现负载均衡,将流量在多个路由器之间分配。
通过配置合适的优先级和权重,可以根据网络流量的负载情况动态地调整活动路由器的角色,实现流量的均衡分担,提高网络的整体性能和吞吐量。
网络拓扑优化:HSRP可以根据网络拓扑和需求,灵活配置路由器之间的优先级、权重和预选项等参数,以实现更优化的网络拓扑结构。
通过选择合适的备份路由器和路由器间的通信方式,可以提高网络的可用性、稳定性和性能。
需要注意的是,HSRP是一种网络协议,通常用于企业级网络或大规模网络中,以提供高可用性和故障恢复功能。
具体的配置和使用方式会根据网络设备和厂商的不同而有所差异。
在实际应用中,建议参考相关设备的文档和厂商的建议,以正确配置和使用HSRP。
《局域网交换技术》项目4-3 HSRP技术
4 switch(config-if)#standby group-
指定可以抢占
number preempt
switch(config-if)#standby 1 preempt
5* switch(config-if)#standby group可选 number times hello-interval holdtime
SW_master (config-if)# standby 2 preempt
13
任务三 掌握HSRP配置方法
以下是SW_backup上的配置,注意是在vlan 20上设置为 优先:
SW_backup (config)# int vlan 10 SW_backup (config-if)# ip add 192.168.1.253 255.255.255.0 SW_backup (config-if)# standby 1 ip 192.168.1.252 SW_backup (config-if)# standby 1 preempt SW_backup (config-if)#exit SW_backup (config)# int vlan 20 SW_backup (config-if)# ip add 192.168.2.253 255.255.255.0 SW_backup (config-if)# standby 2 ip 192.168.2.252 SW_backup (config-if)# standby 2 priority 150 SW_backup (config-if)# standby 2 preempt
SW_master (config-if)# standby 1 priority 150
//配置HSRP组1优先级
Cisco 数据中心之 HSRP, vPC 以及 vPC Peer-Gateway 介绍
How HSRP WorksHot Standby Routing Protocol is a well-known feature of Cisco IOS. The goal of HSRP is to provide a resilient default-gateway to hosts on a LAN. This is accomplished by configuring two or more routers to share the same IP address and MAC address. Hosts on the LAN are configured with a single default-gateway (either statically or via DHCP ).Upon sending its first packet to another subnet, the host ARP s for the MAC address of the default gateway. It receives an ARP reply with the virtual MAC of the HSRP group. The IP packet is encapsulated in an Ethernet frame with a destination MAC address of the default gateway. If the primary router fails, HSRP keepalives are lost, and the standby HSRP router takes over the virtual IP address and MAC address. The host does not need to know that anything has changed.In the diagram above, the user (10.1.1.100) is configured with a default-gateway of 10.1.1.1. When the user sends its first packet to 10.5.5.5, it ARPs for 10.1.1.1. In my example, Router A is the HSRP primary router, so it sends an ARP reply with the virtual MAC address of 0000.0c07.AC05. The User PC then encapsulates the IP packet(destination IP=10.5.5.5) in an Ethernet frame with a destination MAC address of 0000.0c07.AC05. Router A accepts the frame and routes the packet.The above paragraphs tell the story of packets coming from theHSRP-enabled LAN. But what happens to reply packets coming from10.5.5.5 to 10.1.1.100? The answer is simple, and intuitive if you follow step-by-step. First, the Server creates an IP packet with a destination of 10.1.1.100. It encapsulates it in an Ethernet frame and forwards it to its default gateway (for this example, let’s say it is Router A). Router A strips the Ethernet framing and determines the next hop is on the local subnet 10.1.1.0/24. It encapsulates the packet in an Ethernet frame with a MAC address of 0021.6a98.1952. The source MAC address is the physical MAC address of Router A(0024.F71E.3343). Router A does not use the virtual MAC address for packets it routes onto the local subnet.So What is vPC ?Now that we’ve covered HSRP, let’s talk about Virtual P ort Channeling ( vPC ). vPC allows two NX-OS devices to share aport-channel. Attached devices believe that they are connected to a single device via an etherchannel bundle. This is great because it eliminates spanning-tree blocking along parallel paths.To allow this to work, the paired NX-OS devices use two vpc-specific communication channels. The first is a vpc peer-keepalivemessage. This heartbeat lets one switch detect when the other has gone off-line, to prevent traffic from being dropped during a failure. These are lightweight hello packets.The second communication channel is the vpc peer-link . This is a high-speed connection between the two NX-OS switches that is used to stitch together the two sides of the port-channel. If a frame arrives on switch A, but is destined for a host on switch B, it is forwarded across the peer-link for delivery. All things being equal, it is undesirable to forward frames across a vpc peer-link. It is much better for the frame to be sent to the correct switch in the first place. Of course, there’s no way for the attached device to know which path is more appropriate.In the above example, the User PC is sending an Ethernet frame to the Server. It creates a frame with a destination MAC address of0033.9328.12A1 and sends it to the L2 Switch. The L2 switch has an entry in his forwarding table indicating that the destination MAC is accessible via the Port-Channel 100 interface. It uses its etherchannel load balancing hash algorithm to determine which physical interface to forward the frame onto. It is equally likely that it will choose the link to Nexus B, even though the more efficient path is to Nexus A (someday TRILL will help us, but for now there is no solution). If the frame is sent to Nexus B, it will forward the frame over the vPC peer-link to Nexus A.Cisco’s current recommendation is to build the vPC peer-link with multiple dedicated 10GE connections for performance reasons. Cisco also recommends that all devices in a vPC-enabled VLAN be connected to both Nexus switches. In the diagram above, the Server is considered tobe a vpc orphan port. This is undesirable, since it requires usage of the vpc peer-link. It also has implications with multicast traffic forwarding.vPC and HSRP TogetherNow we’ve arrived at the point where we can pull all this information together. In the following diagram, the User PC has been moved to a new VLAN. The user is again trying to communicate with the server.The User PC ARPs for his default gateway. Nexus A (the HSRP primary) replies with the virtual MAC address of 000.0C07.AC05. The user createsan Ethernet frame with a destination address of the virtual MAC. It then forwards the frame to the L2 Switch. The L2 Switch uses its etherchannel load balancing algorithm to determine the physical link to use. The difference is now that it doesn’t matter which link it uses. The NX-OS switch on the other end will accept and route the packet. In effect, both Nexus switches are HSRP active at the same time. This is eliminates the need to forward Ethernet frames across the vPC peer-link for packets that are destined for other subnets.What Does “vpc peer-gateway” Do?If we left everything alone, the story would be complete. Unfortunately, storage vendors thought it would be a good idea to optimize their handling of Ethernet frames. Some NetApp and EMC equipment ignores the ARP reply given by the HSRP primary and instead forwards Ethernet frames to whichever MAC address it receives frames from. This is nonstandard behavior.Using the diagram above, let‘s assume say that the User PC is now a EMC Celera storage device. The Server sends its packets (IP destination 10.1.1.100) to Nexus B, which routes them to the Ethernet LAN. All IP packets with source IP 10.5.5.5 will be encapsulated in Ethernet frames with a source MAC address of 0022.5579.F643. The EMC Celera will cache the source MAC address of these frames, and when it has IP packets to send to 10.5.5.5, it will encapsulate them in Ethernet frames with a destination MAC of 0022.5579.F643. It is choosing to ignore its default gateway for these outbound packets.I suppose the theory behind this feature was to eliminate the extra hop within the LAN. When HSRP is enabled, it is necessary to disable ICMP redirects. This means that the routers will not inform hosts on the LAN that a better default-gateway is available for a particular destination IP address. This storage feature saves a LAN hop.Unfortunately, this optimization does not work well with vPC. vPC relies on virtual MAC address sharing to reduce utilization across the vPC peer-link. If hosts insist on addressing their frames to a specific router, suboptimal packet forwarding can occur. According to Cisco , “Packets reaching a vPC device for the non-local router MAC address are sent across the peer-link and could be dropped by the built in vPC loop avoidance mechanism if the final destination is behind another vPC.” At the application level we saw very poor performance due to these dropped packets. Enough of the packets got through to allow accessto the storage device, but file load times were measured in the tens of seconds, rather than milliseconds.The “vpc peer-gateway” allows HSRP routers to accept frames destined for their vPC peers. This feature extends the virtual MAC address functionality to the paired router’s MAC address. By enabling this feature, NX-OS effectively disables the storage vendors’ optimization.ConclusionIf you are running vPC and HSRP, and you have EMC or NetApp storage equipment, you probably need to add the “peer-gatew ay” command under your vpc configuration. The only caveat to peer-gateway is the following (from NX-OS 5.0 – Configuring vPC ):Packets arriving at the peer-gateway vPC device will have their TTL decremented, so packets carrying TTL = 1 may be dropped in transit due to TTL expire. This needs to be taken into account when the peer-gateway feature is enabled and particular network protocols sourcing packets with TTL = 1 operate on a vPC VLAN.I have yet to face this issue, so my recommendation is to add this to your vpc configuration as a default.。
Cisco思科常用英文缩写及英语单词大全(中英文)
A10BaseT 10M bit/s基带以太网规范,采用两对双绞线(类型3、4或5):一对线用于传输数据,另一对线用于接收数据。
作为IEEE 802.3规范的一部分的10BaesT,其每段的距离限制大约为328英尺(100m)。
802.x 定义局域网协议的一套IEEE标准。
AAA 验证、授权和统计。
此网络安全服务提供了一个主要框架,通过它可以控制对路由器和接入服务器的访问。
两种主要的AAA是TACACS+和RADIUS。
ABR 区域边界路由器。
位于一个或多个OSPF区域边界上、将这些区域连接到主干网络的路由器。
ABR被认为同时是OSPF主干和相连区域的成员。
因此,它们同时维护着描述主干拓扑和其他区域拓扑的路由选择表。
访问层(access layer)在体系化网络中为工作组/用户提供到网络的访问的分层。
访问列表(access list)路由器和交换机所保持的列表用来针对一些进出路由器或交换机的服务(如组织某个IP地址的分组从路由器或交换机的特定端口出发)做访问控制。
访问方法(access methed)一般来说是指网络设备访问网络介质的方法。
访问服务器(access server)将异步设备通过网络和终端仿真软件连接到局域网或广域网上的通信处理器。
能对所支持的协议进行同步和异步路由。
有时也被称为网络访问服务器(NAS)统计(accounting)跟踪可以连接和恶意行为的方法。
统计管理(accounting management)ISO为OSI网络管理所定义的5种网络管理类型之一。
统计管理子系统负责收集有关资源使用的网络数据。
准确性(accuracy)在系统上被正确地传输的有用数据流与包括传输错误在内的总数数据流的百分比。
ACK 1. TCP分段中的确认位。
2. 参见acknowledgment(确认)。
确认(acknowledgment)从一台网络设备发往另一台网络设备的通知,用来确认某个事件的发生(例如,一条消息的接收)。
HSRP实验详解及案例
热备份路由协议(HSRP)一、HSRP的相关概念HSRP(hot standby router protocol)是思科私有的一种协议,二、HSRP的配置1、配置为HSRP的成员switch(config-if)#standby group-number ip irtual-ip-addressgroup-number:默认组是0号,范围0~255irtual-ip-address:虚拟HSRP路由器的ip地址,即网段的网关地址。
例如:switch(config-if)#(no)standby 10 ip 192.168.1.2542、配置HSRP的优先级switch(config-if)#standby group-number priority priority-valuepriority-value:范围是0~255,默认值是100.例如:switch(config-if)#(no)standby 10 priority 2003、配置HSRP的占先权switch(config-if)#standby group-number preempt4、配置Hello消息的计时器switch(config-if)#standby group-number times hellotime holdtimehellotime:默认时间是3s,设置范围是1~255,holdtime:保持时间是hello时间的3倍,默认是10s。
例如:switch(config-if)#standby 10 times 2 85、配置HSRP的端口跟踪switch(config-if)#standby group-number track i nterface-type mod/num interface-priority interface-priority:当端口失效时,路由器的热备份优先级将降低的数值,默认为10.例如:switch(config-if)#standby 10 track fastEthernet 0/1 1006、查看HSRP状态switch#show standby [interface-type mod/num] [group-number] briefinterface-type mod/num:要显示的端口类型和序号。
HSRP环境中track命令的应用
HSRP环境中track命令的应用什么是HSRP?HSRP(Hot Standby Router Protocol,热备份路由器协议)是Cisco公司开发的一种路由协议,主要用于解决网络设备的高可靠性和自动故障恢复问题。
它使用虚拟IP地址和虚拟MAC地址来代表路由器组,允许多台路由器在同一网络内冗余备份,保证网络的连通性和高可用性。
HSRP路由器组中,通常只有一个路由器处于活跃状态,其他路由器处于备用状态。
当活跃路由器出现故障时,备用路由器会接管活跃路由器的IP地址和MAC地址,确保网络服务的连续性。
什么是HSRP的track命令?HSRP的track命令是一种路由器配置命令,可用于动态监测路由器组中的某个特定接口或某个特定状态,并根据相应的监测结果来控制路由器组的切换行为。
HSRP的track命令一般由以下几个基本元素组成:•检测对象:可以是路由器组中的某个接口、某个IP地址、某个路由、某个ACL等;•检测参数:可以是ping检测的超时时间、ping检测的重试次数、路由的跃点数限制等;•检测状态:可以是检测对象的连通性、可达性、状态变化等;•操作行为:可以是启动或停止路由器组的跟踪行为、切换路由器组的活动状态、提高或降低路由器组的优先级等。
HSRP环境中track命令的应用1. HSRP负载均衡当路由器组内只有一条物理链路连接到网络时,轮询算法可以用于实现负载均衡。
但当网络环境较为复杂时,轮询算法无法很好地应对,并且可能导致某些路由器的负载过重。
在这种情况下,可以使用HSRP的track命令来实现路由器组中不同路由器的状态监测,并分配不同的权重给不同的路由器。
当某个路由器的状态发生变化时,HSRP可以自动调整路由器组中路由器的活动状态,从而达到负载均衡的目的。
2. HSRP故障恢复当主干线路断开时,HSRP将自动切换到备用线路上,保证网络服务的连通性和稳定性。
使用HSRP的track命令可以进一步完善故障恢复的机制。
HSRP协议介绍
介绍HSRP:热备份路由器协议(HSRP:Hot Standby Router Protocol)关于HSRP该协议中含有多种路由器,对应一个虚拟路由器。
HSRP 协议只支持一个路由器代表虚拟路由器实现数据包转发过程。
终端主机将它们各自的数据包转发到该虚拟路由器上。
工作原理负责转发数据包的路由器称之为主动路由器(Active Router)。
一旦主动路由器出现故障,HSRP 将激活备份路由器(Standby Routers)取代主动路由器。
HSRP 协议提供了一种决定使用主动路由器还是备份路由器的机制,并指定一个虚拟的 IP 地址作为网络系统的缺省网关地址。
如果主动路由器出现故障,备份路由器(Standby Routers)承接主动路由器的所有任务,并且不会导致主机连通中断现象。
HSRP 运行在 UDP 上,采用端口号1985。
路由器转发协议数据包的源地址使用的是实际 IP 地址,而并非虚拟地址,正是基于这一点,HSRP 路由器间能相互识别.HSRP技术在网络中的应用随着Internet的日益普及,人们对网络的依赖性也越来越强。
这同时对网络的稳定性提出了更高的要求,人们自然想到了基于设备的备份结构,就像在服务器中为提高数据的安全性而采用双硬盘结构一样。
路由器是整个网络的核心和心脏,如果路由器发生致命性的故障,将导致本地网络的瘫痪,如果是骨干路由器,影响的范围将更大,所造成的损失也是难以估计的。
因此,对路由器采用热备份是提高网络可靠性的必然选择。
在一个路由器完全不能工作的情况下,它的全部功能便被系统中的另一个备份路由器完全接管,直至出现问题的路由器恢复正常,这就是热备份路由协议(HotStandbyRouterProtocal),HSR PRFC2281 技术要解决的问题。
HSRP协议概述实现HSRP的条件是系统中有多台路由器,它们组成一个“热备份组”,这个组形成一个虚拟路由器。
在任一时刻,一个组内只有一个路由器是活动的,并由它来转发数据包,如果活动路由器发生了故障,将选择一个备份路由器来替代活动路由器,但是在本网络内的主机看来,虚拟路由器没有改变。
HSRP协议分析与应用_王庆生
Virt ual IP Address( 虚拟 IP 地址) : 32b, 虚拟 IP 将在 H SRP 协议组中使用。
第 20 卷 第 2 期
电脑开发与应用
( 总 115) ·45·
文章编号: 1003-5850( 2007) 02-0045-03
HSRP 协 议 分 析 与 应 用
Analysis of HSRP Protocol and its Application
王庆生 胡 涛 高 峰
( 太原理工大学计算机与软件学院 太原 030024)
4 HSRP 对地址因素的考虑
每个 HSRP 协议组都有一个众所周知的 联合的 虚拟 M AC 地址, 这个地址实际上属于功能地址。 HSRP 协议组中的活动路由器负责对发送给虚拟路由 器 的通 信量
进 行 转 发。
如 果访 问主
机 端将 数据
包 发送 到虚
拟 路由 器的
M AC 地址, 活动路由器将接收并处理这些数据包; 如访问主机端 发送一个包含虚拟路由器 IP 地址的 ARP 请求, 活动 路由器用虚拟的 MA C 地址进行应答。图 3 说明 Cisco 公司运用 HSRP 时所使用的虚拟 MA C 地址格式。
failure o f IP t raffic cir cumst ances. T his pr ot ocol maps multiple r o uter s to be a single virtual ro uter , and insures that o ne and only
Cisco HSRP 路由器的配置
Cisco HSRP 路由器的配置1、介绍本文档将详细说明如何配置Cisco HSRP(Hot Standby Router Protocol)路由器。
HSRP是一种用于提供冗余路由的协议,通过同时配置多个路由器来实现高可靠性和冗余性。
在本文档中,将介绍HSRP的概念、配置过程以及一些常见问题的解决方法。
2、HSRP概念及工作原理⑴ HSRP概念HSRP是一种用于提供冗余路由的协议,通过将多个路由器配置为一个虚拟路由器来实现冗余性。
在一个HSRP组中,有一个主路由器和一个或多个备用路由器。
主路由器负责转发数据流量,而备用路由器在主路由器失效时接管主路由器的功能。
⑵ HSRP工作原理每个HSRP组都有一个主要的虚拟IP地质,该地质与组中的主路由器相对应。
当主路由器失效时,备用路由器中的其中一个将成为新的主路由器,接管原先主路由器的功能,并使用相同的虚拟IP 地质。
主路由器和备用路由器通过互相发送心跳包来检测彼此的状态。
3、配置前的准备工作在开始配置HSRP之前,确保满足以下条件:⑴路由器上已运行适当的IOS版本,支持HSRP功能。
⑵彼此连接的路由器中至少有两台路由器。
⑶路由器之间配置了适当的接口,并具有可达性。
4、HSRP配置步骤以下是配置Cisco HSRP路由器的步骤:⑴创建HSRP组在每台路由器上创建HSRP组,使用相同的组号,并指定虚拟IP地质。
⑵配置接口在每台路由器的接口上配置HSRP,并将其指定为HSRP组的一部分。
⑶配置优先级为了指定主路由器,您可以配置每个路由器的HSRP优先级。
优先级越高,该路由器成为主路由器的可能性越大。
⑷配置其他参数根据需求,您还可以配置其他一些参数,如预共享密钥、追踪对象等。
5、常见问题及解决方法⑴ HSRP状态不稳定如果HSRP状态频繁切换或不稳定,可能是由于网络问题或路由器之间的通信问题引起的。
检查网络连接并确保良好的通信。
⑵主路由器失效后备用路由器无法接管如果主路由器失效后备用路由器无法接管其功能,可能是由于HSRP组配置错误或接口问题。
HSRP配置实例
HSRP配置实例1 HSRP协议原理产生背景随着Internet的日益普及,人们对网络的依赖性也越来越强。
这对网络的稳定性提出了更高的要求,人们自然想到了基于设备的备份结构,就像在服务器中为提高数据的安全性而采用双硬盘结构一样。
网络核心层设备是整个网络的心脏,如果设备发生致命性的故障,将导致本地网络的瘫痪,如果是骨干路由器,影响的围将更大,所造成的损失也是难以估计的。
因此,对核心设备采用热备份是提高网络可靠性的必然选择。
在一个核心设备完全不能工作的情况下,它的全部功能便被系统中的另一个备份设备完全接管,直至出现问题的设备恢复正常,这就是热备份路由协议HSRP(Hot Standby Router Protocal)要解决的问题。
HSRP原理HSRP是Cisco公司制定的专有路由器备份协议,支持多台路由器形成热备而消除单台设备失效造成的网络中断。
实现HSRP的条件是系统中有2台以上的路由器组成一个“热备份组”,这个组形成一个虚拟路由器。
HSRP协议利用一个优先级(priority)方案来决定哪台配置了HSRP协议的路由器成为活跃路由器(active router)。
用户可以手动设置HSRP优先级的值。
如果一个路由器的优先级设置的比所有其他路由器的优先级高,则该路由器成为相应备份组的活跃路由器。
当在预先设定的一段时间(Hold Time),不能收到活跃路由器发送的hello消息时,优先级最高的备用路由器变为活跃路由器。
网络上的所有主机不感知路由器之间的报文交互。
其协议基本原理与VRRP类似,如下图所示。
图1-1 HSRP协议基本原理示意图基本概念备份组:组成虚拟路由器的一组设备,称为HSRP路由器;活跃路由器(active router):备份组中代表虚拟路由器转发数据包的路由器;备份路由器(standby router):备份组中第一备份路由器;Hello Time:设备发送Hello报文的时间间隔,如果未配置Hello Time值,则根据活跃路由器成功发送两个hello消息的时间间隔来确定,否则使用缺省值3秒;Hold Time:HSRP路由器在声明活跃路由器发生故障之前等待的时间,最少为Hello time的3倍;备份优先级:路由器在HSRP备份组的级别,缺省为100。
HSRP简介及分析案例
1、HSRP简介HSRP 是Cisco 的专有协议。
HSRP(Hot Standby Router Protocol)把多台路由器组成一个“热备份组”,形成一个虚拟路由器。
这个组内只有一个路由器是活动的(Active),并由它来转发数据包,如果活动路由器发生了故障,备份路由器将成为活动路由器。
抓包分析HSRP可以帮助我们在分析网络配置和故障排查时更快速的找到问题的根源。
2、协议结构8162432 bit Version Op code State HellotimeHoldtime Priority Group ReservedAuthentication dataAuthentication dataVirtual IP addressHSRP数据包格式Hsrp数据包解码•Version ―HSRP 版本号。
当前值为0。
•Opcode ―数据包中包含的信息类型。
可能值有:o 0 ―发送Hello,表示路由器正在运行,并有可能成为主动或备份路由器。
o 1 ―发送Coup,当路由器希望成为主动路由器时发送。
o 2 ―发送Resign,当路由器不再希望成为主动路由器时发送。
•State ―备份组中的每个路由器运行一个状态机器。
State 字段描述发送信息的路由器的当前状态。
可能值有:0 Initial;1 Learn;2 Listen;4 Speak;8 Standby;16 Active。
•Hellotime ―指路由器发送的Hello 信息间的大约周期。
默认为3秒。
•Holdtime ―时间值,指当前Hello 信息的有效时间(只对Hello 信息)。
默认为10秒。
•Priority ―用于选择主动和备份路由器。
当比较两个路由器的优先级时,具有较高优先级数字的路由器优先。
当两个路由器具有同等优先级时,IP 地址较高的那个路由器优先。
•Group ―识别备份路由器组。
•Authentication Data ―清除8字符再生密码。
4个p及交换feature
在Cisco路由器中,最多可以配置256个HSRP组,
因为HSRP能够使用的MAC地址类似于:0000.0c07.ac**。
HRSP每隔3秒发送hello包,包括group ID,HSRP group和优先级(默认为100)。
路由器彼此之间依据优先级,确定优先级最高的路由器是活动路由器。
①. Hellotime:是以秒来计算的,来定义HELLO消息之间的间隔;默认是3秒
②. Holdtime:是以秒来计算的,来定义活跃或是备份路由器在宣布失效之前的时间,从1~255,缺省为10秒。也就是是说:路由器在3个HELLO消息的间隔内如果还是没有收到HELLO包,宣告现在这台路由器已经失效了。 要恢复到缺省的备份计时器值:no standby group timers命令。
先前的备用服务器代替其角色处于活动状态,直到下一次选举发生。
5)HRSP track技术
如果所监测的端口出现故障,则也可以进行路由器的切换。
如果主路由器上有多条线路被跟踪,
则当一条线路出现故障时,就会切换到备份路由器上,即使其他都线路正常工作,
直到主路由器该线路正常工作,才能重新切换回来。
则认为活动路由器失效,
优先级最高的备用路由器就接替活动路由器的角色,开始转发数据包。
4)HRSP preempt技术
HRSP技术能够保证优先级高的路由器失效恢复后总能处于活动状态。
活动路由器失效后,优先级最高的备用路由器处于活动状态,
如果没有使用preempt技术,
则当活动路由器恢复后,只能处于备用状态,
Proxy ARP
支持Proxy ARP 的计算机无论与本网段的计算机还是不同网段的计算机进入通讯都发送ARP广播以寻找与目的地址相对应的MAC地址,这时,知道目的地址的路由器会响应ARP的请求,并将自己的MAC地址广播给源计算机,然后源计算机就将IP数据包发给该路由器,并由路由器最终将数据包发送到目的。 ARP代理的主要缺点是切换时间长,如果主网关正在传输数据时失效,客户机仍然会继续发包,导致传输中断,只有再另外发送Proxy ARP请求或重新启动之后才能找到备用网关以进行传输。
神州数码交换机HSRP简介
终端可以使用多种方法决定它们到特定ip地址的第一跳。常用的方法有两种:一种是动态学习,如代理arp,路由协议(rip和ospf)以及irdp(icmp router discovery protocol);另一种是静态配置。在每一个终端都运行动态路由协议是不现实的,大多客户端操作系统平台都不支持动态路由协议,即使支持也受到管理开销、收敛度、安全性等许多问题的限制。因此普遍采用对终端ip设备静态路由配置,一般是给终端设备指定一个或者多个默认网关(default gateway)。静态路由的方法简化了网络管理的复杂度和减轻了终端设备的通信开销,但是它仍然有一个缺点:如果作为默认网关的交换机损坏,所有使用该网关为下一跳主机的通信必然要中断。即便配置了多个默认网关,如不重新启动终端设备,也不能切换到新的网关。hsrp就是为了避免静态指定网关的缺陷。
活动交换机是指处于活动状态的运行hsrp的交换机,是物理实体,负责数据报文转发的工作。虚拟交换机是hsrp协议创建的,是逻辑概念。一组hsrp交换机协同工作,共同构成一台虚拟交换机。该虚拟交换机对外表现为一个具有唯一固定ip地址和mac地址的逻辑交换机。hsrp协议使用选择策略从交换机组中选出一台作为主控,负责arp和转发ip数据包,另外一个交换机作为备份的角色处于待命状态。当由于某种原因主控交换机发生故障时,主备份交换机能在几秒钟的时延后升级为活动交换机。由于切换非常迅速而且不用改变ip地址和mac地址,故对终端使用者系统是透明的。
hsrp在以太网上,两台或多台交换机之间实现备份,这些交换机称作一个备份组。它们协同工作,在局域网上的主机看来像一台虚拟交换机。在一个备份组内,只有一台交换机承担报文转发任务,这台交换机称作活动交换机,同时存在一个主备用交换机和任意个数的备用交换机。当活动交换机出现故障后,备份交换机能够自动接管它的报文转发工作,从而提供不中断的网络服务。该协议通常用来防止第一跳交换机的故障而引起的通信中断,因为在通常情况下,源主机不能动态地学到第一跳的交换机的ip地址。hsrp的优点就是它具有更高的实用性,并且它无须在每个终端都配置动态路由或寻找路由的协议。当一台交换机不可用时,由配置的其他交换机来接管其功能,保证通信的不中断。hsrp允许两台或多台交换机使用一台虚拟交换机的mac和ip地址。虚拟交换机并不实际存在,它只表示一组配置的相互之间备份的交换机。
HSRP原理
HSRP(Hot Standby Redundancy Protocol)热备份路由协议HSRP的原理:多台路由器组成一个“路由器组”,用来模拟为一个虚拟的路由器,利用虚拟的IP 地址和虚拟的MAC地址在一个备份组中充当一台路由器作为活动路由器发送数据包,只有当活动路由器失效后,将选择一台备份路由器才能成为活动路由器转发数据包,但对于网络中的主机来说虚拟路由器组是透明的。
HSRP有三种广播包:1)Hello信息:hello消息向组内的其他路由器发送路由器的HSRP优先级和状态信息,并在后续的时候利用路由器的优先级选举主、备路由器。
HELLO消息默认为每3秒钟发送一次。
2)Coup:当一个备用路由器变为一个主动路由器时(此时主DOWN)发送一个coup消息。
3)Resign:当主动路由器DOWN掉或者当有优先级更高的路由器发送hello消息时,ACTIVE路由器发送一个resign消息,类似权利的移交。
HSRP路由器的状态类型:1)Initial:HSRP启动时的状态,HSRP还没有运行,一般是在改变配置或端口刚启动时进入该状态。
2)Learn:路由器已经得到了虚拟IP地址,但是它既不是活动路由器也不是备份路由器。
它一直监听从活动路由器和备份路由器发来的HELLO报文。
3)Liste:路由器正在监听hello消息。
4)Speak:在该状态下,路由器定期发送HELLO报文,并且积极参加活动路由器或等待路由器的竞选。
5)Standby:当主动路由器失效时路由器准备接包传输功能。
6)Active:路由器执行包传输功能。
HSRP路由器体系1)活动路由器,负责转发发送到虚拟路由器的数据。
它通过发送HELLO消息(基于UDP,端口号为1985的广播)来通告它的活跃状态2)备份路由器,监视HSRP组中的运行状态,并且在当前活跃路由器不可用时,迅速承担起负责数据转发的任务。
备份路由器也发送HELLO消息来通告组中其他的路由器它备份路由器的角色。
HSRP详解
Part I: FundamentalHSRP(Hot Standby Router Protocol):Cisco私有的第3层协议。
HSRP为IP网络提供网络冗余,确保用户流量能立即并透明地恢复网络边界设备或接入电路中的第一跳故障。
在LAN中,多个router组成一个HSRP组,其中一个router代表这个HSRP转发这个LAN中的数据流,其它所有router只发送HSRP hello来维持这种HSRP组关系。
一个HSRP组共享一个IP和一个MAC地址。
每个router可以加入多个组。
一个HSRP组由一台active router,一台standby router及other routers。
1>active router转发指向VIP的数据流,并发送HSRP hello包给所有其它HSRP组成员。
(最终处于active state)2>standby router不转发指向VIP的数据流,发送HSRP hello包给所有其它HSRP 组成员,并监控active router的状态。
(最终处于standby state)3>other routers不转发指向VIP的数据流,只监控HSRP hello包,不发送。
它们执行普通router的工作,只转发目标为他们自己的分组,不转发目标为VIP的地址。
(最终处于listen state)Part II: HSRP Operation当standby router在一定时间内没有收到active router的hello包时,它就认为active router出现故障了,并取代它的active router的角色。
因为host设备使用VIP及VMAC来标识它们的网关设备,所有它们不会发现这种变更,也不会感觉到服务的中断。
active router的选择:1>优选priority大的HSRP router,默认的priority值为1002>优选lowest mac地址为了方便进行负载均衡,一个router可以属于多个HSRP组的成员,每个HSRP组有一个VIP及VMAC。
hsrp协议工作原理(一)
hsrp协议工作原理(一)HSRP协议工作原理什么是HSRP协议?HSRP(Hot Standby Router Protocol)是一种网络冗余技术,用于构建可靠的网络架构。
它允许多个路由器以共享虚拟IP地址的方式工作,其中一个路由器担任主要角色,其他路由器作为备份。
当主要路由器发生故障时,备份路由器会接管主要路由器的功能,确保网络的连通性不受影响。
HSRP协议的优势•高可用性:HSRP提供了快速的故障恢复能力,当主要路由器故障时,备份路由器可以迅速接管,减少网络中断的时间。
•负载均衡:HSRP允许多个备份路由器一起工作,实现负载均衡,提高网络的性能和可靠性。
•热备援:HSRP中的备份路由器可以实时监测主要路由器的状态,一旦发现主要路由器故障,可以立即接管,无需手动干预。
HSRP协议的工作原理1.虚拟IP地址分配:在HSRP配置中,需要指定一个虚拟IP地址,该IP地址将被用作路由器的默认路由。
主路由器和备份路由器必须使用相同的虚拟IP地址。
2.选举主备角色:在HSRP中,路由器可以担任主要角色(Active)或备份角色(Standby),主要路由器负责处理实际的数据传输,备份路由器处于待命状态。
3.Hello消息交换:主要路由器和备份路由器之间周期性地发送Hello消息用于通信和选举。
通过Hello消息,路由器可以检测到其他路由器的活动状态。
4.优先级设置:每个HSRP路由器都有一个优先级值,优先级高的路由器更有可能成为主要路由器。
可以手动配置优先级,也可以通过预设值自动设置。
5.监控连接状态:备份路由器定期检测主要路由器的状态,如果没有收到主要路由器的Hello消息,则备份路由器会主动发起选举过程,争夺主要角色。
6.主备切换:当主要路由器故障或网络发生变化时,备份路由器会触发HSRP协议,接管主要角色,并通知其他路由器发生了主备切换。
总结HSRP协议通过虚拟IP地址、角色选举、Hello消息交换和优先级设置等机制,实现了高可用性和负载均衡。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
TAC Notice: What's Changing on TAC Web Help us helpyou.Please rate this document. ExcellentGoodAverageFairPoorThis document solved my problem.Yes No Just browsing Suggestions for improvement: (256 character limit) Understanding and Troubleshooting HSRPProblems in Catalyst Switch NetworksContents Introduction PrerequisitesRequirements Components Used Conventions Understand HSRP Background Information Basic OperationHSRP Terms HSRP Addressing ICMP Redirects HSRP Functionality Matrix HSRP Features Packet FormatHSRP States HSRP TimersHSRP EventsHSRP ActionsHSRP State TablePacket FlowTroubleshoot HSRP Case StudiesCase Study #1: HSRP Standby IP Address Is Reported as a Duplicate IP AddressCase Study #2: HSRP State Continuously Changes (Active, Standby, Speak) or%HSRP-6-STATECHANGECase Study #3: HSRP Does Not Recognize PeerCase Study #4: HSRP State Changes and Switch Reports SYS-4-P2_WARN: 1/Host<mac_address> Is Flapping Between Port <port_1> and Port <port_2> in SyslogCase Study #5: HSRP State Changes and Switch Reports RTD-1-ADDR_FLAP in SyslogCase Study #6: HSRP State Changes and Switch Reports MLS-4-MOVEOVERFLOW:Too manymoves, stop MLS for 5 sec(20000000) in SyslogSendCase Study #7: HSRP Intermittent State Changes on Multicast Stub NetworkCase Study #8: Asymmetric Routing and HSRP (Excessive Flooding of Unicast Traffic in Network with Routers That Run HSRP)Case Study #9: HSRP Virtual IP Address Is Reported as a Different IP AddressCase Study #10: HSRP Causes MAC Violation on a Secure PortCase Study #11: %Interface Hardware Cannot Support Multiple GroupsHSRP Troubleshooting Modules for CatOS SwitchesA. Verify HSRP Router ConfigurationB. Verify Catalyst Fast EtherChannel and Trunking ConfigurationC. Verify Physical Layer ConnectivityD. Layer 3 HSRP DebuggingE. Spanning Tree TroubleshootingF. CGMP Leave Processing and HSRP InteroperabilityG. Divide and ConquerH. High CPU with Asymmetric Traffic in HSRPKnown IssuesNumber of HSRP Groups Supported for Catalyst 6500/6000 Series PFC2/MSFC2 and Catalyst 3550HSRP State Flapping/Unstable When You Use Cisco 2620/2621, Cisco 3600 with Fast Ethernet, or PA-2FEISLHSRP Stuck in Initial or Active State on Cisco 2620/2621, Cisco 3600 with Fast Ethernet, or PA-2FEISLUnable to Ping HSRP Standby Address on Cisco 2500 and 4500 Series RoutersMLS Flows Are Not Created for Devices That Use HSRP Standby IP Address as Default GatewayCatalyst 2948G, 2980G, 4912G, 4003, and 4006 HSRP-CGMP Interoperability Issues Cisco Support Community - Featured ConversationsRelated InformationIntroductionBecause of the nature of the Hot Standby Router Protocol (HSRP), specific network problems can lead to HSRP instability. This document covers common issues and ways to troubleshoot HSRP problems. Most HSRP-related problems are not true HSRP issues. Instead, they are network problems that affect the behavior of HSRP.This document covers these most-common issues that relate to HSRP:q Router report of a duplicate HSRP standby IP addressq Constant HSRP state changes (active, standby, speak)q Missing HSRP peersq Switch error messages that relate to HSRPq Excessive network unicast flooding to the HSRP configurationNote: This document details how to troubleshoot HSRP in Catalyst switch environments. The document contains many references to software versions and network topology design. Nevertheless, the sole purpose of this document is to facilitate and guide engineers on who to troubleshoot HSRP. This document is not intended to be a design guide, software-recommendation document, or a best practices document.PrerequisitesRequirementsThere are no specific requirements for this document.Components UsedThis document is not restricted to specific software and hardware versions.The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.ConventionsRefer to Cisco Technical Tips Conventions for more information on document conventions.Understand HSRPBackground InformationBusinesses and consumers that rely on intranet and Internet services for their mission-critical communications require and expect their networks and applications to be continuously available to them. Customers can satisfy their demands for near-100 percent network uptime if they leverage the HSRP in Cisco IOS® Software. HSRP, which is unique to Cisco platforms, provides network redundancy for IP networks in a manner that ensures that user traffic immediately and transparently recovers from first-hop failures in network edge devices or access circuits.Two or more routers can act as a single, virtual router if they share an IP address and a MAC (Layer 2 [L2]) address. The address is necessary for host workstation default gateway redundancy. Most host workstations do not contain routing tables and use only a single next hop IP and MAC address. This address is known as a default gateway. With HSRP, members of the virtual router group continually exchange status messages. One router can assume the routing responsibility of another if a router goes out of commission for either planned or unplannedreasons. Hosts are configured with a single default gateway and continue to forward IP packets to a consistent IP and MAC address. The changeover of devices that do the routing is transparent to the end workstations.Note: You can configure host workstations that run Microsoft OS for multiple default gateways. But, the multiple default gateways are not dynamic. The OS only uses one single default gateway at a time. The system only selects an additional configured default gateway at boot time if the first configured default gateway is determined unreachable by Internet Control Management Protocol (ICMP).Basic OperationA set of routers that run HSRP works in concert to present the illusion of a single default gateway router to the hosts on the LAN. This set of routers is known as an HSRP group or standby group. A single router that is elected from the group is responsible for the forwarding of the packets that hosts send to the virtual router. This router is known as the active router. Another router is elected as the standby router. If the active router fails, the standby assumes the packet forwarding duties. Although an arbitrary number of routers may run HSRP, only the active router forwards the packets that are sent to the virtual router IP address.In order to minimize network traffic, only the active and the standby routers send periodic HSRP messages after the protocol has completed the election process. Additional routers in the HSRP group remain in the Listen state. If the active router fails, the standby router takes over as the active router. If the standby router fails or becomes the active router, another router is elected as the standby router.Each standby group emulates a single virtual router (default gateway). For each group, a single well-known MAC and IP address is allocated to that group. Multiple standby groups can coexist and overlap on a LAN, and individual routers can participate in multiple groups. In this case, the router maintains a separate state and timers for each group.HSRP TermsTerm DefinitionActive router The router that currently forwards packets for the virtual routerStandby router The primary backup routerStandby group The set of routers that participate in HSRP and jointly emulate a virtual routerHello time The interval between successive HSRP hello messages from a given routerHold time The interval between the receipt of a hello message and the presumption that the sending router has failedHSRP AddressingHSRP Router CommunicationRouters that run HSRP communicate HSRP information between each other through HSRP hello packets. These packets are sent to the destination IP multicast address 224.0.0.2 on User Datagram Protocol (UDP) port 1985. IP multicast address 224.0.0.2 is a reserved multicast address that is used to communicate to all routers. The active router sources hello packets from its configured IP address and the HSRP virtual MAC address. The standby router sources hellos from its configured IP address and the burned-in MAC address (BIA). This use of source addressing is necessary so that HSRP routers can correctly identify each other.In most cases, when you configure routers to be part of an HSRP group, the routers listen for the HSRP MAC address for that group as well as their own BIA. The only exception to this behavior is for Cisco 2500, 4000, and 4500 routers. These routers have Ethernet hardware that only recognizes a single MAC address. Therefore, these routers use the HSRP MAC address when they serve as the active router. The routers use their BIA when they serve as the standby router.HSRP Standby IP Address Communication on All Media Except Token RingBecause host workstations are configured with their default gateway as the HSRP standby IP address, hosts must communicate with the MAC address that is associated with the HSRP standby IP address. This MAC address is a virtual MAC address that is composed of 0000.0c07.ac**. The ** is the HSRP group number in hexadecimal, based on the respective interface. For example, HSRP group 1 uses the HSRP virtual MAC address of 0000.0c07. ac01. Hosts on the adjoining LAN segment use the normal Address Resolution Protocol (ARP) process in order to resolve the associated MAC addresses.HSRP Standby IP Address Communication on Token Ring MediaToken Ring interfaces use functional addresses for the HSRP MAC address. Functional addresses are the only general multicast mechanism available. There is a limited number of Token Ring functional addresses available, and many of these addresses are reserved for other functions. These three addresses are the only addresses available for use with HSRP:c000.0001.0000 (group 0)c000.0002.0000 (group 1)c000.0004.0000 (group 2)Therefore, you can configure only three HSRP groups on Token Ring interfaces, unless you configure the standby use-bia parameter.ICMP RedirectsHSRP peer routers that protect a subnet are able to provide access to all other subnets in the network. This is the basis of HSRP. Therefore, which router becomes the active HSRP router is irrelevant. In Cisco IOS software releases earlier than Cisco IOS Software Release 12.1(3)T, ICMP redirects are automatically disabled on an interface when HSRP is used on that interface. Without this configuration, the hosts can be redirected away from the HSRP virtual IP address and toward an interface IP and MAC address of a single router. Redundancy is lost.Cisco IOS Software Release 12.1(3)T introduces a method to allow ICMP redirects with HSRP. This method filters outbound ICMP redirect messages through HSRP. The next hop IP address is changed to an HSRP virtual address. The gateway IP address in the outbound ICMP redirect message is compared to a list of HSRP active routers that are present on that network. If the router that corresponds to the gateway IP address is an active router for an HSRP group, the gateway IP address is replaced with that group virtual IP address. This solution allows hosts to learn optimal routes to remote networks and, at the same time, maintain the resilience that HSRP provides.HSRP Functionality MatrixRefer to the Cisco IOS Release and HSRP Functionality Matrix section of Hot Standby Router Protocol Features and Functionality in order to learn about the features and Cisco IOS Software releases that support HSRP.HSRP FeaturesRefer to Hot Standby Router Protocol Features and Functionality for information on most of the HSRP features. This document provides information on these HSRP features:q Preemptionq Interface trackingq Use of a BIAq Multiple HSRP groupsq Configurable MAC addressesq Syslog supportq HSRP debuggingq Enhanced HSRP debuggingq Authenticationq IP redundancyq Simple Network Management Protocol (SNMP) MIBq HSRP for Multiprotocol Label Switching (MPLS)Note: You can use your browser Find feature in order to locate these sections within the document.Packet FormatThis table shows the format of the data portion of the UDP HSRP frame: Version Op Code State HellotimeHoldtime Priority Group Reserved Authentication DataAuthentication DataVirtual IP AddressThis table describes each of the fields in the HSRP packet:Packet Field DescriptionOp Code (1 octet)The Op Code describes the type of message that the packet contains. Possible values are: 0 - hello, 1 - coup, and 2 - resign. Hello messages are sent to indicate that a router runs HSRP and is able to become the active router. Coup messages are sent when a router wishes to become the active router. Resign messages are sent when a router no longer wishes to be the active router.State (1 octet)Each router in the standby group implements a state machine. The state field describes the current state of the router that sends the message. These are details on the individual states: 0 - initial, 1 - learn, 2 - listen, 4 - speak, 8 - standby, and 16 - active.Hellotime (1 octet)This field is only meaningful in hello messages. It contains the approximate period between the hello messages that the router sends. The time is given in seconds.Holdtime (1 octet)This field is only meaningful in hello messages. It contains the amount of time that the routers wait for a hello message before they initiate a state change.Priority (1 octet)This field is used to elect the active and standby routers. In a comparison of the priorities of two routers, the router with the highest value becomes the active router. The tie breaker is the router with the higher IP address.Group (1 octet)This field identifies the standby group.Authentication Data (8 octets)This field contains a cleartext, eight-character password.Virtual IP Address (4 octets)If the virtual IP address is not configured on a router, the address can be learned from the hello message from the active router. An address is only learned if no HSRP standby IP address has been configured, and the hello message is authenticated (if authentication is configured).HSRP StatesState DefinitionInitial This is the state at the start. This state indicates that HSRP does not run. This state is entered through a configuration change or when an interface first becomes available.Learn The router has not determined the virtual IP address and has not yet seen an authenticated hello message from the active router. In this state, the router still waits to hear from the active router.Listen The router knows the virtual IP address, but the router is neither the active router nor the standby router. It listens for hello messages from those routers.Speak The router sends periodic hello messages and actively participates in the election of the active and/or standby router. A router cannot enter speak state unless the router has the virtual IP address.Standby The router is a candidate to become the next active router and sends periodic hello messages. With the exclusion of transient conditions, there is, at most, one router in the group in standby state.Active The router currently forwards packets that are sent to the group virtual MAC address. The router sends periodic hello messages. With the exclusion of transient conditions, there must be, at most, one router in active state in the group.HSRP TimersEach router only uses three timers in HSRP. The timers time hello messages. The HSRP converges, when a failure occurs, depend on how the HSRP hello and hold timers are configured. By default, these timers are set to 3 and 10 seconds, respectively, which means that a hello packet is sent between the HSRP standby group devices every 3 seconds, and the standby device becomes active when a hello packet has not been received for 10 seconds. You can lower these timer settings to speed up the failover or preemption, but, to avoid increased CPU usage and unnecessary standby state flapping, do not set the hello timer below one (1) second or the hold timer below 4 seconds. Note that, if you use the HSRP tracking mechanism and the tracked link fails, the failover or preemption occurs immediately, regardless of the hello and hold timers. When a timer expires, the router transitions to a new HSRP state. The timers can be changed with this command: standby [group-number] timers hellotime holdtime. For example, standby 1 timers 5 15.This table provides more information on these timers:Timer DescriptionActive timer This timer is used to monitor the active router. This timer starts any time an active router receives a hello packet. This timer expires in accordance with the hold time value that is set in the related field of the HSRP hello message.Standby timer This timer is used in order to monitor the standby router. The timer starts any time the standby router receives a hello packet. This timer expires in accordance with the hold time value that is set in the respective hello packet.Hello timer This timer is used to clock hello packets. All HSRP routers in any HSRP state generate a hello packet when this hello timer expires.HSRP EventsThis table provides the events in the HSRP finite state machine: Key Events1HSRP is configured on an enabled interface.2HSRP is disabled on an interface or the interface is disabled.3Active timer expiryThe active timer is set to the hold time when the last hello message is seen from the active router.4Standby timer expiryThe standby timer is set to the hold time when the last hello message is seen from the standby router.5Hello timer expiryThe periodic timer for the send of hello messages is expired.6Receipt of a hello message of higher priority from a router in speak state7Receipt of a hello message of higher priority from the active router8Receipt of a hello message of lower priority from the active router9Receipt of a resign message from the active router10Receipt of a coup message from a higher priority router11Receipt of a hello message of higher priority from the standby router12Receipt of a hello message of lower priority from the standby routerHSRP ActionsThis table specifies the actions to be taken as part of the state machine:Initial ActionA Start active timer—If this action occurrs as the result of the receipt of an authenticated hello message from the active router, the active timer is set to the hold time field in the hello message. Otherwise, the active timer is set to the current hold time value that is in use by this router. The active timer then starts.B Start standby timer—If this action occurrs as the result of the receipt of an authenticated hello message from the standby router, the standby timer is set to the hold time field in the hello message. Otherwise, the standby timer is set to the current hold time value that is in use by this router. The standby timer then starts.C Stop active timer—The active timer stops.D Stop standby timer—The standby timer stops.E Learn parameters—This action is taken when an authenticated message is received from the active router. If the virtual IP address for this group is not manually configured, the virtual IP address can be learned from the message. The router can learn hello time and hold time values from the message.F Send hello message—The router sends a hello message with its current state, hello time, and hold time.G Send coup message—The router sends a coup message in order to inform the active router that there is a higher-priority router available.H Send resign message—The router sends a resign message in order to allow another router to become the active router.I Send gratuitous ARP message—The router broadcasts an ARP response packet that advertises the group virtual IP and MAC addresses. The packet is sent with the virtual MAC address as the source MAC address in the link layer header, as well as within the ARP packet.HSRP State TableThe diagram in this section shows the state transitions of the HSRP state machine. Each time that an event occurs, the associated action results, and the router transitions to the next HSRP state. In the diagram, numbers designateevents, and letters designate the associated action. The table in the section HSRP Events defines the numbers, and the table in the section HSRP Actions defines the letters. Use this diagram only as a reference. The diagram is detailed and is not necessary for general troubleshooting purposes.Packet FlowDevice MAC Address IP Address Subnet Mask Default GatewayPC10000.0c00.000110.1.1.10255.255.255.010.1.1.1 PC20000.0c00.111010.1.2.10 255.255.255.010.1.2.1Router A Configuration (Active Router)interface ethernet 0ip address 10.1.1.2 255.255.255.0mac-address 4000.0000.0010standby 1 ip 10.1.1.1standby 1 priority 200interface ethernet 1ip address 10.1.2.2 255.255.255.0mac-address 4000.0000.0011standby 1 ip 10.1.2.1standby 1 priority 200Router B Configuration (Standby Router)interface ethernet 0ip address 10.1.1.3 255.255.225.0mac-address 4000.0000.0020standby 1 ip 10.1.1.1interface ethernet 1ip address 10.1.2.3 255.255.255.0mac-address 4000.0000.0021standby 1 ip 10.1.2.1Note: These examples configure static MAC addresses for illustration purposes only. Do not configure static MAC addresses unless you are required to do so.You must understand the concept behind packet flow when you obtain sniffer traces in order to troubleshoot HSRP problems. Router A uses the priority of 200 and becomes the active router on both interfaces. In the example in this section, packets from the router that are destined for a host workstation have the source MAC address of the router physical MAC address (BIA). Packets from the host machines that are destined for the HSRP IP address have the destination MAC address of the HSRP virtual MAC address. Note that the MAC addresses are not the same for each flow between the router and the host.This table shows the respective MAC and IP address information per flow on the basis of a sniffer trace that is taken from Switch X.Packet Flow Source MACDestinationMACSourceIPDestinationIPPackets fromPC1 that are destined for PC2PC1(0000.0c00.0001)HSRP virtualMAC address ofRouter AinterfaceEthernet 0(0000.0c07.ac01)10.1.1.1010.1.2.10Packets that returnthrough Router A from PC2 and are destined for PC1Router AEthernet 0 BIA(4000.0000.0010)PC1(0000.0c00.0001)10.1.2.1010.1.1.10Packets from PC1 that are destinedfor HSRP standby IP address (ICMP, Telnet)PC1(0000.0c00.0001)HSRP virtualMAC address ofRouter AinterfaceEthernet 0(0000.0c07.ac01)10.1.1.1010.1.1.1Packets that are destined for the actualIP address of the active router (ICMP, Telnet)PC1(0000.0c00.0001)Router AEthernet 0 BIA(4000.0000.0010)10.1.1.1010.1.1.2Packets that are destined for the actualIP address of the standby router (ICMP, Telnet)PC1(0000.0c00.0001)Router BEthernet 0 BIA(4000.0000.0020)10.1.1.1010.1.1.3Troubleshoot HSRP Case StudiesCase Study #1: HSRP Standby IP Address Is Reported as a Duplicate IP Address These error messages can appear:Oct 12 13:15:41: %STANDBY-3-DUPADDR: Duplicate address 10.25.0.1on Vlan25, sourced by 0000.0c07.ac19Oct 13 16:25:41: %STANDBY-3-DUPADDR: Duplicate address 10.25.0.1on Vlan25, sourced by 0000.0c07.ac19Oct 15 22:31:02: %STANDBY-3-DUPADDR: Duplicate address 10.25.0.1on Vlan25, sourced by 0000.0c07.ac19Oct 15 22:41:01: %STANDBY-3-DUPADDR: Duplicate address 10.25.0.1on Vlan25, sourced by 0000.0c07.ac19These error messages do not necessarily indicate an HSRP problem. Rather, the error messages indicate a possible Spanning Tree Protocol (STP) loop or router/switch configuration issue. The error messages are just symptoms of another problem.In addition, these error messages do not prevent the proper operation of HSRP. The duplicate HSRP packet isignored. These error messages are throttled at 30-second intervals. But, slow network performance and packet loss can result from the network instability that causes the STANDBY-3-DUPADDR error messages of the HSRP address.These error messages can appear:Oct 15 22:41:01: %STANDBY-3-DUPADDR: Duplicate address 10.25.0.1on Vlan25, sourced by 0000.0c07.ac19These messages specifically indicate that the router received a data packet that was sourced from the HSRP IP address on VLAN 25 with the MAC addresses 0000.0c07.ac19. Since the HSRP MAC address is 0000.0c07.ac19, either the router in question received its own packet back or both routers in the HSRP group went into the active state. Because the router received its own packet, the problem most likely is with the network rather than the router.A variety of problems can cause this behavior. Among the possible network problems that cause the error messages are:q Momentary STP loopsq EtherChannel configuration issuesq Duplicated framesWhen you troubleshoot these error messages, see the troubleshooting steps in the HSRP Troubleshooting Modules for CatOS Switches section of this document. All the troubleshooting modules are applicable to this section, which includes modules on configuration. In addition, note any errors in the switch log and reference additional case studies as necessary.You can use an access list in order to prevent the active router from receiving its own multicast hello packet. But, this is only a workaround for the error messages and actually hides the symptom of the problem. The workaround is to apply an extended inbound access list to the HSRP interfaces. The access list blocks all traffic that is sourced from the physical IP address and that is destined to all routers multicast address 224.0.0.2.access-list 101 deny ip host 172.16.12.3 host 224.0.0.2access-list 101 permit ip any anyinterface ethernet 0ip address 172.16.12.3 255.255.255.0standby 1 ip 172.16.12.1ip access-group 101 inCase Study #2: HSRP State Continuously Changes (Active, Standby, Speak) or % HSRP-6-STATECHANGEThese error messages can appear:Jan 9 08:00:42.623: %STANDBY-6-STATECHANGE: Standby: 49:Vlan149 state Standby -> ActiveJan 9 08:00:56.011: %STANDBY-6-STATECHANGE: Standby: 49:Vlan149 state Active -> SpeakJan 9 08:01:03.011: %STANDBY-6-STATECHANGE: Standby: 49:Vlan149 state Speak -> StandbyJan 9 08:01:29.427: %STANDBY-6-STATECHANGE: Standby: 49:Vlan149 state Standby -> ActiveJan 9 08:01:36.808: %STANDBY-6-STATECHANGE: Standby: 49:Vlan149 state Active -> SpeakJan 9 08:01:43.808: %STANDBY-6-STATECHANGE: Standby: 49:Vlan149 state Speak -> StandbyThese error messages describe a situation in which a standby HSRP router did not receive three successive HSRP hello packets from its HSRP peer. The output shows that the standby router moves from the standby state to the active state. Shortly thereafter, the router returns to the standby state. Unless this error message occurs during the initial installation, an HSRP issue probably does not cause the error message. The error messages signify the loss of HSRP hellos between the peers. When you troubleshoot this issue, you must verify the communication between the HSRP peers. A random, momentary loss of data communication between the peers is the most common problem that results in these messages. HSRP state changes are often due to High CPU Utilization. If the error message is due to high CPU utilization, put a sniffer on the network and the trace the system that causes the high CPU utilization.There are several possible causes for the loss of HSRP packets between the peers. The most common problems are physical layer problems, excessive network traffic caused by spanning tree issues or excessive traffic caused by each Vlan. As with Case Study #1, all the troubleshooting modules are applicable to the resolution of HSRP state changes, particularly the Layer 3 HSRP Debugging.If the loss of HSRP packets between peers is due to excessive traffic caused by each VLAN as mentioned, you can tune or increase the SPD and hold the queue size to overcome the input queue drop problem.In order to increase the Selective Packet Discard (SPD) size, go to the configuration mode and execute these commands on the Cat6500 switches:(config)# ip spd queue max-threshold 600!--- Hidden Command(config)# ip spd queue min-threshold 500!--- Hidden CommandNote: Refer to Understanding Selective Packet Discard (SPD) for more information on the SPD.In order to increase the hold queue size, go to the VLAN interface mode and execute this command.:。