After configuring RIP and OSPF, I took a look at the routes in the routing table, R1 shows the OSPF route 172.12.13.0 that is being advertised, currently RIP isn't advertising any routes. R2 and R3 show no routes learned.
R1#show ip route
Gateway of last resort is not set
20.0.0.0/24 is subnetted, 1 subnets
C 20.1.1.0 is directly connected, Serial0/0
172.12.0.0/16 is variably subnetted, 2 subnets, 2 masks
O 172.12.34.1/32 [110/65] via 172.12.13.2, 00:06:59, Serial0/1
C 172.12.13.0/24 is directly connected, Serial0/1
R3#show ip route rip
R3#
R2#show ip route rip
R2#
I want to send OSPF routes into RIP, configuration always takes place in the receiving protocol. OSPF will need a metric of 2 because it will increment by one for each router it travels too and 2 being a safe number away for 16. Redistribute connected routes must use a metric as well. The command default-metric 2 can also be used instead of typing it for each statement.
R1(config)#router rip
R1(config-router)#redistribute ospf 1 metric ?
<0-16> Default metric
transparent Transparently redistribute metric
R1(config-router)#redistribute ospf 1 metric 2
R1(config-router)#redistribute connected metric 2
Now that I redistribute OSPF into RIP, I take a look at R2 to see if it learned the routes. The routes show up as RIP routes with a metric of 2.
R2#show ip route rip
172.12.0.0/16 is variably subnetted, 2 subnets, 2 masks
R 172.12.34.1/32 [120/2] via 20.1.1.1, 00:00:22, Serial0/0
R 172.12.13.0/24 [120/2] via 20.1.1.1, 00:00:22, Serial0/0
I try to ping the remote loopback of R3 to ensure the route works but my pings fail, that's because R3 doesn't know how to get back to R2 when it received the ICMP message.
R2#ping 172.12.34.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.12.34.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
A static route will get the ping to work or I can use two-way redistribution , RIP into OSPF. Redistribute subnets is needed so that classful routes aren't sent because we need the true subnets for our network to work properly.
R1(config)#router ospf 1
R1(config-router)#redistribute connected subnets
R1(config-router)#redistribute rip subnets
I can now see the external OSPF route inside R3's routing table
R3#show ip route ospf
20.0.0.0/24 is subnetted, 1 subnets
O E2 20.1.1.0 [110/20] via 172.12.13.1, 00:00:43, Serial0/0
A successful ping verifies I now have connectivity
R2#ping 172.12.34.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.12.34.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/63/72 ms