Category: Route Redistribution

Redistribution: Metric and Metric Types to Influence Redistributed Routes

When a router in a single routing domain receives multiple routes for the same subnet it must pick the best path to the subnet.  Redistributed routes that are considered for best path can be injected into the routing table with specific metric values and types to influence routing.

The following table shows the routing preference for various protocols and what the router will decide is the best path based on the type of metric the route has:


Keep in mind some routers might not use metric as the first consideration, for example OSPF will first take an intra-area route over an inter-area route, regardless of the metric.


Redistribution: Preventing Suboptimal Paths Using Route Tags

Another method for preventing suboptimal routing on redistributing routers is to tag routes with a numeric identifier, indicating the source router that injected the route into the network.

Performing simple route filtering at any other redistributing router will prevent sub-optimal routing from occurring.

In this example RIP routes are redistributed into OSPF using a tag of 9999 on R1.

When R3 gets the routes, it sees the tags in the routing information.  R3 is configured to match any route with this tag 9999 and filter it from being learned via OSPF, doing so prevents suboptimal routing.



Redistribution: Preventing Suboptimal Paths via Administrative Distance

One way to prevent the problem of suboptimal routes on redistribution routers is to flag the redistributed routes with a higher AD.  The routes AD is not advertised by the routing protocol, however you can assign different AD values to redistributed routes which will impact the routers best path decision to the destination.

For example when a route from a RIP domain and OSPF are considered, a router will learn both paths via both protocols, when you configure OSPF external routes to have a higher AD than RIP, the router will determine best path as:

  • OSPF Internal Type Route
  • RIP Route
  • OSPF External Type route

Under normal circumstances RIP routes AD is HIGHER than OSPF External type routes, this allows for optimal paths via RIP to be chosen.

This concept can also be used for RIP and EIGRP, where EIGRP Internal routes have an AD of 90 and EIGRP external routes have an AD of 170, setting RIP lower in this scenario would allow the same outcome as well.

Sometimes there may be instances where setting all External routes AD to be lower would cause sub-optimal routing, in those instances you would define the specific subnet to have an explicit AD using the following distance command:

distance { distance-value ip-address { wildcard-mask } [ ip-standard-list ] [ ip-extended-list ]

The logic of this command defines the Ad value for all routes, learned from a router that is defined by the IP address and wildcard mask, and for which the ACL permits the route.


Route Redistribution

There may be instances where you’ll encounter networks running multiple routing protocols.   Route redistribution allows one or more routers to take the routes they’ve learned through their own protocol and share those prefix’s with other routing protocols.

Here is the syntax of the redistribute command:

redistribute protocol [ process-id ] [ level-1 | level-1-2 | level-2 ] [ as-number ] [ metric metric-value ] [ metric-type type-value ] [ match { internal | external 1 | external 2 }] [ tag tag-value ] [ route-map map-tag ] [ subnets ]

The command defines the routing source from which routes are taken and also defines the process into which those routes will be advertised.

Certain routing protocols require a metric to be set in order to be redistributed, like EIGRP, and RIP.  OSPF will automatically apply its external type metric by default, but you can define what kind of external route type is used.

You can apply a specific tag to the redistributed routes, which is useful for filtering across multiple network redistribution points to prevent routing loops or unintended places for routes to be injected.

You can also apply a route map to the redistribute command, that can match routes to be advertised and filter any you don’t want advertised.