The Hot Standby Router Protocol (HSRP) is an IP routing redundancy protocol designed to allow for transparent failover at the first-hop IP router. HSRP provides high network availability, because it routes IP traffic from hosts on networks without relying on the availability of any single router. HSRP is used in a group of routers for selecting an active router and a standby router. (An active router is the router of choice for routing packets; a standby router is a router that takes over the routing duties when an active router fails, or when preset conditions are met.)
Configuration Example:
HSRP is handled a little differently With IOS XR. With IOS you configure your standby commands under the interfaces; in IOS XR you use ROUTER HSRP.
In below example we will configure HSRP for PE1 and PE2 interface gig0/0/0/1 and will use subnet 10.1.1.0/24
1st we will configure IP address to interface on PE1 and PE2:
RP/0/0/CPU0:PE1#conf t
Fri May 17 19:40:33.130 UTC
RP/0/0/CPU0:PE1(config)#int gig0/0/0/1
RP/0/0/CPU0:PE1(config-if)#ipv4 add 10.1.1.2 255.255.255.0
RP/0/0/CPU0:PE1(config-if)#no sh
RP/0/0/CPU0:PE1(config-if)#commit
Fri May 17 19:41:40.375 UTC
RP/0/0/CPU0:May 17 19:41:40.995 : ifmgr[223]: %PKT_INFRA-LINK-3-UPDOWN : Interface GigabitEthernet0/0/0/1, changed state to Down
RP/0/0/CPU0:May 17 19:41:41.035 : ifmgr[223]: %PKT_INFRA-LINK-3-UPDOWN : Interface GigabitEthernet0/0/0/1, changed state to Up
RP/0/0/CPU0:PE1(config-if)#end
RP/0/0/CPU0:PE2#conf t
Fri May 17 19:41:41.375 UTC
RP/0/0/CPU0:PE2(config)#int gig0/0/0/1
RP/0/0/CPU0:PE2(config-if)#ipv4 add 10.1.1.3 255.255.255.0
RP/0/0/CPU0:PE2(config-if)#no sh
RP/0/0/CPU0:PE2(config-if)#commit
Fri May 17 19:41:55.064 UTC
RP/0/0/CPU0:May 17 19:41:55.834 : ifmgr[223]: %PKT_INFRA-LINK-3-UPDOWN : Interface GigabitEthernet0/0/0/1, changed state to Down
RP/0/0/CPU0:May 17 19:41:55.884 : ifmgr[223]: %PKT_INFRA-LINK-3-UPDOWN : Interface GigabitEthernet0/0/0/1, changed state to Up
RP/0/0/CPU0:PE2(config-if)#end
RP/0/0/CPU0:PE2#
Let’s verify connectivity on PE1:
RP/0/0/CPU0:PE1#ping 10.1.1.3
Fri May 17 19:44:19.914 UTC
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/173/819 ms
RP/0/0/CPU0:PE1#
Now let’s configure HSRP on PE1 and PE2:
RP/0/0/CPU0:PE1#conf t
Fri May 17 20:05:59.395 UTC
RP/0/0/CPU0:PE1(config)#router hsrp
RP/0/0/CPU0:PE1(config-hsrp)#int gig0/0/0/1
RP/0/0/CPU0:PE1(config-hsrp-if)#address-family ipv4
RP/0/0/CPU0:PE1(config-hsrp-ipv4)#hsrp 1
RP/0/0/CPU0:PE1(config-hsrp-gp)#address 10.1.1.1
RP/0/0/CPU0:PE1(config-hsrp-gp)#priority 110
RP/0/0/CPU0:PE1(config-hsrp-gp)#preempt
RP/0/0/CPU0:PE1(config-hsrp-gp)#authentication cisco
RP/0/0/CPU0:PE1(config-hsrp-gp)#commit
Fri May 17 20:07:01.211 UTC
RP/0/0/CPU0:PE1(config-hsrp-gp)#end
RP/0/0/CPU0:PE1#
RP/0/0/CPU0:PE2#conf t
Fri May 17 20:08:05.236 UTC
RP/0/0/CPU0:PE2(config)#router hsrp
RP/0/0/CPU0:PE2(config-hsrp)#int gi0/0/0/1
RP/0/0/CPU0:PE2(config-hsrp-if)#address-family ipv4
RP/0/0/CPU0:PE2(config-hsrp-ipv4)#hsrp 1
RP/0/0/CPU0:PE2(config-hsrp-gp)#address 10.1.1.1
RP/0/0/CPU0:PE2(config-hsrp-gp)#authentication cisco
RP/0/0/CPU0:PE2(config-hsrp-gp)#commit
Fri May 17 20:09:15.331 UTC
RP/0/0/CPU0:PE2(config-hsrp-gp)#end
RP/0/0/CPU0:PE2#
To verify configuration on HSRP router use “sh running-config router hsrp” command.
RP/0/0/CPU0:PE1#sh running-config router hsrp
Fri May 17 20:23:31.853 UTC
router hsrp
interface GigabitEthernet0/0/0/1
address-family ipv4
hsrp 1
authentication cisco
preempt
priority 110
address 10.1.1.1
!
!
!
!
RP/0/0/CPU0:PE1#
RP/0/0/CPU0:PE2#sh running-config router hsrp
Fri May 17 20:23:35.143 UTC
router hsrp
interface GigabitEthernet0/0/0/1
address-family ipv4
hsrp 1
authentication cisco
address 10.1.1.1
!
!
!
!
RP/0/0/CPU0:PE2#
To verify HSRP states use “show hsrp” command.
RP/0/0/CPU0:PE1#sh hsrp
Fri May 17 20:29:32.108 UTC
IPv4 Groups:
P indicates configured to preempt.
|
Interface Grp Pri P State Active addr Standby addr Group addr
Gi0/0/0/1 1 110 P Active local 10.1.1.3 10.1.1.1
IPv6 Groups:
P indicates configured to preempt.
|
Interface Grp Pri P State Active addr Standby addr Group addr
RP/0/0/CPU0:PE1#
From the above output you can see that 10.1.1.1 is group address for group 1.we are active router and 10.1.1.3 is address of standby router.Local router priority is 110.
Also See HSRP states on PE2:
RP/0/0/CPU0:PE2#sh hsrp
Fri May 17 20:32:56.144 UTC
IPv4 Groups:
P indicates configured to preempt.
|
Interface Grp Pri P State Active addr Standby addr Group addr
Gi0/0/0/1 1 100 Standby 10.1.1.2 local 10.1.1.1
IPv6 Groups:
P indicates configured to preempt.
|
Interface Grp Pri P State Active addr Standby addr Group addr
RP/0/0/CPU0:PE2#
Everything is same except preemption and priority. P indicates configured to preempt and default priority is 100.
To see detail information you can use “show hsrp detail” command.
RP/0/0/CPU0:PE1#sh hsrp detail
Fri May 17 22:28:43.459 UTC
GigabitEthernet0/0/0/1 – IPv4 Group 1 (version 1)
Local state is Active, priority 110, may preempt
Hellotime 3000 msec holdtime 10000 msec
Minimum delay 1 sec, reload delay 5 sec
Hot standby IP address is 10.1.1.1 configured
Active router is local
Standby router is 10.1.1.3 expires in 00:00:08
Standby virtual mac address is 0000.0c07.ac01
9 state changes, last state change 00:50:16
State change history:
May 17 21:27:13.061 UTC Init -> Learn Virtual IP configured
May 17 21:34:12.543 UTC Learn -> Init Virtual IP configured
May 17 21:34:12.583 UTC Init -> Listen Virtual IP configured
May 17 21:34:22.602 UTC Listen -> Speak Active timer expired
May 17 21:34:32.621 UTC Speak -> Standby Standby timer expired
May 17 21:34:32.621 UTC Standby -> Active Active timer expired
May 17 21:37:45.708 UTC Active -> Init Virtual IP configured
May 17 21:38:26.405 UTC Init -> Listen Virtual IP configured
May 17 21:38:28.045 UTC Listen -> Active Lower priority active received
Last coup sent: May 17 21:38:28.145 UTC
Last coup received: Never
Last resign sent: May 17 21:37:45.708 UTC
Last resign received: May 17 21:38:28.145 UTC
RP/0/0/CPU0:PE2#sh hsrp detail
Fri May 17 22:30:48.070 UTC
GigabitEthernet0/0/0/1 – IPv4 Group 1 (version 1)
Local state is Standby, priority 100
Hellotime 3000 msec holdtime 10000 msec
Minimum delay 1 sec, reload delay 5 sec
Hot standby IP address is 10.1.1.1
Active router is 10.1.1.2, priority 110 expires in 00:00:09
Standby router is local
Standby virtual mac address is 0000.0c07.ac01
7 state changes, last state change 00:52:53
State change history:
May 17 21:26:26.244 UTC Init -> Learn Virtual IP configured
May 17 21:33:49.364 UTC Learn -> Listen Virtual IP learnt
May 17 21:33:59.383 UTC Listen -> Speak Standby timer expired
May 17 21:34:09.403 UTC Speak -> Standby Standby timer expired
May 17 21:37:02.451 UTC Standby -> Active Resign received
May 17 21:37:44.768 UTC Active -> Speak Higher priority active received
May 17 21:37:54.787 UTC Speak -> Standby Standby timer expired
Last coup sent: Never
Last coup received: May 17 21:37:44.868 UTC
Last resign sent: May 17 21:37:44.788 UTC
Last resign received: May 17 21:37:02.451 UTC
RP/0/0/CPU0:PE2#
Cisco IOS and IOS XR command comparison:
Cisco IOS | Cisco IOS XR |
Int fa0/0
ip add 10.1.1.2 255.255.255.0 Standby 1 ip 10.1.1.1 standby 1 preempt standby 1 priority 110 standby 1 authentication md5 key-string cisco standby 1 track 1 decrement 20
Verification: 1) show standby 2) show standby brief |
Int gig0/0/0/1
ipv4 add 10.1.1.2 255.255.255.0 router hsrp interface GigabitEthernet0/0/0/1 address-family ipv4 hsrp 1 address 10.1.1.1 preempt priority 110 authentication cisco track object 1 20
Verification: 1) sh run router hsrp 2) sh hsrp |
—Original Doc from https://supportforums.cisco.com/docs/DOC-33184
More Related Info:
Basic Information of Configuring HSRP on a Cisco Router