ROUTE – Redistribution Nuance #2 – OSPF External Metric Types

Last time, we talked about a nifty little lab I set up for redistribution and how the OSPF ASBRs acted a little differently than I expected.  This time, let’s look at how changing external OSPF routes to a metric-type of 1 (E1) affects the routing tables.

Here’s the network again.

The static routes are being redistributed into their respective IGPs, and EIGRP is being redistributed into OSPF.  Let’s look at the routing table on R1.

Notice that there are two routes to each of the networks discovered from EIGRP (the loopbacks of 10.0.0.3/32 and 10.0.0.4/32 as well as 192.168.101.0/24).  There is nothing strange here; OSPF simply sees the exit paths through the ASBRs.  How about if we change the metric-type on the routes from R2 and see what happens?

I know of at least two ways you can do it.  First, you can set the metric-type in the redistribute command on the ASBR’s OSPF process.

You can also use a route-map to set the metric-type and apply that to the redistribute command.

Either way does the same thing.  Now let’s check the route table on R1 again.

Only one route this time, and it’s the E1 route from R2.  It seems that E1 routes are more preferred than E2 routes.  Let’s look at the OSPF database for 192.168.101.0/24 on R1 to see if we can figure that out.

You can see that everything is the same except for the metric-type field, which is exactly what we expect.  By definition, if an external OSPF route is E1, the internal OSPF cost is added to the total cost of the route.  This is reflected in the “Comparable directly to link state metric” text next to the Metric Type value.  In contrast, an E2 route does not have the cost incremented; the cost is simply passed down the line as “Larger than any link state path”.  This means that E1 routes are considered more accurate and should be more preferred than E2 routes.

Just another complexity of OSPF.  Thanks to @matthewnorwood, @jameskazin, @steve, @wannabeccie, @ciscotophat, and @lbsources for the insight into the route differences.

Send any twitter updates questions my way.

Audio Commentary
[audio:http://aconaway.com/wp-content/uploads/2010/06/ROUTE-Redistribution-Nuance-2.mp3|titles=ROUTE – Redistribution Nuance #2]

Aaron Conaway

I shake my head around sometimes and see what falls out. That's what lands on these pages.

More Posts

Follow Me:
Twitter

2 comments for “ROUTE – Redistribution Nuance #2 – OSPF External Metric Types

  1. Steve B
    June 6, 2010 at 7:04 pm

    Don’t think I’ve read this point made anywhere, very interesting thanks.

    If you’d asked me before I would have said it would have preferred the E2 due to lower cost (Here 20 to 30), logic foiled again! Also the post could be titled OSPF Nuisances rather than Nuances 😉

  2. June 7, 2010 at 12:25 pm

    I’m with you, Steve. Logic says the best metric should win, but everyone forgets to include the tie-breaker of metric type. *sigh*

Leave a Reply

Your email address will not be published. Required fields are marked *