How to Configure OSPF MD5 Authentication
How to Configure OSPF MD5 Authentication
Just two routers in the same area, nothing special. Here is the
configuration to enable MD5 authentication:
Lessons
It is also possible to enable authentication for the entire area. This way,
you don’t have to use the ip ospf authentication message-digest
command on all of your interfaces to activate it. Here’s the command
to enable MD5 authentication for the entire area:
R1(config)#router ospf 1
R1(config-router)#area 0 authentication message-digest
1. Verification
R1#show ip ospf interface fastEthernet 0/0
FastEthernet0/0 is up, line protocol is up
Internet Address 192.168.12.1/24, Area 0
Process ID 1, Router ID 192.168.12.1, Network Type
BROADCAST, Cost: 1
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router (ID) 192.168.12.2, Interface address
192.168.12.2
Backup Designated router (ID) 192.168.12.1, Interface
address 192.168.12.1
Flush timer for old DR LSA due in 00:01:53
Lessons
First, we’ll enter the wrong password. Now I’ll enable a debug and reset
the OSPF process:
Lessons
R1#
OSPF: Rcv pkt from 192.168.12.2, FastEthernet0/0 :
Mismatch Authentication Key - Message Digest Key 1
Somewhere in the debug, you’ll see the message above. This means
that we are using MD5 key ID 1 on both sides, but the password is
incorrect.
Configurations
Want to take a look for yourself? Here you will find the final
configuration of each device.
R1
hostname R1
!
interface FastEthernet0/0
ip address 192.168.12.1 255.255.255.0
ip ospf message-digest-key 1 md5 MYPASS
ip ospf authentication message-digest
!
router ospf 1
network 192.168.12.0 0.0.0.255 area 0
area 0 authentication message-digest
!
end
Lessons
R2
hostname R2
!
interface FastEthernet0/0
ip address 192.168.12.2 255.255.255.0
ip ospf message-digest-key 1 md5 MYPASS
ip ospf authentication message-digest
!
router ospf 1
network 192.168.12.0 0.0.0.255 area 0
area 0 authentication message-digest
!
end
That’s all there is for now. I hope this was useful for you! If you have
any questions, please leave a comment.
« Previous Lesson
OSPF Plain-Text
Authentication
Next Lesson
OSPF HMAC SHA Extended
Authentication
»
Tags: Authentication
Forum Replies
system
jmwalker24
Does that have to be done first? If yes – then the - Area 1 authentication
message digest – command applies authentication to every other router and
its interface in the entire area? … with the same key and password?
ReneMolenaar
Hi Jason,
If you enable those two commands on the interface then MD5 authentication
will be used, but only if the interface is running OSPF. You need to make sure
you have a network command that covers the subnet of the interface.
Otherwise…the interface won’t run OSPF so we also won’t have any
authentication
Rene
nokturnes
adkatamba
what if i have instances of different OSPF area, and I want the different areas
to communicate. is it still the exact same or I need to have a different key
number and the same password.
Lessons