Configuration Guide Vol. 3


29.5.2 Community configuration

<Structure of this section>

(1) List of configuration commands

The following table lists the commands used to configure communities.

Table 29-10: List of configuration commands

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

  1. (config)# router bgp 65531

    (config-router)# bgp router-id 192.168.1.100

    (config-router)# neighbor 3ffe:192:168:2::2 remote-as 65531

    (config-router)# neighbor 3ffe:172:16:2::2 remote-as 65532

    (config-router)# neighbor 3ffe:10:2:2::2 remote-as 65533

    Configure the BGP4+ peers.

  2. (config-router)# address-family ipv6

    Places the router in config-router-af (ipv6) mode.

  3. (config-router-af)# neighbor 3ffe:172:16:2::2 send-community

    (config-router-af)# neighbor 3ffe:10:2:2::2 send-community

    (config-router-af)# exit

    (config-router)# exit

    Specifies that the COMMUNITIES attribute is to be added to BGP4+ routes advertised to the peers.

  4. (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.

  5. (config)# ipv6 prefix-list MY_NET seq 10 permit 3ffe:192:168::/48 ge 32 le 64

    (config)# route-map SET_COM permit 10

    (config-route-map)# match ipv6 address prefix-list MY_NET

    (config-route-map)# set community 1000:1001

    (config-route-map)# exit

    Configures a COMMUNITIES in which the community-value of 1000:1001 is set for routes whose destination network is 3ffe:192:168::/48 (prefix length 32 to 64).

  6. (config)# router bgp 65531

    (config-router)# address-family ipv6

    (config-router-af)# distribute-list route-map SET_LOCPREF in

    (config-router-af)# distribute-list route-map SET_COM out

    Sets a learned route filter and advertised route filter for all peers.

  7. (config-router-af)# neighbor 3ffe:192:168:2::2 activate

    (config-router-af)# neighbor 3ffe:172:16:2::2 activate

    (config-router-af)# neighbor 3ffe:10:2:2::2 activate

    Enables the IPv6 address family.

(3) Reflecting filter settings in operation

Points to note

To apply route filters as learned route and advertised route filter conditions, use the clear ipv6 bgp operation command.

Command examples

  1. # clear ipv6 bgp * both

    Applies the community-based route filters to the network operation.