路由策略3_Distribute-list6(在双点双向重分发中的应用)
原创
©著作权归作者所有:来自51CTO博客作者810105851的原创作品,请联系作者获取转载授权,否则将追究法律责任
拓扑图:
如上图,在R2和R4上配置双点双向重发布,在配置双点双向重发布时,小AD重发布进大AD时是没问题的,但是大AD重发布进小AD时,就会出现问题,例如次优路径,环路等,如上图,如果是R2先学习到RIP网络的路由,那么在R4的路由表中,RIP网络的路由将是通过OSPF学习到的,这样就产生了次优路径(不是最优的路由)!可以配置分发列表来避免次优路径!下面先不配置分发列表,查看各路由器的路由表,接下来好做实验:
配置参数:
R2:
router ospf 1
redistribute rip metric 12 subnets
network 2.2.2.0 0.0.0.255 area 0
router rip
version 2
redistribute ospf 1 metric 3
network 1.0.0.0
no
auto-summary
R4:
router ospf 1
redistribute rip metric 12 subnets
network 4.4.4.0 0.0.0.255 area 0
router rip
version 2
redistribute ospf 1 metric 3
network 3.0.0.0
no
auto-summary
查看路由表:
R1:
r1#sh ip rou
1.0.0.0/24 is subnetted, 1 subnets
C
1.1.1.0 is directly connected, Serial0/0
2.0.0.0/24 is subnetted, 1 subnets
R
2.2.2.0 [120/3] via 3.3.3.2, 00:00:11, Serial0/1
[120/3] via 1.1.1.2, 00:00:19,
Serial0/0
3.0.0.0/24 is subnetted, 1 subnets
C
3.3.3.0 is directly connected, Serial0/1
4.0.0.0/24 is subnetted, 1 subnets
R 4.4.4.0 [120/3] via 3.3.3.2, 00:00:11,
Serial0/1
[120/3] via 1.1.1.2, 00:00:19,
Serial0/0
10.0.0.0/8 is variably subnetted, 7
subnets, 2 masks
R 10.10.10.10/32 [120/3] via 3.3.3.2,
00:00:11, Serial0/1
[120/3] via 1.1.1.2,
00:00:19, Serial0/0
R 10.11.11.11/32 [120/3] via 3.3.3.2,
00:00:13, Serial0/1
[120/3] via 1.1.1.2,
00:00:20, Serial0/0
R 10.8.8.8/32 [120/3] via 3.3.3.2,
00:00:13, Serial0/1
[120/3] via 1.1.1.2,
00:00:20, Serial0/0
R 10.9.9.9/32 [120/3] via 3.3.3.2,
00:00:13, Serial0/1
[120/3] via 1.1.1.2,
00:00:20, Serial0/0
C
10.2.0.0/16 is directly connected, Loopback1
C
10.3.0.0/16 is directly connected, Loopback2
C
10.1.0.0/16 is directly connected, Loopback0
r1#
可以看到R1学习到的OSPF的路由是通过两台边界路由器R2和R4学习来的,而且实现了负载均衡。这里R2和R4是将OSPF重发布进RIP,是小AD重发布进大AD,不会出现问题。
R2:
r2#sh ip rou
1.0.0.0/24 is subnetted, 1 subnets
C
1.1.1.0 is directly connected, Serial0/0
2.0.0.0/24 is subnetted, 1 subnets
C
2.2.2.0 is directly connected, Serial0/1
3.0.0.0/24 is subnetted, 1 subnets
O E2
3.3.3.0 [110/12] via 2.2.2.1, 00:03:58, Serial0/1
4.0.0.0/24 is subnetted, 1 subnets
O
4.4.4.0 [110/128] via 2.2.2.1, 00:03:58, Serial0/1
10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
O
10.10.10.10/32 [110/65] via 2.2.2.1, 00:03:58, Serial0/1
O
10.11.11.11/32 [110/65] via 2.2.2.1, 00:03:58, Serial0/1
O
10.8.8.8/32 [110/65] via 2.2.2.1, 00:03:58, Serial0/1
O
10.9.9.9/32 [110/65] via 2.2.2.1, 00:03:58, Serial0/1
R
10.2.0.0/16 [120/1] via 1.1.1.1, 00:00:23, Serial0/0
R
10.3.0.0/16 [120/1] via 1.1.1.1, 00:00:23, Serial0/0
R
10.1.0.0/16 [120/1] via 1.1.1.1, 00:00:23, Serial0/0
r2#
可以看到R2通过RIP学习到了RIP网络的路由!
R3:
r3#sh ip rou
1.0.0.0/24 is subnetted, 1 subnets
O E2
1.1.1.0 [110/12] via 2.2.2.2, 00:42:39, Serial0/0
2.0.0.0/24 is subnetted, 1 subnets
C
2.2.2.0 is directly connected, Serial0/0
3.0.0.0/24 is subnetted, 1 subnets
O E2
3.3.3.0 [110/12] via 4.4.4.2, 00:04:43, Serial0/1
4.0.0.0/24 is subnetted, 1 subnets
C
4.4.4.0 is directly connected, Serial0/1
10.0.0.0/16 is subnetted, 7 subnets
C
10.10.0.0 is directly connected, Loopback3
C
10.11.0.0 is directly connected, Loopback4
C
10.8.0.0 is directly connected, Loopback1
C
10.9.0.0 is directly connected, Loopback2
O E2
10.2.0.0 [110/12] via 2.2.2.2, 00:05:06, Serial0/0
O E2
10.3.0.0 [110/12] via 2.2.2.2, 00:05:06, Serial0/0
O E2
10.1.0.0 [110/12] via 2.2.2.2, 00:05:06, Serial0/0
r3#
可以看到R3是通过R2来学习RIP网络的路由的!!!
R4:
r4#sh ip rou
1.0.0.0/24 is subnetted, 1 subnets
O E2
1.1.1.0 [110/12] via 4.4.4.1, 00:05:50, Serial0/0
2.0.0.0/24 is subnetted, 1 subnets
O
2.2.2.0 [110/128] via 4.4.4.1, 00:05:50, Serial0/0
3.0.0.0/24 is subnetted, 1 subnets
C
3.3.3.0 is directly connected, Serial0/1
4.0.0.0/24 is subnetted, 1 subnets
C
4.4.4.0 is directly connected, Serial0/0
10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
O
10.10.10.10/32 [110/65] via 4.4.4.1, 00:05:50, Serial0/0
O
10.11.11.11/32 [110/65] via 4.4.4.1, 00:05:50, Serial0/0
O
10.8.8.8/32 [110/65] via 4.4.4.1, 00:05:50, Serial0/0
O
10.9.9.9/32 [110/65] via 4.4.4.1, 00:05:50, Serial0/0
O
E2 10.2.0.0/16 [110/12] via 4.4.4.1,
00:05:51, Serial0/0
O
E2 10.3.0.0/16 [110/12] via 4.4.4.1,
00:05:51, Serial0/0
O
E2 10.1.0.0/16 [110/12] via 4.4.4.1,
00:05:51, Serial0/0
r4#
如上面,R4是通过OSPF学习到的RIP网络的路由,因为OSPF的AD值比RIP小,所以OSPF的路由信息被装进路由表,而这并不最优的路由,这就是大AD值在重发布进小AD值时遇到的次优路径。下面配置分发列表来解决这个问题:
配置参数:
R2:
r2(config)#acc 1 de 10.1.0.0 //配置不匹配RIP网络的路由
r2(config)#acc 1 de 10.2.0.0
r2(config)#acc 1 de 10.3.0.0
r2(config)#acc 1 per an
//配置匹配其它的路由
r2(config)#router os 1 //进入OSPF路由配置进程
r2(config-router)#distribute-list 1 in s0/1
//配置分发列表,只有访问列表1匹配的路由才可以从接口s0/1进入
R4:
r4(config)#acc 1 de 10.1.0.0
r4(config)#acc 1 de 10.2.0.0
r4(config)#acc 1 de 10.3.0.0
r4(config)#acc 1 per an
r4(config)#router os 1
r4(config-router)#distri 1 in s0/0
r4(config-router)#
查看配置效果:
R2:
r2#sh ip rou
1.0.0.0/24 is subnetted, 1 subnets
C
1.1.1.0 is directly connected, Serial0/0
2.0.0.0/24 is subnetted, 1 subnets
C
2.2.2.0 is directly connected, Serial0/1
3.0.0.0/24 is subnetted, 1 subnets
O E2
3.3.3.0 [110/12] via 2.2.2.1, 00:05:08, Serial0/1
4.0.0.0/24 is subnetted, 1 subnets
O
4.4.4.0 [110/128] via 2.2.2.1,
00:05:08, Serial0/1
10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
O
10.10.10.10/32 [110/65] via 2.2.2.1, 00:05:08, Serial0/1
O
10.11.11.11/32 [110/65] via 2.2.2.1, 00:05:08, Serial0/1
O
10.8.8.8/32 [110/65] via 2.2.2.1, 00:05:08, Serial0/1
O
10.9.9.9/32 [110/65] via 2.2.2.1, 00:05:08, Serial0/1
R 10.2.0.0/16 [120/1] via 1.1.1.1,
00:00:42, Serial0/0
R 10.3.0.0/16 [120/1] via 1.1.1.1,
00:00:42, Serial0/0
R 10.1.0.0/16 [120/1] via 1.1.1.1,
00:00:42, Serial0/0
r2#
可以看出R2通过RIP学习到了RIP网络的路由
R3:
r3#sh ip rou
1.0.0.0/24 is subnetted, 1 subnets
O E2
1.1.1.0 [110/12] via 2.2.2.2, 00:03:36, Serial0/0
2.0.0.0/24 is subnetted, 1 subnets
C
2.2.2.0 is directly connected, Serial0/0
3.0.0.0/24 is subnetted, 1 subnets
O E2
3.3.3.0 [110/12] via 4.4.4.2, 00:15:00, Serial0/1
4.0.0.0/24 is subnetted, 1 subnets
C
4.4.4.0 is directly connected, Serial0/1
10.0.0.0/16 is subnetted, 7 subnets
C
10.10.0.0 is directly connected, Loopback3
C
10.11.0.0 is directly connected, Loopback4
C
10.8.0.0 is directly connected, Loopback1
C
10.9.0.0 is directly connected, Loopback2
O
E2 10.2.0.0 [110/12] via 4.4.4.2,
00:03:49, Serial0/1
[110/12] via 2.2.2.2, 00:03:49,
Serial0/0
O
E2 10.3.0.0 [110/12] via 4.4.4.2,
00:03:49, Serial0/1
[110/12] via 2.2.2.2,
00:03:49, Serial0/0
O
E2 10.1.0.0 [110/12] via 4.4.4.2,
00:03:49, Serial0/1
[110/12] via 2.2.2.2,
00:03:49, Serial0/0
r3#
可以看到R3的路由表中,RIP网络的路由是通过R2和R4学习到的而且实现了负载均衡,和R1学习到OSPF网络的路由一样,可以看到有2条路由去往对端的网络!!!
R4:
r4#sh ip rou
1.0.0.0/24 is subnetted, 1 subnets
O E2
1.1.1.0 [110/12] via 4.4.4.1, 00:06:17, Serial0/0
2.0.0.0/24 is subnetted, 1 subnets
O
2.2.2.0 [110/128] via 4.4.4.1, 00:06:17, Serial0/0
3.0.0.0/24 is subnetted, 1 subnets
C
3.3.3.0 is directly connected, Serial0/1
4.0.0.0/24 is subnetted, 1 subnets
C
4.4.4.0 is directly connected, Serial0/0
10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
O
10.10.10.10/32 [110/65] via 4.4.4.1, 00:06:17, Serial0/0
O
10.11.11.11/32 [110/65] via 4.4.4.1, 00:06:17, Serial0/0
O
10.8.8.8/32 [110/65] via 4.4.4.1, 00:06:17, Serial0/0
O
10.9.9.9/32 [110/65] via 4.4.4.1, 00:06:17, Serial0/0
R 10.2.0.0/16 [120/1] via 3.3.3.1,
00:00:21, Serial0/1
R 10.3.0.0/16 [120/1] via 3.3.3.1,
00:00:21, Serial0/1
R 10.1.0.0/16 [120/1] via 3.3.3.1,
00:00:21, Serial0/1
r4#
可以看到R4是通过RIP学习到的RIP网络的路由,而不是通过OSPF,这样避免了次优路径!
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
LLM在OCR中的应用
LLM在OCR中的应用
预处理 sed 验证码 -
58-高级路由:双点双向重分发
双点双向重分发
双点 双向 重分发 -
路由策略3_Distribute-list2
预备知识:分发列表可根据下列因素过渡更新:l 入站接口inl 出站接口outl 从另一种路由协议生分发如果后面不接接口,默认对所有运行该路由协议的接口起作用!
路由器 rip gns3 distribute-list 分发列表 -
路由策略专题(二)之分发列表(Distribute-List)
在众多的路由策略工具中分发列表是我们比较常见的之一。本文结合具体实例讲述分发列表的具体使用
路由策略 分发列表 distribute-list 路由交换 思科(Cisco) -
CCNP路由-12 路由策略3 Distribute-list prefix-list
CCNP路由-12 路由策略3 Distribute-list prefix-list
CCNP 路由策略 Distribute-list pref