So that was the configuration for VLAN 10, that means that for the PC and VLAN 10 we can configure
the PC to use a default gateway of that HSRP router, the IP address that we need to configure the PC,
as is shown in the output here, 10.1.10.10,
so 10.1.10.10/24 subnet mask.
So I'll open up a command prompt.
IP config, that's the IP address of the PC, can it ping its default gateway?
Yes, it can.
Now notice the arp cache, notice the Mac address used here for the default gateway is the HSRP router.
In other words, the virtual Mac address, as we can see over here.
So once we've got our network configured, we should be able to ping devices in other VLANs. So let's
complete the configuration of HSRP and both of these core routers and then configure default gateways
on other devices and test connectivity.
So configuration on VLAN 10 is as follows, on VLAN 20 this device is not the spanning-tree root.
So we want core 2 to be
the HSRP active router for VLAN 20, because it's the root.
So all we'll do here is use the command standby IP 10.1.20.254 now before I configure switch
2 I want this device to become the active router.
So we need to give it some time
and then I'll show you what happens when the other device comes online with a higher priority and preemption.
Switch 2 will become the active router once we configure it, but notice now that core 1 is active.
So if I type show standby
for VLAN 20, the local router is the active router because the standby router is not known.
Virtual IP address is this notice the virtual Mac address is the same Mac address, but that's not a
problem because these devices are in different VLANs, so they don't see each others traffic.
So devices in one VLAN won't be confused with sending traffic to the wrong device in another VLAN
because VLANs separate Mac addresses.
So on the switch interface VLAN 20, standby one IP address.
is gonna be 10.1.20.254, but now what I'm gonna do is I'm going to force this device to
have a higher priority and I'm gonna force preemption so that it becomes the active router. Notice
as soon as I did that, it became active.
I'll show you in a moment what happens if we don't use preemption.
So show standby shows us that the local switch is the active router, virtual IP address is
this, local router is active.
Standby router is unknown but let's check again.
There you go.
Standby
router is core 1
and what you'll notice on core 1 is that the state changed to standby.
So show stand by again for VLAN20 shows us that this router is no longer the active router it is the
stand by router. Router 2 or Core 2 has become the active router
and we can see something similar on this side.
OK, so that's VLAN 20, show spanning-tree VLAN 30 core 1 is the root for VLAN 30.
So we want core 1 to become the HSRP active.
But let me show you what happens, firstly, if you don't configure preemption, so I'll specify on core 2 that
for VLAN 30 the standby router is 10.1.30.254
that's all I'll configure. Once again
for VLAN 10 and VLAN 30 we don't want the router to be the active router so all I've configured
is this command standby one, an IP address.
Now on core 1 interface VLAN 30 standby 1 IP 10.1.30.254 standby 1 priority
200.
So I'm going to change the priority but not configure preemption.
So notice the difference.
Show run shows us the output on VLAN 10
it's configured with preemption, on VLAN 30 it's not configured with preemption
and notice it became a standby device.
This device is already the active device.
So without preemption, if a device is already the active device or active router the other device
it is not gonna force itself to become the active router.
So show standby again.
Local router is the active router.
Just need to give it some time to sort itself out.
On this side it's going to stand by.
So core 1 has learnt that core 2 is the active router and the local device is the standby router.
On this site that should hopefully sort itself out, that might be a packet tracer issue, but notice
the local router is the active router.
We still see standby router as unknown.
The point is, is that this device, even though it's got a higher priority, has not become active.
And that's not what we want.
We want to type stand-by 1, preempt so that we force core 1 to become active and notice
now that I've done that, it's become the active router.
So Show Standby shows us that preemption is enabled and it's become the active router
and core 2 is now the standby router and we can see that in the output here.
So show standby.
We can see that the active
router is core 1 local router or local switch is the standby router.
So don't forget to specify both a priority and preemption.
Now, what about for VLAN 100? Show spanning tree and let's do that for VLAN 100.
In this example, we made switch 2 the route for VLAN 100 that may have been better to make switch
1 the route for VLAN 100
but I simply wanted to load the VLANs across the links and we have configured Ether channel here so
it will improve performance
but that means we need to configure core 2 as the HSP active router.