www.cisconetsolutions.
com
First Hop Redundancy Protocol
The purpose of a default gateway is to provide routing services to
endpoints. It is a network interface with an IP address on a Layer 3
network device. The default gateway is an upstream router or Layer 3
switch for client and server endpoints. Any packets destined for a remote
subnet are forwarded to the default gateway. DHCP service is often
enabled to automatically configure a default gateway address on each
endpoint. There is only a single default gateway address on any host
client or network server.
Figure 1 First Hop Redundancy Protocol Operation
First Hop Redundancy Protocol (FHRP) is a routing configuration that
creates a virtual router from at least two physical routers. The purpose is
to enable default gateway redundancy or failover. All packets from a host
are automatically forwarded to the standby default gateway when the
primary gateway fails. As a result the standby router becomes the new
default gateway for endpoints at the access layer. There are both open
standard and Cisco proprietary protocols that enable FHRP. The most
commonly deployed FHRP in the enterprise is Cisco HSRP.
www.cisconetsolutions.com
Cisco Gateway Load Balancing Protocol (GLBP) and open standard
VRRP are available as well. The main usage for VRRP is firewall and
load balancer failover. Consider that routing and path forwarding is
always per hop between Layer 3 devices. It is the next hop neighbor that
is identified for packet forwarding. That continues until packets arrive at a
destination. The default gateway is first hop from an endpoint in the
forwarding path to a destination endpoint.
Figure 1 is an example of FHRP operation configured for endpoints in
192.168.1.0/24 subnet. The router interface is assigned within that same
subnet. Since there are often multiple host VLANs at the access layer, it
is more common to use a Layer 3 switch. The VLAN interface, called an
SVI, serves as default gateway for each host VLAN on Layer 3 switch. It
is a logical interface and not physical interface.
FHRP Operation
FHRP creates a virtual shared router from at least two physical routers.
The endpoints always forward packets to the same default gateway
address.
The virtual router is based on a shared virtual IP address and virtual
Ethernet MAC address. That enables redundancy for fast failover to
the standby router. All Layer 3 communication requires an IP address
and MAC address.
The active router is assigned the virtual IP address and MAC address
for packet forwarding. The standby router is assigned the virtual
address when the active router is not available.
FHRP virtual IP address is the default gateway for hosts on the
common subnet.
FHRP is not a routing protocol and virtual IP address is not installed in
the routing table. It is a default gateway address where packets are
forwarded for routing services.
Hello packets are sent between active and standby router at fixed
intervals to detect neighbor operational state (up/up).
Layer 3 switches are configured with an SVI (default gateway address)
for each host VLAN.
www.cisconetsolutions.com
Figure 2 Layer 3 Switch Configuration (FHRP)
Hot Standby Router Protocol (HSRP)
The virtual IP address assigned to an HSRP group is configured on both
routers along with virtual MAC address. Multiple groups across multiple
routers enable configuration of load balancing. At least one HSRP group
is associated with at least two physical routers. There are hello packets
sent between active and standby HSRP router at 3 second intervals to
detect neighbor state.
Priority Setting
The default HSRP priority is 100. The active router is configured with a
higher priority than standby router. The router with highest IP address is
elected the active router when all priorities are equal. HSRP provides a
tracking feature that detects when the active HSRP router is not available.
That triggers failover to the standby HSRP router. The priority of failed
router is decremented by 10 as a default. The standby router has a higher
priority and becomes the active router.
www.cisconetsolutions.com
Preemption
The preempt command enables comparison of priority between routers
to elect an active HSRP router. It is configured on all HSRP enabled
routers so the router with highest priority becomes active. The following
command configures an interface as standby so it becomes active when
the current active router interface fails.
router(config-if)# standby 1 preempt
HSRP Configuration
The following IOS commands will configure HSRP on router-1 interface
Gi0/1. It is active for group 1 with HSRPv2 enabled. The priority 110
command assigns router-1 as the active router. That is higher that the
default priority of 100.
router-1(config)# interface gigabitethernet0/1
router-1(config-if)# ip address 172.16.1.2 255.255.255.0
router-1(config-if)# standby version 2 (enable HSRPv2)
router-1(config-if)# standby 1 preempt (compare router priority)
router-1(config-if)# standby 1 priority 110 (active router)
router-1(config-if)# standby 1 ip 172.16.1.1 (virtual IP address)
HSRP Operational Command
The following command displays the HSRP operational status for all
groups including active router and virtual IP address.
router# show standby
Ethernet0/1 - Group 1
Local state is Active, priority 110, may preempt
Hello time 3 holdtime 10
Next hello sent in 00:00:01.154
Virtual IP address is 172.16.1.1 configured
Active router is 172.16.1.2 expires in 00:00:03
Active router is local
Standby router is 172.16.1.3 expires in 00:00:07
Virtual mac address is 0000.0c07.ac01
Name is cisco
www.cisconetsolutions.com
Table 1 HSRP States
HSRP State Description
Initial (Init) HSRP is not operational.
virtual IP address is unassigned and no hello message
Learn
received from any active router yet.
virtual IP address and MAC address is known
Listen active and standby router are unassigned
router listens for hello messages from HSRP group
Speak all routers send hello messages to elect an active
router and standby router for a group.
local router is in standby mode monitoring hello packets
Standby sent from the active router. It becomes active when the
active router fails
Active active router forwards packets from endpoints and
sends hello packets to confirm operational status is up.