Hi ,
I have Two mx series router and connected to two ISP link like this
ospf /ibgp
ISP1------MX1-------------------MX2---------ISP2
Getting default route from EBGP on both router and redistributing this default route from ebgp to ospf on both router and in my rest of the LAN using IGP protocol OSPF . Now i want to set preference on OSPF that default route from ISP1 should be prefer compare to ISP2 and If ISP1 default route is not present that it should go through ISP1. I have tried definning External type1 to MX1 and E2 route on MX2 .but the result is not satisfactory. the route which is first redistributed will install in my OSPF database and its not changing till i stop the redistributing.
Configuration :-
For that what i did that i have made a import policy on MX1 :-
show policy-options policy-statement bgp-to-ospf
term 1 {
from {
protocol bgp;
neighbor 10.0.21.2;
route-filter 0.0.0.0/0 exact;
}
then {
external {
type 1;
}
accept;
}
}
show policy-options policy-statement ospf-import
term 1 {
from {
protocol ospf;
external;
route-filter 0.0.0.0/0 exact;
}
then reject;
}
show protocols ospf
export bgp-to-ospf;
import ospf-import;
area 0.0.0.0 {
interface ge-0/0/0.0;
interface lo0.0 {
passive;
}
}
After applying this policy on MX1 ,now my route is getting prefernce from only MX1 router only .
Is this policy is correct or wrong ? please advice