The Hot Standby Router Protocol, HSRP, provides a mechanism which is designed to
support non-disruptive failover of IP traffic.
In particular, the protocol protects against the failure of the first hop router when the source host cannot
learn the IP address of the first hop router dynamically.
The protocol is designed for use over multi-access, multicast or broadcast capable LANs. A single router elected from the group is responsible for forwarding 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.
Only the active and the standby routers send periodic HSRP messages once the protocol has completed the election process. 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.
Opcode
State
Hellotime.
8 bits.
Default = 3 seconds
Holdtime. 8 bits. Default = 10 seconds.
Priority. 8 bits. Group. 8 bits. Reserved. 8 bits.
Authentication Data. 8 bytes.
Virtual IP Address. 32 bits.
R1(config-if)#do show run int f0/0
interface FastEthernet0/0
ip address 123.1.1.1 255.255.255.0
duplex auto
speed auto
standby ip 123.1.1.12
end
R2(config-if)#do show run int f0/0
interface FastEthernet0/0
ip address 123.1.1.2 255.255.255.0
duplex auto
speed auto
standby ip 123.1.1.12
end
R2 is elected as the active router, to happen the failover now we shut the R2 F0/0 link
ARP learning
R1 is selected as the active router once failover process is complete
R2(config)#int f0/0
R2(config-if)#no shut
R2(config-if)#
*Mar 1 00:37:17.695: HSRP: Fa0/0 API 123.1.1.2 is not an HSRP address
*Mar 1 00:37:17.699: HSRP: Fa0/0 API MAC address update
*Mar 1 00:37:17.703: HSRP: Fa0/0 API Software interface coming up
*Mar 1 00:37:17.707: HSRP: Fa0/0 Interface up
*Mar 1 00:37:17.707: HSRP: Fa0/0 Starting minimum interface delay (1 secs)
*Mar 1 00:37:17.707: HSRP: Fa0/0 API Software interface coming up
*Mar 1 00:37:17.711: HSRP: Fa0/0 API Add active HSRP addresses to ARP table
*Mar 1 00:37:17.715: HSRP: Fa0/0 API Add active HSRP addresses to ARP table
*Mar 1 00:37:17.803: HSRP: Fa0/0 Grp 0 Hello in 123.1.1.1 Active pri 100 vIP 123.1.1.12
*Mar 1 00:37:17.807: HSRP: Fa0/0 Grp 0 Active router is 123.1.1.1
*Mar 1 00:37:18.707: HSRP: Fa0/0 Interface min delay expired
*Mar 1 00:37:18.707: HSRP: Fa0/0 Grp 0 Init: a/HSRP enabled
*Mar 1 00:37:18.707: HSRP: Fa0/0 Grp 0 Init -> Listen
*Mar 1 00:37:18.707: HSRP: Fa0/0 Redirect adv out, Passive, active 0 passive 1
*Mar 1 00:37:18.711: HSRP: Fa0/0 Grp 0 Redundancy "hsrp-Fa0/0-0" state Init -> Backup
*Mar 1 00:37:19.699: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar 1 00:37:19.699: HSRP: API Hardware state change
*Mar 1 00:37:20.699: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
*Mar 1 00:37:21.275: HSRP: Fa0/0 Grp 0 Hello in 123.1.1.1 Active pri 100 vIP 123.1.1.12
*Mar 1 00:37:24.531: HSRP: Fa0/0 Grp 0 Hello in 123.1.1.1 Active pri 100 vIP 123.1.1.12
*Mar 1 00:37:27.467: HSRP: Fa0/0 Grp 0 Hello in 123.1.1.1 Active pri 100 vIP 123.1.1.12
*Mar 1 00:37:28.707: HSRP: Fa0/0 Grp 0 Listen: d/Standby timer expired (unknown)
*Mar 1 00:37:28.707: HSRP: Fa0/0 Grp 0 Listen -> Speak
*Mar 1 00:37:28.707: HSRP: Fa0/0 Grp 0 Redundancy "hsrp-Fa0/0-0" state Backup -> Speak
*Mar 1 00:37:28.707: HSRP: Fa0/0 Grp 0 Hello out 123.1.1.2 Speak pri 100 vIP 123.1.1.12
*Mar 1 00:37:30.443: HSRP: Fa0/0 Grp 0 Hello in 123.1.1.1 Active pri 100 vIP 123.1.1.12
*Mar 1 00:37:31.711: HSRP: Fa0/0 Grp 0 Hello out 123.1.1.2 Speak pri 100 vIP 123.1.1.12
*Mar 1 00:37:33.895: HSRP: Fa0/0 Grp 0 Hello in 123.1.1.1 Active pri 100 vIP 123.1.1.12
*Mar 1 00:37:34.711: HSRP: Fa0/0 Grp 0 Hello out 123.1.1.2 Speak pri 100 vIP 123.1.1.12
*Mar 1 00:37:36.987: HSRP: Fa0/0 Grp 0 Hello in 123.1.1.1 Active pri 100 vIP 123.1.1.12
*Mar 1 00:37:37.711: HSRP: Fa0/0 Grp 0 Hello out 123.1.1.2 Speak pri 100 vIP 123.1.1.12
*Mar 1 00:37:38.707: HSRP: Fa0/0 Grp 0 Speak: d/Standby timer expired (unknown)
*Mar 1 00:37:38.707: HSRP: Fa0/0 Grp 0 Standby router is local
*Mar 1 00:37:38.707: HSRP: Fa0/0 Grp 0 Speak -> Standby
*Mar 1 00:37:38.707: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 0 state Speak -> Standby
*Mar 1 00:37:38.711: HSRP: Fa0/0 Grp 0 Redundancy "hsrp-Fa0/0-0" state Speak -> Standby
*Mar 1 00:37:38.711: HSRP: Fa0/0 Grp 0 Hello out 123.1.1.2 Standby pri 100 vIP 123.1.1.12
*Mar 1 00:37:39.587: HSRP: Fa0/0 Grp 0 Hello in 123.1.1.1 Active pri 100 vIP 123.1.1.12
*Mar 1 00:37:41.711: HSRP: Fa0/0 Grp 0 Hello out 123.1.1.2 Standby pri 100 vIP 123.1.1.12
Only the active and the standby routers send periodic HSRP messages once the protocol has completed the election process. 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.
Opcode
Description | |
---|---|
0 | Hello. The router is running and is capable of becoming the active or standby router. |
1 | Coup. The router wishes to become the active router. |
2 | Resign. The router no longer wishes to be the active router. |
State
Description | |
---|---|
0 | Initial. This is the starting state and indicates that HSRP is not running. This state is entered via a configuration change or when an interface first comes up. |
1 | Learn. The router has not determined the virtual IP address, and not yet seen an authenticated Hello message from the active router. In this state the router is still waiting to hear from the active router. |
2 | Listen. The router knows the virtual IP address, but is neither the active router nor the standby router. It listens for Hello messages from those routers. |
4 | Speak. The router sends periodic Hello messages and is actively participating in the election of the active and/or standby router. A router cannot enter Speak state unless it has the virtual IP address. |
8 | Standby. The router is a candidate to become the next active router and sends periodic Hello messages. Excluding transient conditions, there MUST be at most one router in the group in Standby state. |
16 | Active. The router is currently forwarding packets that are sent to the group's virtual MAC address. The router sends periodic Hello messages. Excluding transient conditions, there MUST be at most one router in Active state in the group. |
Holdtime. 8 bits. Default = 10 seconds.
Priority. 8 bits. Group. 8 bits. Reserved. 8 bits.
Authentication Data. 8 bytes.
Virtual IP Address. 32 bits.
R1(config-if)#do show run int f0/0
interface FastEthernet0/0
ip address 123.1.1.1 255.255.255.0
duplex auto
speed auto
standby ip 123.1.1.12
end
R2(config-if)#do show run int f0/0
interface FastEthernet0/0
ip address 123.1.1.2 255.255.255.0
duplex auto
speed auto
standby ip 123.1.1.12
end
R2 is elected as the active router, to happen the failover now we shut the R2 F0/0 link
ARP learning
R1 is selected as the active router once failover process is complete
R2(config)#int f0/0
R2(config-if)#no shut
R2(config-if)#
*Mar 1 00:37:17.695: HSRP: Fa0/0 API 123.1.1.2 is not an HSRP address
*Mar 1 00:37:17.699: HSRP: Fa0/0 API MAC address update
*Mar 1 00:37:17.703: HSRP: Fa0/0 API Software interface coming up
*Mar 1 00:37:17.707: HSRP: Fa0/0 Interface up
*Mar 1 00:37:17.707: HSRP: Fa0/0 Starting minimum interface delay (1 secs)
*Mar 1 00:37:17.707: HSRP: Fa0/0 API Software interface coming up
*Mar 1 00:37:17.711: HSRP: Fa0/0 API Add active HSRP addresses to ARP table
*Mar 1 00:37:17.715: HSRP: Fa0/0 API Add active HSRP addresses to ARP table
*Mar 1 00:37:17.803: HSRP: Fa0/0 Grp 0 Hello in 123.1.1.1 Active pri 100 vIP 123.1.1.12
*Mar 1 00:37:17.807: HSRP: Fa0/0 Grp 0 Active router is 123.1.1.1
*Mar 1 00:37:18.707: HSRP: Fa0/0 Interface min delay expired
*Mar 1 00:37:18.707: HSRP: Fa0/0 Grp 0 Init: a/HSRP enabled
*Mar 1 00:37:18.707: HSRP: Fa0/0 Grp 0 Init -> Listen
*Mar 1 00:37:18.707: HSRP: Fa0/0 Redirect adv out, Passive, active 0 passive 1
*Mar 1 00:37:18.711: HSRP: Fa0/0 Grp 0 Redundancy "hsrp-Fa0/0-0" state Init -> Backup
*Mar 1 00:37:19.699: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar 1 00:37:19.699: HSRP: API Hardware state change
*Mar 1 00:37:20.699: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
*Mar 1 00:37:21.275: HSRP: Fa0/0 Grp 0 Hello in 123.1.1.1 Active pri 100 vIP 123.1.1.12
*Mar 1 00:37:24.531: HSRP: Fa0/0 Grp 0 Hello in 123.1.1.1 Active pri 100 vIP 123.1.1.12
*Mar 1 00:37:27.467: HSRP: Fa0/0 Grp 0 Hello in 123.1.1.1 Active pri 100 vIP 123.1.1.12
*Mar 1 00:37:28.707: HSRP: Fa0/0 Grp 0 Listen: d/Standby timer expired (unknown)
*Mar 1 00:37:28.707: HSRP: Fa0/0 Grp 0 Listen -> Speak
*Mar 1 00:37:28.707: HSRP: Fa0/0 Grp 0 Redundancy "hsrp-Fa0/0-0" state Backup -> Speak
*Mar 1 00:37:28.707: HSRP: Fa0/0 Grp 0 Hello out 123.1.1.2 Speak pri 100 vIP 123.1.1.12
*Mar 1 00:37:30.443: HSRP: Fa0/0 Grp 0 Hello in 123.1.1.1 Active pri 100 vIP 123.1.1.12
*Mar 1 00:37:31.711: HSRP: Fa0/0 Grp 0 Hello out 123.1.1.2 Speak pri 100 vIP 123.1.1.12
*Mar 1 00:37:33.895: HSRP: Fa0/0 Grp 0 Hello in 123.1.1.1 Active pri 100 vIP 123.1.1.12
*Mar 1 00:37:34.711: HSRP: Fa0/0 Grp 0 Hello out 123.1.1.2 Speak pri 100 vIP 123.1.1.12
*Mar 1 00:37:36.987: HSRP: Fa0/0 Grp 0 Hello in 123.1.1.1 Active pri 100 vIP 123.1.1.12
*Mar 1 00:37:37.711: HSRP: Fa0/0 Grp 0 Hello out 123.1.1.2 Speak pri 100 vIP 123.1.1.12
*Mar 1 00:37:38.707: HSRP: Fa0/0 Grp 0 Speak: d/Standby timer expired (unknown)
*Mar 1 00:37:38.707: HSRP: Fa0/0 Grp 0 Standby router is local
*Mar 1 00:37:38.707: HSRP: Fa0/0 Grp 0 Speak -> Standby
*Mar 1 00:37:38.707: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 0 state Speak -> Standby
*Mar 1 00:37:38.711: HSRP: Fa0/0 Grp 0 Redundancy "hsrp-Fa0/0-0" state Speak -> Standby
*Mar 1 00:37:38.711: HSRP: Fa0/0 Grp 0 Hello out 123.1.1.2 Standby pri 100 vIP 123.1.1.12
*Mar 1 00:37:39.587: HSRP: Fa0/0 Grp 0 Hello in 123.1.1.1 Active pri 100 vIP 123.1.1.12
*Mar 1 00:37:41.711: HSRP: Fa0/0 Grp 0 Hello out 123.1.1.2 Standby pri 100 vIP 123.1.1.12
No comments:
Post a Comment