Hands-On Lab: Configuring OSPF Authentication

This hands-on lab configures MD5 authentication on an OSPF link between two routers, verifying the neighbor relationship requires a matching key on both sides and observing the resulting failure when the keys are mismatched.

OSPF MD5 AuthenticationNeighbor SecurityAuthentication Key Mismatch

~3 دقیقه مطالعه · آخرین به‌روزرسانی ۱ مهر ۱۴۰۵

Lab Objective

Configure MD5 authentication on an OSPF-enabled interface between two routers, verify the neighbor relationship forms successfully when keys match, then introduce a key mismatch and observe the resulting adjacency failure.

Lab Purpose

Without authentication, any device that can send properly formatted OSPF hello packets on a shared segment can potentially form an unauthorized neighbor relationship and inject false routing information. MD5 authentication ensures only routers sharing a common secret key can become neighbors.

Lab Topology

R1 ---- Gi0/0 ------------------ Gi0/0 ---- R2
     192.168.110.1/24         192.168.110.2/24

OSPF process 1, area 0, already forming a
healthy adjacency between R1 and R2

Task 1: Verify the Current Healthy Adjacency

Confirm R1 and R2 show a FULL neighbor relationship before adding authentication.

Task 2: Configure MD5 Authentication on R1

Enable OSPF MD5 authentication on R1's interface with a specific key.

Task 3: Configure Matching MD5 Authentication on R2

Enable the identical key on R2's corresponding interface.

Task 4: Verify the Adjacency Remains FULL

Confirm the neighbor relationship is unaffected, since both keys match.

Task 5: Introduce a Key Mismatch

Change R2's key to a different value and observe the resulting adjacency failure.

Task 6: Correct the Mismatch

Restore matching keys and confirm the adjacency recovers.

Solution and Verification

R1# show ip ospf neighbor

Neighbor ID     Pri   State           Address
2.2.2.2          1     FULL/BDR        192.168.110.2

R1(config)# interface gigabitethernet0/0
R1(config-if)# ip ospf message-digest-key 1 md5 OspfKey2026
R1(config-if)# ip ospf authentication message-digest

R2(config)# interface gigabitethernet0/0
R2(config-if)# ip ospf message-digest-key 1 md5 OspfKey2026
R2(config-if)# ip ospf authentication message-digest

R1# show ip ospf neighbor

Neighbor ID     Pri   State           Address
2.2.2.2          1     FULL/BDR        192.168.110.2
-- Adjacency remains FULL, since both sides
-- now share the identical key

R2(config)# interface gigabitethernet0/0
R2(config-if)# ip ospf message-digest-key 1 md5 DifferentKey999

R1# show ip ospf neighbor

-- (Neighbor entry eventually disappears
--  entirely once the dead timer expires)

R1# debug ip ospf adj

*OSPF: Rcv pkt from 192.168.110.2, Mismatch
Authentication Key - Message Digest Key ID 1

R2(config)# interface gigabitethernet0/0
R2(config-if)# ip ospf message-digest-key 1 md5 OspfKey2026

R1# show ip ospf neighbor

Neighbor ID     Pri   State           Address
2.2.2.2          1     FULL/BDR        192.168.110.2
-- Adjacency recovers once the keys match again

Key Takeaway

An MD5 key mismatch produces a distinct debug message explicitly naming the authentication failure, unlike the generic "up, line protocol down" symptom seen with clocking or encapsulation mismatches discussed earlier in this series — this specific error message immediately points toward checking authentication configuration on both sides rather than the broader troubleshooting checklist a vaguer symptom would require.

نوشته و پژوهش‌شده توسط دکتر شاهین صیامی

مقالات مرتبط

Hands-On Lab: Final Comprehensive CCNP Troubleshooting Challenge (BGP, DMVPN, and QoS Integration)

This hands-on lab presents a complex multi-layer failure across an integrated BGP-over-DMVPN topology combined with QoS marking, requiring systematic diagnosis of a route reflector misconfiguration, an NHRP registration failure, and an incorrectly applied QoS policy simultaneously affecting the same network.

ادامه

Hands-On Lab: Configuring BGP over DMVPN

This hands-on lab runs iBGP as the routing protocol across the same DMVPN hub-and-spoke topology used in the two previous labs, configuring the hub as a route reflector so spokes learn each other's routes without a full iBGP mesh, combining two previously separate concepts into one integrated design.

ادامه

Hands-On Lab: Configuring OSPF over DMVPN

This hands-on lab runs OSPF as the dynamic routing protocol across the same DMVPN hub-and-spoke topology, configuring the tunnel interface as an OSPF point-to-multipoint network type to correctly handle the hub-and-spoke adjacency pattern without requiring the broadcast network type's DR/BDR election.

ادامه

Hands-On Lab: Configuring EIGRP over DMVPN

This hands-on lab runs EIGRP as the dynamic routing protocol across the DMVPN hub-and-spoke topology built in earlier labs, verifying neighbor relationships form correctly across the multipoint tunnel and routes propagate without requiring per-spoke static configuration on the hub.

ادامه

Hands-On Lab: Configuring HSRP MD5 Authentication

This hands-on lab configures MD5 authentication on an HSRP group, verifying two routers with matching authentication strings form a normal active/standby relationship while a router with a mismatched string is excluded from the group entirely.

ادامه

Hands-On Lab: Configuring Cisco Umbrella-Style DNS Security via DNS Forwarding Redirection

This hands-on lab configures a router to redirect all client DNS queries toward a security-focused DNS resolver using DNS forwarding interception, approximating cloud-delivered DNS security enforcement without requiring per-client configuration changes.

ادامه