/
The COMMUNITY Attribute

The COMMUNITY Attribute


Command References


admin@XorPlus# set protocols bgp peer <Peer-ipv6-address> advertise community disable <true/false>

Note: This command is to enable the BGP speaker to advertise well known community attribute NO_EXPORT (0xFFFFFF01) NO_ADVERTISE (0xFFFFFF02) NO_EXPORT_SUBCONFED (0xFFFFFF03).

 

admin@XorPlus# set protocols bgp peer <Peer-ipv6-address> advertise community-ext disable <true/false>

Note: This command is to enable BGP speakers advertising unknown community attributes.

 

A community is a group of destinations which share some common property. Each autonomous system administrator may define which communities a destination belongs to.  By default, all destinations belong to the general Internet community.

The COMMUNITIES path attribute is an optional transitive attribute of variable length. The attribute consists of a set of four octet values, each of which specify a community.  All routes with this attribute belong to the communities listed in the attribute.

The COMMUNITIES attribute has Type Code 8.

 

Communities are treated as 32 bit values,  however for administrative  assignment, the following presumptions may be made:

The community attribute values ranging from 0x0000000 through 0x0000FFFF, and 0xFFFF0000 through 0xFFFFFFFF, are hereby reserved. The rest of the community attribute values shall be encoded using an autonomous system number in the first two octets. The semantics of the final two octets may be defined by the autonomous system (e.g. AS690 may define research, educational and commercial community values that may be used for policy routing as defined by the operators of that AS, using community attribute values 0x02B20000 through 0x02B2FFFF).

A BGP speaker may use this attribute to control which routing information it accepts, prefers or distributes to other neighbors.

A BGP speaker receiving a route that does not have the COMMUNITIES path attribute may append this attribute to the route when propagating it to its peers.

A BGP speaker receiving a route with the COMMUNITIES path attribute may modify this attribute according to the local policy.

 

Aggregation

If a range of routes is to be aggregated and the resultant aggregate attribute section does not carry the ATOMIC_AGGREGATE attribute, then the resulting aggregate should have a COMMUNITIES path attribute which contains all communities from all of the aggregated routes.

 

Well-known Communities

The following communities have global significance and their operations shall be implemented in any community-attribute-aware BGP speaker.

      NO_EXPORT (0xFFFFFF01):

         All routes received carrying a communities attribute containing this value MUST NOT be advertised outside a BGP confederation boundary (a stand-alone autonomous system that

         is not part of a confederation should be considered a confederation itself).

      NO_ADVERTISE (0xFFFFFF02)

         All routes received carrying a communities attribute containing this value MUST NOT be advertised to other BGP peers.

      NO_EXPORT_SUBCONFED (0xFFFFFF03)

         All routes received carrying a communities attribute containing this value MUST NOT be advertised to external BGP peers (this includes peers in other members autonomous

         systems inside a BGP confederation).

 

Because communities are not propagated to internal or external BGP neighbors by default, the command set protocols bgp peer <peer-ipv6-address> advertise community-ext disable true  and set protocols bgp peer <peer-ipv6-address> advertise community disable true in order for the assigned community to be sent out.

 

Configuration Example 1 

The following example is to show you that, 7777::/64 will not advertise to EBGP peer, 8888::/64 will not advertise to any BGP peer (IBGP,EBGP), and 9999::/64 will not advertise to EBGP BGP peer (including confederation EBGP peer).

                                                                                Figure 1-19

Step 1: Switch A Switch B Enable EBGP, Switch B Switch C Enable EBGP, Switch B Switch D Enable IBGP

Switch A:

admin@XorPlus# set protocols bgp bgp-id 33.33.33.33
admin@XorPlus# set protocols bgp local-as 10
admin@XorPlus# set protocols bgp peer 5005::1 local-ip 5005::2
admin@XorPlus# set protocols bgp peer 5005::1 as 9
admin@XorPlus# set protocols bgp peer 5005::1 ipv6-unicast true

Switch B:

admin@XorPlus# set protocols bgp bgp-id 9.9.9.9
admin@XorPlus# set protocols bgp local-as 9
admin@XorPlus# set protocols bgp peer 3003::1 local-ip 3003::2
admin@XorPlus# set protocols bgp peer 3003::1 as 6
admin@XorPlus# set protocols bgp peer 3003::1 public-as-only true
admin@XorPlus# set protocols bgp peer 3003::1 advertise community disable false
admin@XorPlus# set protocols bgp peer 3003::1 ipv6-unicast true
admin@XorPlus# set protocols bgp peer 4004::2 local-ip 4004::1
admin@XorPlus# set protocols bgp peer 4004::2 as 9
admin@XorPlus# set protocols bgp peer 4004::2 next-hop-self true
admin@XorPlus# set protocols bgp peer 4004::2 ipv6-unicast true
admin@XorPlus# set protocols bgp peer 5005::2 local-ip 5005::1
admin@XorPlus# set protocols bgp peer 5005::2 as 10
admin@XorPlus# set protocols bgp peer 5005::2 ipv6-unicast true

Switch C:

admin@XorPlus# set protocols bgp bgp-id 6.6.6.6
admin@XorPlus# set protocols bgp local-as 6
admin@XorPlus# set protocols bgp peer 3003::2 local-ip 3003::1
admin@XorPlus# set protocols bgp peer 3003::2 as 9
admin@XorPlus# set protocols bgp peer 3003::2 ipv6-unicast true

Switch D:

admin@XorPlus# set protocols bgp bgp-id 100.100.100.100
admin@XorPlus# set protocols bgp local-as 9
admin@XorPlus# set protocols bgp peer 4004::1 local-ip 4004::2
admin@XorPlus# set protocols bgp peer 4004::1 as 9
admin@XorPlus# set protocols bgp peer 4004::1 next-hop-self true
admin@XorPlus# set protocols bgp peer 4004::1 ipv6-unicast true
 

 

Step 2: Switch A propagates three BGP route entries to Switch B

Note: Switch A propagates three BGP route entries 7777::/64 with community NO_EXPORT, it will not advertise to any EBGP peer, 8888::/64 with community NO_ADVERTISE, 9999::/64 will not advertise to any BGP peer, with community NO_EXPORT_SUBCONFED, it will not advertise to any EBGP peer including confederation EBGP peer. So Switch C will receive no BGP route entry, as Switch B and Switch C is an EBGP peer, but Switch D will receive 7777::/64 and 9999::/64, because, Switch B and Switch D are IBGP peers, as 8888::/64 with community NO_ADVERTISE, it will not advertise to any BGP peer, so Switch D just can’t receive 8888::/64.

 

Switch B BGP route table:

admin@XorPlus# run show bgp routes ipv6
Status Codes: * valid route, > best route
Origin Codes: i IGP, e EGP, ? incomplete
 
   Prefix                        Nexthop                   Peer             AS Path
   ----------------------------  ------------------------  ---------------  ------------
*> 7777::/64                     5005::2                   33.33.33.33      10 i
*> 8888::/64                     5005::2                   33.33.33.33      10 i
*> 9999::/64                     5005::2                   33.33.33.33      10 i
admin@XorPlus# run show bgp routes ipv6 detail
7777::/64
        From peer: 33.33.33.33
        Route: Winner
        Origin: IGP
        AS Path: 10
        Nexthop: 5005::2
        Local Preference: 300
        Community: 0xffffff01[NO_EXPORT]
8888::/64
        From peer: 33.33.33.33
        Route: Winner
        Origin: IGP
        AS Path: 10
        Nexthop: 5005::2
        Local Preference: 300
        Community: 0xffffff02[NO_ADVERTISE]
9999::/64
        From peer: 33.33.33.33
        Route: Winner
        Origin: IGP
        AS Path: 10
        Nexthop: 5005::2
        Local Preference: 300
        Community: 0xffffff03[NO_EXPORT_SUBCONFED]
admin@XorPlus#
 

Switch C BGP route table:

admin@XorPlus# run show bgp routes ipv6
Status Codes: * valid route, > best route
Origin Codes: i IGP, e EGP, ? incomplete
 
   Prefix                        Nexthop                   Peer             AS Path
   ----------------------------  ------------------------  ---------------  ------------
admin@XorPlus#

Switch D BGP route table:

admin@XorPlus# run show bgp routes ipv6
Status Codes: * valid route, > best route
Origin Codes: i IGP, e EGP, ? incomplete
 
   Prefix                        Nexthop                   Peer             AS Path
   ----------------------------  ------------------------  ---------------  ------------
*> 7777::/64                     4004::1                   9.9.9.9          10 i
*> 9999::/64                     4004::1                   9.9.9.9          10 i
admin@XorPlus# run show bgp routes ipv6 detail
7777::/64
        From peer: 9.9.9.9
        Route: Winner
        Origin: IGP
        AS Path: 9 10
        Nexthop: 4004::1
        Local Preference: 300
9999::/64
        From peer: 9.9.9.9
        Route: Winner
        Origin: IGP
        AS Path: 9 10
        Nexthop: 4004::1
        Local Preference: 300
admin@XorPlus#

 

Step 3: Enable advertise community on Switch B

Note: Community value will not advertise to it’s BGP peer by default, but we can Enable BGP speakers to advertise community to it’s BGP peer, the command “set protocols bgp peer <peer-ipv6-address> advertise community-ext disable true ” will advertise unknown community to it’s BGP peer and the command “set protocols bgp peer <peer-ipv6-address> advertise community disable true” will advertise a well-known community to it’s BGP peer.

 

Switch B:

admin@XorPlus# set protocols bgp peer 4004::2 advertise community disable false

Note: The community will be sent out after Enable advertise community.

 

Step 4: Check the community value of the BGP route entry on Switch D

Switch D:

admin@XorPlus# run show bgp routes ipv6
Status Codes: * valid route, > best route
Origin Codes: i IGP, e EGP, ? incomplete
 
   Prefix                        Nexthop                   Peer             AS Path
   ----------------------------  ------------------------  ---------------  ------------
*> 7777::/64                     4004::1                   9.9.9.9          10 i
*> 9999::/64                     4004::1                   9.9.9.9          10 i
admin@XorPlus# run show bgp routes ipv6 detail
7777::/64
        From peer: 9.9.9.9
        Route: Winner
        Origin: IGP
        AS Path: 9 10
        Nexthop: 4004::1
        Local Preference: 300
        Community: 0xffffff01[NO_EXPORT]
9999::/64
        From peer: 9.9.9.9
        Route: Winner
        Origin: IGP
        AS Path: 9 10
        Nexthop: 4004::1
        Local Preference: 300
        Community: 0xffffff03[NO_EXPORT_SUBCONFED]
admin@XorPlus#

Note: We can see the community after Step 3

 

Configuration Example 2

This example is to show you that the BGP route entry with Community NO_EXPORT_SUBCONFED will not advertise to EBGP peer, including Confederation EBGP peer. For more detailed information about Confederation, please reference the Confederation section. 

                                                                     Figure 1-20

Step 1: Switch A Switch B Enable EBGP, Switch B Switch C Enable Confederation, Switch B Switch D Enable EBGP

Switch A:

admin@XorPlus# set protocols bgp bgp-id 33.33.33.33
admin@XorPlus# set protocols bgp local-as 10
admin@XorPlus# set protocols bgp peer 5005::1 local-ip 5005::2
admin@XorPlus# set protocols bgp peer 5005::1 as 9
admin@XorPlus# set protocols bgp peer 5005::1 ipv6-unicast true

Switch B:

admin@XorPlus# set protocols bgp bgp-id 9.9.9.9
admin@XorPlus# set protocols bgp local-as 65534
admin@XorPlus# set protocols bgp confederation identifier 9
admin@XorPlus# set protocols bgp peer 3003::1 local-ip 3003::2
admin@XorPlus# set protocols bgp peer 3003::1 as 65533
admin@XorPlus# set protocols bgp peer 3003::1 confederation-member true
admin@XorPlus# set protocols bgp peer 3003::1 public-as-only true
admin@XorPlus# set protocols bgp peer 3003::1 advertise community disable false
admin@XorPlus# set protocols bgp peer 3003::1 ipv6-unicast true
admin@XorPlus# set protocols bgp peer 4004::2 local-ip 4004::1
admin@XorPlus# set protocols bgp peer 4004::2 as 100
admin@XorPlus# set protocols bgp peer 4004::2 next-hop-self true
admin@XorPlus# set protocols bgp peer 4004::2 advertise community disable false
admin@XorPlus# set protocols bgp peer 4004::2 ipv6-unicast true
admin@XorPlus# set protocols bgp peer 5005::2 local-ip 5005::1
admin@XorPlus# set protocols bgp peer 5005::2 as 10
admin@XorPlus# set protocols bgp peer 5005::2 ipv6-unicast true

Switch C:

admin@XorPlus# set protocols bgp bgp-id 6.6.6.6
admin@XorPlus# set protocols bgp local-as 65533
admin@XorPlus# set protocols bgp peer 3003::2 local-ip 3003::1
admin@XorPlus# set protocols bgp peer 3003::2 as 65534
admin@XorPlus# set protocols bgp peer 3003::2 confederation-member true
admin@XorPlus# set protocols bgp peer 3003::2 ipv6-unicast true

Switch D:

admin@XorPlus# set protocols bgp bgp-id 100.100.100.100
admin@XorPlus# set protocols bgp local-as 100
admin@XorPlus# set protocols bgp peer 4004::1 local-ip 4004::2
admin@XorPlus# set protocols bgp peer 4004::1 as 9
admin@XorPlus# set protocols bgp peer 4004::1 ipv6-unicast true

 

Step 2: Switch A propagate three BGP routes to Switch B

Note: Switch A propagates three BGP route entries to Switch B :7777::/64 with community NO_EXPORT, 8888::/64 with community NO_ADVERTISE,and  9999::/64 with community NO_EXPORT_SUBCONFED. 7777::/64 will not advertise to EBGP Peer, so Switch D will not receive this BGP route entry. However, Switch C will receive this entry, 8888::/64 will not advertise to any BGP Peer, so Switch C Switch D all will not receive this entry, 9999::/64 will not advertise to EBGP Peer, including Confederation EBGP Peer, so Switch C Switch D all will not receive this entry.

 

Switch B BGP route table:

admin@XorPlus# run show bgp routes ipv6
Status Codes: * valid route, > best route
Origin Codes: i IGP, e EGP, ? incomplete
   Prefix                        Nexthop                   Peer             AS Path
   ----------------------------  ------------------------  ---------------  ------------
*> 7777::/64                     5005::2                   33.33.33.33      10 i
*> 8888::/64                     5005::2                   33.33.33.33      10 i
*> 9999::/64                     5005::2                   33.33.33.33      10 i
admin@XorPlus# run show bgp routes ipv6 detail
7777::/64
        From peer: 33.33.33.33
        Route: Winner
        Origin: IGP
        AS Path: 10
        Nexthop: 5005::2
        Local Preference: 300
        Community: 0xffffff01[NO_EXPORT]
8888::/64
        From peer: 33.33.33.33
        Route: Winner
        Origin: IGP
        AS Path: 10
        Nexthop: 5005::2
        Local Preference: 300
        Community: 0xffffff02[NO_ADVERTISE]
9999::/64
        From peer: 33.33.33.33
        Route: Winner
        Origin: IGP
        AS Path: 10
        Nexthop: 5005::2
        Local Preference: 300
        Community: 0xffffff03[NO_EXPORT_SUBCONFED]
admin@XorPlus#

Switch C BGP route table:

admin@XorPlus# run show bgp routes ipv6
Status Codes: * valid route, > best route
Origin Codes: i IGP, e EGP, ? incomplete

   Prefix                        Nexthop                   Peer             AS Path
   ----------------------------  ------------------------  ---------------  ------------
*  7777::/64                     5005::2                   9.9.9.9          10 i
admin@XorPlus# run show bgp routes ipv6 detail
7777::/64
        From peer: 9.9.9.9
        Route: Not Used
        Origin: IGP
        AS Path: 10
        Nexthop: 5005::2
        Local Preference: 100
        Community: 0xffffff01[NO_EXPORT]
admin@XorPlus#

SwitchD bgp route table:
admin@XorPlus# run show bgp routes ipv6
Status Codes: * valid route, > best route
Origin Codes: i IGP, e EGP, ? incomplete

   Prefix                        Nexthop                   Peer             AS Path
   ----------------------------  ------------------------  ---------------  ------------
admin@XorPlus#
 

 


Configure Example 3:

This example is to show you how to set community attribute values, via policy.

                                                                                               Figure 1-21

Step 1: Switch A Switch B Establish OSPFV3

Note: Switch A Switch B Establish ospv3 and SwitchA propagate one ospfv3 route 8888::/64 to Switch B. 

Switch A:

admin@XorPlus# set protocols ospf6 instance-id 1
admin@XorPlus# set protocols ospf6 router-id 1.1.1.1
admin@XorPlus# set protocols ospf6 area 0.0.0.0 interface vlan500 vif vlan500 address 5005::2

Switch B:

admin@XorPlus# set protocols ospf6 instance-id 1
admin@XorPlus# set protocols ospf6 router-id 9.9.9.9
admin@XorPlus# set protocols ospf6 area 0.0.0.0 interface vlan500 vif vlan500 address 5005::1

 

Step 2: Switch B Switch C Establish EBGP

Switch B:

admin@XorPlus# set protocols bgp bgp-id 9.9.9.9
admin@XorPlus# set protocols bgp local-as "9"
admin@XorPlus# set protocols bgp peer 3003::1 local-ip "3003::2"
admin@XorPlus# set protocols bgp peer 3003::1 as "6"
admin@XorPlus# set protocols bgp peer 3003::1 ipv6-unicast true

Switch C:

admin@XorPlus# set protocols bgp bgp-id 6.6.6.6
admin@XorPlus# set protocols bgp local-as "6"
admin@XorPlus# set protocols bgp peer 3003::2 local-ip "3003::1"
admin@XorPlus# set protocols bgp peer 3003::2 as "9"
admin@XorPlus# set protocols bgp peer 3003::2 ipv6-unicast true

 

Step 3: Check ospf route table on Switch B: 

admin@XorPlus# run show route table ipv6 unicast ospf
8888::/64          [ospf(110)/1]
                   > to fe80::200:5ff:fe6c:f993 via vlan500/vlan500
8888:0:0:1::/64    [ospf(110)/1]
                   > to fe80::200:5ff:fe6c:f993 via vlan500/vlan500

 

Step 4: Configure a policy to export ospfv3 into bgp and set community 9:6 to this bgp route entry 

Switch B:

admin@XorPlus# set policy policy-statement ospfintobgp term 1 from protocol "ospf6"
admin@XorPlus# set policy policy-statement ospfintobgp term 1 to origin 2
admin@XorPlus# set policy policy-statement ospfintobgp term 1 then community "9:6"

 

Step 5: Apply the policy to BGP on Switch B

Note:  The unknown community will not advertise to it’s BGP peer, so you must enable “advertise community-ext”. 

Switch B:

admin@XorPlus# set protocols bgp export ospfintobgp
admin@XorPlus# set protocols bgp peer 3003::1 advertise community-ext disable false

 

Step 6: Check the community of the BGP route table on Switch C, it should be 9:6 

Switch C:

admin@XorPlus# run show bgp routes ipv6
Status Codes: * valid route, > best route
Origin Codes: i IGP, e EGP, ? incomplete

   Prefix                        Nexthop                   Peer             AS Path
   ----------------------------  ------------------------  ---------------  ------------
*> 8888::/64                     3003::2                   9.9.9.9          9 ?
admin@XorPlus# run show bgp routes ipv6 detail
8888::/64
        From peer: 9.9.9.9
        Route: Winner
        Origin: INCOMPLETE
        AS Path: 9
        Nexthop: 3003::2
        Multiple Exit Discriminator: 0
        Local Preference: 100
        Community: 0x90006[9:6]
admin@XorPlus#

 

 

Copyright © 2025 Pica8 Inc. All Rights Reserved.