27.5.2 コミュニティのコンフィグレーション
(1) コンフィグレーションコマンド一覧
コミュニティのコンフィグレーションコマンド一覧を次の表に示します。
| コマンド名 | 説明 | 
|---|---|
| neighbor send-community | ピアへ広告する経路のCOMMUNITIES属性を削除しないことを指定します。 | 
| distribute-list in (BGP4+)※ | BGP4+の学習経路フィルタリングの条件として用いる経路フィルタを指定します。 | 
| distribute-list out (BGP4+)※ | BGP4+の広告経路フィルタリングの条件として用いる経路フィルタを指定します。 | 
| neighbor in (BGP4+)※ | route-mapパラメータで,BGP4+の特定のピアにだけ,学習経路フィルタリングの条件として用いる経路フィルタを指定します。 | 
| neighbor out (BGP4+)※ | route-mapパラメータで,BGP4+の特定のピアにだけ,広告経路フィルタリングの条件として用いる経路フィルタを指定します。 | 
| redistribute (BGP4+)※ | BGP4+で広告する経路のプロトコルを指定します。 | 
- 注※
- 
                     「コンフィグレーションコマンドレファレンス Vol.2」 「14 経路フィルタリング(IPv4/IPv6共通)」を参照してください。 
(2) コミュニティの設定
- [設定のポイント]
- 
                  広告するBGP4+経路にCOMMUNITIES属性を付加する場合,該当するピアにコンフィグレーションコマンドneighbor send-communityを設定してください。 
[コマンドによる設定]
- 
                  (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 BGP4+ピアを設定します。 
- 
                  (config-router)# address-family ipv6 config-router-af(ipv6)モードへ移行します。 
- 
                  (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 ピアに広告するBGP4+経路にCOMMUNITIES属性を付加することを指定します。 
- 
                  (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 コミュニティ値1000:1002を含むCOMMUNITIES属性を持つ経路のLOCAL_PREF属性値に120を設定し,コミュニティ値1000:1003を含むCOMMUNITIES属性を持つ経路のLOCAL_PREF属性値に80を設定します。 
- 
                  (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 宛先ネットワークが3ffe:192:168::/48(プレフィックス長が32〜64)の経路にコミュニティ値1000:1001が設定されたCOMMUNITIES属性を設定します。 
- 
                  (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 全ピアの学習経路フィルタと全ピアの広告経路フィルタを設定します。 
- 
                  (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 IPv6アドレスファミリを有効にします。 
(3) フィルタ設定の運用への反映
- [設定のポイント]
- 
                  学習経路フィルタリングの条件および広告フィルタリングの条件として経路フィルタを運用に反映させるには運用コマンドclear ipv6 bgpを使用します。 
[コマンドによる設定]
- 
                  # clear ipv6 bgp * both コミュニティを使用した経路フィルタを運用に反映させます。