Table Of Contents
Restrictions for HSRP MD5 Authentication
Information About HSRP MD5 Authentication
How HSRP MD5 Authentication Works
Benefits of HSRP MD5 Authentication
How to Configure HSRP MD5 Authentication
Configuring HSRP MD5 Authentication Using a Key String
Configuring HSRP MD5 Authentication Using a Key Chain
Troubleshooting HSRP MD5 Authentication
Configuration Examples for HSRP MD5 Authentication
HSRP MD5 Authentication Using Key Strings: Example
HSRP MD5 Authentication Using Key Chains: Example
HSRP MD5 Authentication Using Key Strings and Key Chains: Example
HSRP MD5 Authentication
Prior to the introduction of the HSRP MD5 Authentication feature, the Hot Standby Router Protocol (HSRP) authenticated protocol packets with a simple plain text string.The HSRP MD5 Authentication feature is an enhancement to generate an Message Digest 5 (MD5) digest for the HSRP portion of the multicast HSRP protocol packet. This feature provides added security and protects against the threat from HSRP-spoofing software.
Feature History for the HSRP MD5 Authentication Feature
Release Modification12.3(2)T
This feature was introduced.
12.2(25)S
This feature was integrated into Cisco IOS Release 12.2(25)S.
Finding Support Information for Platforms and Cisco IOS Software Images
Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at the login dialog box and follow the instructions that appear.
Contents
•
Restrictions for HSRP MD5 Authentication
•
Information About HSRP MD5 Authentication
•
How to Configure HSRP MD5 Authentication
•
Configuration Examples for HSRP MD5 Authentication
Restrictions for HSRP MD5 Authentication
Text authentication cannot be combined with MD5 authentication for an HSRP group at any one time. When MD5 authentication is configured, the text authentication field in HSRP hello messages is set to all zeroes on transmit and ignored on receipt, provided the receiving router also has MD5 authentication enabled.
Information About HSRP MD5 Authentication
Before you configure HSRP MD5 authentication, you should understand the following concepts:
•
How HSRP MD5 Authentication Works
•
Benefits of HSRP MD5 Authentication
How HSRP MD5 Authentication Works
MD5 authentication provides greater security than plain text authentication. This feature allows each HSRP group member to use a secret key to generate a keyed MD5 hash of the packet that is part of the outgoing packet. A keyed hash of an incoming packet is generated and if the generated hash does not match the hash within the incoming packet, the packet is ignored.
The key for the MD5 hash can either be given directly in the configuration using a key string or supplied indirectly through a key chain.
HSRP has two authentication schemes:
•
Plain text authentication
•
MD5 authentication
HSRP authentication protects against false HSRP hello packets causing a denial-of-service attack. For example, Router A has a priority of 120 and is the active router. If a host sends spoof HSRP hello packets with a priority of 130, then Router A stops being the active router. If Router A has authentication configured such that the spoof HSRP hello packets are ignored, Router A will remain the active router.
HSRP packets will be rejected in any of the following cases:
•
The authentication schemes differ on the router and in the incoming packets.
•
MD5 digests differ on the router and in the incoming packet.
•
Text authentication strings differ on the router and in the incoming packet.
Benefits of HSRP MD5 Authentication
•
Protects against HSRP-spoofing software
•
Uses the industry-standard MD5 algorithm for improved reliability and security
How to Configure HSRP MD5 Authentication
The following sections describe configuration tasks for HSRP MD5 authentication. The task you perform depends on whether you want to use a simple MD5 key string or MD5 key chains for authentication.
•
Configuring HSRP MD5 Authentication Using a Key String
•
Configuring HSRP MD5 Authentication Using a Key Chain
•
Troubleshooting HSRP MD5 Authentication
Configuring HSRP MD5 Authentication Using a Key String
This task describes how to configure HSRP MD5 authentication using a key string.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
interface type number
4.
ip address ip-address mask [secondary]
5.
standby [group-number] ip [ip-address [secondary]]
6.
standby [group-number] priority priority
7.
standby [group-number] preempt
8.
standby [group-number] authentication md5 key-string [0 | 7] key [timeout seconds]
9.
Repeat Steps 1 through 8 on each router that will communicate.
10.
end
11.
show standby
DETAILED STEPS
Troubleshooting Tips
If you are changing a key string in a group of routers, change the active router last to prevent any HSRP state change. The active router should have its key string changed no later than one holdtime period, specified by the standby timers interface configuration command, after the non-active routers. This procedure ensures that the non-active routers do not time out the active router.
Configuring HSRP MD5 Authentication Using a Key Chain
This task describes how to configure HSRP MD5 authentication using a key chain. Key chains allow a different key string to be used at different times according to the key chain configuration. HSRP will query the key chain process to obtain the current live key and key ID for the specified key chain.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
key chain name-of-chain
4.
key key-id
5.
key-string string
6.
exit
7.
interface type number
8.
ip address ip-address mask [secondary]
9.
standby [group-number] ip [ip-address [secondary]]
10.
standby [group-number] priority priority
11.
standby [group-number] preempt
12.
standby [group-number] authentication md5 key-chain name-of-chain
13.
Repeat steps 1 through 12 on each router that will communicate.
14.
end
15.
show standby
DETAILED STEPS
Troubleshooting HSRP MD5 Authentication
Perform this task if HSRP MD5 authentication is not operating correctly.
SUMMARY STEPS
1.
enable
2.
debug standby errors
DETAILED STEPS
Command PurposeStep 1
enable
Example:Router> enable
Enables higher privilege levels, such as privileged EXEC mode.
•
Enter your password if prompted.
Step 2
debug standby errors
Example:Router# debug standby errorsDisplays error messages related to HSRP.
•
Error messages will be displayed for each packet that fails to authenticate so use this command with care.
•
See the "Examples"section for an example of the type of error messages displayed when two routers are not authenticating.
Examples
In the following example, Router A has MD5 text string authentication configured, but Router B has the default text authentication:
Router# debug standby errorsA:Jun 16 12:14:50.337:HSRP:Et0/1 Grp 0 Auth failed for Hello pkt from 10.21.0.5, MD5 confgd but no tlvB:Jun 16 12:16:34.287:HSRP:Et0/1 Grp 0 Auth failed for Hello pkt from 10.21.0.4, Text auth failedIn the following example, both Router A and Router B have different MD5 authentication strings:
Router# debug standby errorsA:Jun 16 12:19:26.335:HSRP:Et0/1 Grp 0 Auth failed for Hello pkt from 10.21.0.5, MD5 auth failedB:Jun 16 12:18:46.280:HSRP:Et0/1 Grp 0 Auth failed for Hello pkt from 10.21.0.4, MD5 auth failedConfiguration Examples for HSRP MD5 Authentication
This section provides the following configuration examples:
•
HSRP MD5 Authentication Using Key Strings: Example
•
HSRP MD5 Authentication Using Key Chains: Example
•
HSRP MD5 Authentication Using Key Strings and Key Chains: Example
HSRP MD5 Authentication Using Key Strings: Example
The following example configures HSRP MD5 authentication using a key string:
!interface Ethernet0/1standby 1 ip 10.21.0.10standby 1 priority 110standby 1 preemptstandby 1 authentication md5 key-string 54321098452103ab timeout 30HSRP MD5 Authentication Using Key Chains: Example
In the following example, HSRP queries the key chain "hsrp1" to obtain the current live key and key ID for the specified key chain:
key chain hsrp1key 1key-string 54321098452103abinterface Ethernet0/1standby 1 ip 10.21.0.10standby 1 priority 110standby 1 preemptstandby 1 authentication md5 key-chain hsrp1HSRP MD5 Authentication Using Key Strings and Key Chains: Example
The key ID for key-string authentication is always zero. If a key chain is configured with a key ID of zero, then the following configuration will work:
Router 1
key chain hsrp1key 0key-string 54321098452103abinterface Ethernet0/1standby 1 ip 10.21.0.10standby 1 authentication md5 key-chain hsrp1Router 2
interface Ethernet0/1standby 1 ip 10.21.0.10standby 1 authentication md5 key-string 54321098452103abAdditional References
The following sections provide information related to HSRP MD5 authentication.
Related Documents
Standards
Standards TitleNo new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.
—
MIBs
RFCs
Technical Assistance
Command Reference
This section documents modified commands. All other commands used with this feature are documented in the Cisco IOS Release 12.3T command reference publications.
show standby
To display Hot Standby Router Protocol (HSRP) information, use the show standby command in user EXEC or privileged EXEC mode.
show standby [type number [group]] [active | init | listen | standby] [brief]
Syntax Description
Command Modes
User EXEC
Privileged EXECCommand History
Usage Guidelines
To specify a group, you must specify an interface type and number.
Examples
The following is sample output from the show standby command:
Router# show standbyEthernet0/1 - Group 1State is Active2 state changes, last state change 00:30:59Virtual IP address is 10.1.0.20Secondary virtual IP address 10.1.0.21Active virtual MAC address is 0004.4d82.7981Local virtual MAC address is 0004.4d82.7981 (bia)Hello time 4 sec, hold time 12 secNext hello sent in 1.412 secsPreemption enabled, min delay 50 sec, sync delay 40 secActive router is localStandby router is 10.1.0.6, priority 75 (expires in 9.184 sec)Priority 95 (configured 120)Tracking 2 objects, 0 upDown Interface Ethernet0/2, pri 15Down Interface Ethernet0/3IP redundancy name is "HSRP1", advertisement interval is 34 secThe following is sample output from the show standby command with an interface and the brief and init keywords specified:
Router# show standby ethernet0/1 1 init briefInterface Grp Prio P State Active addr Standby addr Group addrEt0 0 120 Init 10.0.0.1 unknown 10.0.0.12The following is sample output from the show standby command when HSRP MD5 authentication is configured:
Router# show standbyEthernet0/1 - Group 1State is Active5 state changes, last state change 00:17:27Virtual IP address is 10.21.0.10Active virtual MAC address is 0000.0c07.ac01Local virtual MAC address is 0000.0c07.ac01 (default)Hello time 3 sec, hold time 10 secNext hello sent in 2.276 secsAuthentication MD5, key-string "f33r45", timeout 30 secsPreemption enabledActive router is localStandby router is unknownPriority 110 (configured 110)IP redundancy name is "hsrp-Et0/1-1" (default)Table 1 describes the significant fields shown in the displays.
Related Commands
standby authentication
To configure an authentication string for the Hot Standby Router Protocol (HSRP), use the standby authentication command in interface configuration mode. To delete an authentication string, use the no form of this command.
standby [group-number] authentication {text string | md5 {key-string [0 | 7] key [timeout seconds] | key-chain name-of-chain}}
no standby [group-number] authentication {text string | md5 {key-string [0 | 7] key [timeout seconds] | key-chain name-of-chain}}
Syntax Description
Defaults
The default group number is 0. The default string is cisco.
Command Modes
Interface configuration
Command History
Usage Guidelines
The authentication string is sent unencrypted in all HSRP messages when using the standby authentication text string option. The same authentication string must be configured on all routers and access servers on a cable to ensure interoperation. Authentication mismatch prevents a device from learning the designated Hot Standby IP address and the Hot Standby timer values from other routers configured with HSRP.
When group number 0 is used, no group number is written to NVRAM, providing backward compatibility.
If password encryption is configured with the service password-encryption command, the software saves the key string as encrypted text.
The timeout seconds is the duration that the HSRP group will accept message digests based on both the old and new keys. This allows time for configuration of all routers in a group with the new key. HSRP route flapping can be minimized by changing the keys on all the routers, provided that the active router is changed last. The active router should have its key string changed no later than one holdtime period, specified by the standby timers interface configuration command, after the non-active routers. This procedure ensures that the non-active routers do not time out the active router.
Examples
The following example configures "company1" as the authentication string required to allow Hot Standby routers in group 1 to interoperate:
interface ethernet 0standby 1 authentication text company1The following example configures MD5 authentication using a key string named "345890":
!interface Ethernet0/1standby 1 ip 10.21.0.12standby 1 priority 110standby 1 preemptstandby 1 authentication md5 key-string 345890 timeout 30The following example configures MD5 authentication using a key chain. HSRP queries the key chain "hsrp1" to obtain the current live key and key ID for the specified key chain:
key chain hsrp1key 1key-string 543210interface Ethernet0/1standby 1 ip 10.21.0.10standby 1 priority 110standby 1 preemptstandby 1 authentication md5 key-chain hsrp1Related Commands
Glossary
encryption—Encryption is the translation of data into a secret code. Encryption is a way to achieve data security. Encryption prevents the password or key from being easily readable in the configuration file.
MD5—Message Digest 5. An algorithm that is used to create digital signatures. MD5 is a one-way hash function, meaning that it takes a message and converts it into a fixed string of digits, also called a message digest. When using a one-way hash function, you can compare a calculated message digest against the received message digest to verify that the message hasn't been tampered with. This comparison is called a hashcheck.
Note
Refer to the Internetworking Terms and Acronyms for terms not included in this glossary.


