I am trying to learn how the " order " does not matter when using Route-list in import routing policy ( assuming different prefix ).
Please consider the following Policy:
R5 (184.108.40.206)-----220.127.116.11 em0.200 JUN4
R5: Cisco router, running RIP Ver2 with Juniper JUN4, it is advertsining 18.104.22.168/24. 22.214.171.124/24, 126.96.36.199/24
We will apply the above policy as IMPUT POLICY TO RIP on JUN4, but before we apply the policy, routing table on JUN4 is:
Above we can see all the RIP routes.
Next we apply the policy " MISSY" as an IMPORT POLICY to RIP on JUN4
We expect only single RIP route 188.8.131.52/24 based on IMPORT POLICY MISSY, however we do not see any RIP routes:
If we remove the policy, we see all the rip routes:
Based on Juniper doc, longest match term will be evaluated first which is TERM2 here but we do not see this here.
What am i missing?
Thanks and have a nice day!!
Policies are evaluated sequentially, i.e 1st term, 2nd, 3rd and so on if preceeding terms are not matched.
Whether the next term is evaluated also depends on the action of a matched term. Example for accept and reject actions no further terms are evaluated, but an action of next-term does:
In this case, once term 1 is matched routes 184.108.40.206/16 are rejected and exits policy, term 2 is not processed.
Hope this helps.
This is excatly I see as well but I am confused when I read following:
The order in which the prefixes are specified (from top to bottom) typically does not matter, because the policy framework software scans the route filter looking for the longest prefix during evaluation. An exception to this rule is when you use the same destination prefix multiple times in a list. In this case, the order of the prefixes is important, because the list of identical prefixes is scanned from top to bottom, and the first match type that matches the route applies.
I am also reading a book " JUNOS ENTERPRISE ROUTING" which says the same thing but my lab does not corroborate that or I am missing something here.
Have a nice day!!
inside a "from" statement with multiple route-filter the prefix length is evaluated, but not between different terms.
you interpreted the information wrong
Great, that was my hunch but you made it real clear.
I think I am missing something:
Terms with in a policy are evaluated in sequential orderm if a term contains multiple " route-filter" then longest match from that term will be used for matching criteria .
term 1 from route-filter 10.10.0.0/16
from route-filter 10.10.10.0/24
term2 from route-filter 10.10.10.10/32
f then reject
If we apply the above policy as IMPORT, a prefix 10.10.10.0/24 will be first matched against term1 because it is listed first, with in that term, longest match is picked for comparison which route-filter 10.10.10.0/24 which matches the prefix 10.10.10.0/24 so it a match,
I see the above behavior when I labbed it up.