In this demonstration,
I'll show you how an HSRP basic configuration provides default-gateway
router redundancy to host on the local area network.
Once configured,
I'll simulate an HSRP failover scenario by bringing down the active router.
In this way,
we'll see how HSRP reacts and uses gratuitous ARP to update hosts and
switches on the LAN to the location of the new active router.
Let's start by taking a look at the configuration on our LabRouter1 and I
want to show the running configuration on my interface f0/1,
which is facing my host on the LAN.
This interface has an IP address set to 20.
1.
254 with a /24 mask.
The HSRP configuration is only one line.
The standby command tells this interface it's going to
participate in the HSRP process.
The 20 is a group number associated with this HSRP process and shared
among all of the HSRP speaking routers on the LAN.
And the IP 20.
1.
1 sets the virtual IP address that is shared among all the HSRP speaking
routers and is going to be the default-gateway servicing the LAN.
Now let's take a look at our other HSRP router.
I'll show the running configuration for the interface FastEthernet 0/0,
in this case, LabRouter3's interface servicing the LAN.
It has an IP address set to 20.
1.
253/24.
Again,
the standby 20 tells the interface it's participating in the
HSRP process with a group number of 20, and again,
the IP 20.
1.
1 sets the virtual IP address so that this router can also participate
and service hosts as a default-gateway on the LAN.
This HSRP configuration also adds the priority 105 to the HSRP
group 20 process which will give this router priority when there
are elections to become the active router.
And finally,
the standby 20 preempt tells this router it's allowed to use that
priority to preempt other routers to become the active router and start
servicing hosts as the default-gateway for the LAN.
Now you'll notice this interface is in shutdown,
which means you can't forward pack it and it can't
participate in the HSRP process.
So let's start a Wireshark capture and put an ARP display filter on,
and let's turn on the HSRP process on LabRouter3.
I'll go to global configuration mode into the interface
FastEthernet 0/0 and give the no shutdown command,
which will bring this interface up.
Right away, we can see it's participating in the group 20 HSRP process,
and the last part of that HSRP state change notification lets us
know that it's moved to the active role and is now acting as the
default-gateway for hosts on the LAN.
Let's take a look and see if this generated any gratuitous ARPs.
When HSRP came on, it generated three gratuitous ARPs.
Let's take a look at one of them.
In this case,
LabRouter3 was set to preempt the other routers and become the active router.
For this reason,
gratuitous ARPs were sent to the LAN to notify all hosts of the
location of the new active default-gateway.
Of course, this gratuitous ARP is a broadcast to all hosts; however,
the source that MAC address,
00:00:0c:07:ac is what's called the HSRP well-known MAC address.
The last hexadecimal number 14 is simply the group
number 20 written in hexadecimal format.
In this way,
all the HSRP routers use a common virtual MAC address and
are able to communicate the group number.
Within the ARP header,
it looks like our standard reply with the opcode of
2 and a broadcast target MAC, but of course,
again, this is a gratuitous ARP,
so the sender and target IP addresses are set to the default-gateway IP address.
Let's check my host ARP cache and verify that the information is in there.
Arp -a allows me to see that the default-gateway is at
that exact HSRP well-known MAC address.
Interestingly enough, even if you're not the net admin,
if you know the well-known MAC addresses for the router redundancy protocols,
you can tell which one you're using in your LAN.
I'm going to exit my command prompt and start a new
capture for my HSRP failover demonstration.
To simulate HSRP failover,
I'm going to bring up the current active HSRP router
acting as the default-gateway for the LAN,
and I'm going to shut down its interface.
Once I do that, the interface goes down,
but also, it can't participate in the HSRP process.
What this means is our backup LabRouter1 had to become
the active HSRP gateway for the LAN.
Let's take a look at that router.
I'll show the standby HSRP information and we'll see that it's
participating in group 20 and the state is active.
That means this router is the active default-gateway for the LAN.
You can also see that the virtual IP address is set to that 20.
1.
1 that all the hosts are using and it's using that
well-known HSRP virtual MAC address.
Now let's take a look at what reaction this had in the network.
Back to my Wireshark capture, I can see some gratuitous ARPs already.
HSRP by default sends out three gratuitous ARPs,
two broadcasts for the LAN, and one to the STP UplinkFast MAC address.
Now in this case, LabRouter1 sent this gratuitous ARP,
although, you can't really tell from the packet details.
It's a broadcast to the LAN, it sources that well-known HSRP MAC address,
and again, as a gratuitous ARP,
it puts the HSRP virtual IP address as the sender and
target IP address in the ARP header.
Now although this may not have changed the host ARP caches,
because this router has a different physical link than LabRouter3 into the LAN,
the switch MAC address tables are going to reflect a new
path to the HSRP well-known MAC address.
In this way,
the failover was transparent to the hosts on the local area network and the
HSRP virtual IP address and MAC address continues with no interruption to provide default-gateway service to the hosts on the LAN.