01-14-2012 01:19 AM - edited 03-04-2019 02:54 PM
Hello,
Could somebody please clarify how the "route-map continue" works ? I've read the following command reference from Cisco :
http://www.cisco.com/en/US/docs/ios/12_3t/12_3t2/feature/guide/gt_brmcs.html but found nothing that could help me.
QUESTION 1 :
When you have a route-map permit statement that is matched, and if you have a continue command inside it that makes you jump to another statement which is a deny statement and which is matched also, what happens ? Is the prefix announced by BGP to the peer or not ? Does the deny preempt the permit or not ?
Example :
route-map TEST permit 10
continue 30
set community 65001:1
!
route-map TEST permit 20
match prefix-list PFX-LIST1
!
route-map TEST deny 30
=> In this example, any prefix matches statement 10, then we go to statement 30 which denies all. What happens in this case ? Is the prefix announced or not ?
QUESTION 2 :
When setting BGP communities inside a route-map, is the modification applied in "real-time" inside the same statement ?
For example, if I receive the prefix 10.0.0.0/8 which has the community 65001:1 and have the following route-map applied to the neighbor :
route-map TEST permit 10
set community 65001:2
continue
!
route-map TEST permit 20
match community COMM-LIST-1
set local-preference 400
!
ip community-list expanded COMM-LIST-1 permit 65001:2
=> In this example, will the statement 20 match or not ?
In fact the question is : do we apply community 65001:2 directly at statement 10 (and so statement 20 will see that community) or do we keep in memory that we have to add community 65001:2 and we only add this community at the end of the route-map, in which case statement 20 won't see community 65001:2 ?
Thanks for your help !
Sam
Solved! Go to Solution.
01-14-2012 02:20 AM
Hi Sam,
I appreciate your well-presented case! It's a pleasure to respond to it.
Question 1: The prefixes will not be advertised. Each route is evaluated in the route-map TEST section 10 and will be initially permitted because the action of the section 10 is permit (route-map TEST permit 10). These permitted prefixes will be subsequently subjected to the section 30, and because the section 30 matches all prefixes and its action is deny, the prefixes will not be advertised.
Note that if a prefix is denied by a particular route-map section because of its deny action, it will not be evaluated in any other route-map section even if there is a continue statement configured. Once a route has been denied, the continue statement has no effect for it. This means that is does not make sense to configure continue statements in route-map sections with deny action because they would be ignored - just like set statements.
Put in other words, the destiny of a prefix is determined by the action of a terminal route-map section it was positively matched in, where the terminal section is
Question 2: The set clauses are not applied immediately. Rather, they are only saved and applied after the terminal route-map section was hit. The document you have referred to also states that (see the section "Set Operations with Continue Clauses"):
Set clauses are saved during the match clause evaluation process and executed after the route-map evaluation is completed.
Your route-map TEST would therefore set the community 65001:2 but it would not set the local preference to 400 because at the time of evaluation of the prefix, it does not yet have the community attribute set - its addition is only stored in memory and will be performed after the route-map evaluation finishes.
Please feel welcome to ask further!
Best regards,
Peter
01-14-2012 02:20 AM
Hi Sam,
I appreciate your well-presented case! It's a pleasure to respond to it.
Question 1: The prefixes will not be advertised. Each route is evaluated in the route-map TEST section 10 and will be initially permitted because the action of the section 10 is permit (route-map TEST permit 10). These permitted prefixes will be subsequently subjected to the section 30, and because the section 30 matches all prefixes and its action is deny, the prefixes will not be advertised.
Note that if a prefix is denied by a particular route-map section because of its deny action, it will not be evaluated in any other route-map section even if there is a continue statement configured. Once a route has been denied, the continue statement has no effect for it. This means that is does not make sense to configure continue statements in route-map sections with deny action because they would be ignored - just like set statements.
Put in other words, the destiny of a prefix is determined by the action of a terminal route-map section it was positively matched in, where the terminal section is
Question 2: The set clauses are not applied immediately. Rather, they are only saved and applied after the terminal route-map section was hit. The document you have referred to also states that (see the section "Set Operations with Continue Clauses"):
Set clauses are saved during the match clause evaluation process and executed after the route-map evaluation is completed.
Your route-map TEST would therefore set the community 65001:2 but it would not set the local preference to 400 because at the time of evaluation of the prefix, it does not yet have the community attribute set - its addition is only stored in memory and will be performed after the route-map evaluation finishes.
Please feel welcome to ask further!
Best regards,
Peter
01-21-2012 04:03 AM
Thanks a lot Peter for this clear answer.
07-24-2019 03:31 AM
Can u explain what will happen if 30 is a permit and the set will also apply from 10
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