BGP IPv4 - Community String

Community String

The BGP (Border Gateway Protocol) IPv4 Community String is a mechanism for tagging and categorizing BGP routes within an Autonomous System (AS). A community string is a numeric or alphanumeric label attached to BGP route advertisements, serving as a form of metadata to convey specific information about the route. Network operators can define and assign community strings based on their policies, enabling more granular control over how BGP routes are treated within the AS. Common use cases for community strings include influencing route propagation, implementing traffic engineering, or applying route policies. Routers within the AS can use the information encoded in the community string to make decisions about route advertisement, filtering, or preference. The flexibility and extensibility of BGP IPv4 community strings make them a valuable tool for managing and controlling routing behavior within complex network environments.

Lab:

Disclaimer

This Configuration Guide is designed to assist members to enhance their skills in particular technology area. While every effort has been made to ensure that all material is as complete and accurate as possible, the enclosed material is presented on an “as is” basis. Neither the authors nor Forum assume any liability or responsibility to any person or entity with respect to loss or damages incurred from the information contained in this guide. This configuration guide was developed by Forum. Any similarities between material presented in this configuration guide and any other material is completely coincidental. Cisco IOS Software, Linux Software (I86BI_LINUX-ADVENTERPRISEK9-M), Version 15.2(4)M1, DEVELOPMENT TEST SOFTWARE

Task 1: Configure IPv4 BGP Community String

Step 1: In the configuration mode of router configure Community String Attributes by following command:

R1:
router bgp 65100
address-family ipv4
neighbor 22.0.1.2 send-community
neighbor 22.0.1.2 route-map aaa out
exit
route-map aaa permit 10
set community 8888
exit

Step 2: Verify receipt of route in neighbor router’s by following command

R2#show ip bgp community	
BGP table version is 21, local router ID is 22.0.3.2
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, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop           Metric    LocPrf    Weight   Path
 *>  11.0.1.0/24      11.0.1.1             0             	   0      65100 i
 *>  11.0.2.0/24      11.0.1.1             0                   0      65100 i
 *>  11.0.3.0/24      11.0.1.1             0                   0      65100 i
R2#show ip bgp community 8888
BGP table version is 21, local router ID is 22.0.3.2
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, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop          Metric    LocPrf    Weight    Path
 *>  11.0.1.0/24      11.0.1.1            0             	   0      65100 i
 *>  11.0.2.0/24      11.0.1.1            0                    0      65100 i
 *>  11.0.3.0/24      11.0.1.1            0                    0      65100 i
R2#show ip bgp 11.0.1.0
BGP routing table entry for 11.0.1.0/24, version 19
Paths: (1 available, best #1, table default)
Advertised to update-groups:
2
Refresh Epoch 2
65100, (received & used)
11.0.1.1 (metric 65) from 11.0.1.1 (11.0.3.1)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: 8888

11 network is tagged 8888 community

Task 2: Configure IPv4 BGP Community String

Step 1: In the configuration mode of router configure Community String Manipulation by following command:

R2: 
router bgp 65000 
address-family ipv4 
neighbor 11.0.1.1 route-map bbb in 
exit 
ip community-list 1 permit 8888 
route-map bbb permit 10 
match community 1 
set weight 9999 
exit

Step 2: Verify receipt of route in neighbor router’s bgp table by following command

BGP table version is 24, local router ID is 22.0.3.2 
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, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete 
RPKI validation codes: V valid, I invalid, N Not found 

 Network          Next Hop       Metric      LocPrf      Weight      Path 
 *> 11.0.1.0/24   11.0.1.1       0                       9999        65100 i 
 *> 11.0.2.0/24   11.0.1.1       0                       9999        65100 i 
 *> 11.0.3.0/24   11.0.1.1       0                       9999        65100 i
R2#show ip bgp 
BGP table version is 24, local router ID is 22.0.3.2 
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, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete 
RPKI validation codes: V valid, I invalid, N Not found 

 Network          Next Hop       Metric       LocPrf       Weight     Path 
*> 11.0.1.0/24    11.0.1.1       0                         9999       65100 i 
*> 11.0.2.0/24    11.0.1.1       0                         9999       65100 i 
*> 11.0.3.0/24    11.0.1.1       0                         9999       65100 i 
*> 22.0.1.0/24    0.0.0.0        0                         32768      i 
*> 22.0.2.0/24    0.0.0.0        0                         32768      i 
*> 22.0.3.0/24    0.0.0.0        0                         32768      i 
*>i 33.0.1.0/24 33.0.1.3         0            100          0          i 
*>i 33.0.2.0/24 33.0.1.3         0            100          0          i 
*>i 33.0.3.0/24 33.0.1.3         0            100          0          i 
*>i 44.0.1.0/24 44.0.1.4         0            100          0          65200 i 
*>i 44.0.2.0/24 44.0.1.4         0            100          0          65200 i 
*>i 44.0.3.0/24 44.0.1.4         0            100          0          65200 i 

Policy is called to match only 8888 community and wiil change weight attribute to 9999 . Hence manipulation is achieved with the help of Community String.