In reading up on one of the guides on the website, I came across the policy section regarding OSPF:
"In OSPF, you can't apply import policy to affect the LSDB, and you can't apply policy to prevent the software from installing interarea OSPF routing into the routing table. This is because a LSP assumes that all devices have the same routing information for internal routes, which causes all devices to make consistent forwarding decisions. If you could block internal routes, you could create routing loops."
Makes perfect sense to me. However, if that is the case, why are export policies permitted? Regardless of whether or not I configured an import policy on my receiving OSPF router that blocks certain OSPF routes or if I configure an export policy on the sending router that prevents those routes from being exported to my neighbor (the receiving router), isn't the end result the same (not having a consistent interarea routing table), introducing the potential for routing loops and dest unreachables?
My thought is that because JUNOS sees received routes in their original form before applying import policies, it knows what they look like in their original form and thus won't manipulate OSPF routes with import policies, whereas a router receiving OSPF routes that were already manipulated on the sending end via an export policy are received in their manipulated form already and it doesn't know any better. If that is the case, is it ill-advisable to configure OSPF export policies that block routes?
Export policies for OSPF in Junos are used to introduce external routes into OSPF, i.e. type 5 LSAs, making the router an ASBR. I don't think OSPF export polices that block routes are going to have any effect, as by default no external routes are introduced into OSPF unless explicitly configured.
In OSPF we have import, export, network-sumary-import, and network-summary-export.
Import: Control what routes will be added into routing table. Please note that import only affect LSA5 (external route).
Export: Control what routes (from other routing protocol) will be advertised to OSPF neighbor.
OK so what I am getting from this is that import and export OSPF policies can only be used when you are dealing with external routers (type 5 LSA's) right?
For example, if you have LSA5 in OSPF Database, but you don't want routing table installs this route, you can use import to prevents this.
If you have a static route, and you want to share with another OSPF neighbor, you can use export to advertise this static route
Gotcha. Thank you guys.
You're welcome. Please note that, Junos has network-summary-import and network-summary-export. They are used to control LSA 3.