1、动态路由协议ospf支持明文验证和加密验证。我们这里以三台2811路由器配置。
2、拓扑图中,我们配置路由R1和R2明文验证,R2和R3加密验证。查看R1的直接网络R1#sh ip int bri
3、配置R1的ospfR1(config-if)#router ospf 1R1(config-router)#network 192.168.1.1 0.0.0.0 area 0
4、查看R2的直接网络R2#sh ip int bri
5、配置R2的ospfR2(config-if)#router ospf 1R2(config-router)#network 192.168.1.2 0.0.0.0 area 0R2(config-router)#network 192.168.2.1 0.0.0.0 area 0
6、查看R3的直接网络R3#sh ip int bri
7、配置R3的ospfR3(config-if)#router ospf 1R2(config-router)#network 192.168.2.2 0.0.0.0 area 0
8、验证是在线路上的验证,我们配置R1的接口线路。我们先配置明文验证。R1(config)#interface fa0/0R1(config-if)#ip ospf authenticationR1(config-if)#ip ospf authentication-key ospf这里的密码设置为ospf
9、线路是双向的,我们还要配置R2的明文验证。验证类型和密码都要一样。R2(config)#interface fa0/0R2(config-if)#ip ospf authenticationR3(config-if)#ip ospf authentication-key ospf
10、配置R2加密验证message-digest,加密类型是md5。R2(config)#interface fa0/1R2(config-if)#ip ospf authentication message-digestR2(config-if)#ip ospf message-digest-key 1 md5 eigrp
11、配置R3加密验证message-digest,加密类型是md5。R3(config)#inter fa0/1R3(config-if)#ip ospf authentication message-digestR3(config-if)#ip ospf message-digest-key 1 md5 eigrp
12、查看路由邻居表R2#show ip ospf neighbor