The authentication type for OSPF can be configured as Simple Password Authentication, Message-Digest Authentication, or Null Authentication. Authentication related configuration are done in Interface Configuration mode. The following sections describe the configuration of OSPF authentication.
Type the following:
iS5comm# configure terminal
iS5comm(config)# router ospf
iS5comm(config-router)# network 10.4.0.1 area 0.0.0.0
iS5comm(config-router)# network 10.10.2.1 area 0.0.0.6
iS5comm(config-router)# exit
iS5comm(config)# interface vlan 1
iS5comm(config-if)#
A sample configuration for testing authentication is as follows.
Some prerequisite configuration (refer to Configuration Guidelines (Prerequisite) Section) must be done in the switches ISS2 & ISS4 before configuring OSPF.
For simple password authentication, a password must be specified which is to be used by the neighboring routers using the OSPF simple password authentication.
Message-Digest Authentication is a cryptographic authentication. A key (password) and key-id are configured on each router. The router uses an algorithm based on the OSPF packet, the key, and the key-id to generate a “message-digest” that appends to the packet.
SHA-1, a 160-bit message-digest algorithm, developed by the National Security Agency, is generally considered to provide stronger cryptographic security than MD5 (a 128-bit digest developed by RSA Data Security, Inc), because it uses a longer message digest and it is not vulnerable to some attacks that can be conducted against MD5.
Configures the time when the switch will start generating OSPF packets with the configured key id. The mismatch in key id or password in any of the two routers in our example say either in ISS2 or ISS4 causes the OSPF neighborship link status to down between them. The purpose of this command is to start generating OSPF packets with a new key id when the configured time reaches.
Type the following:
Configuration in ISS2
iS5comm# configure terminal
iS5comm(config)# interface vlan 1
iS5comm(config-if)# no ip ospf authentication
iS5comm(config-if)# ip ospf message-digest-key 11 sha-1 abcd
iS5comm(config-if)# ip ospf authentication sha-1
iS5comm(config-if)# ip ospf key 11 start-generate 30-May-2021 09:20
iS5comm(config-if)# end
Configuration in ISS4
iS5comm# configure terminal
iS5comm(config)# interface vlan 1
iS5comm(config-if)# no ip ospf authentication
iS5comm(config-if)# ip ospf message-digest-key 11 sha-1 abcd
iS5comm(config-if)# ip ospf authentication sha-1
iS5comm(config-if)# ip ospf key 11 start-generate 30-May-2021 09:20
iS5comm(config-if)# end