OK, so let's see if we can complete this lab together.
The first thing we need to do is configure and optimize HSRP.
That means that we are going to configure HSRP on the core switch as in the topology, core 1 and core
2.
Core 1 and Core 2 are the switches that are configured with inter VLAN routing, as well as layer
3 IP addresses for the various VLANs.
In other words, they have these SVIs or switched virtual interfaces configured.
So they're going to be used as the default gateway for the PCs.
Now, we could configure the PCs to use switch 1 as their default gateway
or they could use switch 2 as their default gateway.
In other words, we could configure PCs in VLAN 10 to use this IP address as the default gateway
and perhaps for devices in VLAN 20 this IP address as the default gateway.
The problem with that is if this PC has core 1 configured as its default gateway and core 1
goes down, PCs and VLAN 10 will no longer be able to connect to devices and other VLANs because their
default gateway has gone down.
So the idea with HSRP or hot standby routing protocol and other protocols such as VRRP or Virtual
Router Redundancy Protocol and GLBP or Gateway Load Balancing Protocol is that they create a virtual
router or virtual default gateway.
So the idea is you run these protocols on the core switches and a virtual router or virtual default
gateway is created for the PCs.
If one of the core physical devices goes down, it's not a problem because the other physical device
will do the routing on behalf of that virtual router.
So we want to configure HSRP on these two core routers so that we have redundancy in case one of the physical
routers goes down.
PCs will still be able to use their virtual default gateway.
So on core 1 let's start with VLAN 10 the command to use is standby and you specify a number
you can do load sharing of traffic within a VLAN by using multiple group numbers. For the CCNA course
however, we're just going to use one group
number, the group number could be the same number as your VLAN number, but it doesn't have to be.
I'm simply going to use group number one on all the VLANs to show you that the group number is
not specific to a VLAN, group
numbers can be in this range.
So we type a standby group number 1, IP because we want to have HSRP configured for IPv4
and we specify a virtual IP address.
Now in this example, we want to optimize HSRP that means that we want core 1 to be the HSRP
active router for VLANs where it is the spanning-tree root. Notice for this VLAN
it's become active because there's no other router or switch configured for HSRP.
But the idea is the switch is the spanning-tree root for VLANs 1, 10 and 30.
We are going to want it to be the HSRP primary for those VLANs.
We don't want this switch to be the HSRP primary or active router for VLAN 10 because it means that traffic
will traverse across these links to get to the default gateway.
And in the same way, we don't want switch 1 to be the HSRP active router when switch 2 is the spanning
tree root for VLAN 20 because traffic would have to traverse this way to get to the HSRP default gateway.
So hence, we are going to match HSRP active routers to VLANs and a way to ensure that is to change
the priority of the active router the higher the priority, the more likely that that router or switch will
become the HSRP active forwarder or active router.
Default priority is 100, stand by one preempt allows us to force this switch to become the HSRP active
router when it's up.
So as an example, if it went down, so you turn off core 1, core 2 would become the HSRP active
router
while core 1 is down
but when you turn on core 1 and it boots up again, preemption will force it to become the HSRP active
router once again.
So show
standby
we can see that we've got a group configured on VLAN 10.
State is active, a virtual IP address is this, virtual Mac address is this, now this is the HSRP well
known Mac address.
This is the group number, group number is 1 because we created a group of one.
This is a hexadecimal number, if we had created Group 10, the Mac address would have ended in 0A,
A being hexadecimal for 10.
If we had created group 11, it would have been AB, B being hexadecimal for 11.
Active router is the local router preemption is enabled standby, router is not known yet we haven't configured
switch 2, so switch 1 doesn't know about another
HSRP router, priority is 200.
On this side, if we type show stand by, we see nothing because we haven't configured HSRP on the
switch yet, so on the same VLAN, VLAN 10, standby, make sure that you use the same number on both
sides.
IP same IP address.
In other words, same virtual IP address.
Now, we could specify a priority here.
We don't need to because the default is already 100 but if we type show run and have a look at
the configuration on VLAN
10 notice the property is not displayed because it's the default priority the router has become a
standby.
I just hope he goes through different states and the state is standby.
So show standby shows us that for this group.
The local switch is a standby switch.
Do the command again here.
Switch 1 or core 1 is the active router,
core 2 is the standby router or standby switch, it's a layer 3 switch but it's acting like a router.
So forgive me if I use the terms interchangeably, a virtual IP address is that notice Mac address is
the same, standby router is the local router, active router is core
1 priority is this,
that is the default.
On this side, we've got an active router being the local router and it's now learnt about core 2 being
the standby router.