In the previous video, we made switch 1
the Spanning Tree root for VLAN 10 and VLAN 1
as well as making switch 2 the Spanning Tree root for VLAN 20
we can see that as an example by going into switch 1
and typing show spanning-tree vlan 10
Notice this switch or this bridge is the Spanning Tree root for VLAN 10
as well as the Spanning Tree root for VLAN 1
here's switch 2
so show spanning-tree vlan 20
this switch or bridge is the root for VLAN 20.
Once again, the reason why we use terms bridge
rather than switch in Spanning Tree
is that Spanning Tree has been around for a long time
so we talk about bridges rather than switches
in some of the Spanning Tree terminology.
Spanning Tree was developed when bridges were used instead of switches.
So we’ve got the roots configured in Spanning Tree.
We have enabled in previous videos redundancy between these switches.
So as an example, switch 3 has 2 uplinks to the core and so the switch 4
so we have redundancy at layer 1 and layer 2
but now we need to implement redundancy at layer 3.
Here’s the problem
root 1 which is acting as PC 1 in this topology is in VLAN 10.
It needs to be configured with the default gateway
so which switch will become its default gateway
switch 1 or switch 2? Both switches have IP addresses in VLAN 10.
Switch 1 is 10.1.10.1 and switch 2 is 10.1.10.2
so which switch will be configured as the default gateway
and what will happen when that switch goes down
as an example, you probably wanna make a switch 1 the default gateway
for router 1 because switch 1 is the Spanning Tree root
which should mean that traffic at both layer 2 and layer 3
will traverse this link and get to switch 1
the problem is, if you make switch 1 the default gateway for PCs
in VLAN 10 and switch 1 goes down
where will those PCs send their traffic?
they won’t be able to reach their default gateway
which means that they won’t be able to send traffic off VLAN 10.
in other words, they won’t be able to access the Internet
or other service and devices in a separate VLAN
the same is true for devices in VLAN 20
if VLAN 20 devices have switch 2 as the default gateway
in other words, we configured the default gateway as 10.1.20.2
and switch 2 goes down, what happens then?
the default gateway is down
which means that they won’t be able to for example ping devices in VLAN 10
or access devices on the Internet.
So this is where first hop redundancy protocols
such as Hot Standby router Protocol or HSRP are used.
HSRP is a Cisco propriety protocol
that allows you to implement first hop redundancy.
The industry standard version of the protocol
is VRRP or Virtual router Redundancy Protocol.
The idea here is that you configure your 2 switches
with a virtual IP address
these 2 switches will have an election
and choose who is in charge of forwarding traffic
on behalf of a virtual router
In this topology, we'll have 2 physical switches configured
with IP addresses in say VLAN 10 but a virtual switch
or a virtual router is created through the configuration
and that virtual router or virtual switch
becomes the default gateway for your devices.
I’ll talk about virtualrouters rather than virtual switches
or layer 3 switches for most of this discussion
because that’s how HSRP is written and describe
but essentially what you do on your PC is you configure
a default gateway of a virtual switch.
Logically a router is created through HSRP
now this router is not a physical router or real router
that’s going to exist in our topology.
It’s simply created through the HSRP commands configured on the switches.
PCs such as the PC in VLAN 10 will be configured
with a default gateway in our example of 10.0.254
so rather than the PC being configured
with the default gateway of switch 1 or switch 2
the default gateway is this virtual HSRP router
this HSRP router will have its own IP address as shown here for VLAN 10
we'll also configure another virtual router for VLAN 20.
In addition, this router has its own MAC address
based on a group number configured in the HSRP.
The PC's are unaware that they are talking to a virtual device
they think they’re talking to a physical router
but in actual fact, they're talking to the switches
which are pretending to be this virtual router
We can manipulate which physical switch
is going to be forwarding traffic on behalf of the virtual router
by changing a priority, the default priority in HSRP is 100
and the highest priority 1's
so we'll influence HSRP so that switch 1
becomes what’s called the active router for VLAN 10
and switch 2 will be the standby router for VLAN 20
switch 2 will be the active router
and switch 1 will be the standby router
and that’s because switch 1 is the root in Spanning Tree for VLAN 10
and switch 2 is the root in Spanning Tree for VLAN 20.
We want to ensure that traffic from this host in VLAN 20 is forwarded
to its default gateway here
which is the same device that’s a Spanning Tree root.
In other words, traffic will take this path
rather than the traffic having to go across multiple links
to get to the default gateway by the same token
this switch will be the active router or active forwarder for VLAN 10
so that VLAN 10 traffic uses this uplink
to get to the Spanning Tree root as well as the default gateway.