CCNP Switch - HSRP Lab

HSRP Topology
Enable HSRP
R1# (first will be configured)
!
interface FastEthernet1/0
 ip address 192.168.0.100 255.255.255.0
 duplex auto
 speed auto
 standby 1 ip 192.168.0.1
!
R2#
!
interface FastEthernet1/0
 ip address 192.168.0.200 255.255.255.0
 duplex auto
 speed auto
 standby 1 ip 192.168.0.1
end

HSRP Election as views on R2
*Oct 19 13:29:44.563: HSRP: Fa1/0 Interface UP
*Oct 19 13:29:44.571: HSRP: Fa1/0 Initialize swsb, Intf state Up
*Oct 19 13:29:44.571: HSRP: Fa1/0 Starting minimum intf delay (1 secs)
*Oct 19 13:29:44.575: HSRP: Fa1/0 Grp 1 Set virtual MAC 0000.0c07.ac01 type: v1 default
*Oct 19 13:29:44.575: HSRP: Fa1/0 MAC hash entry 0000.0c07.ac01, Added Fa1/0 Grp 1 to list
*Oct 19 13:29:44.579: HSRP: Fa1/0 Added 192.168.0.1 to hash table
*Oct 19 13:29:44.583: HSRP: Fa1/0 Grp 1 Has mac changed? cur 0000.0c07.ac01 new 0000.0c07.ac01
*Oct 19 13:29:44.583: HSRP: Fa1/0 Grp 1 Disabled -> Init
*Oct 19 13:29:44.583: HSRP: Fa1/0 Grp 1 Redundancy "hsrp-Fa1/0-1" state Disabled -> Init
*Oct 19 13:29:44.587: HSRP: Fa1/0 IP Redundancy "hsrp-Fa1/0-1" added
*Oct 19 13:29:44.587: HSRP: Fa1/0 IP Redundancy "hsrp-Fa1/0-1" update, Disabled -> Init
*Oct 19 13:29:45.571: HSRP: Fa1/0 Intf min delay expired
*Oct 19 13:29:45.571: HSRP: Fa1/0 Grp 1 Init: a/HSRP enabled
*Oct 19 13:29:45.571: HSRP: Fa1/0 Grp 1 Init -> Listen
*Oct 19 13:29:45.571: HSRP: Fa1/0 Interface adv out, Passive, active 0 passive 1
*Oct 19 13:29:45.575: HSRP: Fa1/0 Grp 1 Redundancy "hsrp-Fa1/0-1" state Init -> Backup
*Oct 19 13:29:45.575: HSRP: Fa1/0 IP Redundancy "hsrp-Fa1/0-1" update, Init -> Backup
*Oct 19 13:29:46.587: HSRP: Fa1/0 Grp 1 Hello  in  192.168.0.100 Active  pri 100 vIP 192.168.0.1
*Oct 19 13:29:46.591: HSRP: Fa1/0 Grp 1 Active router is 192.168.0.100
*Oct 19 13:29:46.591: HSRP: Fa1/0 Nbr 192.168.0.100 created
*Oct 19 13:29:46.591: HSRP: Fa1/0 Nbr 192.168.0.100 active for group 1
*Oct 19 13:29:46.591: HSRP: Fa1/0 Interface adv out, Passive, active 0 passive 1
*Oct 19 13:29:49.211: HSRP: Fa1/0 Grp 1 Hello  in  192.168.0.100 Active  pri 100 vIP 192.168.0.1
*Oct 19 13:29:52.023: HSRP: Fa1/0 Grp 1 Hello  in  192.168.0.100 Active  pri 100 vIP 192.168.0.1
*Oct 19 13:29:55.043: HSRP: Fa1/0 Grp 1 Hello  in  192.168.0.100 Active  pri 100 vIP 192.168.0.1
*Oct 19 13:29:56.787: HSRP: Fa1/0 Grp 1 Listen: d/Standby timer expired (unknown)
*Oct 19 13:29:56.787: HSRP: Fa1/0 Grp 1 Listen -> Speak
*Oct 19 13:29:56.787: HSRP: Fa1/0 Grp 1 Redundancy "hsrp-Fa1/0-1" state Backup -> Speak
*Oct 19 13:29:56.791: HSRP: Fa1/0 Grp 1 Hello  out 192.168.0.200 Speak   pri 100 vIP 192.168.0.1
*Oct 19 13:29:56.791: HSRP: Fa1/0 IP Redundancy "hsrp-Fa1/0-1" update, Backup -> Speak
*Oct 19 13:29:57.943: HSRP: Fa1/0 Grp 1 Hello  in  192.168.0.100 Active  pri 100 vIP 192.168.0.1
*Oct 19 13:29:59.419: HSRP: Fa1/0 Grp 1 Hello  out 192.168.0.200 Speak   pri 100 vIP 192.168.0.1
*Oct 19 13:30:00.539: HSRP: Fa1/0 Grp 1 Hello  in  192.168.0.100 Active  pri 100 vIP 192.168.0.1
*Oct 19 13:30:01.963: HSRP: Fa1/0 Grp 1 Hello  out 192.168.0.200 Speak   pri 100 vIP 192.168.0.1
*Oct 19 13:30:03.243: HSRP: Fa1/0 Grp 1 Hello  in  192.168.0.100 Active  pri 100 vIP 192.168.0.1
*Oct 19 13:30:04.511: HSRP: Fa1/0 Grp 1 Hello  out 192.168.0.200 Speak   pri 100 vIP 192.168.0.1
*Oct 19 13:30:05.783: HSRP: Fa1/0 Grp 1 Hello  in  192.168.0.100 Active  pri 100 vIP 192.168.0.1
*Oct 19 13:30:07.391: HSRP: Fa1/0 Grp 1 Hello  out 192.168.0.200 Speak   pri 100 vIP 192.168.0.1
*Oct 19 13:30:08.031: HSRP: Fa1/0 Grp 1 Speak: d/Standby timer expired (unknown)
*Oct 19 13:30:08.031: HSRP: Fa1/0 Grp 1 Standby router is local
*Oct 19 13:30:08.031: HSRP: Fa1/0 Grp 1 Speak -> Standby
*Oct 19 13:30:08.031: %HSRP-5-STATECHANGE: FastEthernet1/0 Grp 1 state Speak -> Standby
*Oct 19 13:30:08.035: HSRP: Fa1/0 Grp 1 Redundancy "hsrp-Fa1/0-1" state Speak -> Standby
*Oct 19 13:30:08.035: HSRP: Fa1/0 Grp 1 Hello  out 192.168.0.200 Standby pri 100 vIP 192.168.0.1
*Oct 19 13:30:08.039: HSRP: Fa1/0 IP Redundancy "hsrp-Fa1/0-1" standby, unknown -> local
*Oct 19 13:30:08.039: HSRP: Fa1/0 IP Redundancy "hsrp-Fa1/0-1" update, Speak -> Standby
*Oct 19 13:30:08.775: HSRP: Fa1/0 Grp 1 Hello  in  192.168.0.100 Active  pri 100 vIP 192.168.0.1
*Oct 19 13:30:10.615: HSRP: Fa1/0 Grp 1 Hello  out 192.168.0.200 Standby pri 100 vIP 192.168.0.1
*Oct 19 13:30:11.631: HSRP: Fa1/0 Grp 1 Hello  in  192.168.0.100 Active  pri 100 vIP 192.168.0.1
*Oct 19 13:30:13.163: HSRP: Fa1/0 Interface adv out, Passive, active 0 passive 1
*Oct 19 13:30:13.339: HSRP: Fa1/0 Grp 1 Hello  out 192.168.0.200 Standby pri 100 vIP 192.168.0.1
*Oct 19 13:30:14.251: HSRP: Fa1/0 Grp 1 Hello  in  192.168.0.100 Active  pri 100 vIP 192.168.0.1
*Oct 19 13:30:15.859: HSRP: Fa1/0 Grp 1 Hello  out 192.168.0.200 Standby pri 100 vIP 192.168.0.1
*Oct 19 13:30:17.119: HSRP: Fa1/0 Grp 1 Hello  in  192.168.0.100 Active  pri 100 vIP 192.168.0.1

Check HSRP status
R1#sh standby  br
                     P indicates configured to preempt.
                     |
Interface   Grp  Pri P State   Active          Standby         Virtual IP
Fa1/0       1    100   Active  local           192.168.0.200   192.168.0.1
R1#
R2#sh standby br
                     P indicates configured to preempt.
                     |
Interface   Grp  Pri P State   Active          Standby         Virtual IP
Fa1/0       1    100   Standby 192.168.0.100   local           192.168.0.1
R2#

Check redundancy

disable uplink from Active router
R5(config-router)#int fa 0/0
R5(config-if)#sh
*Oct 19 13:34:00.283: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 10.0.15.1 (FastEthernet0/0) is down: interface down
*Oct 19 13:34:02.151: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down
*Oct 19 13:34:03.151: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
R5(config-if)#
Traffic will go suboptimal way, because HSRP Active router didn't change
R3#ping 8.8.8.8 repeat 1000

Type escape sequence to abort.
Sending 1000, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!........!!!!!!!!!!!!!
Timeout is 8x2 ~16 seconds, is mainly caused by EIGRP timeout (in GNS3 L1 of fa 0/0 on R1 will not be down even on another end is admin down)

Track configuration
To change this behavior we'll need to configure 'track' option.
R1 uplink interface (fa 0/0)  will be tracked and if status changed to down, HSRP role will be changed automatically to be STANDY Router.

R1(config)#int fa 0/0
R1(config-if)#sh
*Oct 19 13:58:01.435: %TRACKING-5-STATE: 1 interface Fa0/0 line-protocol Up->Down
*Oct 19 13:58:03.431: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down
*Oct 19 13:58:04.431: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
R1#sh track
Track 1  (via HSRP)
  Interface FastEthernet0/0 line-protocol
  Line protocol is Down (hw admin-down)
    2 changes, last change 00:02:27
  Tracked by:
    HSRP FastEthernet1/0 1
R1#
R1#sh standby br
                     P indicates configured to preempt.
                     |
Interface   Grp  Pri P State   Active          Standby         Virtual IP
Fa1/0       1    90    Active  local           192.168.0.200   192.168.0.1
R1#

Make R2 active in case R1 (active) will lower his priority
R2(config)#interface FastEthernet1/0
R2(config-if)#standby 1 preempt delay minimum 3
*Oct 19 14:05:36.515: %HSRP-5-STATECHANGE: FastEthernet1/0 Grp 1 state Standby -> Active

-No packet loss from R3 to R5