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

[目次][索引][前へ][次へ]


23.3.7 BGP4+広告経路フィルタリング【OP-BGP】

<この項の構成>
(1) 他プロトコルの経路を広告する
(2) ピアごとに広告経路を変更する

(1) 他プロトコルの経路を広告する

直結経路とスタティック経路の中で,宛先ネットワークが自ASのネットワーク(2001:db8::/32)の内部である経路だけをBGP4+へ広告します。

[設定のポイント]
デフォルトでは広告しない経路を広告させるには,redistributeを設定します。redistributeには,広告したいプロトコルを指定します。
redistributeに,経路広告条件のroute-mapを指定します。route-map中の宛先ネットワーク条件の指定にはipv6 prefix-listを使用します。

[コマンドによる設定]
  1. (config)# ipv6 prefix-list LONGER2001db8 seq 10 permit 2001:db8::/32 ge 32 le 128
    2001:db8::/32に含まれる経路だけpermitになるipv6 prefix-listを設定します。
     
  2. (config)# route-map LONGER2001db8PERMIT permit 10
    (config-route-map)# match ipv6 address prefix-list LONGER2001db8
    (config-route-map)# exit
    2001:db8::/32に含まれる経路だけpermitになるroute-mapを設定します。
     
  3. (config)# router bgp 65531
    (config-router)# address-family ipv6
    (config-router-af)# redistribute connected route-map LONGER2001db8PERMIT
    (config-router-af)# redistribute static route-map LONGER2001db8PERMIT
    直結経路とスタティック経路について,LONGER2001db8PERMITでフィルタした結果がpermitになる経路だけを広告するように,redistributeを設定します。
     
  4. (config-router-af)# end
    # clear ipv6 bgp * out
    広告経路フィルタリング設定の変更を動作に反映します。
     

(2) ピアごとに広告経路を変更する

外部ピアに広告する経路を,AS100から受信したASパス長が一つのBGP4+経路,および自AS内のネットワークが宛先(2001:db8::/32に含まれる)である直結経路とスタティック経路だけに制限します。広告に当たり,ピア2001:db8:812:1::1へはAS_PATHのAS番号を二つ追加します。内部ピアには,BGP4+経路だけを広告します。

[設定のポイント]
ピア個別に経路フィルタリングする必要がある場合,neighbor outを設定してください。
今回の場合,次の四つのroute-mapを設定します。
  • 直結経路およびスタティック経路のredistribute用
    2001:db8::/32に含まれている経路だけpermitになるipv6 prefix-listを設定して,これを参照するroute-mapを設定します。
  • ピア2001:db8:812:1::1広告用
    経路プロトコルが直結またはスタティックの場合だけASを二つ追加するroute-mapを設定します。
  • 2001:db8:812:1::1以外の外部ピア用
    ASが一つのAS_PATH属性だけpermitになるip as-path access-listを設定して,これを参照するroute-mapを設定します。
  • 内部ピア用
    BGP4+経路だけpermit,それ以外はdenyになるroute-mapを設定します。

[コマンドによる設定]
  1. (config)# ipv6 prefix-list LONGER2001db8 seq 10 permit 2001:db8::/32 ge 32 le 128
    (config)# route-map LONGER2001db8PERMIT permit 10
    (config-route-map)# match ipv6 address prefix-list LONGER2001db8
    (config-route-map)# exit
    2001:db8::/32に含まれる経路だけpermitになるroute-mapを設定します。直結経路およびスタティック経路のredistributeに使用します。
     
  2. (config)# ip as-path access-list 1 permit "^[0-9]+$"
    (config)# route-map BGPEXTOUT permit 10
    (config-route-map)# match protocol connected static
    (config-route-map)# exit
    (config)# route-map BGPEXTOUT permit 20
    (config-route-map)# match protocol bgp
    (config-route-map)# match as-path 1
    (config-route-map)# exit
    直結経路,スタティック経路,BGP4+経路の中でAS_PATH属性のAS数が一つの経路だけpermitになるroute-mapを設定します。外部ピアへの広告に使用します。
     
  3. (config)# route-map BGP81211OUT permit 10
    (config-route-map)# match protocol connected static
    (config-route-map)# set as-path prepend count 2
    (config-route-map)# exit
    (config)# route-map BGP81211OUT permit 20
    (config-route-map)# match protocol bgp
    (config-route-map)# match as-path 1
    (config-route-map)# set as-path prepend count 2
    (config-route-map)# exit
    直結経路,スタティック経路,BGP4+経路の中でAS_PATH属性のAS数が一つの経路だけpermitになり,ASを二つ追加するroute-mapを設定します。ピア2001:db8:812:1::1への広告に使用します。
     
  4. (config)# route-map BGPINTOUT permit 10
    (config-route-map)# match protocol bgp
    (config-route-map)# exit
    BGP4+経路だけpermitになるroute-mapを設定します。内部ピアへの広告に使用します。
     
  5. (config)# router bgp 65531
    (config-router)# address-family ipv6
    (config-router-af)# redistribute connected route-map LONGER2001db8PERMIT
    (config-router-af)# redistribute static route-map LONGER2001db8PERMIT
    (config-router-af)# exit
    直結経路とスタティック経路について,route-map LONGER2001db8PERMITでフィルタした結果がpermitになる経路だけを広告するように,redistributeを設定します。
     
  6. (config-router)# neighbor 2001:db8:811:1::1 remote-as 65532
    (config-router)# address-family ipv6
    (config-router-af)# neighbor 2001:db8:811:1::1 route-map BGPEXTOUT out
    (config-router-af)# exit
    外部ピアへの広告経路のフィルタにBGPEXTOUTを使用します。
     
  7. (config-router)# neighbor 2001:db8:812:1::1 remote-as 65533
    (config-router)# address-family ipv6
    (config-router-af)# neighbor 2001:db8:812:1::1 route-map BGP81211OUT out
    (config-router-af)# exit
    外部ピア2001:db8:812:1::1への広告経路のフィルタにBGP81211OUTを使用します。
     
  8. (config-router)# neighbor 2001:db8:811:ff01::1 remote-as 65531
    (config-router)# address-family ipv6
    (config-router-af)# neighbor 2001:db8:811:ff01::1 route-map BGPINTOUT out
    内部ピアへの広告経路のフィルタにBGPINTOUTを使用します。
     
  9. (config-router-af)# end
    # clear ipv6 bgp * out
    広告経路フィルタリング設定の変更を動作に反映します。

[目次][前へ][次へ]


[他社商品名称に関する表示]

All Rights Reserved, Copyright(C), 2014, 2019, ALAXALA Networks, Corp.