11-26-2013 04:36 AM
hi
I wanted to get an answer to a question related to using the apply command inside route-policies
I have an rpl that calls two sub policies sequentially.
if inside the first sub policy I set the prefix to have a drop terminating statement, does this jump completely out of the RPL processing or simply out of the sub policy.
I am having a situation where if I remove the second policy I get the correct prefix set output to the neighbor.
If I then include the second sub policy which performs as-path padding and commit
I get the complete set of routes sent to the neighbor , which were before blocked?
11-26-2013 04:51 AM
good question. it stops the policy execution all together.
here an example:
BEFORE:
Network Next Hop Metric LocPrf Weight Path
*> 2.2.2.2/32 123.1.1.2 0 0 300 ?
*> 3.0.0.0/8 123.1.1.2 0 0 300 ?
*> 33.33.1.0/24 123.1.1.2 0 0 300 ?
RP/0/RSP0/CPU0:A9K-BNG#sh run route-policy hierarchical-1
Tue Nov 26 08:50:27.427 EDT
route-policy hierarchical-1
apply hierarchical-2
set local-preference 1234
end-policy
!
RP/0/RSP0/CPU0:A9K-BNG#sh run route-policy hierarchical-2
Tue Nov 26 08:50:28.509 EDT
route-policy hierarchical-2
if destination in (2.2.2.2/32) then
set weight 5555
drop
endif
end-policy
Network Next Hop Metric LocPrf Weight Path
*> 3.0.0.0/8 123.1.1.2 0 1234 0 300 ?
*> 33.33.1.0/24 123.1.1.2 0 1234 0 300 ?
the route for 2.2.2.2 is gone.
xander
11-26-2013 05:21 AM
This is what I thought but something is up example:
I have the following:
policy Top-Policy($param1,$param2)
apply sub-policy1(param1,param2)
#apply sub-policy2
end-policy
policy sub-policy 2
prepend as-path xxxx 5
end-policy
When I have sub-policy 2 removed from the Top-Policy I get 22 prefixes as output from running the command:
sh bgp route-policy Top-Policy
if I then have the sub-policy2 applied in the Top-Policy I get the original 22 prefixes + all my internal BGP prefixes that would match against an as-local check?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide