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 terminal
Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#interface
Router1(config-if)#
Serial0/1
ip ospf message-digest-key
1
md5
Router1(config-if)#
oreilly
exit
Router1(config)#router ospf
Router1(config-router)#
55
area
2
authentication message-digest
Router1(config-router)#exit
Router1(config)#end
Router1#
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 terminal
Enter configuration commands, one per line. End with CNTL/Z. Router2(config)#interface
Router2(config-if)#
Serial0/0
ip ospf message-digest-key
1
md5
Router2(config-if)#
oreilly
exit
Router2(config)#router ospf
Router2(config-router)#
12
area
2
authentication message-digest
Router2(config-router)#exit
Router2(config)#end
Router2#
Discussion
RFC 2328, which defines OSPF Version 2, includes three different types of authentication for OSPF: null authentication, simple password authentication, and cryptographic authentication. ...
Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.