How Communities Are Evaluated
The policy framework software evaluates communities as follows:
- Each route is evaluated against each named community in a routing policy
fromstatement. If a route matches one of the named communities in thefromstatement, 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 either a literal community value or a regular expression. Each member is evaluated against each community associated with the route. (Communities are an unordered property of a route. For example,
1:2 3:4is the same as3: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 members comm-one [ 1:2 "^4:(5|6)$" ];community members comm-two [ 7:8 9:10 ];}To match routing policy one, the route must match eithercomm-oneorcomm-two.To match comm-one, the route must have a community that matches1:2and a community that matches4:5or4:6.To match comm-two, the route must have a community that matches7:8and a community that matches9:10.