- Resilience in networks is something I always shoot for.
But how can that be obtained for a host default gateway?
The answer is first hop redundancy protocols.
It's a practical technique for hosts,
but is especially useful for server infrastructure.
Take this diagram for example,
it's common to have multiple redundant switches
connected in a LAN.
But if they go back to a single router,
that is a single point of failure.
Obviously, it's important to eliminate all single points
of failure but in some critical portions of the network,
it makes sense to add as much redundancy as possible.
A first hop Redundancy Protocol allows for one or
more redundant routers to act as a default gateway
for devices on a subnet.
The idea being that a router can unexpectedly fail
and another one will seamlessly take its place
without users noticing.
This is actually achieved fairly cleverly.
First, all hosts continue to utilize a standard default
gateway configuration invisible to them.
Each router participating in the first hop Redundancy
Protocol is configured to share a virtual IP.
It's this virtual IP that hosts have configured
to be their default gateway.
The participating first hop Redundancy Protocol routers
exchange messages or the layer two segment to determine
which will actively hold the virtual IP.
These messages are also used to determine if the
virtual IP holder is still alive.
If there is a failure of the virtual IP holder,
then one of the others will seamlessly take over advertising
the virtual IP and accepting host traffic.
There are actually three protocols that can be used
for FHRP hot standby routing protocol,
virtual router Redundancy Protocol,
and gateway load balancing protocol.
HSRP is a Cisco proprietary protocol
though it's quite popular.
In fact, I use it in several of my networks,
HSRP acts and active and standby modes,
all the routers participating in HSRP will negotiate
and determine which router should be active.
The active router will begin responding to ARP request
for any hosts queering for the virtual IP.
If the active router fails, then the next preferred HSRP
router will begin answering our requests for the virtual IP
using the same virtual MAC address.
By default, when the failed router returns,
nothing happens it will simply go back into the pool
of available HSRP routers,
there is a concept of preemption that can be enabled.
So when the failed router comes back online after a defined
wait time, it will take the role of active router back over.
HSRP can also be used for a form of load balancing.
If two routers are running router on a stick
like in this example, then different routers can be the
active router on different VLANs the splitting the load.
If one router fails, then the standby router will take over
for the remaining HSRP sessions.
VRRP is extremely similar to HSRP
The few subtle differences.
One is that it defaults to using preemption.
Other differences come down to how many VRRP routers
can be on a single segment and virtual MAC addresses
they're used.
Cisco proprietary gateway load balancing protocol operates
similarly but also allows multiple gateways
to forward traffic simultaneously.
FHRPS are a convenient way to add additional
resilience to many networks in many different environments.