Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Example: Configuring MD5 Authentication for OSPFv2 Exchanges

This example shows how to enable MD5 authentication for OSPFv2 exchanges.

Requirements

Before you begin:

Overview

MD5 authentication uses an encoded MD5 checksum that is included in the transmitted packet. The receiving routing device uses an authentication key (password) to verify the packet.

You define an MD5 key for each interface. If MD5 is enabled on an interface, that interface accepts routing updates only if MD5 authentication succeeds. Otherwise, updates are rejected. The routing device only accepts OSPFv2 packets sent using the same key identifier (ID) that is defined for that interface.

In this example, you create the backbone area (area 0.0.0.0), specify OSPFv2 interface so-0/2/0, set the authentication type to md5, and then define the authentication key ID as 5 and the password as PssWd8.

Configuration

CLI Quick Configuration

To quickly configure MD5 authentication, copy the following command and paste it into the CLI.

[edit]set protocols ospf area 0.0.0.0 interface so-0/2/0 authentication md5 5 key PssWd8

Step-by-Step Procedure

To enable MD5 authentication for OSPFv2 exchanges:

  1. Create an OSPF area.
    [edit]user@host# edit protocols ospf area 0.0.0.0
  2. Specify the interface.
    [edit protocols ospf area 0.0.0.0]user@host# edit interface so-0/2/0
  3. Configure MD5 authentication and set a key ID and an authentication password.
    [edit protocols ospf area 0.0.0.0 interface s0-0/2/0.0]user@host# set authentication md5 5 key PssWd8
  4. If you are done configuring the device, commit the configuration.
    [edit protocols ospf area 0.0.0.0 interface s0-0/2/0.0]user@host# commit

    Note: Repeat this entire configuration on all peer OSPFv2 routing devices.

Results

Confirm your configuration by entering the show protocols ospf command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

Note: After you configure the password, you do not see the password itself. The output displays the encrypted form of the password you configured.

user@host# show protocols ospf area 0.0.0.0 {interface so-0/2/0.0 {authentication {md5 5 key "$9$pXXhuIhreWx-wQF9puBEh"; ## SECRET-DATA}}}

Verification

Confirm that the configuration is working properly.

Verifying the Configured Authentication Method

Purpose

Verify that the authentication method for sending and receiving OSPF protocol packets is configured. When configured for MD5 authentication, the Authentication Type field displays MD5, the Active key ID field displays the unique number you entered that identifies the MD5 key, and the Start time field displays the date as Start time 1970 Jan 01 00:00:00 PST. Do not be alarmed by this start time. This is the default start time that the routing device displays if the MD5 key is effective immediately.

Action

From operational mode, enter the show ospf interface and the show ospf overview commands.

Published: 2012-12-08