OSPF路由验证

OSPF路由验证:
主要分为两大方面
1.基于链路的验证
2..基于区域的验证
这里就只发命令了,很简单。
1.基于链路的验证:
R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 1.1.1.0 0.0.0.255 area 0
R1(config-router)#network 192.168.12.0 0.0.0.255 area 0
R1(config)#interface s0/0
R1(config-if)#ip ospf authentication //接口S0/0启用简单口令认证
R1(config-if)#ip ospf authentication-key cisco //配置认证密码
或者

R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 1.1.1.0 0.0.0.255 area 0
R1(config-router)#network 192.168.12.0 0.0.0.255 area 0
R1(config)#interface s0/0
R1(config-if)#ip ospf authentication message-digest//接口s0/0 启用MD5 认证
R1(config-if)#ip ospf message-digest-key 1 md5 cisco //配置key ID 及密匙
注意:加密方式,应该一样。不然无法建立关系。

2.基于区域的验证
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  / /区域号0 启用MD5 认证
R1(config)#interface s0/0
R1(config-if)#ip ospf message-digest-key 1 md5 cisco   //接口配置认证key ID 及密匙 ID 1 钥匙cisco
或者
R1(config-if)#ip ospf authentication-key cisco  //接口配置认证key为cisco 明文

注意:加密方式,应该一样。不然无法建立关系。

验证优先级:OSPF 链路认证优于区域认证