HSRP – No longer for the weak of heart – Part2 LAB

HSRP – No longer for the weak of heart – Part2 LAB

Here is some of my testings

here is my Lab diagram

Simple config for testing 
R5 – Acting as HO
interface Ethernet0/0
no switchport
ip address 192.168.13.3 255.255.255.0
ip ospf network point-to-point
!
interface Ethernet0/1
no switchport
ip address 192.168.23.3 255.255.255.0
ip ospf network point-to-point
!
interface Ethernet0/2
!
interface Ethernet0/3
!
router ospf 1
router-id 3.3.3.3
redistribute connected subnets
passive-interface default
no passive-interface Ethernet0/0
no passive-interface Ethernet0/1
network 3.3.3.3 0.0.0.0 area 0
network 192.168.13.0 0.0.0.255 area 0
network 192.168.23.0 0.0.0.255 area 0
R4 = acting as Switch
interface Ethernet0/0
switchport access vlan 13
!
interface Ethernet0/1
switchport access vlan 23
!
interface Ethernet0/2
switchport access vlan 13
!
interface Ethernet0/3
switchport access vlan 23
R2 – As Branch router 1
track 2 ip sla 2 reachability
delay up 90
interface Ethernet0/1
no switchport
ip address 192.168.12.1 255.255.255.0
standby 1 ip 192.168.12.3
standby 1 priority 140
standby 1 preempt
standby 1 track 2 decrement 20
!
interface Ethernet0/2
no switchport
ip address 192.168.13.1 255.255.255.0
ip ospf network point-to-point
ip ospf 1 area 0
!
interface Ethernet0/3
!
router ospf 1
router-id 2.2.2.2
redistribute connected subnets
passive-interface default
no passive-interface Ethernet0/2
network 192.168.12.0 0.0.0.255 area 0
!
ip sla 2
icmp-echo 192.168.13.3 source-ip 192.168.13.1
frequency 5
ip sla schedule 2 life forever start-time now
R3 – Acting as Branch 2 router
interface Ethernet0/0
no switchport
ip address 192.168.12.2 255.255.255.0
standby 1 ip 192.168.12.3
standby 1 priority 130
standby 1 preempt
!
!
interface Ethernet0/3
no switchport
ip address 192.168.23.2 255.255.255.0
ip ospf network point-to-point
ip ospf 1 area 0
!
router ospf 1
router-id 1.1.1.1
redistribute connected subnets
passive-interface default
no passive-interface Ethernet0/3
network 192.168.12.0 0.0.0.255 area 0
R1 – Branch Switch
interface Ethernet0/0
switchport access vlan 12
!
interface Ethernet0/1
switchport access vlan 12
!
interface Ethernet0/2
switchport access vlan 12
VPC – virtual pc for testing
VPCS> show
NAME   IP/MASK              GATEWAY                             GATEWAY
VPCS1  192.168.12.254/24    192.168.12.3
       fe80::250:79ff:fe66:6806/64
Lets do some basic tests, before we break the network and confirm HSRP auto fail over works.
OSPF check :
HO#show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           0   FULL/  –        00:00:39    192.168.23.2    Ethernet0/1
2.2.2.2           0   FULL/  –        00:00:30    192.168.13.1    Ethernet0/0
BRR1#show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           0   FULL/  –        00:00:35    192.168.13.3    Ethernet0/2
BRR2#show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           0   FULL/  –        00:00:38    192.168.23.3    Ethernet0/3
Branch PC to HO connection testing :
VPCS> ping 3.3.3.3 -c 10000
84 bytes from 3.3.3.3 icmp_seq=1 ttl=254 time=1.567 ms
84 bytes from 3.3.3.3 icmp_seq=2 ttl=254 time=1.962 ms
84 bytes from 3.3.3.3 icmp_seq=3 ttl=254 time=2.235 ms
84 bytes from 3.3.3.3 icmp_seq=4 ttl=254 time=2.169 ms
84 bytes from 3.3.3.3 icmp_seq=5 ttl=254 time=1.960 ms
84 bytes from 3.3.3.3 icmp_seq=6 ttl=254 time=2.293 ms
Branch Rourter 1 acting as active :
BRR1#show standby brief
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Et0/1 1 140 P Active local 192.168.12.2 192.168.12.3
Branch Rourter 2 acting as standby :
BRR2#show standby brief
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Et0/0 1 130 P Standby 192.168.12.1 local 192.168.12.3
Lets check the IP SLA :
BRR1#show track 2 brief
Track Type Instance Parameter State Last Change
2 ip sla 2 reachability Up 00:06:10
BRR1#show ip sla statistics
IPSLAs Latest Operation Statistics
IPSLA operation id: 2
        Latest RTT: 2 milliseconds
Latest operation start time: 15:01:15 GMT Fri Apr 27 2015
Latest operation return code: OK
Number of successes: 631
Number of failures: 40
Operation time to live: Forever
Now everything working :
Lets break the connection on HO side and see how Auto failover works :
HO(config)#interface ethernet 0/0
HO(config-if)#sh
HO(config-if)#shutdown
HO(config-if)#
*Apr 27 15:03:01.423: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Ethernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
HO(config-if)#
*Apr 27 15:03:03.420: %LINK-5-CHANGED: Interface Ethernet0/0, changed state to administratively down
*Apr 27 15:03:04.424: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to down
BRR1#
*Apr 27 15:03:13.818: %TRACK-6-STATE: 2 ip sla 2 reachability Up -> Down
BRR1#
*Apr 27 15:03:14.057: %HSRP-5-STATECHANGE: Ethernet0/1 Grp 1 state Active -> Speak
BRR1#
*Apr 27 15:03:25.889: %HSRP-5-STATECHANGE: Ethernet0/1 Grp 1 state Speak -> Standby
BRR2#
*Apr 27 15:03:14.056: %HSRP-5-STATECHANGE: Ethernet0/0 Grp 1 state Standby -> Active
VPCS> ping 3.3.3.3 -c 10000
84 bytes from 3.3.3.3 icmp_seq=1 ttl=254 time=1.732 ms
84 bytes from 3.3.3.3 icmp_seq=2 ttl=254 time=2.101 ms
84 bytes from 3.3.3.3 icmp_seq=3 ttl=254 time=1.881 ms
84 bytes from 3.3.3.3 icmp_seq=4 ttl=254 time=2.291 ms
84 bytes from 3.3.3.3 icmp_seq=5 ttl=254 time=1.874 ms
84 bytes from 3.3.3.3 icmp_seq=6 ttl=254 time=1.998 ms
84 bytes from 3.3.3.3 icmp_seq=7 ttl=254 time=1.788 ms
84 bytes from 3.3.3.3 icmp_seq=8 ttl=254 time=2.079 ms
84 bytes from 3.3.3.3 icmp_seq=9 ttl=254 time=1.919 ms
84 bytes from 3.3.3.3 icmp_seq=10 ttl=254 time=1.682 ms
84 bytes from 3.3.3.3 icmp_seq=11 ttl=254 time=2.019 ms
84 bytes from 3.3.3.3 icmp_seq=12 ttl=254 time=1.721 ms
84 bytes from 3.3.3.3 icmp_seq=13 ttl=254 time=1.803 ms
3.3.3.3 icmp_seq=14 timeout
3.3.3.3 icmp_seq=15 timeout
3.3.3.3 icmp_seq=16 timeout
3.3.3.3 icmp_seq=17 timeout
3.3.3.3 icmp_seq=18 timeout
3.3.3.3 icmp_seq=19 timeout
3.3.3.3 icmp_seq=20 timeout
84 bytes from 3.3.3.3 icmp_seq=21 ttl=254 time=6.363 ms
84 bytes from 3.3.3.3 icmp_seq=22 ttl=254 time=2.410 ms
84 bytes from 3.3.3.3 icmp_seq=23 ttl=254 time=2.102 ms
84 bytes from 3.3.3.3 icmp_seq=24 ttl=254 time=1.862 ms
BRR2#show standby brief
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Et0/0 1 130 P Active local 192.168.12.1 192.168.12.3
BRR1#show standby brief 
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Et0/1 1 120 P Standby 192.168.12.2 local 192.168.12.3
See the Track and Sla Statistics :
BRR1#show track 2 brief
Track Type        Instance                   Parameter        State Last Change
2     ip sla      2                          reachability     Down  00:01:52
BRR1#show ip sla statistics
IPSLAs Latest Operation Statistics
IPSLA operation id: 2
        Latest RTT: NoConnection/Busy/Timeout
Latest operation start time: 15:04:55 GMT Fri Apr 27 2015
Latest operation return code: Timeout
Number of successes: 12
Number of failures: 12
Operation time to live: Forever
Lets bring back the HO interface and  check the network connectivity. – now you see seamlessly shift-over. :
HO#
*Apr 27 15:08:21.620: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Apr 27 15:08:22.620: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
HO#
*Apr 27 15:08:27.578: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Ethernet0/0 from LOADING to FULL, Loading Done
Now Track will take 90 seconds to bring the link, so we can do consistency check before preempt the link.
BRR1#
*Apr 27 15:09:58.976: %TRACK-6-STATE: 2 ip sla 2 reachability Down -> Up
BRR1#
BRR1#
*Apr 27 15:09:59.293: %HSRP-5-STATECHANGE: Ethernet0/1 Grp 1 state Standby -> Active
BRR2#
*Apr 27 15:09:59.294: %HSRP-5-STATECHANGE: Ethernet0/0 Grp 1 state Active -> Speak
BRR2#
*Apr 27 15:10:09.393: %HSRP-5-STATECHANGE: Ethernet0/0 Grp 1 state Speak -> Standby
No Ping loss from Client.
84 bytes from 3.3.3.3 icmp_seq=120 ttl=254 time=2.258 ms
84 bytes from 3.3.3.3 icmp_seq=121 ttl=254 time=1.883 ms
84 bytes from 3.3.3.3 icmp_seq=122 ttl=254 time=2.216 ms
84 bytes from 3.3.3.3 icmp_seq=123 ttl=254 time=1.882 ms
84 bytes from 3.3.3.3 icmp_seq=124 ttl=254 time=1.660 ms
84 bytes from 3.3.3.3 icmp_seq=125 ttl=254 time=1.969 ms
84 bytes from 3.3.3.3 icmp_seq=126 ttl=254 time=2.030 ms
84 bytes from 3.3.3.3 icmp_seq=127 ttl=254 time=1.626 ms
84 bytes from 3.3.3.3 icmp_seq=128 ttl=254 time=1.836 ms
84 bytes from 3.3.3.3 icmp_seq=129 ttl=254 time=2.023 ms
Now all back original status :
BRR1#show standby brief
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Et0/1 1 140 P Active local 192.168.12.2 192.168.12.3
BRR2#show standby brief
P indicates configured to preempt.
|
Interface Grp Pri P State Active Standby Virtual IP
Et0/0 1 130 P Standby 192.168.12.1 local 192.168.12.3
Happy Labbing ….!!