Packets exchanged between neighbors must be authenticated to ensure that a device accepts packets only from devices that have
the same preshared authentication key. Enhanced Interior Gateway Routing Protocol (EIGRP) authentication is configurable on
a per-interface basis; this means that packets exchanged between neighbors connected through an interface are authenticated.
EIGRP supports message digest algorithm 5 (MD5) authentication to prevent the introduction of unauthorized information from
unapproved sources. MD5 authentication is defined in RFC 1321. EIGRP also supports the Hashed Message Authentication Code-Secure
Hash Algorithm-256 (HMAC-SHA-256) authentication method. When you use the HMAC-SHA-256 authentication method, a shared secret
key is configured on all devices attached to a common network. For each packet, the key is used to generate and verify a message
digest that gets added to the packet. The message digest is a one-way function of the packet and the secret key. For more
information on HMAC-SHA-256 authentication, see FIPS PUB 180-2, SECURE HASH STANDARD (SHS), for the SHA-256 algorithm and
RFC 2104 for the HMAC algorithm.
If HMAC-SHA-256 authentication is configured in an EIGRP network, EIGRP packets will be authenticated using HMAC-SHA-256 message
authentication codes. The HMAC algorithm takes as input the data to be authenticated (that is, the EIGRP packet) and a shared
secret key that is known to both the sender and the receiver; the algorithm gives a 256-bit hash output that is used for authentication.
If the hash value provided by the sender matches the hash value calculated by the receiver, the packet is accepted by the
receiver; otherwise, the packet is discarded.
Typically, the shared secret key is configured to be identical between the sender and the receiver. To protect against packet
replay attacks because of a spoofed source address, the shared secret key for a packet is defined as the concatenation of
the user-configured shared secret (identical across all devices participating in the authenticated domain) with the IPv4 or
IPv6 address (which is unique for each device) from which the packet is sent.
The device sending a packet calculates the hash to be sent based on the following:
-
Key part 1—the configured shared secret.
-
Key part 2—the local interface address from which the packet will be sent.
-
Data—the EIGRP packet to be sent (prior to the addition of the IP header).
The device receiving the packet calculates the hash for verification based on the following:
-
Key part 1—the configured shared secret.
-
Key part 2—the IPv4 or IPv6 source address in the IPv4 or IPv6 packet header.
-
Data—the EIGRP packet received (after removing the IP header).
For successful authentication, all of the following must be true:
-
The sender and receiver must have the same shared secret.
-
The source address chosen by the sender must match the source address in the IP header that the receiver receives.
-
The EIGRP packet data that the sender transmits must match the EIGRP packet data that the receiver receives.
Authentication cannot succeed if any of the following is true:
-
The sender does not know the shared secret expected by the receiver.
-
The IP source address in the IP header is modified in transit.
-
Any of the EIGRP packet data is modified in transit.