菜鸟学习CCNA-OSPF认证
网络拓扑图:
OSPF简单认证
R1(config)#router ospf 1 //启用ospf协议
R1(config-router)#router-id 1.1.1.1 //配置id
R1(config-router)#network 1.1.1.0 255.255.255.0 area 0 //通告网段
R1(config-router)#network 192.168.1.0 255.255.255.0 area 0
R1(config-router)#area 0 authentication //区域0 启用简单口令认证
R1(config-router)#int s0/0/0 //进入接口S0/0/0
R1(config-if)#ip ospf authentication-key cisco //配置认证密码
R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 2.2.2.0 255.255.255.0 area 0
R2(config-router)#network 192.168.1.0 255.255.255.0 area 0
R2(config-router)#area 0 authentication
R2(config-router)#int s0/0/0
R2(config-if)#ip ospf authentication-key cisco
配置查看:
R1#show ip ospf
.........
Area BACKBONE(0)
Number of interfaces in this area is 1
Area has simple password authentication //启用简单认证
.........
R1#show ip ospf interface
........
Simple password authentication enabled //启用简单认证
OSPF MD5认证
R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 192.168.12.0 255.255.255.0 area 0
R1(config-router)#network 1.1.1.0 255.255.255.0 area 0
R1(config-router)#area 0 authentication message-digest
R1(config-router)#int s0/0/0
1(config-if)#ip ospf message-digest-key 1 md5 cisco
R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 192.168.1.0 255.255.255.0 area 0
R2(config-router)#network 2.2.2.0 255.255.255.0 area 0
R2(config-router)#area 0 authentication message-digest //区域0启用MD5 认证
R2(config-router)#int s0/0/0
R2(config-if)#ip ospf message-digest-key 1 md5 cisco//配置认证key ID及密匙
配置查看:
R1#show ip ospf
......
Area has message digest authentication //启用MD5认证