今天做一个RIP与OSPF之间路由重分发的实验,实验拓扑图如下:
实验用的时小凡的模拟器,路由器连接拓扑如下表:
Router1 S0/0 <----> Router2 S0/1
Router2 S0/0 <----> Router3 S0/1
Router3 S0/0 <----> Router4 S0/1
Router2 S0/0 <----> Router3 S0/1
Router3 S0/0 <----> Router4 S0/1
实验过程如下;
RIP to OSPF
RIP to OSPF
在未使用路由重分发之前的路由状况:
R1#sh ip route
!
Gateway of last resort is not set
!
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
R 10.0.0.8/30 [120/1] via 10.0.0.2, 00:00:03, Serial0/0
C 10.2.0.0/16 is directly connected, Loopback1
C 10.3.0.0/16 is directly connected, Loopback2
C 10.0.0.0/30 is directly connected, Serial0/0
C 10.1.0.0/16 is directly connected, Loopback0
R 10.0.0.8/30 [120/1] via 10.0.0.2, 00:00:03, Serial0/0
C 10.2.0.0/16 is directly connected, Loopback1
C 10.3.0.0/16 is directly connected, Loopback2
C 10.0.0.0/30 is directly connected, Serial0/0
C 10.1.0.0/16 is directly connected, Loopback0
R2#SH IP ROUTE
!
Gateway of last resort is not set
!
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 9 subnets, 3 masks
O IA 10.11.0.1/32 [110/129] via 10.0.0.10, 00:03:32, Serial0/0
O IA 10.10.0.1/32 [110/129] via 10.0.0.10, 00:03:42, Serial0/0
O IA 10.9.0.1/32 [110/129] via 10.0.0.10, 00:03:52, Serial0/0
O IA 10.8.0.0/16 [110/128] via 10.0.0.10, 00:04:53, Serial0/0
C 10.0.0.8/30 is directly connected, Serial0/0
R 10.2.0.0/16 [120/1] via 10.0.0.1, 00:00:12, Serial0/1
R 10.3.0.0/16 [120/1] via 10.0.0.1, 00:00:12, Serial0/1
C 10.0.0.0/30 is directly connected, Serial0/1
R 10.1.0.0/16 [120/1] via 10.0.0.1, 00:00:12, Serial0/1
O IA 10.11.0.1/32 [110/129] via 10.0.0.10, 00:03:32, Serial0/0
O IA 10.10.0.1/32 [110/129] via 10.0.0.10, 00:03:42, Serial0/0
O IA 10.9.0.1/32 [110/129] via 10.0.0.10, 00:03:52, Serial0/0
O IA 10.8.0.0/16 [110/128] via 10.0.0.10, 00:04:53, Serial0/0
C 10.0.0.8/30 is directly connected, Serial0/0
R 10.2.0.0/16 [120/1] via 10.0.0.1, 00:00:12, Serial0/1
R 10.3.0.0/16 [120/1] via 10.0.0.1, 00:00:12, Serial0/1
C 10.0.0.0/30 is directly connected, Serial0/1
R 10.1.0.0/16 [120/1] via 10.0.0.1, 00:00:12, Serial0/1
R3#SH IP ROUTE
!
Gateway of last resort is not set
!
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 5 subnets, 3 masks
O 10.11.0.1/32 [110/65] via 10.8.0.2, 00:04:02, Serial0/0
O 10.10.0.1/32 [110/65] via 10.8.0.2, 00:04:02, Serial0/0
O 10.9.0.1/32 [110/65] via 10.8.0.2, 00:04:02, Serial0/0
C 10.8.0.0/16 is directly connected, Serial0/0
C 10.0.0.8/30 is directly connected, Serial0/1
O 10.11.0.1/32 [110/65] via 10.8.0.2, 00:04:02, Serial0/0
O 10.10.0.1/32 [110/65] via 10.8.0.2, 00:04:02, Serial0/0
O 10.9.0.1/32 [110/65] via 10.8.0.2, 00:04:02, Serial0/0
C 10.8.0.0/16 is directly connected, Serial0/0
C 10.0.0.8/30 is directly connected, Serial0/1
R4#SH IP ROUTE
!
Gateway of last resort is not set
!
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
C 10.10.0.0/16 is directly connected, Loopback1
C 10.11.0.0/16 is directly connected, Loopback2
C 10.8.0.0/16 is directly connected, Serial0/1
O IA 10.0.0.8/30 [110/128] via 10.8.0.1, 00:04:53, Serial0/1
C 10.9.0.0/16 is directly connected, Loopback0
C 10.10.0.0/16 is directly connected, Loopback1
C 10.11.0.0/16 is directly connected, Loopback2
C 10.8.0.0/16 is directly connected, Serial0/1
O IA 10.0.0.8/30 [110/128] via 10.8.0.1, 00:04:53, Serial0/1
C 10.9.0.0/16 is directly connected, Loopback0
在R2上配置路由重分发:
R2#sh run
Building configuration...
R2#sh run
Building configuration...
Current configuration : 1139 bytes
!
router ospf 1
log-adjacency-changes
redistribute rip metric 200 subnets
network 10.0.0.8 0.0.0.3 area 0
!
router rip
version 2
redistribute ospf 1 metric 4
passive-interface Serial0/0
network 10.0.0.0
no auto-summary
!
!
router ospf 1
log-adjacency-changes
redistribute rip metric 200 subnets
network 10.0.0.8 0.0.0.3 area 0
!
router rip
version 2
redistribute ospf 1 metric 4
passive-interface Serial0/0
network 10.0.0.0
no auto-summary
!
配置路由重分发后各路由器的路由状况:
R1#sh ip route
!
Gateway of last resort is not set
!
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 9 subnets, 3 masks
R 10.11.0.1/32 [120/4] via 10.0.0.2, 00:00:16, Serial0/0
R 10.10.0.1/32 [120/4] via 10.0.0.2, 00:00:16, Serial0/0
R 10.9.0.1/32 [120/4] via 10.0.0.2, 00:00:16, Serial0/0
R 10.8.0.0/16 [120/4] via 10.0.0.2, 00:00:16, Serial0/0
R 10.0.0.8/30 [120/1] via 10.0.0.2, 00:00:16, Serial0/0
C 10.2.0.0/16 is directly connected, Loopback1
C 10.3.0.0/16 is directly connected, Loopback2
C 10.0.0.0/30 is directly connected, Serial0/0
C 10.1.0.0/16 is directly connected, Loopback0
R 10.11.0.1/32 [120/4] via 10.0.0.2, 00:00:16, Serial0/0
R 10.10.0.1/32 [120/4] via 10.0.0.2, 00:00:16, Serial0/0
R 10.9.0.1/32 [120/4] via 10.0.0.2, 00:00:16, Serial0/0
R 10.8.0.0/16 [120/4] via 10.0.0.2, 00:00:16, Serial0/0
R 10.0.0.8/30 [120/1] via 10.0.0.2, 00:00:16, Serial0/0
C 10.2.0.0/16 is directly connected, Loopback1
C 10.3.0.0/16 is directly connected, Loopback2
C 10.0.0.0/30 is directly connected, Serial0/0
C 10.1.0.0/16 is directly connected, Loopback0
R2#SH IP ROUTE
!
Gateway of last resort is not set
!
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 9 subnets, 3 masks
O IA 10.11.0.1/32 [110/129] via 10.0.0.10, 00:05:54, Serial0/0
O IA 10.10.0.1/32 [110/129] via 10.0.0.10, 00:05:54, Serial0/0
O IA 10.9.0.1/32 [110/129] via 10.0.0.10, 00:05:54, Serial0/0
O IA 10.8.0.0/16 [110/128] via 10.0.0.10, 00:05:54, Serial0/0
C 10.0.0.8/30 is directly connected, Serial0/0
R 10.2.0.0/16 [120/1] via 10.0.0.1, 00:00:11, Serial0/1
R 10.3.0.0/16 [120/1] via 10.0.0.1, 00:00:11, Serial0/1
C 10.0.0.0/30 is directly connected, Serial0/1
R 10.1.0.0/16 [120/1] via 10.0.0.1, 00:00:11, Serial0/1
O IA 10.11.0.1/32 [110/129] via 10.0.0.10, 00:05:54, Serial0/0
O IA 10.10.0.1/32 [110/129] via 10.0.0.10, 00:05:54, Serial0/0
O IA 10.9.0.1/32 [110/129] via 10.0.0.10, 00:05:54, Serial0/0
O IA 10.8.0.0/16 [110/128] via 10.0.0.10, 00:05:54, Serial0/0
C 10.0.0.8/30 is directly connected, Serial0/0
R 10.2.0.0/16 [120/1] via 10.0.0.1, 00:00:11, Serial0/1
R 10.3.0.0/16 [120/1] via 10.0.0.1, 00:00:11, Serial0/1
C 10.0.0.0/30 is directly connected, Serial0/1
R 10.1.0.0/16 [120/1] via 10.0.0.1, 00:00:11, Serial0/1
R3#sh ip route
!
Gateway of last resort is not set
!
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 9 subnets, 3 masks
O 10.11.0.1/32 [110/65] via 10.8.0.2, 00:09:28, Serial0/0
O 10.10.0.1/32 [110/65] via 10.8.0.2, 00:09:28, Serial0/0
O 10.9.0.1/32 [110/65] via 10.8.0.2, 00:09:28, Serial0/0
C 10.8.0.0/16 is directly connected, Serial0/0
C 10.0.0.8/30 is directly connected, Serial0/1
O E2 10.2.0.0/16 [110/200] via 10.0.0.9, 00:01:22, Serial0/1
O E2 10.3.0.0/16 [110/200] via 10.0.0.9, 00:01:22, Serial0/1
O E2 10.0.0.0/30 [110/200] via 10.0.0.9, 00:01:22, Serial0/1
O E2 10.1.0.0/16 [110/200] via 10.0.0.9, 00:01:22, Serial0/1
O 10.11.0.1/32 [110/65] via 10.8.0.2, 00:09:28, Serial0/0
O 10.10.0.1/32 [110/65] via 10.8.0.2, 00:09:28, Serial0/0
O 10.9.0.1/32 [110/65] via 10.8.0.2, 00:09:28, Serial0/0
C 10.8.0.0/16 is directly connected, Serial0/0
C 10.0.0.8/30 is directly connected, Serial0/1
O E2 10.2.0.0/16 [110/200] via 10.0.0.9, 00:01:22, Serial0/1
O E2 10.3.0.0/16 [110/200] via 10.0.0.9, 00:01:22, Serial0/1
O E2 10.0.0.0/30 [110/200] via 10.0.0.9, 00:01:22, Serial0/1
O E2 10.1.0.0/16 [110/200] via 10.0.0.9, 00:01:22, Serial0/1
本文转自 tiger506 51CTO博客,原文链接:http://blog.51cto.com/tiger506/107819,如需转载请自行联系原作者