13.5.2 Community configuration
- <Structure of this section>
(1) List of configuration commands
The following table lists the commands used to configure communities.
Command name |
Description |
---|---|
neighbor send-community |
Specifies that the COMMUNITIES attribute should not be removed from route advertisements to peers. |
distribute-list in (BGP4) # |
Specifies the route filter to be used as BGP4 learned route filter conditions. |
distribute-list out (BGP4) # |
Specifies the route filter to be used as BGP4 advertised route filter conditions. |
neighbor in (BGP4) # |
Specifies in the route-map parameter the route filter to be used as learned route filter conditions for a specific BGP4 peer only. |
neighbor out (BGP4) # |
Specifies in the route-map parameter the route filter to be used as advertised route filter conditions for a specific BGP4 peer only. |
redistribute (BGP4) # |
Specifies the protocol of learned routes advertised by BGP4. |
- #
-
See "Configuration Command Reference Vol.2" "15 Route Filtering (Common to IPv4/IPv6)".
(2) Configuring Communities
- Points to note
-
The example below shows how to add the COMMUNITIES attribute to advertised BGP4 routes by setting the neighbor send-community configuration command for the concerned peers.
Command examples
-
(config)# router bgp 65531
(config-router)# bgp router-id 192.168.1.100
(config-router)# neighbor 192.168.2.2 remote-as 65531
(config-router)# neighbor 172.16.2.2 remote-as 65532
(config-router)# neighbor 10.2.2.2 remote-as 65533
Configure the BGP4 peers.
-
(config-router)# neighbor 172.16.2.2 send-community
(config-router)# neighbor 10.2.2.2 send-community
(config-router)# exit
Specifies that the COMMUNITIES attribute is to be added to BGP4 routes advertised to the peers.
-
(config)# ip community-list 10 permit 1000:1002
(config)# ip community-list 20 permit 1000:1003
(config)# route-map SET_LOCPREF permit 10
(config-route-map)# match community 10
(config-route-map)# set local-preference 120
(config-route-map)# exit
(config)# route-map SET_LOCPREF permit 20
(config-route-map)# match community 20
(config-route-map)# set local-preference 80
(config-route-map)# exit
(config)# route-map SET_LOCPREF permit 30
(config-route-map)# exit
Sets 120 as the LOCAL_PREF attribute value of routes that have the community value 1000:1002 in their COMMUNITIES attribute, and 80 as the LOCAL_PREF attribute value of routes that have the community value 1000:1003 in their COMMUNITIES attribute.
-
(config)# ip prefix-list MY_NET seq 10 permit 192.168.0.0/16 ge 16 le 30
(config)# route-map SET_COM permit 10
(config-route-map)# match ip address prefix-list MY_NET
(config-route-map)# set community 1000:1001
(config-route-map)# exit
Configures a COMMUNITIES in which the route whose destination network is 192.168.0.0/16 (mask length 16 to 30) has the community-value of 1000:1001.
-
(config)# router bgp 65531
(config-router)# distribute-list route-map SET_LOCPREF in
(config-router)# distribute-list route-map SET_COM out
(config-router)# exit
Sets a learned route filter and advertised route filter for all peers.
(3) Reflecting filter settings in operation
- Points to note
-
The example below shows how to apply route filters as learned route and advertised route filter conditions by using the clear ip bgp operation command.
Command examples
-
# clear ip bgp * both
Applies the community-based route filters to the network operation.