Interface level command
ip ospf authentication message-digest (Enable MD5 authentication)
ip ospf message-digest-key 1 md5 cisco
ip ospf authentication (Enable clear text authentication)
ip ospf authentication-key cisco
OSPF authentication type
Type 0: Null, no authentication
Command: ip ospf authentication null
Type 1: Clear text
Command: ip ospf authentication
Type 2: MD5 hash authentication
Command: ip ospf authentication message-digest
Condition for the authentication to work
OSPF neighbors must have the same authentication.
If OSPF area authentication is enabled, it must be enabled for the entire area.