The BGP Named Community Lists feature allows the network operator to assign meaningful names to community lists and increases the number of community lists that can be configured.
Your software release may not support all the features documented in this module. For the latest caveats and feature information, see
Bug Search Tool and the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the feature information table at the end of this module.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to
www.cisco.com/go/cfn. An account on Cisco.com is not required.
A BGP community is a group of routes that share a common property, regardless of their network, autonomous system, or any physical boundaries. In large networks, applying a common routing policy by using prefix lists or access lists requires individual peer statements on each networking device. Using the BGP COMMUNITIES attribute, BGP speakers with common routing policies can implement inbound or outbound route filters based on the community tag, rather than consult long lists of individual permit or deny statements. A COMMUNITIES attribute can contain multiple communities.
A route can belong to multiple communities. The network administrator defines the communities to which a route belongs. By default, all routes belong to the general Internet community.
In addition to numbered communities, there are several predefined (well-known) communities:
no-export--Do not advertise this route to external BGP peers.
no-advertise--Do not advertise this route to any peer.
internet--Advertise this route to the Internet community. All BGP-speaking networking devices belong to this community.
local-as--Do not send this route outside the local autonomous system.
gshut--Community of routes gracefully shut down.
The COMMUNITIES attribute is optional, which means that it will not be passed on by networking devices that do not understand communities. Networking devices that understand communities must be configured to handle the communities or else the COMMUNITIES attribute will be discarded. By default, no COMMUNITIES attribute is sent to a neighbor. In order for a COMMUNITIES attribute to be sent to a neighbor, use the
neighbor send-community command.
BGP Community Lists
A BGP community list is used to create groups of communities to use in a match clause of a route map. A community list can be used to control which routes are accepted, preferred, distributed, or advertised, for example. You can also use a community list to set, append, or modify the communities of a route.
Standard community lists are used to specify well-known communities and community numbers.
Expanded community lists are used to filter communities using a regular expression. Regular expressions are used to specify patterns to match COMMUNITIES attributes.
A BGP named community list allows you to assign a meaningful name to a community list. A named community list can be configured using community numbers, well-known communities, or regular expressions. All the rules of numbered community lists apply to named community lists, except that there is no limit on the number of named community lists that can be configured.
Note
A maximum of 100 standard community lists and 100 expanded community lists can be configured. A named community list does not have this limitation.
Perform this task to filter traffic by creating a BGP community list, referencing the community list within a route map, and then applying the route map to a neighbor, specifying whether the route map applies to incoming or outgoing routes.
In this task, Router B in the figure below is configured with route maps and a community list to control incoming routes.
Specifies the IPv4 address family and enters address family configuration mode.
The
unicast keyword specifies the IPv4 unicast address family. By default, the router is placed in address family configuration mode for the IPv4 unicast address family if the
unicast keyword is not specified with the
address-familyipv4 command.
The
multicast keyword specifies IPv4 multicast address prefixes.
The
vrf keyword and
vrf-name argument specify the name of the VRF instance to associate with subsequent IPv4 address family configuration mode commands.
Device(config)# ip community-list 2 permit internet
Creates a community list for BGP and controls access to it.
In the first example, community list 1 permits routes with a COMMUNITIES attribute of 100. Router E routes all have a COMMUNITIES attribute of 100, so their weight will be set to 30.
In the second example, community list 2 effectively permits all routes by specifying the
internet community. Any routes that did not match community list 1 are checked against community list 2. All routes are permitted, but no changes are made to the route attributes.
Note
Two examples are shown here because the task example requires both of these statements to be configured.
Step 18
Repeat Step 17 to create all the required community lists.
--
Step 19
exit
Example:
Device(config)# exit
Exits global configuration mode and enters privileged EXEC mode.
The following sample output verifies that community list 1 has been created and it permits routes that have a community attribute of 100:
Device# show ip community-list 1
Community standard list 1
permit 100
The following sample output verifies that community list 2 has been created and it effectively permits all routes by specifying the
internet community:
Device# show ip community-list 2
Community standard list 2
permit internet
Filtering Traffic Using Extended Community Lists
Perform this task to filter traffic by creating an extended BGP community list to control outbound routes.
Figure 2
Topology for Which a Community List Is Configured
In this task, Router B in the figure above is configured with an extended named community list to specify that the BGP peer at 192.168.1.2 is not sent advertisements about any path through or from autonomous system 50000. The IP extended community-list configuration mode is used and the ability to resequence entries is shown.
Note
A sequence number is applied to all extended community list entries by default, regardless of the configuration mode. Explicit sequencing and resequencing of extended community list entries can be configured only in IP extended community-list configuration mode, not in global configuration mode.
In the first example, an expanded community list entry with the sequence number 10 is configured to deny advertisements about paths from autonomous system 50000.
In the second example, an expanded community list entry with the sequence number 20 is configured to deny advertisements about paths through autonomous system 50000.
Note
Two examples are shown here because the task example requires both these statements to be configured.
Note
Only the syntax applicable to this task is used in this example. For more details, see the
Cisco IOS IP Routing: BGP Command Reference.
Step 5
Repeat Step 4 for all the required permit or deny entries in the extended community list.
In this example, the sequence number of the first expanded community list entry is set to 50 and subsequent entries are set to increment by 100. The second expanded community list entry is therefore set to 150.
Note
Only the syntax applicable to this task is used in this example. For more details, see the
Cisco IOS IP Routing: BGP Command Reference.
Step 7
exit
Example:
Device(config-extcomm-list)# exit
Exits expanded community-list configuration mode and enters global configuration mode.
Step 8
routerbgpautonomous-system-number
Example:
Device(config)# router bgp 45000
Enters router configuration mode for the specified routing process.
Specifies the IPv4 address family and enters address family configuration mode.
The
unicast keyword specifies the IPv4 unicast address family. By default, the router is placed in address family configuration mode for the IPv4 unicast address family if the
unicast keyword is not specified in the
address-familyipv4 command.
The
multicast keyword specifies IPv4 multicast address prefixes.
Note
The
vrf keyword and
vrf-name argument specify the name of the VRF instance to associate with subsequent IPv4 address family configuration mode commands.
(Optional) Specifies a network as local to this autonomous system and adds it to the BGP routing table.
For exterior protocols, the
network command controls which networks are advertised. Interior protocols use the
network command to determine where to send updates.
Note
Only the syntax applicable to this task is used in this example. For more details, see the
Cisco IOS IP Routing: BGP Command Reference.
Step 13
end
Example:
Device(config-router-af)# end
Exits address family configuration mode and enters privileged EXEC mode.
Step 14
showipextcommunity-list [list-name]
Example:
Device# show ip extcommunity-list DENY50000
Displays configured BGP expanded community list entries.
Examples
The following sample output verifies that the BGP expanded community list DENY50000 has been created, with the output showing that the entries to deny advertisements about autonomous system 50000 have been resequenced from 10 and 20 to 50 and 150:
Device# show ip extcommunity-list DENY50000
Expanded extended community-list DENY50000
50 deny _50000_
150 deny ^50000 .*
Configuration Examples for BGP Named Community Lists
Example: Filtering Traffic Using COMMUNITIES Attributes
This section contains two examples of the use of BGP COMMUNITIES attributes with route maps.
The first example configures a route map named set-community, which is applied to the outbound updates to the neighbor 172.16.232.50. The routes that pass access list 1 are given the well-known COMMUNITIES attribute value
no-export. The remaining routes are advertised normally. The
no-export community value automatically prevents the advertisement of those routes by the BGP speakers in autonomous system 200.
router bgp 100
neighbor 172.16.232.50 remote-as 200
neighbor 172.16.232.50 send-community
neighbor 172.16.232.50 route-map set-community out
!
route-map set-community permit 10
match address 1
set community no-export
!
route-map set-community permit 20
match address 2
The second example configures a route map named
set-community, which is applied to the outbound updates to neighbor 172.16.232.90. All the routes that originate from autonomous system 70 have the COMMUNITIES attribute values 200 200 added to their already existing communities. All other routes are advertised as normal.
route-map bgp 200
neighbor 172.16.232.90 remote-as 100
neighbor 172.16.232.90 send-community
neighbor 172.16.232.90 route-map set-community out
!
route-map set-community permit 10
match as-path 1
set community 200 200 additive
!
route-map set-community permit 20
!
ip as-path access-list 1 permit 70$
ip as-path access-list 2 permit .*
Additional References for BGP Named Community Lists
The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password.
The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to
www.cisco.com/go/cfn. An account on Cisco.com is not required.
Table 1
Feature Information for BGP Named Community Lists
Feature Name
Releases
Feature Information
BGP Named Community Lists
12.2(8)T
12.2(14)S
15.0(1)S
Cisco IOS XE Release 2.1
Cisco IOS XE Release 3.2SE
The BGP Named Community Lists feature allows the network operator to assign meaningful names to community lists. The feature increases the number of community lists that can be configured. A named community list can be configured with regular expressions and with numbered community lists. All rules of numbered communities apply to named community lists, except that there is no limit on the number of named community lists that can be configured.
This feature was introduced on the Cisco ASR 1000 Series Routers.
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL:
www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1110R)
Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.