08-18-2011 11:44 PM
Dear all,
what is the replacement for continue command in route-map for CRS IOS XR RPL ?
is it ? pass command ??
actually i had some issue matching almost 15 community attribute ingress from customer network...
and i think, is it can be done with pass command ?
like :
if community (a:a) then
action
pass
else if community (b:b) then
action
pass
end if
so, when the route contain community a:a, will get action assigned, and not yet to be forwarded, instead, will continue to run the next if, to check if the route also contain b:b community...
so with this i dont have to create almost 2^15 combination if format on RPL.
is it do able ? or is there any command that work simillar with "continue" command in route-map, if match, the route still get processed until the end of policy.
Thanks a lot,
Budi L
08-21-2011 02:51 AM
Hello Budi
Yes, the pass statement allows a policy to continue executing even though the route has not been modified. When a policy has finished executing, any route that has been modified in the policy or any route that has received a pass disposition in the policy, successfully passes the policy and completes the execution. Note, a policy does not modify route attribute values until all tests have been completed. In other words, comparison operators always run on the initial data in the route. Intermediate modifications of the route attributes do not have a cascading effect on the evaluation of the policy.
Here is the PASS example:
!
route-policy ak-community
if community matches-any (11:11, 44:44) then
set community (55:55) additive
pass
endif
if community matches-any (22:22) then
set community (77:77) additive
endif
end-policy
!
If a route contains a community 11:11 then we add 55:55 and continue. So If the same route contain 22:22 as well, we’d add another community 77:77 to the same route. Note, if we have an action (like SET here), a PASS statement is not needed and we continue with the policy.
Example 2. Here we can see nested IF. So if a route contains 11:11 then we add 55:55 and verify it further if the route has 22:22 and if so, add 77:77
!
route-policy ak-community
if community matches-any (11:11, 44:44) then
set community (55:55) additive
if community matches-any (22:22) then
set community (77:77) additive
endif
endif
end-policy
!
Example 3. In this example we add 55:55 to routes matching 11:11 or 44:44. Otherwise, if a route has 22:22, we add 77:77. Note, if a route has 11:11 AND 22:22 (or 44:44 AND 22:22) we’d add 55:55 only.
!
route-policy ak-community
if community matches-any (11:11, 44:44) then
set community (55:55) additive
elseif community matches-any (22:22) then
set community (77:77) additive
endif
end-policy
!
IF statement are flexible too. You noted we used MATCHES-ANY in the IF statement. We can use a list of different conations in one IF. For example:
!
If community matches-every (11:11, 22:22) or destination in (11.1.3.0/24) then
set local-preference 500
!
Regards,
/A
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