cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4914
Views
15
Helpful
3
Replies

BGP route-map continue command behavior

Sam Preston
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

Peter Paluch
Cisco Employee
Cisco Employee

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

  • either a section that contains no continue statement (the resulting action depends on the action of this section)
  • or a section whose action is deny (the resulting action will be deny)
  • or the implicit deny at the end of the route-map, if this is reached (the resulting action will be deny)

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

View solution in original post

3 Replies 3

Peter Paluch
Cisco Employee
Cisco Employee

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

  • either a section that contains no continue statement (the resulting action depends on the action of this section)
  • or a section whose action is deny (the resulting action will be deny)
  • or the implicit deny at the end of the route-map, if this is reached (the resulting action will be deny)

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

Thanks a lot Peter for this clear answer.

Can u explain what will happen if 30 is a permit and the set will also apply from 10

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card