Configuring RedistributionRIP and OSPF

Redistribution requires you to configure a router with the redistribute router mode command and the two protocols between which you want to redistribute. Consider the example network in Figure 3-4.

Figure 3-4 A Network for Configuring Mutual Redistribution

Figure 3-4 A Network for Configuring Mutual Redistribution

In the example, Router II is a RTP-only router with RIP routes 192.168.X.0 (where x ranges from 1 to 3). Router G is the redistribution router: It must run both RIP and OSPF.

The routing configuration for Router H is nothing new:

router rip network network network network

Router G, 011 the other hand, is a redistribution router. The following is Router G's RIP configuration:

router rip redistribute ospf 10 metric 3 passive-interface Seriall network

The command redistribute ospf 10 metric 3 redistributes the routes Router G learned from its OSPF process 10 into its RIP process with a default metric of 3 hops. Because OSPF has a different metric than RIP, you must assign a starting metric for the redistributed routes (keywords metric 3). The redistribute command injects a lot of routes into RIP—you can imagine there are many routes up there in that OSPF core. It's as though the router has two "brains": one that knows everything about the OSPF world and another that knows everything about the RIP world. When you redistribute from OSPF into RIP with redistribute ospf 10 metric 3 (a subcommand of router rip), you copy all of the contents of the OSPF brain into the RIP brain. Subsequently, this provides RIP with all of the information learned from OSPF, and that information is a bunch of routes. Router G then advertises the combined database of routes to Router H. This, in turn, provides Router H (a RIP-only router) w ith all of the routes originated by the OSPF world.

The command passive-interface Seriall disables the transmission of RIP out Router G's Serial 1 interface. Because only OSPF routers are in the core, there is no need to send RIP advertisements out this interface disable it for less overhead and more efficiency (see "Configuring Passive Interfaces," earlier in this chapter).

The command network is the basic RIP command that enables RIP processing on major net

Router G also needs to redistribute routes the other way: from RIP into OSPF. This is called two-way or mutual redistribution. The following is Router G's OSPF configuration:

router ospf 10 redistribute rip metric 50 metric-type 1 subnets network area 0

The command redistribute rip metric 50 metric-type 1 subnets redistributes the routes learned by the RIP process into OSPF process 10. Break up the command by keywords and you get the following:

• rip: The source for the redistribution is the RIP process. Notice that this time redistribute is a subcommand of router ospf 10. When you wani to redistribute into a routing protocol, you put the redistribute command under the router command for that protocol.

• metric 50: Because RIP uses hop count and OSPF uses cost, you have to specify a starting (or default) metric for the routes redistributed into OSPF. Here, the default metric is a cost of 50.

• metric-type I: This sets the redistributed routes to OSPF external type 1 routes. This applies only when you redistribute into OSPF. Basically, Iwo types of external (redistributed) routes exist in OSPF: type 1 and type 2. The metric for type 1 routes is the sum of the cost to reach the redistribution router and the default metric. The metric for type 2 routes is simply the default metric—the OSPF cost is not added because the route propagates the OSPF domain. It you want to include the OSPF cost to reach the redistribution point, use external type 1 routes.

• subnets: This tells the router to redistribute both major nets and their subnets. If you exclude this, only major nets are redistributed. This applies only when redistributing into OSPF. A common error is to forget the subnets keyword when redistributing into OSPF.

Router G's OSPF configuration does not need the passive-interface command because only Serial 1 is assigned to an OSPF area. SerialO is not in an area, and therefore, does not send any OSPF updates. Consult Chapter 2 for OSPF configuration.

A look at the routing table of a core OSPF router (a router somewhere in the OSPF cloud in Figure 3-4) proves that the RIP routes are being redistributed into OSPF:

CoreRouter#sh ip ro

Codes: C connected, S - static, I - IGRP, R • RIP, M mobile, B - BGP D - EIGRP, EX - EIGRP external, 0 • 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 - ISIS level-2, * • candidate default U - per user static route, o ODR T - traffic engineered route

Gateway of last resort is not set is subnetted, 1 subnets 0 IA [110/51] via, 00:30:40, Seriall is subnetted, 2 subnets 0 E1 [110/320] via, 00:30:40, Seriall C is directly connected, Seriall

0 E1 [110/400] via, 00:30:40, Seriall 0 E1 [110/400] via, 00:29:54, Seriall 0 E1 [110/460] via, 00:29:54, Seriall <lines deleted for brevity>

In the preceding output, the lines highlighted in boldface are the routes originally sourced from the RIP domain and redistributed into OSPF by Router G. The code O El designates an OSPF type I external route. An external route is simply a route that was redistributed into OSPF.

Was this article helpful?

0 0

Post a comment