キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 
cancel
4503
閲覧回数
5
いいね!
0
コメント
Kenichi Izumi
Cisco Employee
Cisco Employee

 

 

1. IOS、IOS XR での set community 時の動作の違い

BGP が動作するルータにおいて、prefix が保持する community を操作する場合に、IOS XR では IOS ルータとは一部異なる動作をします。本ドキュメントでは、この相違の一部について説明し、その後、IOS XR での community 削除方法を例示します。

 

a. Topology

b. IOS での set community 設定時の動作

IOS では、以下のように "set community" を使用し、community の set を行った場合、元々保持している community は上書きされます。

route-map test permit 10
 set community 10:10

 

以下の例では、well-know community である no-export を保持しています。

* IOS 15.4(1)T でログ取得

Router#show bgp ipv4 unicast 200.0.0.1
BGP routing table entry for 200.0.0.1/32, version 4
Paths: (1 available, best #1, table default, not advertised to EBGP peer)
  Not advertised to any peer
  Refresh Epoch 1
  Local
    10.0.0.3 (metric 11) from 10.0.0.3 (10.0.0.3)
      Origin incomplete, metric 0, localpref 100, valid, internal, best
      Community: no-export
      rx pathid: 0, tx pathid: 0x0

 

この状態で、inbound 側に、上述の route-map を適用した場合、以下のように no-export は削除され、10:10 が付与されます。

Router#show bgp ipv4 unicast 200.0.0.1
BGP routing table entry for 200.0.0.1/32, version 7
Paths: (1 available, best #1, table default)
  Advertised to update-groups:
     9         
  Refresh Epoch 2
  Local
    10.0.0.3 (metric 11) from 10.0.0.3 (10.0.0.3)
      Origin incomplete, metric 0, localpref 100, valid, internal, best
      Community: 655370
      rx pathid: 0, tx pathid: 0x0

* community 10:10 を設定したのに対し、上記表示では community が 655370 となっています。この表示は、"ip bgp-community new-format" コマンドで変更することが可能です。本設定を実施した場合、10:10 と表示されます。

set community 設定時に、additive option を指定した場合には、set する community は元々保持している community に追加となります。

route-map test permit 10
 set community 10:10 additive

 

この route-map を適用した場合の結果は、以下の通りです。元々保持していた no-export に加え、10:10 が付与されています。

Router#show bgp ipv4 unicast 200.0.0.1
BGP routing table entry for 200.0.0.1/32, version 10
Paths: (1 available, best #1, table default, not advertised to EBGP peer)
  Not advertised to any peer
  Refresh Epoch 3
  Local
    10.0.0.3 (metric 11) from 10.0.0.3 (10.0.0.3)
      Origin incomplete, metric 0, localpref 100, valid, internal, best
      Community: 655370 no-export
      rx pathid: 0, tx pathid: 0x0

 

c. IOS XR での set community 設定時の動作

上述した通り、IOS では "set community" により community が上書きされます。

しかし、IOS XR においては、"set community" で community を set した場合、対象 prefix に internet、no-export、no-advertise、local-as といった well-known community が含まれる場合、これらの well-known community は削除されません。

 

以下の例では、1:1、internet、no-export、no-advertise、local-as の community を持つ prefix (200.0.0.1) を受信しています。

* IOS XR 4.3.4 でログ取得

RP/0/RSP0/CPU0:Router#show bgp ipv4 unicast 200.0.0.1

BGP routing table entry for 200.0.0.1/32
Versions:
  Process           bRIB/RIB  SendTblVer
  Speaker                 18          18
Last Modified: Jan 23 08:44:44.492 for 00:00:00
Paths: (1 available, best #1, not advertised to any peer)
  Advertised to peers (in unique update groups):
    192.168.1.1     
  Path #1: Received by speaker 0
  Advertised to peers (in unique update groups):
    192.168.1.1     
  Local
    10.0.0.3 (metric 2) from 10.0.0.3 (10.0.0.3)
      Origin incomplete, metric 0, localpref 100, valid, internal, best, group-best, import-candidate
      Received Path ID 0, Local Path ID 1, version 18
      Community: internet 1:1 no-export no-advertise local-AS

 

この prefix に対し、community 10:10 を set します。

route-policy test
  set community (10:10)
end-policy


この route-policy を適用した場合、1:1 は削除され、10:10 が set されますが、well-known community は削除されません。

RP/0/RSP0/CPU0:Router#show bgp ipv4 unicast 200.0.0.1

BGP routing table entry for 200.0.0.1/32
Versions:
  Process           bRIB/RIB  SendTblVer
  Speaker                  3           3
Last Modified: Jan 23 08:46:58.490 for 00:00:00
Paths: (1 available, best #1, not advertised to any peer)
  Not advertised to any peer
  Path #1: Received by speaker 0
  Not advertised to any peer
  Local
    10.0.0.3 (metric 2) from 10.0.0.3 (10.0.0.3)
      Origin incomplete, metric 0, localpref 100, valid, internal, best, group-best, import-candidate
      Received Path ID 0, Local Path ID 1, version 3
      Community: internet 10:10 no-export no-advertise local-AS


well-known community を削除するためには、"delete community" コマンドを使用し、明示的に削除する必要があります。


以下の例では、先ほどの route-policy に well-known community を削除するための "delete community" を追加しています。

route-policy test
  set community (10:10)
  delete community in (internet, no-export, no-advertise, local-AS)
end-policy


この route-policy を適用した場合、well-known community は削除され、10:10 が set されます。

RP/0/RSP0/CPU0:Router#show bgp ipv4 unicast 200.0.0.1

BGP routing table entry for 200.0.0.1/32
Versions:
  Process           bRIB/RIB  SendTblVer
  Speaker                 15          15
Last Modified: Jan 26 05:24:08.767 for 00:00:48
Paths: (1 available, best #1)
  Advertised to peers (in unique update groups):
    192.168.1.1     
  Path #1: Received by speaker 0
  Advertised to peers (in unique update groups):
    192.168.1.1     
  Local
    10.0.0.3 (metric 2) from 10.0.0.3 (10.0.0.3)
      Origin incomplete, metric 0, localpref 100, valid, internal, best, group-best, import-candidate
      Received Path ID 0, Local Path ID 1, version 15
      Community: 10:10

 

2. IOS XR での community 削除例

IOS XR での、community 削除方法を一部例示します。
この例に使用するルータでは、route-policy が inbound に適用されていない (filter が行われていない) 状態で、以下の prefix を受信しています。

保持している community は以下の通りです。

10:10 10:20 10:30 10:40 10:50 10:60 10:70 10:80 10:90 internet no-export no-advertise local-AS

 

prefix 200.0.0.1 がこれらの community を保持しています。

RP/0/RSP0/CPU0:Router#show bgp ipv4 unicast 200.0.0.1

BGP routing table entry for 200.0.0.1/32
Versions:
  Process           bRIB/RIB  SendTblVer
  Speaker                 27          27
Last Modified: Jan 26 06:44:50.679 for 00:00:07
Paths: (1 available, best #1, not advertised to any peer)
  Not advertised to any peer
  Path #1: Received by speaker 0
  Not advertised to any peer
  Local
    10.0.0.3 (metric 2) from 10.0.0.3 (10.0.0.3)
      Origin incomplete, metric 0, localpref 100, valid, internal, best, group-best, import-candidate
      Received Path ID 0, Local Path ID 1, version 27
      Community: internet 10:10 10:20 10:30 10:40 10:50 10:60 10:70 10:80 10:90 no-export no-advertise local-AS

 

a. Topology

b. delete community all を設定

route-policy test
  delete community all
end-policy

 

この場合、上述した通り、well-known community は削除されず、その他の community が全て削除されます。

RP/0/RSP0/CPU0:Router#show bgp ipv4 unicast 200.0.0.1

BGP routing table entry for 200.0.0.1/32
Versions:
  Process           bRIB/RIB  SendTblVer
  Speaker                 29          29
Last Modified: Jan 26 06:48:14.675 for 00:00:03
Paths: (1 available, best #1, not advertised to any peer)
  Not advertised to any peer
  Path #1: Received by speaker 0
  Not advertised to any peer
  Local
    10.0.0.3 (metric 2) from 10.0.0.3 (10.0.0.3)
      Origin incomplete, metric 0, localpref 100, valid, internal, best, group-best, import-candidate
      Received Path ID 0, Local Path ID 1, version 29
      Community: internet no-export no-advertise local-AS

 

c. delete community in (internet, no-export, no-advertise, local-as, *:*) を設定

route-policy test
  delete community in (internet, no-export, no-advertise, local-AS, *:*)
end-policy


この場合、well-known community を含む全ての community が削除されます。

RP/0/RSP0/CPU0:Router#show bgp ipv4 unicast 200.0.0.1

BGP routing table entry for 200.0.0.1/32
Versions:
  Process           bRIB/RIB  SendTblVer
  Speaker                 31          31
Last Modified: Jan 26 06:50:14.673 for 00:00:00
Paths: (1 available, best #1)
  Advertised to peers (in unique update groups):
    192.168.1.1     
  Path #1: Received by speaker 0
  Advertised to peers (in unique update groups):
    192.168.1.1     
  Local
    10.0.0.3 (metric 2) from 10.0.0.3 (10.0.0.3)
      Origin incomplete, metric 0, localpref 100, valid, internal, best, group-best, import-candidate
      Received Path ID 0, Local Path ID 1, version 31
     <<< 全て削除されているため、community が list されません。

 

d. delete community in (10:[50..80]) を設定

community 指定時、[ low-value .. high-value ] の形式で range で指定することが可能です。

例
10:[100..1000]
[10..100]:80
[10..100]:[100..2000]


以下の例では、10:50 から 10:80 までの community が削除されます。

route-policy test
  delete community in (10:[50..80])
end-policy

 

RP/0/RSP0/CPU0:Router#show bgp ipv4 unicast 200.0.0.1

BGP routing table entry for 200.0.0.1/32
Versions:
  Process           bRIB/RIB  SendTblVer
  Speaker                 33          33
Last Modified: Jan 26 06:53:24.669 for 00:00:04
Paths: (1 available, best #1, not advertised to any peer)
  Not advertised to any peer
  Path #1: Received by speaker 0
  Not advertised to any peer
  Local
    10.0.0.3 (metric 2) from 10.0.0.3 (10.0.0.3)
      Origin incomplete, metric 0, localpref 100, valid, internal, best, group-best, import-candidate
      Received Path ID 0, Local Path ID 1, version 33
      Community: internet 10:10 10:20 10:30 10:40 10:90 no-export no-advertise local-AS

 

e. community list の使用

上述したような直接 community を直接指定するだけでなく、community list を使用して削除が可能です。

以下の例では、d. と同じ指定を community list で行っています。

community-set test-community
  10:[50..80]
end-set
!
route-policy test
  delete community in test-community
end-policy

 

RP/0/RSP0/CPU0:Router#show bgp ipv4 unicast 200.0.0.1

BGP routing table entry for 200.0.0.1/32
Versions:
  Process           bRIB/RIB  SendTblVer
  Speaker                 33          33
Last Modified: Jan 26 06:53:24.668 for 00:01:47
Paths: (1 available, best #1, not advertised to any peer)
  Not advertised to any peer
  Path #1: Received by speaker 0
  Not advertised to any peer
  Local
    10.0.0.3 (metric 2) from 10.0.0.3 (10.0.0.3)
      Origin incomplete, metric 0, localpref 100, valid, internal, best, group-best, import-candidate
      Received Path ID 0, Local Path ID 1, version 33
      Community: internet 10:10 10:20 10:30 10:40 10:90 no-export no-advertise local-AS

 

3. 不具合事例

well-known community 削除時の不具合事例を紹介します。
以下の試験は、IOS XR 5.1.2 において行っています。

a. Topology

b. 事象

DUT は、iBGP peer である 10.0.0.3 から 200.0.0.1 を受信しており、この prefix は no-export community を保持しています。no export を持つため、eBGP peer へは advertise されません。

RP/0/RSP0/CPU0:Router#show bgp ipv4 unicast 200.0.0.1

BGP routing table entry for 200.0.0.1/32
Versions:
  Process           bRIB/RIB  SendTblVer
  Speaker                 16          16
Last Modified: Jan 26 11:24:38.808 for 00:00:03
Paths: (1 available, best #1, not advertised to EBGP peer)
  Not advertised to any peer
  Path #1: Received by speaker 0
  Not advertised to any peer
  Local
    10.0.0.3 (metric 2) from 10.0.0.3 (10.0.0.3)
      Origin incomplete, metric 0, localpref 100, valid, internal, best, group-best, import-candidate
      Received Path ID 0, Local Path ID 1, version 16
      Community: no-export

 

ここで、inbound policy で no-export を削除する設定を行います。
追加する route-policy は以下の通りです。

prefix-set test_pref
  200.0.0.1/32
end-set
!
community-set test_community
  no-export
end-set
!
route-policy test
  if destination in test_pref then
    delete community in test_community
  else
    pass
  endif
end-policy

 

この policy を 10.0.0.3 に対して inbound で設定します。
no-export community が削除されるため eBGP peer へ prefix が advertise されることが想定されますが、この例では、no-export が存在しないにも関わらず、"not advertised to EBGP peer" となっており、prefix が advertise されていません。

RP/0/RSP0/CPU0:Router#show bgp ipv4 unicast 200.0.0.1

BGP routing table entry for 200.0.0.1/32
Versions:
  Process           bRIB/RIB  SendTblVer
  Speaker                 17          17
Last Modified: Jan 26 11:26:50.808 for 00:00:01
Paths: (1 available, best #1, not advertised to EBGP peer)
  Not advertised to any peer
  Path #1: Received by speaker 0
  Not advertised to any peer
  Local
    10.0.0.3 (metric 2) from 10.0.0.3 (10.0.0.3)
      Origin incomplete, metric 0, localpref 100, valid, internal, best, group-best, import-candidate
      Received Path ID 0, Local Path ID 1, version 17
     <<< no-export が削除されているため、community が list されません。

 

c. 原因

この問題は、CSCup67279 として報告されています。

CSCup67279
Routes are not advertised on eBGP after clearing no-export in inbound

この問題は、5.1.2、5.2.0 以降また、4.3.4 で CSCup93313 の SMU が install されている場合に発生します。5.1.3、5.2.2 以降での修正されています。

該当 version 使用時は、prefix 送信側機器において、outbound policy で no-export を削除すれば問題は発生しません。

 

4. 参考情報

本動作については、以下の URL をご参照ください。

Cisco IOS IP Routing: BGP Command Reference

Getting Started

検索バーにキーワード、フレーズ、または質問を入力し、お探しのものを見つけましょう

シスコ コミュニティをいち早く使いこなしていただけるよう役立つリンクをまとめました。みなさんのジャーニーがより良いものとなるようお手伝いします