需求:
1、
2、
3、
4、
======================================================
解决方案:
R1(config)#int s1/0
R1(config-if)#ip ospf authentication message-digest
R1(config-if)#ip ospf message-digest-key 1 md5 cisco
R2(config)#int s1/0
R2(config-if)#ip ospf authentication message-digest
R2(config-if)#ip ospf message-digest-key 1 md5 cisco
-->在区域1上做接口上的密文认证。
R1#sh ip ospf int s1/0
Serial1/0 is up, line protocol is up
Youngest key id is 1
可以看到s1/0接口上启用了OSPF密文认证。
----------------------------------------------------------------------------
R3(config)#int s1/1
R3(config-if)#ip ospf message-digest-key 1 md5 cisco1
R3(config)#router ospf 1
R3(config-router)#area 2 authentication message-digest
R4(config)#int s1/0
R4(config-if)#ip ospf message-digest-key 1 md5 cisco1
R4(config)#router ospf 1
R4(config-router)#area 2 authentication message-digest
-->在区域2上做区域的密文认证。
R3(config)#router ospf 1
R3(config-router)#area 2 virtual-link 4.4.4.4
R4(config)#router ospf 1
R4(config-router)#area 2 virtual-link 3.3.3.3
-->在区域0和区域3之间建立虚链路。
R3#sh ip ospf nei
Neighbor ID
4.4.4.4
2.2.2.2
4.4.4.4
-------------------------------------------------------------------------------------
R2(config)#int s1/1
R2(config-if)#ip ospf message-digest-key 1 md5 cisco2
R2(config)#router ospf 1
R2(config-router)#area 0 authentication message-digest
R3(config)#int s1/0
R3(config-if)#ip ospf message-digest-key 1 md5 cisco2
R3(config)#router ospf 1
R3(config-router)#area 0 authentication message-digest
R3(config-router)#area 2 virtual-link 4.4.4.4 message-digest-key 1 md5 cisco3
R4(config)#router ospf 1
R4(config-router)#area 2 virtual-link 3.3.3.3 message-digest-key 1 md5 cisco3
R4(config-router)#area 0 authentication message-digest
-->在区域0做密文认证,此时需要对虚链路两端做区域0的认证,否则虚链路在重启后会down掉。
或者
R3(config)#router ospf 1
R3(config-router)#area 2 virtual-link 4.4.4.4 authentication null
R4(config)#router ospf 1
R4(config-router)#area 2 virtual-link 3.3.3.3 authentication null
-->用authentication null在虚链路上来屏蔽对区域0的认证。