二、OSPF认证配置
% V$ @- T2 J9 E/ Q) p) a; d' vOSPF认证有基于区域和基于链路的认证,现分别介绍如下:
1 k1 Q- u+ j% M, l1 a$ W9 d# e8 n
/ g' ]$ r2 j+ w1 h/ B3 M(一)基于区域的认证' M- K1 t1 b' o% @* u4 K( q
7 M; B" V/ N) H, E7 c0 i% m1、明文认证:各个路由器的基本配置
/ k; K; |9 d6 K, U6 {! T-------------------------------------
. A: F% O& q4 ^8 ~1 J1 R: F' XRA(config)#router ospf 1' ^3 @# I9 o6 z! d
RA(config-router)#area 0 auth -----启用基于区域的明文验证
; J8 \0 X1 ]! x9 n3 jRA(config-router)#int s1/0
+ O! {9 S7 B- y) t. ~RA(config-if)#ip ospf authentication-key 123 ----设置验证密钥
" `! f9 p0 _3 h, xRA(config-if)#int s1/2
9 w3 d i. k/ A0 j [4 p, oRA(config-if)#ip ospf authentication-key 123- S: s2 ?' m+ c/ z. l: C2 J7 B: t
RA(config-if)#end% x+ ?3 H( N1 F
-------------------------------------------# v! f# j# Z) Z/ R
RB(config-router)#area 0 auth
+ D" ?1 p' _1 [$ e" U5 s/ SRB(config-router)#int s1/0
7 p. E i7 o( i9 T1 hRB(config-if)#ip ospf authentication-key 123
l: X3 a* V, ?1 }" `RB(config-if)#int s1/1
# g% H% a! s9 \- y1 zRB(config-if)#ip ospf authentication-key 123: C0 Z; w2 e- c: D V9 J
------------------------------------------------------------------
) }/ y6 |; l7 z4 _/ hRC(config)#router ospf 35 \& `6 N$ Z+ n( z n, `
RC(config-router)#area 0 auth
" n$ G' c3 _$ o+ J5 ^3 R3 J* ~RC(config-router)#int s1/19 f. ?" U- [. t
RC(config-if)#ip ospf authentication-key 123
* t j \8 D' S' ^, kRC(config-if)#int s1/2
" r9 |6 H- d3 t- rRC(config-if)#ip ospf authentication-key 1 |