实验拓扑图
具体配置如下
R1
Router>en
Router#conf t
Router(config)#hostname R1
R1(config)#int f0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.252
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#int s0/0/0
R1(config-if)#ip address 192.168.1.5 255.255.255.252
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config-router)#network 192.168.1.0
R1(config-router)#network 192.168.1.4
R1(config-router)#
R3
Router>en
Router#conf t
Router(config)#hostname R3
R3(config)#int f0/0
R3(config-if)#ip address 192.168.1.13 255.255.255.252
R3(config-if)#no shut
R3(config-if)#exit
R3(config)#int s0/0/0
R3(config-if)#ip address 192.168.1.10 255.255.255.252
R3(config-if)#no shut
R3(config)#router ospf 10
R3(config-router)#network 192.168.1.8 255.255.255.252 area 0
R3(config-router)#network 192.168.1.12 255.255.255.252 area 0
R3(config-router)#exit
R3(config)#exit
R3#
R2
Router>en
Router#conf t
Router(config)#int s0/0/0
Router(config-if)#ip address 192.168.1.6 255.255.255.252
Router(config-if)#clock rate 64000
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#int s0/0/1
Router(config-if)#ip address 192.168.1.9 255.255.255.252
Router(config-if)#clock rate 64000
Router(config-if)#no shut
Router(config)#router rip
Router(config-router)#version 2
Router(config-router)#network 192.168.1.4
Router(config-router)#exit
Router(config)#router ospf 10
Router(config-router)#network 192.168.1.8 255.255.255.252 area 0
Router(config-router)#exit
Router(config)#exit
Router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
192.168.1.0/30 is subnetted, 4 subnets
R 192.168.1.0 [120/1] via 192.168.1.5, 00:00:18, Serial0/0/0
C 192.168.1.4 is directly connected, Serial0/0/0
C 192.168.1.8 is directly connected, Serial0/0/1
O 192.168.1.12 [110/65] via 192.168.1.10, 00:00:35, Serial0/0/1
Router#conf t
Router(config)#router rip
Router(config-router)#version 2
Router(config-router)#redistribute ospf 10
Router(config-router)#exit
Router(config)#router ospf 10
Router(config-router)#redistribute rip subnets
Router(config-router)#end
Router#