Routing

 View Only
last person joined: 2 days ago 

Ask questions and share experiences about ACX Series, CTP Series, MX Series, PTX Series, SSR Series, JRR Series, and all things routing, including portfolios and protocols.
  • 1.  Modifying route preference with policy

    Posted 07-22-2024 18:47

    Hi everyone,

    We have OSPF domain with area 0.0.0.0, a certain subnet  17.17.17.0is being exported into OSPF from three routers R1, R2, R3. All three routers are learning 17.17.17.0 over EBGP and exporting it into OSPF.

     Our goal is R1 should be egress point for 17.17.17.0/24 , followed by R2 and R3.  To accomplish that , R1 is annoucing the prefix with metric 1, R2 with metric 2, and R3 with metric 3. 

    The issue is when R1 goes down and comes back up, R1 can not  become egress point for 17.17.17.0/24,  because R1 sees R2's announced route 17.17.17..0/24  in OSPF domain. Since  BGP 's preference is 200 and OSPF's preference is 150, therefore R1 prefers  OSPF route . The net result is R1 does not become egress point for 17.17.17.0/24 .

    To fix this, we have to tell R1 to assign preference value of 210  if it does see OSPF announced 17.17.17.0/24 in OSPF domain. Below is the config on R1 to acheive that:


    set policy-options policy-statement PREF term T1 from route-filter 17.17.17.0/24 exact

    set policy-options policy-statement PREF term T1 from protocol ospf

    set policy-options policy-statement PREF term T1 from external
    set policy-options policy-statement PREF term T1 then preference 210
    set policy-options policy-statement PREF term T1 then accept
    set policy-options policy-statement PREF term T2 then accept

    This policy is then applied as import to OSPF :

    set protocols ospf import PREF

    But it does not change the preference value as intended.

    R1> show route 17.17.17.1
     
    inet.0: 8 destinations, 10 routes (8 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both
     
    17.17.17.0/24      *[OSPF/150] 05:02:21, metric 0, tag 2
                                           > to 199.199.199.2 via ge-0/0/1.0
                                           [BGP/170] 06:04:09, localpref 100
                                           AS path: 1 I, validation-state: unverified
                                         > to 10.10.10.1 via ge-0/0/0.0

    What am I missing?

    Thanks !!



    ------------------------------
    Be kind!!
    ------------------------------


  • 2.  RE: Modifying route preference with policy

    Posted 07-24-2024 08:54

    I think what's happening is:

    The router's source of the active route is BGP, since it learns it via BGP with a preference of 200.  You may also be learning via OSPF, but it won't be active.  The import policy won't match the inactive, OSPF-learnt route and so never bumps up the preference.  My understanding is that the import statement will only scan active routes in the table, not all of the routes.

    You might win by lowering the BGP preference, thereby allowing the OSPF-learnt router to take precedence.  This might have adverse flow-on effects that I haven't considered, so YMMV.

    Scott



    ------------------------------
    SCOTT AITKEN
    ------------------------------