So here’s switch 1 sh ip int brief
We can see the IP address of switch 1 on VLAN 10 is 10.1.10.1
sh standby
shows me that this switch is the active router for VLAN 10
so what I'll do now started ping from router 1 to router 2
but make that continuous for the thousand pings
so conf t interface vlan 10
if I press enter to shut that down
I'll start the continuous ping on router 1
and now shut that interface on switch 1.
As you can see here the state went from Active to Init
and we're losing pings on router 1
we now however getting successful pings through do show standby on switch 1
notice, notice this switch has a state of Init because the interface is down
so active routers are known, standby routers are known on VLAN 20
it is still the standby router however on switch 2
sh standby
shows me that this switch is now the active router
these standby routers are known.
so once again at the moment router 1 can still ping router 2
and router 2 can still ping router 1.
We’ve just shut down VLAN 10 on switch 1
which means that router 1 cannot ping switch 1 on VLAN 10
and we can prove that by doing a ping to 10.1.10.1
the IP address of switch 1 on VLAN 10
notice the pings are failing
and that’s because the interface is shutdown on switch 1.
But router 1 acting as PC 1 is still able to communicate to the virtual router
because switch 2 is now replying as the virtual router
and is forwarding traffic on behalf of the virtual router.
So on switch 2 as an example
if we do debug ip icmp
and router 1 pings that virtual IP address
notice we see the output on switch 2
switch 2 is acting as the virtual router
and router 1 believes it's still talking to this HSRP device.
So now let’s do the reverse process
we'll do a ping again from router 1 to router 2
through the network and let's see what happens
when we bring up the VLAN interface on switch 1.
So do the ping again, no shut on switch 1
sh standby do sh standby
Now notice its went from listen to active
all I was doing that so the local router is the active router
the standby router is unknown at the moment.
Standby router is switch 2 and pings are now succeeding.
So we were able to prove that router 1 acting as PC 1
can ping router 2 acting as PC 2
through this network even when we bring down one of the interfaces
now you may be thinking that it takes too long for the pings to continue
but that’s space on this timers which we can change.
The default hello timer's 3 seconds
and the default hold timers is 10 seconds.
At the moment, we didn’t change the config of HSRP timers
we just left them at the default
but I could type standby 1 timers
and I can actually specify millisecond timers
but for now just specify a hello timer of 1 second
and a hold timer of 3 seconds.
So copy that config and go into switch 2 vlan 10
and change the timers so do show run interface vlan 10
that’s the config of HSRP on switch 2 VLAN 10
and do sh run int vlan 10 on switch 1
that’s the config on switch 1.
So let’s do the test again
int vlan 10 before I press enter here
let’s do a ping again
pings are succeeding shutdown the interface
notice we only lost 2 pings in this example
because I reduce the timers.
Switch 1 went from Active to Init
switch 2 notice on VLAN 10 groups 1 and from standby to active.
So we’ve managed to improve the performance
with a last only 2 pings in this topology
now once again you can reduce the packets lost even more
by using millisecond timers rather than second timers.
But for this topology and for the CCNA those timers are good enough.
So I'll do the ping again and then no shut the interface
let’s see how many pings we lose here
so interface has come up we’ve gone from Listen to Active
do show standby
local router is the active router
standby router is switch 2 and we didn’t lost any pings at all.
So that’s a much better response in what we have previously.
That’s an example of HSRP in a switch environment
showing you what happens when an interface or switch goes down.
I shutdown an interface
rather than rebooting the switch just to make it happen quicker
and allow us to see changes more easily
but you would see something similar
if you rebooted an entire switch or router when using HSRP.