
言归正传,OSPF和RIP都配置好后执行重发布
n$ w2 e4 K" e2 x然后很自然地产生了次优路径:/ E! F$ t- G/ I3 f* j% U
发布后由于OSPF的管理距离小于RIP,所以R2上到192.168.6.0网段的下一跳指向了R4而不是R1,为了解决这个问题,配置了发布列表,R2和R3配置如下:
& W, c+ [/ ~% H$ q. DR2:
7 m8 S j& B1 b0 L$ Irouter ospf 18 a) B: K% m4 F+ ?
log-adjacency-changes
% z( ]% N% A2 oredistribute rip subnets# z @. Z6 f3 D+ F. b, p
network 192.168.3.0 0.0.0.255 area 0
. m8 ^1 H+ r+ g" M3 e- m+ Zdistribute-list 2 in7 C- s. T( o7 [
!
N$ g k1 o2 nrouter rip
- V; i5 P3 Z1 @) oversion 2/ [6 p6 |% [( D: z" G
redistribute ospf 1 metric 5
% ]! S+ Y5 j' K0 @# gnetwork 192.168.2.0( @4 F9 |' z/ O9 z( ?9 |& a% J
distribute-list 1 in
3 @% m# K( q, ^no auto-summary
& P. Y* Q% `" R% J!
, D; \$ P: V% i0 B! o% c$ Sip http server! D2 R- r7 t& A2 p' [# m6 m
!
' W7 ~$ B. D4 S6 J0 W* U!
: B7 h0 t6 f3 z& [9 K: M/ i6 C!
9 L5 A% a+ R, r" T) ^! ]0 taccess-list 1 permit 192.168.1.0 0.0.0.255* g& F0 X! F. l
access-list 1 permit 192.168.6.0 0.0.0.255
, T4 @/ ^5 e3 C! caccess-list 2 permit 192.168.4.0 0.0.0.2553 Z% ?/ v8 x$ T' C& I. I+ y
access-list 2 permit 192.168.5.0 0.0.0.255
) ~1 ^. V0 { C8 u8 h
0 Z, Z: E" b$ z! Y9 w) I% ZR3:5 j4 w! x6 ]* \! y. c, D* e
router ospf 14 f, T- a; p5 V7 ]2 W2 d2 m
log-adjacency-changes3 k$ I" E/ w0 O$ ]
redistribute rip subnets
5 k0 `& z# w5 j. @5 znetwork 192.168.5.0 0.0.0.255 area 0
6 ~2 J! w4 Y ?distribute-list 2 in
% n W/ G# }6 d# C* E!+ G% D- L y9 X5 C+ o8 B
router rip' H! C) \# P2 A
version 24 G5 N/ {. |; @3 \9 u& w7 d* q
redistribute ospf 1 metric 5& q. Y2 ?2 A# F4 t2 y
network 192.168.6.0
: f8 P9 z% e+ ?8 w. Ydistribute-list 1 in d2 P! F. w) O( ]% F# A! n$ @
no auto-summary- |7 J7 E: I4 X- F' E# ]( E5 m# U4 @
!# @. E2 L6 b, B" l% t8 `/ b. s
ip http server
) V, l, `0 E k M( X, W0 V!9 Z' i1 ]- M0 Q2 V' m
!
7 S, R1 J$ m! U" n!
* o! v* s/ f; z% i2 t, M3 ^access-list 1 permit 192.168.2.0 0.0.0.2555 o: M# ~- {& e0 A
access-list 1 permit 192.168.1.0 0.0.0.255$ T8 X- V- H( I t! k
access-list 2 permit 192.168.3.0 0.0.0.255
8 _, I' T5 r2 t& Xaccess-list 2 permit 192.168.4.0 0.0.0.255. h3 d& S$ E0 D) m- v/ A
2 |: T! ]1 _2 Q' n我理解的是只有访问控制列表1允许的地址才能发布进入RIP进程,列表2允许的地址可以发布进入ospf进程,不明白的是为什么R1、R4和R5还能学到不允许的地址?不是在重发布路由器那就给拦住了吗?
3 |7 r0 s2 b+ SR1:
" G+ }1 b$ a7 Q* hR1#sh ip rou
* i4 ?( F5 Q a% M7 SCodes: C - connected, S - static, R - RIP, M - mobile, B - BGP
3 x8 F1 X5 ?+ U/ i8 t D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area $ E% B$ L& ^: g; n) F: }& {; d
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 28 k4 ^% `# B( |6 o6 _! ?6 n: ]5 h
E1 - OSPF external type 1, E2 - OSPF external type 2
' k1 R3 U5 x! X* j% q/ n9 y3 M i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
I# P3 K2 `; {6 u7 J8 } ia - IS-IS inter area, * - candidate default, U - per-user static route
2 g% w$ E2 c+ F+ W! j3 ~4 n" ^/ l o - ODR, P - periodic downloaded static route
5 P. J/ e6 U# x5 i# Z' k4 o _5 K9 }8 {; X: @) k' I2 }
Gateway of last resort is not set9 K2 T+ E4 S/ N' U% J5 A; [; H& H
9 Q5 P& e$ R% @ D! S: WR 192.168.4.0/24 [120/5] via 192.168.6.2, 00:00:02, FastEthernet1/01 J# {+ w$ q2 W; W
[120/5] via 192.168.2.2, 00:02:20, FastEthernet0/09 B* @( C4 D/ v% \/ p
R 192.168.5.0/24 [120/5] via 192.168.6.2, 00:00:02, FastEthernet1/09 r# y! x0 U8 M& u3 C" C/ Z
[120/5] via 192.168.2.2, 00:02:20, FastEthernet0/0
1 p9 d4 S9 U+ G7 O) sC 192.168.6.0/24 is directly connected, FastEthernet1/0
4 O1 y- o4 B" H) u& ^) ?2 w7 g$ c# \C 192.168.1.0/24 is directly connected, Loopback0- r% }# [; F G' n# h7 b
C 192.168.2.0/24 is directly connected, FastEthernet0/0
t+ I8 K7 Y' o, W: g. l; q- {R 192.168.3.0/24 [120/5] via 192.168.6.2, 00:00:02, FastEthernet1/0
* W; f. @! a* M, c [120/5] via 192.168.2.2, 00:02:20, FastEthernet0/0$ ~6 j& m6 y! |6 u7 K* Z- H
% y J7 V* J& GR4:
8 E" |2 i! D) |* b9 K7 rR4#sh ip rou, s& K, Q9 R+ n* N" `2 b
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP# O' T! A: ^$ s: w' Y) u# Y' i: o9 s
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
0 B3 w% x2 j) q" H/ e( R) b N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
4 s2 K: {! |$ l* u7 q' U E1 - OSPF external type 1, E2 - OSPF external type 2" X: ^7 M* e# T. `
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-21 |! l/ H' H9 b! @. z
ia - IS-IS inter area, * - candidate default, U - per-user static route2 |/ \' b4 H# D5 Y. u
o - ODR, P - periodic downloaded static route
* s3 ?0 u3 _6 _6 }; C8 M7 `
- P; R* ]! V. m: GGateway of last resort is not set
5 J$ h1 k6 ?/ A: @% ]0 t) O3 m6 o; V$ \- x
C 192.168.4.0/24 is directly connected, FastEthernet0/0$ C( E" i. g0 ]. R3 @8 I6 R
O 192.168.5.0/24 [110/65] via 192.168.4.2, 00:16:40, FastEthernet0/0( ]5 t8 g; h" }; x/ A
O E2 192.168.6.0/24 [110/20] via 192.168.3.1, 00:05:59, Serial1/0
4 T' O5 s( O& N) l; `/ t4 G* {O E2 192.168.1.0/24 [110/20] via 192.168.3.1, 00:05:59, Serial1/0
" v% b7 t7 B& bO E2 192.168.2.0/24 [110/20] via 192.168.3.1, 00:05:59, Serial1/0
/ t6 k$ p5 q6 {C 192.168.3.0/24 is directly connected, Serial1/06 ^3 z# z# C! A! l- K
: f8 v2 S7 [7 J2 |+ {8 SR5:
; a- B2 f7 f" u6 ER5#sh ip rou ' C e+ k2 l" V* U$ @; }
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP( ~9 [' f% r f& x
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 8 h) A; `+ q* C% U! K
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
0 H. b2 f4 z! J# h2 Z7 N E1 - OSPF external type 1, E2 - OSPF external type 2
+ n0 K5 M: S& z8 K0 ` i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
" @4 F1 k- Y& b& Z( F ia - IS-IS inter area, * - candidate default, U - per-user static route
8 v; Z" e u( c! [# x o - ODR, P - periodic downloaded static route
9 [. N- r3 g6 z' x+ M, m3 K% m0 s# @( k
Gateway of last resort is not set
" s9 U) B/ b2 @' c$ c1 M i, }& D( Y! U7 G2 R
C 192.168.4.0/24 is directly connected, FastEthernet0/05 V+ z) o2 Y4 y
C 192.168.5.0/24 is directly connected, Serial1/0
/ w( ^. }- y; EO E2 192.168.6.0/24 [110/20] via 192.168.5.1, 00:26:47, Serial1/0
9 C. f7 _7 k$ q: S' Q8 EO E2 192.168.1.0/24 [110/20] via 192.168.5.1, 00:26:48, Serial1/0) b, `. i) y$ w% ?; U, d; @* M
O E2 192.168.2.0/24 [110/20] via 192.168.5.1, 00:26:48, Serial1/04 y6 S9 i4 q7 a6 m' `7 W, z9 X4 _
O 192.168.3.0/24 [110/65] via 192.168.4.1, 00:33:54, FastEthernet0/0' y5 x& }" S2 _" t
: I) [( O8 l3 r5 @: b求高手解答下我的疑问.... |
|