Technical Documentation

How BGP Communities and Extended Communities Are Evaluated in Routing Policy Match Conditions

When you use BGP communities and extended communities as match conditions in a routing policy, the policy framework software evaluates them as follows:

  • Each route is evaluated against each named community in a routing policy from statement. If a route matches one of the named communities in the from statement, the evaluation of the current term continues. If a route does not match, the evaluation of the current term ends.
  • The route is evaluated against each member of a named community. The evaluation of all members must be successful for the named community evaluation to be successful.
  • Each member in a named community is identified by either a literal community value or a regular expression (for information about using regular expressions, see Using UNIX Regular Expressions in Community Names). Each member is evaluated against each community associated with the route. (Communities are an unordered property of a route. For example, 1:2 3:4 is the same as 3:4 1:2.) Only one community from the route is required to match for the member evaluation to be successful.
  • Community regular expressions are evaluated on a character-by-character basis. For example, if a route contains community 1234:5678, the regular expressions see nine discrete characters, including the colon (:), instead of two sets of numbers (1234 and 5678) separated by a colon. For example:
    [edit]policy-options {policy-statement one {from {community [comm-one comm-two];}}community comm-one members [ 1:2 "^4:(5|6)$" ];community comm-two members [ 7:8 9:10 ];}

    Note: If a community member is a regular expression, a string match is made rather than a numeric match.

  • To match routing policy one, the route must match either comm-one or comm-two.
  • To match comm-one, the route must have a community that matches 1:2 and a community that matches 4:5 or 4:6.
  • To match comm-two, the route must have a community that matches 7:8 and a community that matches 9:10.

Related Topics


Published: 2010-07-16

Help
|
My Account
|
Log Out