CISCO IP Routing Configuration BGP Large Community User Guide
- June 15, 2024
- Cisco
Table of Contents
- CISCO IP Routing Configuration BGP Large Community
- Specifications
- Information About the BGP Large Community Feature
- How to Configure the BGP Large Community
- Matching Large Communities
- Deleting Large Communities
- Troubleshooting Large Communities
- BGP Large Community Configuration Example
- Additional References
- Feature Information for BGP Large Communities
- References
- Read User Manual Online (PDF format)
- Download This Manual (PDF format)
CISCO IP Routing Configuration BGP Large Community
Specifications
- Maximum number of numbered standard large community lists: 99 (range 1-99)
- Maximum number of numbered expanded large community lists: 401 (range 100-500)
- No limitation on named large community lists
BGP Large Community Feature Overview
The BGP Large Community feature allows you to create groups of large
communities that can be used in a match clause of a route map. Large
communities are used to control routing policies, including filtering routes,
modifying route attributes, and selectively deleting large communities.
- Information About the BGP Large Community Feature, on page 1
- How to Configure the BGP Large Community, on page 2
- BGP Large Community Configuration Example, on page 11
- Additional References, on page 12
- Feature Information for BGP Large Communities, on page 13
Information About the BGP Large Community Feature
BGP Large Community Overview
The BGP large communities attribute provides the capability for tagging
routes and modifying the BGP routing policy on routers. BGP large communities
can be appended or removed selectively on the large communities attribute as
the route travels from router to router. When large communities are specified
in commands, they are specified as three non-negative decimal integers
separated by colons. For example as 1:2:3. The first integer represents the
Global Administrator field, and the other two integers represent the Local
Administrator field.
The BGP large communities attribute behaves similarly to regular communities
and is used for similar purposes. For more information on BGP’s large
community, see the rfc8092 document.
Large Community Lists
A BGP large community list is used to create groups of large communities
which can be used in a match clause of a route map. You can use large
communities to control the routing policy. Routing policy allows you to filter
the routes you receive or advertise, or modify the attributes of the routes
you receive or advertise. You can also use a large community list to delete
the large communities selectively. There are two types of large community
lists:
- Standard large community lists -—Specifies large communities.
- Expanded large community lists —Specifies large communities using a regular expression.
A large community list can be either named or numbered. Both named and numbered large community lists can be either standard or expanded. All the rules of numbered large community lists apply to named large community lists, except that there is no limit on the number of named community lists that can be configured.
Note: A maximum of 99 (range 1-99) numbered standard large community lists and 401 (range 100-500) numbered expanded large community lists can be configured. Named large community lists do not have this limitation.
BGP Large Communities Attribute
In a BGP large community, the large community value is encoded as a 12
octet number. The following image displays the syntax of the large communities
attribute.
How to Configure the BGP Large Community
Enabling BGP Large Communities
To enable large communities, perform the following steps.
SUMMARY STEPS
- configure terminal
- router bgp autonomous-system-number
- neighbor IP address remote-as autonomous-system-number
- address-family {ipv4 | ipv6} {unicast | multicast}
- neighbor IP address activate
- neighbor IP address send-community [both | extended | standard]
- exit
- exit
- end
DETAILED STEPS
| Command or Action| Purpose
---|---|---
| |
Step 1| configure terminal
Example:
Device# configure terminal
| Enters global configuration mode.
Step 2| router bgp autonomous-system-number
Example:
Device(config)# router bgp 64496
| Enters router configuration mode for the specified routing process.
Step 3| neighbor IP address remote-as
autonomous-system-number
Example:
Device(config-router)# neighbor 209.165.201.1
remote-as 100
| Enters global address family configuration mode.
Step 4| address-family { ipv4 | ipv6 } { unicast | multicast
}
Example:
Device(config-router-neighbor)# address-family ipv4 multicast
| Enters global address family configuration mode.
Note **** It also supports other available address families.
Step 5| neighbor IP address activate
Example:
Device(config-router-af)# neighbor 209.165.201.1 activate
| Enters global address family configuration mode and activates the BGP
neighbor.
Step 6| neighbor IP address send-community [ both |
extended
| standard ]
Example:
| Configures the router to send the large communities attribute to the
neighbor 209.165.201.1.
| Command or Action| Purpose
---|---|---
| ****
Device(config-router-neighbor-af)# neighbor 209.165.201.1 send-community standard
| • Both—Sends extended community, large community,
and standard communities attributes to the neighbor.
• Extended—Sends the extended communities attribute to the neighbor.
• Standard—Sends large community and also standard communities attribute to the neighbor.
Note **** When configuring the command, not specifying any keyword is equivalent to configuring the standard keyword (no keyword will be displayed in the
configuration). When configuring both standard keyword and extended keyword, that will be equivalent to configuring both keyword (both keyword is displayed in the configuration).
Step 7| exit
Example:
Device(config-router-neighbor-af)# exit
| Exits address-family mode and enters global configuration mode.
Step 8| exit
Example:
Device(config-router)# exit
| Exits router configuration mode and enters global configuration mode.
Step 9| end
Example:
Device(config)# end
| Exits configuration mode and enters privileged EXEC mode.
Defining a BGP Large Community List
To define a BGP large community list, perform the following steps. BGP
large community supports named and numbered community lists.
SUMMARY STEPS
- configure terminal
- ip large-community-list {list-number | standard list-name } {deny | permit} community-number large-community
- ip large-community-list {list-number | expanded list-name} {deny | permit} regexp
- end
DETAILED STEPS
| Command or Action| Purpose
---|---|---
Step 1| configure terminal
Example:
Device# configure terminal
| Enters global configuration mode.
Step 2| ip large-community-list { list-number |
standard list-name } { deny | permit } community-number large-
community
Example:
Numbered Large Community List
Device(config)# ip large-community-list 1 permit 1:2:3 5:6:7
Device(config)# ip large-community-list 1 permit 4123456789:4123456780:4123456788
Named Large Community List
Device(config)# ip large-community-list standard LG_ST permit 1:2:3 5:6:7
Device(config)# ip large-community-list standard LG_ST permit 4123456789:4123456780:4123456788
| Defines a standard large community list. A standard large community list is
composed of a set of entries, each specifying a set of large community lists.
Step 3| ip large-community-list { list-number | expanded
list-name } { deny | permit } regexp
Example:
Numbered Extended Large Community List
Device(config)# ip large-community-list 100 permit
^5:.*:7$
Device(config)# ip large-community-list 100 permit
^5:.*:8$
Named Extended Large Community List
Device(config)# ip large-community-list expanded LG_EX permit ^5:.*:7$
Device(config)# ip large-community-list expanded LG_EX permit ^5:.*:8$
| Defines an expanded large community list. An expanded large community list
is composed of a set of entries, each specifying a regular expression used to
match a set of large communities.
Step 4| end
Example:
Device(config)# end
| Exits configuration mode and enters privileged EXEC mode.
Matching Large Communities
To match BGP large communities, perform the following steps.
SUMMARY STEPS
- configure terminal
- route-map map-tag [permit | deny] [sequence number]
- match large-community {list-name | list-numbered }
- exit
- route-map map-tag [permit | deny] [sequence number]
- match large-community {list-name | list-numbered } exact-match
- exit
- end
| Command or Action| Purpose
---|---|---
Step 1| configure terminal
Example:
Device# configure terminal
| Enters global configuration mode.
Step 2| route-map map-tag [permit | deny] [sequence number]
Example:
Device(config)# route-map test permit 10
| Enters route-map configuration mode.
Step 3| match large-community { list-name | list-numbered }
Example:
Device(config-route-map)# match large-community 1
| Matches a large community list.
Matching a standard large community list entry means that all the large communities defined in such entry are included in the large communities attribute in the route we are trying to match.
Matching an expanded large community list entry means the regular expression defined in such entry matches the string representing (in order) all the large communities in the large communities attribute.
Matching a large community list means matching at least one of its entries with a grant permit. The entries are
evaluated in order. If the first entry in matching has a grant permit, we consider the large community list has matched. If the first entry in matching has a grant deny, or there is no entry matching, we consider the large community list has not matched.
Note **** You can specify more than one large
community list. In such a case, a match of any large community list will be consider a global match for the match large community statement.
| Command or Action| Purpose
---|---|---
Step 4| exit
Example:
Device(config-route-map)# exit
| Exits route-map configuration mode and enters global configuration mode.
Step 5| route-map map-tag [permit | deny] [sequence number]
Example:
Device(config)# route-map test permit 20
| Enters the route-map configuration mode and defines the conditions for
routes from one routing protocol into another.
Step 6| match large-community { list-name | list-numbered }
exact-match
Example:
Device(config-route-map)# match large-community 1 exact-match
| The key word exact-match ensures that there is no large community in the route that is not matched by a large
community in the large community list entry. In other
words, the set of large communities in the route must be an exact match of the set of large communities in the large
community list entry.
Note **** The exact-match keyword is only supported for standard large community lists.
Step 7| exit
Example:
Device(config-router-map)# exit
| Exits route-map configuration mode and enters global configuration mode.
Step 8| end
Example:
Device(config)# end
| Exits configuration mode and enters privileged EXEC mode.
Setting BGP Large Communities
To set large communities, perform the following steps.
SUMMARY STEPS
- configure terminal
- route-map map-tag [permit | deny] [sequence number]
- set large-community { none | xx1:yy1:zz1….xxn:yyn:zzn}
- exit
- route-map map-tag [permit | deny] [sequence number]
- set large-community xx1:yy1:zz1….xxn:yyn:zzn additive
- exit
- end
DETAILED STEPS
| Command or Action| Purpose
---|---|---
Step 1| configure terminal
Example:
Device# configure terminal
| Enters global configuration mode.
Step 2| route-map map-tag [permit | deny] [sequence number]
Example:
Device(config)# route-map foo permit 10
| Enters the route-map configuration mode.
Step 3| set large-community { none | xx1:yy1:zz1… xxn:yyn:zzn }
Example:
Device(config-route-map)# set large-community 1:2:3 5:6:7
| This route-map set statement is used to set one or more large communities in
a route. The keyword none sets an empty set of large communities. This is
equivalent to an update with no large communities attribute.
Step 4| exit
Example:
Device(config-router-map)# exit
| Exits route-map configuration mode and enters global configuration mode.
Step 5| route-map map-tag [permit | deny] [sequence number]
Example:
Device(config)# route-map foo permit 20
| Enters the route-map configuration mode.
Step 6| set large-community xx1:yy1:zz1… xxn:yyn:zzn
additive
Example:
Device(config-route-map)# set large-community 1:2:3 5:6:7 additive
| This route-map set statement is used to set one or more large communities in
a route in an additive manner. The keyword additive adds the speified
large communities without removing the existing large communities.
Step 7| exit
Example:
Device(config-router-map)# exit
| Exits route-map configuration mode and enters global configuration mode.
Step 8| end
Example:
Device(config)# end
| Exits configuration mode and enters privileged EXEC mode.
Deleting Large Communities
To delete BGP large communities, perform the following steps.
SUMMARY STEPS
- configure terminal
- route-map map-tag [permit | deny] [sequence number]
- set largecomm-list {standard | expanded | large-community-list number } delete
- exit
- end
| Command or Action| Purpose
---|---|---
Step 1| configure terminal
Example:
Device# configure terminal
| Enters global configuration mode.
Step 2| route-map map-tag [permit | deny] [sequence number]
Example:
Device(config)# route-map test permit 10
| Enters the route-map configuration mode.
Step 3| set largecomm-list { standard | expanded | large-community-
list number } delete
Example:
Device(config-route-map)# set largecomm-list 1 delete
| Deletes the large communities based on the matches for the large community
list.
Step 4| exit
Example:
Device(config-route-map)# exit
| Exits route-map configuration mode and enters global configuration mode.
Step 5| end
Example:
Device(config)# end
| Exits configuration mode and enters privileged EXEC mode.
Verifying the Configuration of the BGP Large Community
- To verify the BGP large community, use the following commands.
- This example displays entries in the IP version 4 (IPv4) BGP routing table.
Verifying the Configuration of the BGP Large Community
- Device # show bgp ipv4 unicast 2.2.2.2
- BGP routing table entry for 2.2.2.2/32, version 2
- Paths: (1 available, best #1, table default)
- Not advertised to any peer
- Refresh Epoch 1
- 67001
- 19.0.101.1 from 19.0.101.1 (19.0.101.1)
- Origin IGP, local prep 100, valid, external, best
- Large Community: 67001:0:2
- rx path: 0, tx pathed: 0x0
- Updated on Nov 1 2020 01:18:02 PST
This example shows a list of routes that contain all of the large communities given in the command. The listed routes may contain additional large communities.
- Device# show bgp large-community 1:2:3 5:6:7
- BGP table version is 17, the local router ID is 1.1.1.3
- Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
- r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
- x best-external, an additional-path, c RIB-compressed,
- Origin codes: i – IGP, e – EGP, ? – incomplete
- RPKI validation codes: V valid, I invalid, N Not found
Network
-
i 5.5.5.5/32
-
i 5.5.5.6/32
Next Hop
- 1.1.1.2
- 1.1.1.2
Metric LocPrf Weight Path
- 00/100100/0 ?0 ?
This example displays the listed routes that contain only the given large communities when you add the keyword exact-match in the configuration.
- Device#show bgp large-community 1:2:3 5:6:7 exact-match
- BGP table version is 17, the local router ID is 1.1.1.3
- Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
- r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
- x best-external, an additional-path, c RIB-compressed,
- Origin codes: i – IGP, e – EGP, ? – incomplete
- RPKI validation codes: V valid, I invalid, N Not found
Network
i 5.5.5.5/32
Next Hop
- 1.1.1.2
Metric LocPrf Weight Path
- 0 100 0 ?
In the last two examples above, the routes 5.5.5.5/32 and 5.5.5.6/32 contain both the large communities 1:2:3 and 5:6:7. The route 5.5.5.6/32 contains some additional large communities.
This example displays a large community list.
- Device# show ip large community-list 51
- Large Community Standard List 51
- permit 1:2:3 5:6:7
This example displays a match with a large community list.
- Device# show ip bgp large community-list 51 exact-match
- BGP table version is 17, local router ID is 1.1.1.3
- Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
- r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
- x best-external, an additional-path, c RIB-compressed,
- Origin codes: i – IGP, e – EGP, ? – incomplete
- RPKI validation codes: V valid, I invalid, N Not found
Network
-
i 5.5.5.5/32
Next Hop
- 1.1.1.2
Metric LocPrf Weight Path
- 0 100 0 ?
Troubleshooting Large Communities
To debug the large communities, use debug ip bgp update command.
Device# debug ip bgp update
- Mar 10 23:25:01.194: BGP(0): 192.0.0.1 rcvd UPDATE w/ attr: nexthop 192.0.0.1, origin ?, metric 0, merged path 1, AS_PATH , community 0:44 1:1 2:3, large-community 3:1:244 3:1:245
- Mar 10 23:25:01.194: BGP(0): 192.0.0.1 rcvd 5.5.5.1/32
- Mar 10 23:25:01.194: BGP(0): Revise route installing 1 of 1 routes for 5.5.5.1/32 -> 192.0.0.1(global) to main IP table
Memory Display
- The show ip bgp summary command displays large community memory information.
- Device # show ip bgp summary
- BGP router identifier 1.1.1.1, local AS number 1
- BGP table version is 3, main routing table version 3
- 2 network entries using 496 bytes of memory
- 2 path entries using 272 bytes of memory
- 1/1 BGP path/bestpath attribute entries using 288 bytes of memory
- 1 BGP community entries using 40 bytes of memory
- 2 BGP large-community entries using 96 bytes of memory
- 0 BGP route-map cache entries using 0 bytes of memory
- 0 BGP filter-list cache entries using 0 bytes of memory
- BGP using 1096 total bytes of memory
- BGP activity 3/1 prefixes, 3/1 paths, scan interval 60 secs
- 2 networks peaked at 13:04:52 Mar 11 2020 EST (00:07:25.579 ago)
Neighbor
- 192.0.0.2
- 4
AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
- 2 1245 1245 3 0 0 18:47:56 0
BGP Large Community Configuration Example
The following examples show how to configure policies used to match and
manipulate the large communities attribute.
Numbered Standard Large Community List
- This example shows how to configure a numbered large community list.
- ip large-community-list 1 permit 1:2:3 5:6:7
- ip large-community-list 1 permit 4123456789:4123456780:4123456788
Named Standard Large Community List
- This example shows how to configure a named standard large community list.
- ip large-community-list standard LG_ST permit 1:2:3 5:6:7
- ip large-community-list standard LG_ST permit 4123456789:4123456780:4123456788
Numbered Expanded Large Community List
- This example shows how to configure a numbered expanded large community list.
- ip large-community-list 100 permit ^5:.*:7$
- ip large-community-list 100 permit ^5:.*:8$
Named Expanded Large Community List
This example shows how to configure a named expanded large community list.
- ip large-community-list expanded LG_EX permit ^5:.*:7$
- ip large-community-list expanded LG_EX permit ^5:.*:8$
Matching Large Communities
These examples show how to match large communities.
- route-map foo permit 10
- match large-community 1
- route-map foo2 permit 10
- match large-community 1 exact-match
- route-map foo3 permit 10
- match large-community 100
- route-map foo4 permit 10 match large-community LG_ST exact-match
Setting Large Communities
These examples show how to add large communities to the large communities
attribute. The additive keyword adds the large communities without removing
the existing large communities.
- route-map foo permit 10
- set large-community 1:2:3 5:6:7
- route-map foo2 permit 10 set large-community 1:2:3 5:6:7 additive
Deleting Large Communities
These examples show how to remove large communities from the large communities
attribute. route-map foo
- set large-comm-list 1 delete
- route-map foo2
- set largecomm-list 100 delete
- route-map foo3
- set largecomm-list LG_ST delete
Additional References
Related Documents
-
Related Topic: Document Title
-
BGP commands: Cisco IOS IP Routing: BGP Command Reference
Technical Assistance
Description
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.
Link:http://www.cisco.com/cisco/web/support/index.html
Standards and RFCs
-
Standard/RFC/Title
-
RFC-8092: BGP Large Communities Attribute
Feature Information for BGP Large Communities
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 http://www.cisco.com/go/cfn. An account on Cisco.com is not required.
Table 1: Feature Information for BGP Large Communities
- Feature Name: BGP Large Communities
- Releases: Cisco IOS XE Bengaluru 17.4.1a
- Feature Information: The BGP large communities attribute provides the capability for tagging routes and modifying BGP routing policy on routers.
References
- Cisco IOS IP Routing: BGP Command Reference - Cisco
- Cisco Feature Navigator
- Support - Cisco Support and Downloads – Documentation, Tools, Cases - Cisco
Read User Manual Online (PDF format)
Read User Manual Online (PDF format) >>