コンフィグレーションガイド Vol.3


22.3.2 コミュニティの設定

〈この項の構成〉

(1) コンフィグレーションコマンド一覧

コミュニティのコンフィグレーションコマンド一覧を次の表に示します。

表22‒22 コンフィグレーションコマンド一覧

コマンド名

説明

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.3」 「22 経路フィルタリング」を参照してください。

(2) コミュニティの設定

[設定のポイント]

広告するBGP4+経路にCOMMUNITIES属性を付ける場合,該当するピアにneighbor send-communityコマンドを設定してください。

[コマンドによる設定]

  1. (config)# router bgp 65531

    (config-router)# bgp router-id 192.168.1.100

    (config-router)# neighbor 2001:db8:168:2::2 remote-as 65531

    (config-router)# neighbor 2001:db8:16:2::2 remote-as 65532

    (config-router)# neighbor 2001:db8:2:2::2 remote-as 65533

    BGP4+ピアを設定します。

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

    config-router-afモードへ移行します。

  3. (config-router-af)# neighbor 2001:db8:16:2::2 send-community

    (config-router-af)# neighbor 2001:db8:2:2::2 send-community

    (config-router-af)# exit

    (config-router)# exit

    ピアに広告するBGP4+経路にCOMMUNITIES属性を付けることを指定します。

  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

    コミュニティ値1000:1002を含むCOMMUNITIES属性を持つ経路のLOCAL_PREF属性値に120を設定して,コミュニティ値1000:1003を含むCOMMUNITIES属性を持つ経路のLOCAL_PREF属性値に80を設定します。

  5. (config)# ipv6 prefix-list MY_NET seq 10 permit 2001:db8: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

    宛先ネットワークが2001:db8:168::/48(プレフィックス長が32〜64)の経路にコミュニティ値1000:1001が設定されたCOMMUNITIES属性を設定します。

  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

    全ピアに学習用経路フィルタと広告用経路フィルタを適用します。

  7. (config-router-af)# neighbor 2001:db8:168:2::2 activate

    (config-router-af)# neighbor 2001:db8:16:2::2 activate

    (config-router-af)# neighbor 2001:db8:2:2::2 activate

    IPv6アドレスファミリを有効にします。

(3) 経路フィルタリングの運用への反映

[設定のポイント]

運用コマンドclear ipv6 bgpを使用して,学習経路フィルタリングの条件および広告フィルタリングの条件として設定した経路フィルタを運用に反映します。

[コマンドによる設定]

  1. # clear ipv6 bgp * both

    コミュニティを使用した経路フィルタを運用に反映します。