ospf认证
 

                          R1                                                                                    R2
 
 
OSPF 接口认证:(分为明文认证和密文认证)
 
一、 明文认证:
 
1、  基本配置:
R1
interface Loopback0
 ip address 1.1.1 .1 255.255.255.0
interface Serial2/2
 ip address 12.0.0 .1 255.255.255.0
router ospf 1
 log-adjacency-changes
 network 1.1.1 .0 0.0.0.255 area 0
 network 12.0.0 .0 0.0.0.255 area 0
 
R2
interface Loopback0
 ip address 2.2.2 .2 255.255.255.0
interface Serial2/1
 ip address 12.0.0 .2 255.255.255.0
router ospf 1
 log-adjacency-changes
 network 2.2.2 .0 0.0.0.255 area 0
 network 12.0.0 .0 0.0.0.255 area 0
2、  在接口下启动简单密码认证:
 
ip ospf authentication
ip ospf authentication-key ccie
 
Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2 .2           1   FULL/  -        00:00:38    12.0.0 .2        Serial2/2
 
Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1 .1           1   FULL/  -        00:00:36    12.0.0 .1        Serial2/1
 
注意:不管是明文认证还是密文认证,在 R1 R2 上的密码要相同,认证方式也要相同。
 
 
二、 基本配置同上:
在接口下配置密文认证:
r1(config-if)#ip ospf authentication message-digest (启用密文认证)
r1(config-if)#ip ospf message-digest-key 1 md5 ccie (指定认证类型并设密码)
 
r2(config-if)#ip ospf authentication message-digest (启用密文认证)
r2(config-if)#ip ospf message-digest-key 1 md5 ccie (指定认证类型并设密码)
 
 
OSPF 区域认证(分为明文认证和密文认证):
 
 
一、 明文认证:
 
r1(config-router)#area 0 authentication
r2(config-router)#area 0 authentication
 
Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2 .2           1   FULL/  -        00:00:38    12.0.0 .2        Serial2/2
 
Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1 .1           1   FULL/  -        00:00:36    12.0.0 .1        Serial2/1
二、密文认证:
area 0 authentication message-digest
area 0 authentication message-digest
 
Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2 .2           1   FULL/  -        00:00:38    12.0.0 .2        Serial2/2
 
Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1 .1           1   FULL/  -        00:00:36    12.0.0 .1        Serial2/1
 
注意:不管是区域认证还是接口认证,认证的类型和密码要相同。