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!!
------------------------------