拓扑说明
R1: s0 10.1.1.1/24  l0 4.4.4.4/32
R2: s0 10.1.1.2/24   s1 10.1.2.5/24  l0 5.5.5.5/32
R3: s1 10.1.2.6/24  l0 6.6.6.6/32
R1, R2的S0和l0参与area 0
R2, R3的S1参与area 2
R3的l0 参与area 3
 
1,基于区域的验证
R1
conf t
int l 0
ip ad 4.4.4.4 255.255.255.255
int s 0
ip ad 10.1.1.1 255.255.255.0
clock rate 64000
no shut
ip ospf message 1 md5 pass
router ospf 1
router-id 4.4.4.4
net 4.4.4.4 0.0.0.0 a 0
net 10.1.1.1 0.0.0.0 a 0
area 0 authentication message-digest
end

R2
conf t
int l 0
ip ad 5.5.5.5 255.255.255.255
int s 0
ip ad 10.1.1.2 255.255.255.0
no shut
int s 1
ip ad 10.1.2.5 255.255.255.0
no shut
ip ospf message 1 md5 ccie
router ospf 1
router-id 5.5.5.5
net 5.5.5.5 0.0.0.0 a 0
net 10.1.1.2 0.0.0.0 a 0
net 10.1.2.5 0.0.0.0 a 2
area 2 virtual-link 6.6.6.6
area 0 authentication message-digest
area 2 virtual-link 6.6.6.6 authentication-key pass

end
 
R3
conf t
int  l 0
ip ad 6.6.6.6 255.255.255.255
int l 1
ip ad 6.6.7.6 255.255.255.255
int s 1
clock rate 64000
ip ad 10.1.2.6 255.255.255.0
no shut
router ospf 1
router-id 6.6.6.6
net 6.6.6.6 0.0.0.0 a 2
net 10.1.2.6 0.0.0.0 a 2
net 6.6.7.6 0.0.0.0 a 3
area 2 virtual-link 5.5.5.5
area 0 authentication message-digest
area 2 virtual-link 5.5.5.5 authentication-key pass

end

r1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route
Gateway of last resort is not set
     4.0.0.0/32 is subnetted, 1 subnets
C       4.4.4.4 is directly connected, Loopback0
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/65] via 10.1.1.2, 00:00:54, Serial0
     6.0.0.0/32 is subnetted, 2 subnets
O IA    6.6.6.6 [110/75] via 10.1.1.2, 00:00:54, Serial0
O IA    6.6.7.6 [110/75] via 10.1.1.2, 00:00:54, Serial0

     10.0.0.0/24 is subnetted, 2 subnets
O IA    10.1.2.0 [110/74] via 10.1.1.2, 00:00:54, Serial0
C       10.1.1.0 is directly connected, Serial0

r2#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route
Gateway of last resort is not set
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/65] via 10.1.1.1, 00:01:13, Serial0
     5.0.0.0/32 is subnetted, 1 subnets
C       5.5.5.5 is directly connected, Loopback0
     6.0.0.0/32 is subnetted, 2 subnets
O       6.6.6.6 [110/11] via 10.1.2.6, 00:26:07, Ethernet0
O IA    6.6.7.6 [110/11] via 10.1.2.6, 00:01:13, Ethernet0

     10.0.0.0/24 is subnetted, 2 subnets
C       10.1.2.0 is directly connected, Ethernet0
C       10.1.1.0 is directly connected, Serial0

R3#
R3#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route
Gateway of last resort is not set
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/75] via 10.1.2.5, 00:00:24,
Ethernet0/0
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/11] via 10.1.2.5, 00:00:24, Ethernet0/0
     6.0.0.0/32 is subnetted, 2 subnets
C       6.6.6.6 is directly connected, Loopback0
C       6.6.7.6 is directly connected, Loopback1
     10.0.0.0/24 is subnetted, 2 subnets
C       10.1.2.0 is directly connected, Ethernet0/0
O       10.1.1.0 [110/74] via 10.1.2.5, 00:00:24, Ethernet0/0
 
 
 
二,基于接口的验证
初始配置就不再写了,这里只写有关接口验证的配置
R1
conf t
int s 0
ip ospf authentication message-digest
ip ospf message-digest 1 md5 pass
end
 
R2
int s 0
ip ospf authentication message-digest
ip ospf message-digest 1 md5 pass
router ospf 1
area 0 authentication message-digest
area 2 virtual-link 6.6.6.6 authentication message-digest
area 2 virtual-link 6.6.6.6 message-digest 1 md5 pass
end
 
R3
conf t
router ospf 1
area 0 authentication message-digest
area 2 virtual-link 5.5.5.5 authentication message-digest
area 2 virtual-link 5.5.5.5 message-digest 1 md5 pass
end
 
校验
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     4.0.0.0/32 is subnetted, 1 subnets
C       4.4.4.4 is directly connected, Loopback0
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/65] via 10.1.1.2, 00:00:11, Serial2/0
     6.0.0.0/32 is subnetted, 2 subnets
O IA    6.6.6.6 [110/129] via 10.1.1.2, 00:00:11, Serial2/0
O IA    6.6.7.6 [110/129] via 10.1.1.2, 00:00:11, Serial2/0
     10.0.0.0/24 is subnetted, 2 subnets
O IA    10.1.2.0 [110/128] via 10.1.1.2, 00:00:11, Serial2/0

C       10.1.1.0 is directly connected, Serial2/0
 
R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/65] via 10.1.1.1, 00:00:06, Serial2/0
     5.0.0.0/32 is subnetted, 1 subnets
C       5.5.5.5 is directly connected, Loopback0
     6.0.0.0/32 is subnetted, 2 subnets
O       6.6.6.6 [110/65] via 10.1.2.6, 00:29:27, Serial2/1
O IA    6.6.7.6 [110/65] via 10.1.2.6, 00:00:06, Serial2/1
     10.0.0.0/24 is subnetted, 2 subnets
C       10.1.2.0 is directly connected, Serial2/1
C       10.1.1.0 is directly connected, Serial2/0
 
R3#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/129] via 10.1.2.5, 00:00:10, Serial2/1
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/65] via 10.1.2.5, 00:00:10, Serial2/1
     6.0.0.0/32 is subnetted, 2 subnets
C       6.6.6.6 is directly connected, Loopback0
C       6.6.7.6 is directly connected, Loopback1
     10.0.0.0/24 is subnetted, 2 subnets
C       10.1.2.0 is directly connected, Serial2/1
O       10.1.1.0 [110/128] via 10.1.2.5, 00:00:10, Serial
 
以上是OSPF的验证方法,OSPF的验证有两种,一种是明文验证,一种是MD5验证,在此只写出MD5验证的配置方法。