动态路由多点双向重分布
->
实验拓扑:
实验配置 :
实验拓扑如上图, 两个路由选择域, 在R2, R3上做路由的双向重分布, 使每个区域的路由器都可以达到共识.
实验目的 :
解决在多点重分布时出现路径的不优问题.
R2配置:
!
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
redistribute rip metric 10000 metric-type 1 subnets
network 192.1.12.0 0.0.0.255 area 0
!
router rip
version 2
redistribute ospf 1 metric 5
network 2.0.0.0
network 192.2.24.0
no auto-summary
!
ip classless
no ip http server
!
!
R3配置:
!
router ospf 1
router-id 3.3.3.3
log-adjacency-changes
redistribute rip metric 10000 metric-type 1 subnets
network 192.1.13.0 0.0.0.255 area 0
!
router rip
version 2
redistribute ospf 1 metric 5
network 3.0.0.0
network 192.2.35.0
no auto-summary
!
ip classless
no ip http server
!
!
R2 先双向重分布, 然后R3再双向重分布.
R3路由表:
O 192.1.12.0/24 [110/128] via 192.1.13.1, 00:03:19, Serial1
1.0.0.0/24 is subnetted, 1 subnets
O 1.1.1.0 [110/65] via 192.1.13.1, 00:03:19, Serial1
C 192.1.13.0/24 is directly connected, Serial1
2.0.0.0/24 is subnetted, 1 subnets
O E1 2.2.2.0 [110/10128] via 192.1.13.1, 00:03:19, Serial1
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
O E1 192.2.45.0/24 [110/10128] via 192.1.13.1, 00:03:19, Serial1
4.0.0.0/24 is subnetted, 1 subnets
O E1 4.4.4.0 [110/10128] via 192.1.13.1, 00:03:20, Serial1
5.0.0.0/24 is subnetted, 1 subnets
O E1 5.5.5.0 [110/10128] via 192.1.13.1, 00:03:20, Serial1
O E1 192.2.24.0/24 [110/10128] via 192.1.13.1, 00:03:22, Serial1
C 192.2.35.0/24 is directly connected, Serial0
*红色路由不优, 红色条目为以下RIPv2的路由, 直接通过RIP就可以到达, 现在反而通过OSPF学到从RIP重分布进来的这些条目.
R2路由表:
C 192.1.12.0/24 is directly connected, Serial0
1.0.0.0/24 is subnetted, 1 subnets
O 1.1.1.0 [110/65] via 192.1.12.1, 00:00:04, Serial0
O 192.1.13.0/24 [110/128] via 192.1.12.1, 00:00:04, Serial0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
3.0.0.0/24 is subnetted, 1 subnets
O E1 3.3.3.0 [110/10128] via 192.1.12.1, 00:00:04, Serial0
R 192.2.45.0/24 [120/1] via 192.2.24.4, 00:00:04, Serial1
4.0.0.0/24 is subnetted, 1 subnets
R 4.4.4.0 [120/1] via 192.2.24.4, 00:00:05, Serial1
5.0.0.0/24 is subnetted, 1 subnets
R 5.5.5.0 [120/2] via 192.2.24.4, 00:00:05, Serial1
C 192.2.24.0/24 is directly connected, Serial1
O E1 192.2.35.0/24 [110/10128] via 192.1.12.1, 00:00:06, Serial0
*不优条目
R1路由表:
C 192.1.12.0/24 is directly connected, Serial0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
C 192.1.13.0/24 is directly connected, Serial1
2.0.0.0/24 is subnetted, 1 subnets
O E1 2.2.2.0 [110/10064] via 192.1.12.2, 00:00:03, Serial0
3.0.0.0/24 is subnetted, 1 subnets
O E1 3.3.3.0 [110/10064] via 192.1.13.3, 00:00:03, Serial1
O E1 192.2.45.0/24 [110/10064] via 192.1.12.2, 00:00:03, Serial0
4.0.0.0/24 is subnetted, 1 subnets
O E1 4.4.4.0 [110/10064] via 192.1.12.2, 00:00:03, Serial0
5.0.0.0/24 is subnetted, 1 subnets
O E1 5.5.5.0 [110/10064] via 192.1.12.2, 00:00:04, Serial0
O E1 192.2.24.0/24 [110/10064] via 192.1.12.2, 00:00:04, Serial0
O E1 192.2.35.0/24 [110/10064] via 192.1.13.3, 00:00:14, Serial1
*R1对于下边RIPv2的路由路径没有达到负载均衡的效果
实验结论:
R2先双向重分布, 把R2通过RIP学到的路由信息带进OSPF域中, R1学到R2重分布进来的RIP路由信息(OE1), 当R1把OE1路由传给R3时, 此时R3本身也已有该些路由条目(R3通过RIP学到的路由信息), R3从R1收到(OE1)与自身(RIP)相同路由条目的更新信息时, 因为通过OSPF学到的路由管理距离比RIP低, 故采用OE1路由, 所以导致RIPv2网段的路由绕OSPF走, 出现路径不优的结果.
解决办法:
R2配置:
!
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
redistribute rip metric 10000 metric-type 1 subnets
network 192.1.12.0 0.0.0.255 area 0
distance 125 0.0.0.0 255.255.255.255 1 (1是调用下边的访问控制列表1)
!
router rip
version 2
redistribute ospf 1 metric 5
network 2.0.0.0
network 192.2.24.0
no auto-summary
!
ip classless
no ip http server
!
access-list 1 permit 192.2.0.0 0.0.255.255
access-list 1 permit 2.2.2.0 0.0.0.255
access-list 1 permit 3.3.3.0 0.0.0.255
access-list 1 permit 4.4.4.0 0.0.0.255
access-list 1 permit 5.5.5.0 0.0.0.255
!
R3配置:
!
router ospf 1
router-id 3.3.3.3
log-adjacency-changes
redistribute rip metric 10000 metric-type 1 subnets
network 192.1.13.0 0.0.0.255 area 0
distance 130 0.0.0.0 255.255.255.255 1
!
router rip
version 2
redistribute ospf 1 metric 5
network 3.0.0.0
network 192.2.35.0
no auto-summary
!
ip classless
no ip http server
!
access-list 1 permit 192.2.0.0 0.0.255.255
access-list 1 permit 2.2.2.0 0.0.0.255
access-list 1 permit 3.3.3.0 0.0.0.255
access-list 1 permit 4.4.4.0 0.0.0.255
access-list 1 permit 5.5.5.0 0.0.0.255
!
对重分布进OSPF的路由条目更改其管理距离
调整后的R3路由表:
O 192.1.12.0/24 [110/128] via 192.1.13.1, 00:05:05, Serial1
1.0.0.0/24 is subnetted, 1 subnets
O 1.1.1.0 [110/65] via 192.1.13.1, 00:05:05, Serial1
C 192.1.13.0/24 is directly connected, Serial1
2.0.0.0/24 is subnetted, 1 subnets
R 2.2.2.0 [120/3] via 192.2.35.5, 00:00:11, Serial0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
R 192.2.45.0/24 [120/1] via 192.2.35.5, 00:00:11, Serial0
4.0.0.0/24 is subnetted, 1 subnets
R 4.4.4.0 [120/2] via 192.2.35.5, 00:00:12, Serial0
5.0.0.0/24 is subnetted, 1 subnets
R 5.5.5.0 [120/1] via 192.2.35.5, 00:00:12, Serial0
R 192.2.24.0/24 [120/2] via 192.2.35.5, 00:00:13, Serial0
C 192.2.35.0/24 is directly connected, Serial0
调整后的R2路由表:
C 192.1.12.0/24 is directly connected, Serial0
1.0.0.0/24 is subnetted, 1 subnets
O 1.1.1.0 [110/65] via 192.1.12.1, 00:08:07, Serial0
O 192.1.13.0/24 [110/128] via 192.1.12.1, 00:08:07, Serial0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
3.0.0.0/24 is subnetted, 1 subnets
R 3.3.3.0 [120/3] via 192.2.24.4, 00:00:11, Serial1
R 192.2.45.0/24 [120/1] via 192.2.24.4, 00:00:11, Serial1
4.0.0.0/24 is subnetted, 1 subnets
R 4.4.4.0 [120/1] via 192.2.24.4, 00:00:12, Serial1
5.0.0.0/24 is subnetted, 1 subnets
R 5.5.5.0 [120/2] via 192.2.24.4, 00:00:12, Serial1
C 192.2.24.0/24 is directly connected, Serial1
R 192.2.35.0/24 [120/2] via 192.2.24.4, 00:00:13, Serial1
*R2. R3的路由条目都正常了, 各自使用本路由选择区域的IGP路由进行通讯
调整后的R1路由表:
C 192.1.12.0/24 is directly connected, Serial0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
C 192.1.13.0/24 is directly connected, Serial1
2.0.0.0/24 is subnetted, 1 subnets
O E1 2.2.2.0 [110/10064] via 192.1.12.2, 00:00:00, Serial0
[110/10064] via 192.1.13.3, 00:00:00, Serial1
3.0.0.0/24 is subnetted, 1 subnets
O E1 3.3.3.0 [110/10064] via 192.1.12.2, 00:00:00, Serial0
[110/10064] via 192.1.13.3, 00:00:02, Serial1
O E1 192.2.45.0/24 [110/10064] via 192.1.12.2, 00:00:02, Serial0
[110/10064] via 192.1.13.3, 00:00:02, Serial1
4.0.0.0/24 is subnetted, 1 subnets
O E1 4.4.4.0 [110/10064] via 192.1.12.2, 00:00:03, Serial0
[110/10064] via 192.1.13.3, 00:00:03, Serial1
5.0.0.0/24 is subnetted, 1 subnets
O E1 5.5.5.0 [110/10064] via 192.1.12.2, 00:00:03, Serial0
[110/10064] via 192.1.13.3, 00:00:03, Serial1
O E1 192.2.24.0/24 [110/10064] via 192.1.12.2, 00:00:03, Serial0
[110/10064] via 192.1.13.3, 00:00:03, Serial1
O E1 192.2.35.0/24 [110/10064] via 192.1.12.2, 00:00:03, Serial0
[110/10064] via 192.1.13.3, 00:00:03, Serial1
*R1对于RIPv2路由区域的路由也都达到负载均衡的结果
实验结论:
可以修改重分布进OSPF的RIPv2路由的管理距离, 以确保边界路由器选择RIPv2路由.
因为从RIPv2重分布进OSPF的路由管理距离修改为 (125,130), 虽然在边界路由器上有相同的RIPv2路由条目, 但RIPv2的管理距离比较小, 故仍采用RIPv2的路由条目.

大哥,请问用TAG 怎么做双向多点重分布。
你这个是用ACL 。要不用ACL 用TAG 。 教教我。
。。。不是一样嘛。@乔木