You can use extended community lists to filter BGP routes based on the community attribute. The community number consists of a 6-byte value in the aa4:nn format. The first four bytes represent the autonomous system number, and the last two bytes represent a user-defined network number.
When you configure multiple values in the same extended community list statement, all extended community values must match to satisfy the extended community list filter. When you configure multiple values in separate extended community list statements, the first list that matches a condition is processed.
Use extended community lists in a match statement to filter BGP routes based on the extended community attribute.
Transitive—BGP propagates the community attributes across autonomous systems.
Nontransitive—BGP removes community attributes before propagating the route to another autonomous system.
Any[String[Regex: ^[a-f0-9]{4}\.[a-f0-9]{4}\.[a-f0-9]{4}$] or String[Regex: ^[a-f0-9]{2}:[a-f0-9]{2}:[a-f0-9]{2}:[a-f0-9]{2}:[a-f0-9]{2}:[a-f0-9]{2}$] or String[Regex: ^[a-f0-9]{2}-[a-f0-9]{2}-[a-f0-9]{2}-[a-f0-9]{2}-[a-f0-9]{2}-[a-f0-9]{2}$]]
No
rt
List
Any[String[Regex: ^((?!0)[0-9]{1,10}:[0-9]{1,5})$] or String[Regex: ^((?!0)[0-9]{1,5}:[0-9]{1,10})$] or String[Regex: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?){4}:\d{1,5}$]]
No
soo
List
Any[String[Regex: ^((?!0)[0-9]{1,10}:[0-9]{1,5})$] or String[Regex: ^((?!0)[0-9]{1,5}:[0-9]{1,10})$] or String[Regex: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?){4}:\d{1,5}$]]
The following example creates and configures a named: extcomm_list-test extended community list that will permit routes only from AS-4byte 65535:40transitiveAND AS-4byte 65535:60transitive
Terminal window
switch#configureterminal
switch(config)# ip extcommunity-list standard extcomm_list-test seq 10 permit 4byteas-generic transitive 65535:40 4byteas-generic transitive 65535:60
The following example creates and configures a named: commext extended community list that will permit routes only from AS-4byte 65535:20AND route target (rt) 2:2AND with site of origin (soo) 3:3AND will implicitly deny all other routes: