How can I give preference to OSPF interarea routes over intra-area routes?

Hello All, 

I heard that in OSPF we can give preference to OSPF interarea routes over intra-area if a router has multiple OSPF processes running.

OSPF does a route comparison by the metrics and administrative distances (if they have been changed) for the OSPF processes.

I am aware of a case, when we use OSPF in CE & PE routers in a L3VPN scenario,there we have a facility of extending Intra area domain among PE to PE routers by creating a SHAM links, thereby making a route comparison based on metric.

But here I want to understand this concept through a Scenario [other than L3 VPN]. Can some one please explain this through a topology diagram as to how and where the route comparison actually happens between inter and intra area routes in OSPF [when using multiple processes in single router] ?

Many thanks

 

 

 

Comments

  • u cannot change order intra >inter>E1>N1>E2>N2

     

    edit: corrected

  • Per the RFC 2328 the OSPF path selection state machine prefers:


    • Intra Area Routes (O)
    • Inter Area Routes (O IA)
    • External Type 1 (E1)
    • NSSA Type 1 (N1)
    • External Type 2 (E2)
    • NSSA Type 2 (N2)
    Within a single OSPF process the preference of selection can not be adjusted. However when you are running multiple OSPF process OSPF will do route comparison. With route comparison the metric and the administrative distance will be compared and the path selection by the OSPF state machine doesn't apply. 

  • Q. How can I give preference to OSPF interarea routes over intra-area routes?

     

    A. According to section 11 of RFC 2328 leavingcisco.com, the order of preference for OSPF routes is:

    • intra-area routes, O

    • interarea routes, O IA

    • external routes type 1, O E1

    • external routes type 2, O E2

    This rule of preference cannot be changed. However, it applies only within a single OSPF process. If a router is running more than one OSPF process, route comparison occurs. With route comparison, the metrics and administrative distances (if they have been changed) of the OSPF processes are compared. Route types are disregarded when routes supplied by two different OSPF processes are compared.

     

    Source : http://www.cisco.com/c/en/us/support/docs/ip/open-shortest-path-first-ospf/9237-9.html

     

    But I want to understand this using a network topology 



  • There is one case where this does not hold true when using VL's

    OSPF RFC 2328 Section 16

    Basically it says and if you look at the topology (having labbed it a while back too) that normally R1 would have to follow the intra-area path over the virtual-link because that's step 1 of the decision.  However there is another ABR R5 that has the same route with a lower cost as an inter-area route.  Since TransitCapability = TRUE R1 can follow the shorter inter-area path over the longer intra-area path over the virtual-link.

    So here Inter-Area can trump Intra-Area is variables are met



    On 27 Oct 2014, at 12:37, bjorn.timmer <[email protected]> wrote:

    Per the RFC 2328 the OSPF path selection state machine prefers:


    • Intra Area Routes (O)
    • Inter Area Routes (O IA)
    • External Type 1 (E1)
    • NSSA Type 1 (N1)
    • External Type 2 (E2)
    • NSSA Type 2 (N2)
    Within a single OSPF process the preference of selection can not be adjusted. However when you are running multiple OSPF process OSPF will do route comparison. With route comparison the metric and the administrative distance will be compared and the path selection by the OSPF state machine doesn't apply. 




    INE - The Industry Leader in CCIE Preparation

    http://www.INE.com



    Subscription information may be found at:

    http://www.ieoc.com/forums/ForumSubscriptions.aspx




  • There is one case where this does not hold true when using VL's




    OSPF RFC 2328 Section 16



    Basically it says and if you look at the topology (having labbed it a while back too) that normally R1 would have to follow the intra-area path over the virtual-link because that's step 1 of the decision.  However there is another ABR R5 that has the same route with a lower cost as an inter-area route.  Since TransitCapability = TRUE R1 can follow the shorter inter-area path over the longer intra-area path over the virtual-link.



    So here Inter-Area can trump Intra-Area is variables are met






    On 27 Oct 2014, at 12:37, bjorn.timmer <[email protected]> wrote:

    Per the RFC 2328 the OSPF path selection state machine prefers:

     

    • Intra Area Routes (O)
    • Inter Area Routes (O IA)
    • External Type 1 (E1)
    • NSSA Type 1 (N1)
    • External Type 2 (E2)
    • NSSA Type 2 (N2)
    Within a single OSPF process the preference of selection can not be adjusted. However when you are running multiple OSPF process OSPF will do route comparison. With route comparison the metric and the administrative distance will be compared and the path selection by the OSPF state machine doesn't apply. 

     





    INE - The Industry Leader in CCIE Preparation

    http://www.INE.com



    Subscription information may be found at:

    http://www.ieoc.com/forums/ForumSubscriptions.aspx

    Today with the labs i was strugling with the Transit Capability with virtual links and found out a good page on the blog INE explaining about understanding OSPF Transit Capability.

    http://blog.ine.com/2009/09/14/understanding-ospf-transit-capability/

  • guys, RFC 2328 in section 16.4. Equal-cost multipath does not say anything about N1 N2. where do u have N1 N2?

  • I heard that in OSPF we can give preference to OSPF interarea routes over intra-area if a router has multiple OSPF processes running.

    Take a look at this article by Daniel - http://lostintransit.se/2013/03/15/tiebreakers-with-routes-from-different-ospf-processes/

    Lowest process number is used as tiebreak.

     

     

  • Good one, thx for sharing

  • JoeMJoeM ✭✭✭

    Take a look at this article by Daniel - http://lostintransit.se/2013/03/15/tiebreakers-with-routes-from-different-ospf-processes/

    Lowest process number is used as tiebreak.

     

    Excellent blog article.  I always enjoyed his explanations.

    I started doubting myself on the original question with 2 processess.  So I labbed it the same way Daniel described it his blog.

    * Lowest Process ID definitely was the tie-breaker.

     

    Daniel pointed to another article that discusses changing the AD preference  within a single process. This gave the final clue for how to change the ospf selection.    It is possible.

     

    Labbing it paid off.  ;-)  I was able to get INTER preferred over INTRA between 2 processes:

    * change the OSPF distances in both processes.  I was not able to make it work when changing it with only one process.

          distance ospf intra-area 130 inter-area 100  external 150

     

    R2# sh ip ospf rib

                OSPF Router with ID (23.0.0.2) (Process ID 1)


                    Base Topology (MTID 0)

    OSPF local RIB
    Codes: * - Best, > - Installed in global RIB


                OSPF Router with ID (22.22.22.22) (Process ID 11)


                    Base Topology (MTID 0)

    OSPF local RIB
    Codes: * - Best, > - Installed in global RIB

    *   1.1.1.0/24, Intra, cost 2, area 0
          via 12.0.0.1, FastEthernet0/0
    *   12.0.0.0/24, Intra, cost 1, area 0, Connected
          via 12.0.0.2, FastEthernet0/0

                OSPF Router with ID (222.222.222.222) (Process ID 3)


                    Base Topology (MTID 0)

    OSPF local RIB
    Codes: * - Best, > - Installed in global RIB

    *>  1.1.1.0/24, Inter, cost 2, area 0
          via 23.0.0.3, FastEthernet1/0
    *>  3.3.3.0/24, Inter, cost 2, area 0
          via 23.0.0.3, FastEthernet1/0
    *   23.0.0.0/24, Intra, cost 1, area 0, Connected
          via 23.0.0.2, FastEthernet1/0



    R2#sh ip route | in 1.1.1.
    O IA     1.1.1.0 [110/2] via 23.0.0.3, 00:13:12, FastEthernet1/0

Sign In or Register to comment.