www.howtonetwork.org

CCNA & CCNP Certifcation Training

  • About
  • Contact
  • FAQ
  • Join
  • Home
  • CCNA
    • ICND1
    • ICND2
    • 101 CCNA LABS
  • CCNP
    • ROUTE
    • SWITCH
    • TSHOOT
    • 101 CCNP LABS
  • CompTIA
    • Security+
    • Network+
  • Design
    • CCDA
    • CCDP
You are here: Home / ICND2 / Day 34 – First Hop Redundancy Protocols / Day 34 Tasks / Hot Standby Router Protocol

Hot Standby Router Protocol

Hot Standby Router Protocol (HSRP) is a Cisco-proprietary First Hop Redundancy Protocol (FHRP). HSRP allows two physical gateways that are configured as part of the same HSRP group to share the same virtual gateway address. Network hosts residing on the same subnet as the gateways are configured with the virtual gateway IP address as their default gateway.

While operational, the primary gateway forwards packets destined to the virtual gateway IP address of the HSRP group. In the event that the primary gateway fails, the secondary gateway assumes the role of primary gateway and forwards all packets sent to the virtual gateway IP address. Figure 34.1 below illustrates the operation of HSRP in a network:

 

 34.1

 

Figure 34.1 – Hot Standby Router Protocol (HSRP) Operation

 

Referencing Figure 34.1, HSRP is configured between the Layer 3 (Distribution Layer) switches, providing gateway redundancy for VLAN 10. The IP address assigned to the Switch Virtual Interface (SVI) on Layer 3 Switch 1 is 10.10.10.2/24, and the IP address assigned to the SVI on Layer 3 Switch 2 is 10.10.10.3/24. Both switches are configured as part of the same HSRP group and share the IP address of the virtual gateway, which is 10.10.10.1.

Switch 1 has been configured with a priority of 105, while Switch 2 is using the default priority of 100. Because of the higher priority, Layer 3 Switch 1 is elected as the primary switch and Layer 3 Switch 2 is elected as the secondary switch. All hosts on VLAN 10 are configured with a default gateway address of 10.10.10.1. Based on this solution, Switch 1 will forward all packets sent to the 10.10.10.1 address. However, in the event that Switch 1 fails, then Switch 2 will assume this responsibility. This process is entirely transparent to the network hosts.

 

Real-World Implementation

 

 

In production networks, when configuring FHRPs, it is considered good practice to ensure that the active (primary) gateway is also the Spanning Tree Root Bridge for the particular VLAN. Referencing the diagram in Figure 34.1, for example, Switch 1 would be configured as the Root Bridge for VLAN 10 in tandem with being the HSRP primary gateway for the same VLAN.

This results in a deterministic network and avoids suboptimal forwarding at Layer 2 or Layer 3. For example, if Switch 2 was the Root Bridge for VLAN 10, while Switch 1 was the primary gateway for VLAN 10, packets from the network hosts to the default gateway IP address would be forwarded as shown in Figure 34.2 below:

 

34.2

Figure 34.2 – Synchronising the STP Topology with HSRP

 

In the network above, packets from Host 1 to 10.10.10.1 are forwarded as follows:

  1. The Access Layer switch receives a frame destined to the MAC address of the virtual gateway IP address from Host 1. This frame is received in VLAN 10 and the MAC address for the virtual gateway has been learned by the switch via its Root Port.
  2. Because the Root Bridge for VLAN 10 is Switch 2, the uplink towards Switch 1 (the HSRP primary router) is placed into a Blocking state. The Access Layer switch forwards the frame via the uplink to Switch 2.
  3. Switch 2 forwards the frame via the Designated Port connected to Switch 1. The same suboptimal forwarding path is used for frames received from Host 2.

 

 

Currently, two versions of HSRP are supported in Cisco IOS software: versions 1 and 2. The similarities and differences between the versions will be described in the sections that follow.

 

HSRP Version 1

By default, when Hot Standby Router Protocol is enabled in Cisco IOS software, version 1 is enabled. HSRP version 1 restricts the number of configurable HSRP groups to 255. HSRP version 1 routers communicate by sending messages to Multicast group address 224.0.0.2 using UDP port 1985. This is shown in Figure 34.3 below:

 

 34.3

 

Figure 34.3 – HSRP Version 1 Multicast Group Address

 

While going into detail on the HSRP packet format is beyond the scope of the CCNA exam requirements, Figure 34.4 below illustrates the information contained in the HSRP version 1 packet:

 

34.4

 

Figure 34.4 – The HSRP Version 1 Packet Fields

 

In Figure 34.4, notice that the Version field shows a value of 0. This is the default value for this field when version 1 is enabled; however, remember that this implies HSRP version 1.

 

HSRP Version 2

HSRP version 2 uses the new Multicast address 224.0.0.102 to send Hello packets instead of the Multicast address of 224.0.0.2, which is used by version 1. The UDP port number, however, remains the same. This new address is also encoded in both the IP packet and the Ethernet frame, as shown below in Figure 34.5:

 

34.5

 

Figure 34.5 – HSRP Version 2 Multicast Group Address

 

While going into detail on the HSRP version 2 packet format is beyond the scope of the CCNA exam requirements, it is important to remember that HSRP version 2 does not use the same packet format as HSRP version 1.

The version 2 packet format uses a Type/Length/Value (TLV) format. HSRP version 2 packets received by an HSRP version 1 router will have the Type field mapped to the Version field by HSRP version 1 and will be subsequently ignored. Figure 34.6 illustrates the information contained in the HSRP version 2 packet:

 

 34.6

Figure 34.6 – The HSRP Version 2 Packet Fields

HSRP Version 1 and Version 2 Comparison

HSRP version 2 includes enhancements to HSRP version 1. The version 2 enhancements and differences from version 1 will be described in this section.

Although HSRP version 1 advertises timer values, these values are always to the whole second, as it is not capable of advertising or learning millisecond timer values. Version 2 is capable of both advertising and learning millisecond timer values. Figures 34.7 and 34.8 below highlight the differences between the Timer fields for both HSRP version 1 and HSRP version 2, respectively:

 

 34.7

 

Figure 34.7 – HSRP Version 1 Timer Fields

 

 34.8

Figure 34.8 – HSRP Version 2 Timer Fields

 

HSRP version 1 group numbers are restricted to the range of 0 to 255, whereas the version 2 group numbers have been extended from 0 to 4095. This difference will be illustrated in the HSRP configuration examples that will be provided later in this module.

Version 2 provides improved management and troubleshooting by including a 6-byte Identifier field that is populated with the physical router interface MAC address and is used to uniquely identify the source of HSRP active Hello messages. In version 1, these messages contain the virtual MAC address as the source MAC, which means it is not possible to determine which HSRP router actually sent the HSRP Hello message. Figure 34.9 below shows the Identifier field that is present in the version 2 packet but not in the HSRP version 1 packet:

 

34.9

Figure 34.9 – HSRP Version 2 Identifier Field

 

In HSRP version 1, the Layer 2 address that is used by the virtual IP address will be a virtual MAC address composed of 0000.0C07.ACxx, where “xx” is the HSRP group number in hexadecimal value and is based on the respective interface. HSRP version 2, however, uses a new MAC address range of 0000.0C9F.F000 to 0000.0C9F.FFFF for the virtual gateway IP address. These differences are illustrated below in Figure 34.10, which shows the version 1 virtual MAC address for HSRP Group 1, as well as in Figure 34.11, which shows the version 2 virtual MAC address, also for HSRP Group 1:

 

 34.10

 

Figure 34.10 – HSRP Version 1 Virtual MAC Address Format

 

 34.11

Figure 34.11 – HSRP Version 2 Virtual MAC Address Format

 

HSRP Primary Gateway Election

HSRP primary gateway election can be influenced by adjusting the default HSRP priority of 100 to any value between 1 and 255. The router with the highest priority will be elected as the primary gateway for the HSRP group.

If two gateways are using the default priority values, or if the priority values on two gateways are manually configured as equal, the router with the highest IP address will be elected as the primary gateway. The HSRP priority value is carried in the HSRP frame, as is the current state of the router (e.g., primary or standby). Figure 34.12 below illustrates the Priority and State fields of a gateway configured with a non-default priority value of 105, which resulted in it being elected as the active gateway for the HSRP group:

 

 34.12

Figure 34.12 – HSRP Priority and State Fields

HSRP Messages

HSRP routers exchange the following three types of messages:

  • Hello messages
  • Coup messages
  • Resign messages

Hello messages are exchanged via Multicast and they tell the other gateway the HSRP state and priority values of the local router. Hello messages also include the Group ID, HSRP timer values, version, and authentication information. All of the messages shown in the previous screenshots are HSRP Hello messages.

HSRP Coup messages are sent when the current standby router wants to assume the role of active gateway for the HSRP group. This is similar to a coup d’état in real life.

HSRP Resign messages are sent by the active router when it is about to shut down or when a gateway that has a higher priority sends a Hello or Coup message. In other words, this message is sent when the active gateway concedes its role as primary gateway.

 

HSRP Preemption

If a gateway has been elected as the active gateway and another gateway that is part of the HSRP group is reconfigured with a higher priority value, the current active gateway retains the primary forwarding role. This is the default behaviour of HSRP.

In order for a gateway with a higher priority to assume active gateway functionality when a primary gateway is already present for an HSRP group, the router must be configured for preemption. This allows the gateway to initiate a coup and assume the role of the active gateway for the HSRP group. HSRP preemption is illustrated in the configuration examples to follow.

NOTE: Preemption does not necessarily mean that the Spanning Tree topology changes also.

 

HSRP States

In a manner similar to Open Shortest Path First (OSPF), when HSRP is enabled on an interface, the gateway interface goes through the following series of states:

  1. Disabled
  2. Init
  3. Listen
  4. Speak
  5. Standby
  6. Active

NOTE: There are no set time values for these interface transitions.

In either the Disabled or the Init states, the gateway is not yet ready or is unable to participate in HSRP, possibly because the associated interface is not up.

The Listen state is applicable to the standby gateway. Only the standby gateway monitors Hello messages from the active gateway. If the standby gateway does not receive Hellos within 10 seconds, it assumes that the active gateway is down and takes on this role itself. If other gateways exist on the same segment, they also listen to Hellos and will be elected as the group active gateway if they have the next highest priority value or IP address.

During the Speak phase, the standby gateway exchanges messages with the active gateway. Upon completion of this phase, the primary gateway transitions to the Active state and the backup gateway transitions to the Standby state. The Standby state indicates that the gateway is ready to assume the role of active gateway if the primary gateway fails, and the Active state indicates that the gateway is ready to actively forward packets.

The following output shows the state transitions displayed in the debug standby command on a gateway for which HSRP has just been enabled:

R2#debug standby

HSRP debugging is on

R2#

R2#conf t

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

R2(config)#logging con

R2(config)#int f0/0

R2(config-if)#stand 1 ip 192.168.1.254

R2(config-if)#

*Mar  1 01:21:55.471: HSRP: Fa0/0 API 192.168.1.254 is not an HSRP address

*Mar  1 01:21:55.471: HSRP: Fa0/0 Grp 1 Disabled -> Init

*Mar  1 01:21:55.471: HSRP: Fa0/0 Grp 1 Redundancy “hsrp-Fa0/0-1” state Disabled -> Init

*Mar  1 01:22:05.475: HSRP: Fa0/0 Interface up

 

…

 

[Truncated Output]

 

…

 

*Mar  1 01:22:06.477: HSRP: Fa0/0 Interface min delay expired

*Mar  1 01:22:06.477: HSRP: Fa0/0 Grp 1 Init: a/HSRP enabled

*Mar  1 01:22:06.477: HSRP: Fa0/0 Grp 1 Init -> Listen

*Mar  1 01:22:06.477: HSRP: Fa0/0 Redirect adv out, Passive, active 0 passive 1

 

…

 

[Truncated Output]

 

…

 

*Mar  1 01:22:16.477: HSRP: Fa0/0 Grp 1 Listen: d/Standby timer expired (unknown)

*Mar  1 01:22:16.477: HSRP: Fa0/0 Grp 1 Listen -> Speak

 

…

 

[Truncated Output]

 

…

 

*Mar  1 01:22:26.478: HSRP: Fa0/0 Grp 1 Standby router is local

*Mar  1 01:22:26.478: HSRP: Fa0/0 Grp 1 Speak -> Standby

*Mar  1 01:22:26.478: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 1 state Speak -> Standby

*Mar  1 01:22:26.478: HSRP: Fa0/0 Grp 1 Redundancy “hsrp-Fa0/0-1” state Speak -> Standby

HSRP Addressing

Earlier in this module, you learned that in HSRP version 1, the Layer 2 address that is used by the virtual IP address will be a virtual MAC address composed of 0000.0C07.ACxx, where “xx” is the HSRP group number in hexadecimal value and is based on the respective interface. HSRP version 2, however, uses a new MAC address range of 0000.0C9F.F000 to 0000.0C9F.FFFF for the virtual gateway IP address.

In some cases, it may not be desirable to use these default address ranges. An example would be a situation where several HSRP groups were configured on a router interface connected to a switch port that was configured for port security. In such a case, the router would use a different MAC address for each HSRP group, the result being multiple MAC addresses that would all need to be accommodated in the port security configuration. This configuration would have to be modified each time an HSRP group was added to the interface; otherwise, a port security violation would occur.

To address this issue, Cisco IOS software allows administrators to configure HSRP to use the actual MAC address of the physical interface on which it is configured. The result is that a single MAC address is used by all groups (i.e., the MAC address of the active gateway is used) and the port security configuration need not be modified each time an HSRP group is configured between the routers connected to the switches. This is performed via the standby use-bia interface configuration command. The following output illustrates the show standby command, which shows a gateway interface that is configured with two different HSRP groups:

Gateway-1#show standby

FastEthernet0/0 – Group 1

State is Active

8 state changes, last state change 00:13:07

Virtual IP address is 192.168.1.254

Active virtual MAC address is 0000.0c07.ac01

    Local virtual MAC address is 0000.0c07.ac01 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 2.002 secs

Preemption disabled

Active router is local

Standby router is 192.168.1.2, priority 100 (expires in 9.019 sec)

Priority 105 (configured 105)

IP redundancy name is “hsrp-Fa0/0-1” (default)

FastEthernet0/0 – Group 2

State is Active

2 state changes, last state change 00:09:45

Virtual IP address is 172.16.1.254

Active virtual MAC address is 0000.0c07.ac02

    Local virtual MAC address is 0000.0c07.ac02 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 2.423 secs

Preemption disabled

Active router is local

In the output above, based on the default HSRP version, the virtual MAC address for HSRP Group 1 is 0000.0c07.ac01, while that for HSRP Group 2 is 0000.0c07.ac02. This means that the switch port that this gateway is connected to learns three different addresses: the actual or burnt-in MAC address assigned to the actual physical FastEthernet0/0 interface, the virtual MAC address for HSRP Group 1, and the virtual MAC address for HSRP Group 2.

The following output illustrates how to configure HSRP to use the actual MAC address of the gateway interface as the virtual MAC address of the different HSRP groups:

Gateway-1#conf

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

Gateway-1(config)#int f0/0

Gateway-1(config-if)#standby use-bia

Gateway-1(config-if)#exit

 

Based on the configuration in the output above, the show standby command reflects the new MAC address for the HSRP group, as illustrated in the following output:

Gateway-1#show standby

FastEthernet0/0 – Group 1

State is Active

8 state changes, last state change 00:13:30

Virtual IP address is 192.168.1.254

Active virtual MAC address is 0013.1986.0a20

    Local virtual MAC address is 0013.1986.0a20 (bia)

Hello time 3 sec, hold time 10 sec

Next hello sent in 2.756 secs

Preemption disabled

Active router is local

Standby router is 192.168.1.2, priority 100 (expires in 9.796 sec)

Priority 105 (configured 105)

IP redundancy name is “hsrp-Fa0/0-1” (default)

FastEthernet0/0 – Group 2

State is Active

2 state changes, last state change 00:10:09

Virtual IP address is 172.16.1.254

Active virtual MAC address is 0013.1986.0a20

    Local virtual MAC address is 0013.1986.0a20 (bia)

Hello time 3 sec, hold time 10 sec

Next hello sent in 0.188 secs

Preemption disabled

Active router is local

Standby router is unknown

Priority 105 (configured 105)

IP redundancy name is “hsrp-Fa0/0-2” (default)

The MAC address used by both groups, 0013.1986.0a20, is the MAC address assigned to the physical gateway interface. This is illustrated in the following output:

Gateway-1#show interface FastEthernet0/0

FastEthernet0/0 is up, line protocol is up

Hardware is AmdFE, address is 0013.1986.0a20 (bia 0013.1986.0a20)

Internet address is 192.168.1.1/24

MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,

reliability 255/255, txload 1/255, rxload 1/255

Encapsulation ARPA, loopback not set

 

…

 

[Truncated Output]

NOTE: In addition to configuring HSRP to use the burnt-in address (BIA), administrators also have the option of statically specifying the MAC address that the virtual gateway should use via the standby [number] mac-address [mac] interface configuration command. This option is typically avoided, as it can result in duplicate MAC addresses in the switched network, which can cause severe network issues and possibly even an outage.

 

HSRP Plain Text Authentication

By default, HSRP messages are sent with the plain text key string “cisco” as a simple method to authenticate HSRP peers. If the key string in a message matches the key configured on an HSRP

peer, the message is accepted. If not, HSRP ignores the unauthenticated message(s).

Plain text keys provide very little security because they can be “captured on the wire” using simple packet capture tools, such as Wireshark and Ethereal. Figure 34.13 below shows the default plain text authentication key used in HSRP messages:

 

 34.13

Figure 34.13 – Viewing the Default HSRP Plain Text Key

 

Because plain text authentication provides very little security, Message Digest 5 (MD5) authentication, which is described in the following section, is the recommended authentication method for HSRP.

 

HSRP MD5 Authentication

This isn’t a CCNA subject but it’s included here for completeness and for those of you who will be applying these lessons in your job on a live network.

Message Digest 5 authentication provides greater security for HSRP than that provided by plain text authentication by generating an MD5 digest for the HSRP portion of the Multicast HSRP protocol packet. Using MD5 authentication allows each HSRP group member to use a secret key to generate a keyed MD5 hash that is part of the outgoing packet. A keyed hash of the incoming HSRP packet is generated and if the hash within the incoming packet does not match the MD5-generated hash, the packet is simply ignored by the receiving router.

The key for the MD5 hash can be either given directly in the configuration using a key string or supplied indirectly through a key chain. Both configuration options will be described in detail later in this module. When using plain-text or MD5 authentication, the gateway will reject HSRP packets if any of the following is true:

  • The authentication schemes differ on the router and in the incoming packets
  • The MD5 digests differ on the router and in the incoming packets
  • The text authentication strings differ on the router and in the incoming packets

 

HSRP Interface Tracking

HSRP allows administrators to track the status of interfaces on the current active gateway so that when that interface fails, the gateway decrements its priority by a specified value, the default being 10, allowing another gateway to assume the role of active gateway for the HSRP group. This concept is illustrated below in Figure 34.14:

 

 34.14

Figure 34.14 – HSRP Interface Tracking

 

Referencing Figure 34.14, HSRP has been enabled on Switch 1 and Switch 2 for VLAN 150. Based on the current priority configuration, Switch 1, with a priority value of 105, has been elected as the primary switch for this VLAN. Both Switch 1 and Switch 2 are connected to two routers via their GigabitEthernet5/1 interfaces. It is assumed that these two routers peer with other external networks, such as the Internet.

Without HSRP interface tracking, if the GigabitEthernet5/1 interface between Switch 1 and R1 failed, Switch 1 would retain its primary gateway status. It would then have to forward any received packets destined for the Internet, for example, over to Switch 2 using the connection between itself and Switch 2. The packets would be forwarded out via R2 towards their intended destination. This results in a suboptimal traffic path within the network.

HSRP interface tracking allows the administrators to configure HSRP to track the status of an interface and decrement the active gateway priority by either a default value of 10 or a value specified by the administrators. Referencing Figure 34.14, if HSRP interface tracking was configured using the default values on Switch 1, allowing it to track the status of interface GigabitEthernet5/1, and that interface failed, Switch 1 would decrement its priority for the HSRP group by 10, resulting in a priority of 95.

Assuming that Switch 2 was configured to preempt, which is mandatory in this situation, it would realise that it had the higher priority (100 versus 95) and perform a coup, assuming the role of active gateway for this HSRP group.

Real-World Implementation

 

In production networks, Cisco Catalyst switches also support Enhanced Object Tracking (EOT), which can be used with any FHRP (i.e., HSRP, VRRP, and GLBP). Enhanced Object Tracking allows administrators to configure the switch to track the following parameters:

  • The IP routing state of an interface
  • IP route reachability
  • The threshold of IP route metrics
  • IP SLA operations

FHRPs, such as HSRP, can be configured to track these enhanced objects, allowing for greater flexibility when implementing FHRP failover situations. For example, using EOT, the active HSRP router could be configured to decrement its priority value by a certain amount if a network or host route was not reachable (i.e., present in the routing table). EOT is beyond the scope of the CCNA exam requirements and will not be illustrated in the configuration examples.

 

 

HSRP Load Balancing

HSRP allows administrators to configure multiple HSRP groups on physical interfaces to allow for load balancing. By default, when HSRP is configured between two gateways, only one gateway actively forwards traffic for that group at any given time. This can result in wasted bandwidth for the standby gateway link. This is illustrated below in Figure 34.15:

 

 34.15

Figure 34.15 – A Network without HSRP Load Balancing

 

In Figure 34.15, two HSRP groups are configured between Switch 1 and Switch 2. Switch 1 has been configured as the active (primary) gateway for both groups – based on the higher priority value. Switch 1 and Switch 2 are connected to R1 and R2, respectively. These routers are both connected to the Internet via T3/E3 dedicated lines. Because Switch 1 is the active gateway for both groups, it will forward traffic for both groups until it fails and Switch 2 will then assume the role of active (primary) gateway.

While this does satisfy the redundancy needs of the network, it also results in the expensive T3/E3 link on R2 remaining idle until Switch 2 becomes the active gateway and begins to forward traffic through it. Naturally, this represents a wasted amount of bandwidth.

By configuring multiple HSRP groups, each using a different active gateway, administrators can effectively prevent the unnecessary waste of resources and load balance between Switch 1 and Switch 2. This is illustrated below in Figure 34.16:

 

 34.16

Figure 34.16 – A Network Using HSRP for Load Balancing

 

By configuring Switch 1 as the active gateway for HSRP Group 1 and Switch 2 as the active gateway for HSRP Group 2, administrators can allow traffic from these two groups to be load balanced between Switch 1 and Switch 2, and ultimately across the two dedicated T3/E3 WAN connections. Each switch then backs up the other’s group. For example, Switch 1 will assume the role of active gateway for Group 2 if Switch 2 fails, and vice versa.

Real-World Implementation

 

In production networks, it is important to remember that creating multiple HSRP groups may result in increased gateway CPU utilisation, as well as increased network utilisation due to HSRP message exchanges. Cisco Catalyst switches, such as the Catalyst 4500 and 6500 series switches, support the implementation of HSRP client groups.

In the previous section, you learned that HSRP allows for the configuration of multiple groups on a single gateway interface. The primary issue with running many different HSRP groups on the gateway interface is that it increases CPU utilisation on the gateway and may potentially also increase the amount of network traffic, given the 3-second Hello interval used by HSRP.

 

To address this potential issue, HSRP also allows for the configuration of client or slave groups. These are simply HSRP groups that are configured to follow a master HSRP group and that do not participate in the HSRP election. These client or slave groups follow the operation and HSRP status of the master group and, therefore, do not need to exchange periodic Hello packets themselves. This reduces CPU and network utilisation when using multiple HSRP groups.

However, it should be noted that client groups send periodic messages in order to refresh their virtual MAC addresses in switches. The refresh message may be sent at a much lower frequency compared with the protocol election messages sent by the master group. While the configuration of client groups is beyond the scope of the CCNA exam requirements, the following output illustrates the configuration of two client groups, which are configured to follow master group HSRP Group 1, also named the SWITCH-HSRP group:

Gateway-1(config)#interface vlan100

Gateway-1(config-if)#ip address 192.168.1.1 255.255.255.0

Gateway-1(config-if)#ip address 172.16.31.1 255.255.255.0 secondary

Gateway-1(config-if)#ip address 10.100.10.1 255.255.255.0 secondary

Gateway-1(config-if)#standby 1 ip 192.168.1.254

Gateway-1(config-if)#standby 1 name SWITCH-HSRP

Gateway-1(config-if)#standby 2 ip 172.16.31.254

Gateway-1(config-if)#standby 2 follow SWITCH-HSRP

Gateway-1(config-if)#standby 3 ip 10.100.10.254

Gateway-1(config-if)#standby 3 follow SWITCH-HSRP

Gateway-1(config-if)#exit

In the configuration in the output above, Group 1 is configured as the master HSRP group and Groups 2 and 3 are configured as client or slave HSRP groups.

 

 

Configuring HSRP on the Gateway

The following steps are required to configure HSRP on the gateway:

  1. Configure the correct IP address and mask for the gateway interface using the ip address [address] [mask] [secondary] interface configuration command.
  2. Create an HSRP group on the gateway interface and assign the group the virtual IP address via the standby [number] ip [virtual address][secondary] interface configuration command. The [secondary] keyword specifies the IP address as a secondary gateway IP address for the specified group.
  3. Optionally, assign the HSRP group a name using the standby [number] name [name] interface configuration command.
  4. Optionally, if you want to control the election of the active gateway, configure the group priority via the standby [number] priority [value] interface configuration command.

The following HSRP configuration outputs in this section will be based on the network below in Figure 34.17:

 

 34.17

Figure 34.17 – HSRP Configuration Examples Topology

 

NOTE: It is assumed that the VLAN and trunking configuration between VTP-Server-1 and VTP-Server-2 is already in place and the switches are successfully able to ping each other across VLAN172. For brevity, this configuration output will be omitted from the configuration examples.

VTP-Server-1(config)#interface vlan172

VTP-Server-1(config-if)#ip address 172.16.31.1 255.255.255.0

VTP-Server-1(config-if)#standby 1 ip 172.16.31.254

VTP-Server-1(config-if)#standby 1 priority 105

VTP-Server-1(config-if)#exitVTP-Server-2(config)#interface vlan172

VTP-Server-2(config-if)#ip address 172.16.31.2 255.255.255.0

VTP-Server-2(config-if)#standby 1 ip 172.16.31.254

VTP-Server-2(config-if)#exit

NOTE: No priority value is manually assigned for the HSRP configuration applied to VTP-Server-2. By default, HSRP will use a priority value of 100, allowing VTP-Server-1, with a priority value of 105, to win the election and to be elected the primary gateway for the HSRP group.

Once implemented, HSRP configuration may be validated using the show standby [interface brief] command. The show standby brief command is shown in the following outputs:

VTP-Server-1#show standby brief

                     P indicates configured to preempt.

                     |

Interface   Grp  Pri P State   Active  Standby         Virtual IP

Vl172       1    105   Active  local   172.16.31.2     172.16.31.254

VTP-Server-2#show standby brief

                     P indicates configured to preempt.

                     |

Interface   Grp  Pri P State    Active  Standby       Virtual IP

Vl172       1    100   Standby  local   172.16.31.1   172.16.31.254

Based on this configuration, VTP-Server-2 will become the active gateway for this group only if VTP-Server-1 fails. Additionally, because preemption is not configured, when VTP-Server-1 comes back online, it will not be able to assume forcefully the role of active gateway, even though it has a higher priority for the HSRP group than that being used on VTP-Server-2.

 

Configuring HSRP Preemption

Preemption allows a gateway to assume forcefully the role of active gateway if it has a higher priority than the current active gateway. HSRP preemption is configured using the standby [number] preempt command. This configuration is illustrated on VTP-Server-1 in the following output:

VTP-Server-1(config)#interface vlan172

VTP-Server-1(config-if)#standby 1 preempt

The show standby [interface [name]|brief] command is also used to verify that preemption has been configured on a gateway. This is illustrated by the “P” shown in the output of the show standby brief command below:

VTP-Server-1#show standby brief

                     P indicates configured to preempt.

                     |

Interface   Grp  Pri P State   Active  Standby         Virtual IP

Vl172       1    105 P Active  local   172.16.31.2     172.16.31.254

Based on this modification, if VTP-Server-1 did fail and VTP-Server-2 assumed the role of active gateway for VLAN 172, VTP-Server-1 could forcibly reassume that role once it reinitialises. When configuring preemption, Cisco IOS software allows you to specify the duration the switch must wait before it preempts and forcibly reassumes the role of active gateway.

By default, this happens immediately. However, it may be adjusted using the standby [number] preempt delay [minimum|reload|sync] interface configuration command. The [minimum] keyword is used to specify the minimum amount of time to wait (seconds) before preemption. The following output shows how to configure the gateway to wait 30 seconds before preemption:

VTP-Server-1(config)#interface vlan172

VTP-Server-1(config-if)#standby 1 preempt delay minimum 30

This configuration may be validated using the show standby [interface] command. This is illustrated in the following output:

VTP-Server-1#show standby vlan172

Vlan172 – Group 1

State is Active

5 state changes, last state change 00:00:32

Virtual IP address is 172.16.31.254

Active virtual MAC address is 0000.0c07.ac01

Local virtual MAC address is 0000.0c07.ac01 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 0.636 secs

Preemption enabled, delay min 30 secs

Active router is local

Standby router is 172.16.31.2, priority 100 (expires in 8.629 sec)

Priority 105 (configured 105)

IP redundancy name is “hsrp-Vl172-1” (default)

The [reload] keyword is used to specify the amount of time the gateway should wait after it initialises following a reload. The [sync] keyword is used in conjunction with IP redundancy clients. This configuration is beyond the scope of the CCNA exam requirements but is very useful in production environments because it prevents an unnecessary change of roles in the case of a flapping interface that is being tracked, or similar activity.

 

Configuring HSRP Interface Tracking

HSRP interface tracking allows administrators to configure HSRP in order to track the state of interfaces and decrement the current priority value by the default value (10) or a preconfigured value, allowing another gateway to assume the role of primary gateway for the specified HSRP group.

In the following output, VTP-Server-1 is configured to track the state of interface GigabitEthernet5/1, which is connected to an imaginary WAN router. In the event that the state of that interface transitions to “down,” the gateway will decrement its priority value by 10 (which is the default):

VTP-Server-1(config)#interface vlan172

VTP-Server-1(config-if)#standby 1 track GigabitEthernet5/1

This configuration may be validated using the show standby [interface] command. This is illustrated in the following output:

VTP-Server-1#show standby vlan172

Vlan172 – Group 1

State is Active

5 state changes, last state change 00:33:22

Virtual IP address is 172.16.31.254

Active virtual MAC address is 0000.0c07.ac01

Local virtual MAC address is 0000.0c07.ac01 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 1.085 secs

Preemption enabled

Active router is local

Standby router is 172.16.31.2, priority 100 (expires in 7.616 sec)

Priority 105 (configured 105)

IP redundancy name is “hsrp-Vl172-1” (default)

  Priority tracking 1 interfaces or objects, 1 up:

  Interface or object           Decrement  State

  GigabitEthernet5/1            10         Up

To configure the gateway to decrement its priority value by 50, for example, the standby [name] track [interface] [decrement value] command can be issued, as shown in the following output:

VTP-Server-1(config)#interface vlan172

VTP-Server-1(config-if)#standby 1 track GigabitEthernet5/1 50

This configuration may be validated using the show standby [interface] command. This is illustrated in the following output:

VTP-Server-1#show standby vlan172

Vlan172 – Group 1

State is Active

5 state changes, last state change 00:33:22

Virtual IP address is 172.16.31.254

Active virtual MAC address is 0000.0c07.ac01

Local virtual MAC address is 0000.0c07.ac01 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 1.085 secs

Preemption enabled

Active router is local

Standby router is 172.16.31.2, priority 100 (expires in 7.616 sec)

Priority 105 (configured 105)

IP redundancy name is “hsrp-Vl172-1” (default)

  Priority tracking 1 interfaces or objects, 1 up:

  Interface or object           Decrement  State

  GigabitEthernet5/1            50         Up

 

Configuring the HSRP Version

As stated previously in this module, by default, when HSRP is enabled, version 1 is enabled. HSRP version 2 can be manually enabled using the standby version [1|2] interface configuration command. HSRP version 2 configuration is illustrated in the following output:

VTP-Server-1(config)#interface vlan172

VTP-Server-1(config-if)#standby version 2

This configuration may be validated using the show standby [interface] command. This is illustrated in the following output:

VTP-Server-1#show standby vlan172

Vlan172 – Group 1 (version 2)

State is Active

5 state changes, last state change 00:43:42

Virtual IP address is 172.16.31.254

  Active virtual MAC address is 0000.0c9f.f001

    Local virtual MAC address is 0000.0c9f.f001 (v2 default)

  Hello time 3 sec, hold time 10 sec

    Next hello sent in 2.419 secs

Preemption enabled

Active router is local

Standby router is 172.16.31.2, priority 100 (expires in 4.402 sec)

Priority 105 (configured 105)

IP redundancy name is “hsrp-Vl172-1” (default)

Enabling HSRP automatically changes the MAC address range used by HSRP from an address in the 0000.0C07.ACxx range to one in the 0000.0C9F.F000 to 0000.0C9F.FFFF range. It is therefore important to understand that this may cause some packet loss in a production network, as devices must learn the new MAC address of the gateway. Such changes are always recommended during a maintenance window or planned outage window.

Next

About Us

This is a free bonus site for members of www.howtonetwork.com

Copyright

The content on this copyright Reality Press Ltd.
Copyright Reality Press Ltd.