Quick Reference Guide

802 PowerConnect B-Series TI24X Configuration Guide
53-1002269-02
Filtering
25
Matching on routes containing a specific set of communities
Device software enables you to match routes based on the presence of a community name or
number in a route, and to match when a route contains exactly the set of communities you specify.
To match based on a set of communities, configure a community ACL that lists the communities,
then compare routes against the ACL.
Here is an example.
PowerConnect(config)# ip community-list standard std_1 permit 12:34 no-export
PowerConnect(config)# route-map bgp2 permit 1
PowerConnect(config-routemap bgp2)# match community std_1 exact-match
The first command configures a community ACL that contains community number 12:34 and
community name no-export. The remaining commands configure a route map that matches the
community attributes field in BGP4 routes against the set of communities in the ACL. A route
matches the route map only if the route contains all the communities in the ACL and no other
communities.
Syntax: match community <ACL> exact-match
The <ACL> parameter specifies the name of a community list ACL. You can specify up to five ACLs.
Separate the ACL names or IDs with spaces.
Here is another example.
These commands configure an additional community ACL, std_2, that contains community
numbers 23:45 and 57:68. Route map bgp3 compares each BGP4 route against the sets of
communities in ACLs std_1 and std_2. A BGP4 route that contains either but not both sets of
communities matches the route map. For example, a route containing communities 23:45 and
57:68 matches. However, a route containing communities 23:45, 57:68 and 12:34, or
communities 23:45, 57:68, 12:34, and no-export does not match. To match, the route
communities must be the same as those in exactly one of the community ACLs used by the match
community statement.
Setting parameters in the routes
Use the following command to define a set statement that prepends an AS number to the AS path
on each route that matches the corresponding match statement.
PowerConnect(config-routemap GET_ONE)# set as-path prepend 65535
Syntax: set [as-path [prepend <as-num,as-num,...>]] | [automatic-tag] | [comm-list <ACL> delete]
| [community <num>:<num> | <num> | internet | local-as | no-advertise | no-export] |
[dampening [<half-life> <reuse> <suppress> <max-suppress-time>]] [[default] interface
null0 | [ip [default] next hop <ip-addr>] [ip next-hop peer-address] | [local-preference
<num>] | [metric [+ | - ]<num> | none] | [metric-type type-1 |
type-2] | [metric-type
internal] | [next-hop <ip-addr>] | [nlri multicast | unicast | multicast unicast] | [origin igp
| incomplete] | [tag <tag-value>] | [weight <num>]
The as-path prepend <num,num,...> parameter adds the specified AS numbers to the front of the
AS-path list for the route.
The automatic-tag parameter calculates and sets an automatic tag value for the route.
PowerConnect(config)# ip community-list standard std_2 permit 23:45 56:78
PowerConnect(config)# route-map bgp3 permit 1
PowerConnect(config-routemap bgp3)# match community std_1 std_2 exact-match