OSPF Route Types
R1#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
O – A route to a destination in the same area.
O IA – A route to a destination in another OSPF area.
O E2 AND O E1: Both codes indicate external routes. OSPF external routes are routes learned via redistribution. Before an area becomes a stub area, it will have E2 routes.
The difference between E2 and E1 routes is that the metric of an E2 route only reflects the cost of the path between the ASBR and the final destination.
The metric of an E1 route reflects the OSPF cost of the entire path from the local router to the final destination.
O E2 126.96.36.199 [110/20] via 188.8.131.52, 00:33:21, Ethernet0
O E2 184.108.40.206 [110/20] via 220.127.116.11, 00:33:21, Ethernet0
The metric is 20. This is the cost from the ASBR to the destination. E2 is the default route type for routes learned via redistribution.
To redistribute routes into OSPF as E1 routes, use the metric-type option.
Example of RIP routes injected into OSPF:
R1(config-router)#redistribute rip subnets metric-type 1
O E1 18.104.22.168 [110/94] via 22.214.171.124, 00:04:13, Ethernet0
O E1 126.96.36.199 [110/94] via 188.8.131.52, 00:04:14, Ethernet0
The routes now show a larger metric – 94. That’s because this is the OSPF cost for the entire path from R4 to each of the destination networks.
Oddly enough I personally thought this would be the other way round and E2 routes would be the default, however there is slight justification/logic as these routes are normally learned via redistribution, which is only performed on a ASBR. Me personally I would prefer to use E1 as a default, as you will have a true metric/believability from the OSPF router and the destination.
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
These route types will obviously be found only in NSSAs. It can be a little confusing to keep up with the different route types that can be found in stub, total stub, and not-so-stubby areas, so here’s a summary:
- Stub areas can contain O, O IA, and O* IA routes.
- Total stub areas can contain O and O* IA routes only.
- NSSAs can contain O, O IA, O N2, O* N2, O N1, and O* N1 routes.
My own overview on OSPF are types!
These OSPF area types can really be a headache, so this is in my own words as if I want a colleague or fellow Cisco candidate (or myself) to understand OSPF area types. This is not from any book, just my own brain and experience so is a test for me.
A stub area is usually an area that is a dead end and only has 1 way out or exit point. Therefore the next hop IP Address being the same for all routes. We can make the routing table more efficient by replacing all learned routes with a single default route. By making the area a stub, we also are minimising overall LSA updates as Type 5 LSAs will never flood into a stubby area.
When we make an OSPF area a ‘stub’, it will not receive Type 5 LSAs. A Type 5 LSA is a route that is external or learned via route redistribution. These routes will appear in the table as E2 by default. By just making an area a stub, we can remove all E2 routes and replace them with one default route that will show in the routing table as O*IA. (Candidate default/interarea default route)
Totally Stubby Area
We can go one step further than this and make an OSPF area ‘totally stubby’. A totally stubby area will not received Type 3,4 and 5 LSAs or a better way of understanding it, will not receive any external routes or Inter-area routes. (Known routes in other OSPF areas with the Autonomous System)
We already know that type 5 LSAs are routes learned by route redistribution. Type 3 and 4 LSAs are generated by the ABRs flooding LSU updates into other areas. When an area is made totally stubby, we have the same overall objective as a stub, but it is just one step further with the overall efficiency. By filtering out LSA types 3, 4 and 5 we will make the routing table very neat and tidy. 🙂
Not So Stubby Area
There is where things get a little nuts. A Not So Stubby Area or an NSSA bends the rules.. Let me explain.. The overall goal of a NSSA is to still receive the external routes or Type 5 LSAs… all Type 3 and 4 LSA types for inter area routes will not be flooded into a NSSA. However as we know these LSA types are not flooded into a stub area, the LSA itself is flooded into the area as a Type 7 LSA. A Type 7 LSA is unique to a NSSA and is the end product of a route learned by redistribution. This will appear in the routing table as a N1 or N2 route. These Type 7 LSA is overall the same routing update as a Type 5 LSA, but is flooded as a Type 7… These LSA TYpe 7s are flooded into the NSSA by the ASBR, as this is the router performing route redistribution.
Not So Stubby Total Stubby Area
🙂 Your taking the mick right…..? Seriously! Ok this way is also way more nuts than a NSSA. 🙂 Here we go then.. These area types are extremely rare in the real world and hopefully in the CCIE. 🙂 A NSSTSA (!!!!) is a further extension of the NSSA, in the NSSA we already know that Type 7 LSAs exist, but no Type 3 or 4. However when the area is made a NSSTSA, summary TYpe 3 and 4 LSA types will not be flooded into this area and as a result a default route will now be added in addition to the N2 or N1 NSSA routes.
To be honest no matter how many times I try and explain OSPF stub areas and LSA types to people and myself it always sounds a little confusing. OSPF is a monster routing protocol as it is and these are the icing on the cake. 🙂 I look forward to plenty more of this in the CCIE. 🙂 Woah……! At the NP level I want to really start to master these, so I will keep coming back to them and hopefully when I step into the CCIE material I will be fairly solid with these concepts. It will be handy to actually start the CCIE workbooks and get more hands on experience in configuring OSPF areas I think that experience is truly the only way for this to permanently sink in.