You can use the exact-match keyword for the match community command to specify that a match exists only for the exact community numbers specified in the community list. The exact-match keyword applies only to a standard community list—that is, one not specified by a regular expression. You cannot use the exact-match keyword with a community list that is specified by a regular expression.
Consider the following example:
- host1(config)#ip community-list 1 permit 100
200 300
- host1(config)#exit
- host1#show ip community-list
- Community standard list 1
- permit 0:100 0:200 0:300
- host1(config)#route-map example1 permit 10
- host1(config-route-map)#match community 1
exact-match
- host1(config)#exit
- host1#show route-map example1
- route-map example, permit, sequence 10
- Match clauses:
- community (community-list filter): 1 exact-match
The route map example1 permits a route only if the route contains community 100 and community 200 and community 300 and no additional communities.
If you do not specify the exact-match option, the route map also permits a match on a route that contains additional communities. For example, a route that contains communities 100, 200, 300, 400, and 450 matches.