Lab 10-2 – Configuring Mutual OSPF and RIP Redistribution

In this lab you will learn how to configure mutual redistribution between Open Shortest Path First (OSPF) and the Routing Information Protocol (RIP) at a single OSPF Autonomous System Boundary Router (ASBR).

Real World Application & Core Knowledge

So up until this point you’ve learnt how to configure different routing protocols such as the Routing Information Protocol (RIP), Enhanced Interior Gateway Routing protocol (EIGRP) and Open Shortest Path First (OSPF) but now its time to learn how to make this protocols play nice with each other and share their routes between each other. It’s always nice to share things.


First lets look at how route redistribution works in a basic way. In this lab you’ll be redistributing routes between OSPF and RIP, with that being said routes from OSPF will appear in RIP marked as a RIP route and RIP routes redistributed will appear in OSPF as an OSPF E2 route by default.

So for example; lets say you work at ABC Inc. and your corporation buys company XYZ Inc. Your company uses OSPF and XYZ Inc. uses RIP. During the acquisition you’ll want to merge infrastructures to ensure information sharing between the already existing infrastructure to the newly acquired company. In this case you’ll have to configure redistribution between the two networks. Keep in mind even redistribution may not work 100% of the time. For example when you purchase a company that uses the same RFC1918 private address space as you. You don’t want their routes to 10.50.33.0/24 in your network which has its own route to 10.50.33.0/24, this would cause serious problems. In cases like these, NAT is used until the issue can be fully addressed.

Route redistribution should NOT be designed into a network from the beginning but should only be used during scenarios where you need to route between two different autonomous systems running different routing protocols. For example, company acquisitions or vendor incompatibilities; in which case you have a device that only supports rip but your network runs OSPF. You will need to either utilize static routing or redistribution.

When you configure redistribution, the command(s) are entered under the routing process configuration mode; in which case you specify the metric for the redistributed routes when redistributing a particular routing process into the routing process you’re currently configuring. For example in RIP router configuration mode you’d redistribute ospf and specify a hop count metric.

In OSPF router configuration mode, when redistributing RIP routes into OSPF you’d specify a COST associated with the routes redistributed by RIP into OSPF. You can however leave a metric out following the redistribute command specifying a metric is best practice.

Also a quick note to remember, when configuring route redistribution into EIGRP or OSPF you must use the subnets keyboard following the specified metric or the routing process will only redistribute a classful network into the routing process.

So now that you have an understanding of mutual route redistribution lets jump into the configuration.

Please review the following command(s) listed below;

redistribute type metric metric info – This command is executed in router configuration mode of RIP, EIGRP or OSPF to configure the routing process to redistribute routes from a different source into the configured routing process such as static into RIP or RIP into OSPF. It’s best practice to specify a metric.

The following logical topology shown below is used in this lab;

Lab Prerequisites

  • If you are using GNS3 than load the Stub Area Networking GNS3 topology than start devices; R1, R2, R3, R4, and R5
  • Establish a console session with devices R1, R2, R3, R4, and R5 than load the initial configurations provided below by copying the config from the textbox and pasting it into the respected routers console.

Lab Objectives

  • Create four new loopback interfaces on R1 using the 10.1.0.0/22 address allocation and configure those interfaces to participate in OSPF area 0. Ensure that these loopback interfaces participate in OSPF with their configured subnet mask and not a host mask.
  • Create four new loopback interfaces on R5 using the 172.5.0.0/22 address allocation and configure those interfaces to participate in RIP.
  • By viewing R3′s routing table, verify that the newly created loopback interfaces are being learned by R3.
  • Configure R3 to redistribute RIP routes into OSPF using the cost of 50000 then redistribute OSPF routes into RIP using the hop count of 3.
  • Verify on R1 and R5 that routes from the opposite autonomous system exist in their routing table.

Lab Instruction

Objective 1. – Create four new loopback interfaces on R1 using the 10.1.0.0/22 address allocation and configure those interfaces to participate in OSPF area 0. Ensure that these loopback interfaces participate in OSPF with their configured subnet mask and not a host mask.

By default loopback interfaces participate in ospf as a /32 host route unless you change the default network type from LOOPBACK to Point-to-Point as shown below;

R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface loopback0
R1(config-if)#ip address 10.1.0.1 255.255.255.0
R1(config-if)#ip ospf 1 area 0
R1(config-if)#ip ospf network point-to-point
R1(config-if)#
R1(config-if)#interface loopback1
R1(config-if)#ip address 10.1.1.1 255.255.255.0
R1(config-if)#ip ospf 1 area 0
R1(config-if)#ip ospf network point-to-point
R1(config-if)#
R1(config-if)#interface loopback2
R1(config-if)#ip address 10.1.2.1 255.255.255.0
R1(config-if)#ip ospf 1 area 0
R1(config-if)#ip ospf network point-to-point
R1(config-if)#
R1(config-if)#interface loopback3
R1(config-if)#ip address 10.1.3.1 255.255.255.0
R1(config-if)#ip ospf 1 area 0
R1(config-if)#ip ospf network point-to-point
R1(config-if)#end
R1#
%SYS-5-CONFIG_I: Configured from console by console
R1#

Objective 2. – Create four new loopback interfaces on R5 using the 172.5.0.0/22 address allocation and configure those interfaces to participate in RIP.

R5#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R5(config)#interface loopback0
R5(config-if)#ip address 172.5.0.1 255.255.255.0
R5(config-if)#
R5(config-if)#interface loopback1
R5(config-if)#ip address 172.5.1.1 255.255.255.0
R5(config-if)#
R5(config-if)#interface loopback2
R5(config-if)#ip address 172.5.2.1 255.255.255.0
R5(config-if)#
R5(config-if)#interface loopback3
R5(config-if)#ip address 172.5.3.1 255.255.255.0
R5(config-if)#exit
R5(config)#router rip
R5(config-router)#network 172.5.0.0
R5(config-router)#end
R5#
%SYS-5-CONFIG_I: Configured from console by console
R5#


Objective 3. – By viewing R3′s routing table, verify that the newly created loopback interfaces are being learned by R3.

R3#show ip route
Codes: C - connected, S - static, 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
       * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     172.5.0.0/24 is subnetted, 4 subnets
R       172.5.1.0 [120/2] via 172.29.34.4, 00:00:01, Serial0/0.324
R       172.5.0.0 [120/2] via 172.29.34.4, 00:00:01, Serial0/0.324
R       172.5.3.0 [120/2] via 172.29.34.4, 00:00:01, Serial0/0.324
R       172.5.2.0 [120/2] via 172.29.34.4, 00:00:01, Serial0/0.324
     172.29.0.0/24 is subnetted, 2 subnets
C       172.29.34.0 is directly connected, Serial0/0.324
R       172.29.45.0 [120/1] via 172.29.34.4, 00:00:01, Serial0/0.324
     10.0.0.0/24 is subnetted, 6 subnets
O       10.1.3.0 [110/129] via 10.102.23.2, 00:02:24, Serial0/0.322
O       10.1.2.0 [110/129] via 10.102.23.2, 00:02:24, Serial0/0.322
O       10.1.1.0 [110/129] via 10.102.23.2, 00:02:24, Serial0/0.322
O       10.1.0.0 [110/129] via 10.102.23.2, 00:02:24, Serial0/0.322
O       10.102.12.0 [110/128] via 10.102.23.2, 00:02:24, Serial0/0.322
C       10.102.23.0 is directly connected, Serial0/0.322
R3#

Objective 4. – On R3 redistribute RIP routes into OSPF using the cost of 50000 then redistribute OSPF routes into RIP using the hop count of 3.

Before redistributing RIP into OSPF keep in mind you must use the subnets keyword after the redistribution metric as shown below other wise you’ll redistribute only a classful network;

R3#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#router ospf 1
R3(config-router)#redistribute rip metric 50000 subnets
R3(config-router)#exit
R3(config)#router rip
R3(config-router)#redistribute ospf 1 metric 3
R3(config-router)#end
R3#

Objective 5. – Verify on R1 and R5 that routes from the opposite autonomous system exist in their routing table.

R1#show ip route
Codes: C - connected, S - static, 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
       * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     172.5.0.0/24 is subnetted, 4 subnets
O E2    172.5.1.0 [110/50000] via 10.102.12.2, 00:00:15, Serial0/0.122
O E2    172.5.0.0 [110/50000] via 10.102.12.2, 00:00:15, Serial0/0.122
O E2    172.5.3.0 [110/50000] via 10.102.12.2, 00:00:15, Serial0/0.122
O E2    172.5.2.0 [110/50000] via 10.102.12.2, 00:00:15, Serial0/0.122
     172.29.0.0/24 is subnetted, 2 subnets
O E2    172.29.34.0 [110/50000] via 10.102.12.2, 00:00:15, Serial0/0.122
O E2    172.29.45.0 [110/50000] via 10.102.12.2, 00:00:15, Serial0/0.122
     10.0.0.0/24 is subnetted, 6 subnets
C       10.1.3.0 is directly connected, Loopback3
C       10.1.2.0 is directly connected, Loopback2
C       10.1.1.0 is directly connected, Loopback1
C       10.1.0.0 is directly connected, Loopback0
C       10.102.12.0 is directly connected, Serial0/0.122
O       10.102.23.0 [110/128] via 10.102.12.2, 00:05:34, Serial0/0.122
R1#

As shown above you can see that the RIP routes being redistributed into the OSPF autonomous system are denoted as E2 routes in the routing table on R1.

R5#show ip route
Codes: C - connected, S - static, 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
       * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     172.5.0.0/24 is subnetted, 4 subnets
C       172.5.1.0 is directly connected, Loopback1
C       172.5.0.0 is directly connected, Loopback0
C       172.5.3.0 is directly connected, Loopback3
C       172.5.2.0 is directly connected, Loopback2
     172.29.0.0/24 is subnetted, 2 subnets
R       172.29.34.0 [120/1] via 172.29.45.4, 00:00:05, Serial0/0.524
C       172.29.45.0 is directly connected, Serial0/0.524
     10.0.0.0/24 is subnetted, 6 subnets
R       10.1.3.0 [120/4] via 172.29.45.4, 00:00:06, Serial0/0.524
R       10.1.2.0 [120/4] via 172.29.45.4, 00:00:06, Serial0/0.524
R       10.1.1.0 [120/4] via 172.29.45.4, 00:00:06, Serial0/0.524
R       10.1.0.0 [120/4] via 172.29.45.4, 00:00:06, Serial0/0.524
R       10.102.12.0 [120/4] via 172.29.45.4, 00:00:07, Serial0/0.524
R       10.102.23.0 [120/4] via 172.29.45.4, 00:00:07, Serial0/0.524
R5#

As shown above you can see that the OSPF networks in the 10.0.0.0/8 range are now in R5′s routing table with a hop count of 4. To get to R3 its 1 hop to R4, on R3 the redistributed metric adds +3 giving you a total metric of 4 on R5 for routes learned from the OSPF network.

7 comments so far

Add Your Comment
  1. Great info tanks

  2. Thanks for this info.

  3. Thanks, Good info

  4. this is the best way to learn from this website thanks for buddy.

  5. very very thankful for providing such knowledge………..it really helps me a lot in profession

  6. i have two router one having rip and other having ospf…….how to redistribute their route to each other or how could we make communication between them

  7. actually it was a great lap but i have inquiry

    from the aspect of the R3 which is participate with two interfaces one interface in the RIP area and the second interface in the OSPF area

    lets look for example to a route like 172.29.45.0/24

    and lets see when the R3 is advertising this route (172.29.45.0/24) to the ospf area

    so now i see R3 has tow way to reach this route (172.29.45.0/24)

    one way from the rip
    second way from the ospf area (because its redistributed to it)

    and the problem is the route when distributed in the ospf area become has an AD =110

    while when was in the rip area it has an AD =120

    SO now the R3 i think surly will choose the route which has the low AD

    and off course this will be in the ospf area

    and if this happens so the loop will occur and the network will damage

    so if i am wrong please explain to me
    thank u too much