Enabling OSPF Authentication
Problem
You want to authenticate your OSPF neighbor relationships to ensure that no unauthorized equipment is allowed to affect routing.
Solution
To enable OSPF MD5 authentication, you need to define the encryption key, which is essentially just a password, on an interface. And you also must enable authentication for the entire area. For the first router, you could do this as follows:
Router1#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router1(config)#interfaceRouter1(config-if)#Serial0/1ip ospf message-digest-key1md5Router1(config-if)#oreillyexitRouter1(config)#router ospfRouter1(config-router)#55area2authentication message-digestRouter1(config-router)#exitRouter1(config)#endRouter1#
Similarly, you must enable OSPF authentication on other routers in the area, as well as making sure that the authentication keys match on all interfaces that share the same network segment:
Router2#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router2(config)#interfaceRouter2(config-if)#Serial0/0ip ospf message-digest-key1md5Router2(config-if)#oreillyexitRouter2(config)#router ospfRouter2(config-router)#12area2authentication message-digestRouter2(config-router)#exitRouter2(config)#endRouter2#
Discussion
RFC 2328, which defines OSPF Version 2, includes three different types of authentication for OSPF: null authentication, simple password authentication, and cryptographic authentication. ...