ルートリフレクタとは
ルートリフレクタ(RR)は、iBGPのフルメッシュ要件を緩和する仕組みで、RFC 4456で定義されています。
iBGPには「iBGPピアから学習した経路を他のiBGPピアへ広告しない」スプリットホライズンがあり(iBGPとeBGPの違い)、AS内の全ルータが互いにピアを張る必要があります(n台で n × (n - 1) ÷ 2 本)。
RRは特定のルータに「iBGPで受け取った経路を他のiBGPピアへ反射してよい」例外を与え、各ルータはRRとだけ張ればよくなります(n - 1 本)。
用語
| 用語 | 意味 |
|---|---|
| ルートリフレクタ(RR) | 経路の反射を行うルータ。route-reflector-clientの設定を持つ。 |
| クライアント(Client) | RRから見てroute-reflector-clientに指定されたiBGPピア。RRとだけピアを張ればよい。 |
| 非クライアント(Non-client) | RRの通常のiBGPピア。クライアントに指定されていないもの。非クライアント同士は従来どおりフルメッシュが必要(RFC 4456 5)。 |
| クラスタ(Cluster) | RRとそのクライアントの集合。クラスタIDで識別され、既定ではRRのBGP Router IDが使われる(RFC 4456 7)。 |
クライアント側に設定は不要で、RR側で指定するだけです。
反射のルール
RRは受信元によって、他のiBGPピアへ反射するかどうかを変えます(RFC 4456 6)。eBGPピアへの広告は通常どおりです。
| 受信元 | 他のiBGPピアへの反射 | eBGPピアへの広告 |
|---|---|---|
| クライアント | 他のクライアントと非クライアントの両方へ反射する | する |
| 非クライアント | クライアントへのみ反射する(非クライアント同士はフルメッシュが前提のため反射しない) | する |
| eBGPピア | クライアントと非クライアントの両方へ広告する(通常のiBGPと同じ) | する |
このルールから、クライアントが1台でも残っていれば、そのクライアント発の経路は非クライアントにも届き続けます。
反射するのはベストパスだけです。RFC 4456 6は「ベストパスを選んだあとに、受信元の種別に応じて反射する」と定めており、 同じプレフィックスに複数のパスがあってもクライアントには1本しか渡りません。AS内の別の出口をクライアントに知らせたい場合は、 ADD-PATHやBest External、Diverse Pathを使います。
反射のときにRRが書き換えてはいけない属性も決まっています。NEXT_HOP・AS_PATH・LOCAL_PREF・MEDは変更すべきでない(SHOULD NOT)とされ(RFC 4456 10)、
経路の中身はそのままクライアントへ渡ります。また、RRは他のRRを自分のクライアントにもできるため、クラスタを入れ子にした階層構成も組めます(RFC 4456 6)。
冗長構成と階層構成は別記事で解説します。
ループを防ぐ2つの属性
スプリットホライズンを緩和すると経路がクラスタ内を巡回するおそれがあるため、RFC 4456 8は2つのパス属性を追加しています。どちらもOptional Non-transitiveで、ASの外へは出ません。
| 属性 | Type code | 内容 |
|---|---|---|
ORIGINATOR_ID | 9 | 経路をAS内に最初に持ち込んだルータのBGP Router ID。RRが反射する際に付与する。すでに付いている場合は作り直さない。自身のRouter IDと一致する経路を受け取ったルータは、その経路を無視すべき(SHOULD)。 |
CLUSTER_LIST | 10 | 経路が通過したクラスタIDのリスト。RRが反射する際に自身のクラスタIDを先頭に追加しなければならない(MUST)。自身のクラスタIDが含まれる経路を受け取ったRRは、その広告を無視すべき(SHOULD)。 |
この2つはベストパス選択にも影響します(RFC 4456 9)。ORIGINATOR_IDを持つ経路では、タイブレークのステップでこの値を広告元のBGP Router IDとして扱い、
さらにCLUSTER_LISTが短い経路を優先する規則が加わります(属性を持たない経路の長さは0)。
設定方法
IOS XRでは、RRとなるルータでクライアントにするネイバーのアドレスファミリー配下にroute-reflector-clientを設定します。
router bgp <AS番号>
neighbor <クライアントのアドレス>
address-family ipv4 unicast
route-reflector-clientクラスタIDは既定でBGP Router IDです。複数のRRを同一クラスタにする冗長構成ではbgp cluster-idで揃えます。
router bgp <AS番号>
bgp cluster-id <クラスタID>実機での検証
XRd 26.1.1を5台使い、AS 65001のR2をRR、R1とR3をクライアントにします。R1 - R3間にiBGPピアはありません。
| ルータ | AS | 役割 | 広告するネットワーク |
|---|---|---|---|
| R1 | 65001 | RRクライアント | 192.168.1.0/24 |
| R2 | 65001 | ルートリフレクタ | 192.168.2.0/24 |
| R3 | 65001 | RRクライアント(AS 65002とeBGP) | 192.168.3.0/24 |
| R4 | 65002 | - | 192.168.4.0/24 |
| R5 | 65003 | - | 192.168.5.0/24 |
AS 65001内はOSPFエリア0で、iBGPはLoopback0どうしです。R3の10.3.4.0/24はOSPFのpassiveインタフェースとして広告し、R1が反射された経路のNEXT_HOPに到達できるようにしています。
入方向・出方向のルートポリシーはネイバーごとに別名(中身はpassのみ)にしてあり、2台のクライアントは別々のupdate-groupに入ります。操作するのはR2だけです。
| STEP | R2への操作 | 確かめること |
|---|---|---|
| 0 | なし(RR未設定) | スプリットホライズンでR1にR3側の経路が届かない |
| 1 | R1・R3をroute-reflector-clientに指定 | 反射が始まりORIGINATOR_ID / CLUSTER_LISTが付く |
| 2 | bgp cluster-id 10.100.100.1 | CLUSTER_LISTの値がクラスタIDに追従する |
| 3 | 2台のクライアントに同名のポリシーを当てる | update-groupが1つにまとまり、送信元のクライアントにも同じUPDATEが届く。受信側はORIGINATOR_IDで採用しない |
| 4 | ネイバーごとの別名ポリシーに戻す | update-groupが分かれ、送信元への広告が止まる |
| 5 | R1のroute-reflector-clientだけ削除 | R1が非クライアントになっても、クライアント発の経路は届き続ける |
| 6 | R3のroute-reflector-clientも削除(最終状態) | 反射が止まる。クラスタIDだけでは反射しない |
各STEPでR1から192.168.3.1・192.168.4.1・192.168.5.1へ、R3とR5から192.168.1.0/24へpingを50発送っています。
STEP 0:ルートリフレクタ未設定
R1のBGPテーブルには、自分の192.168.1.0/24とR2自身の192.168.2.0/24しかありません。R3が持つ3経路は届いていません。
RP/0/RP0/CPU0:R1#show bgp
Wed Sep 23 03:07:50.544 UTC
BGP router identifier 10.0.0.1, local AS number 65001
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe0000000 RD version: 4
BGP main routing table version 4
BGP NSR Initial initsync version 3 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs
Status codes: s suppressed, d damped, h history, * valid, > best
i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 192.168.1.0/24 0.0.0.0 0 32768 i
*>i192.168.2.0/24 10.0.0.2 0 100 0 i
Processed 2 prefixes, 2 pathsR2は5経路すべてを持っていますが、R3から受け取った経路はNot advertised to any peerです。R1へ広告しているのは自身の192.168.2.0/24だけです。
RP/0/RP0/CPU0:R2#show bgp 192.168.3.0/24
Wed Sep 23 03:08:36.914 UTC
BGP routing table entry for 192.168.3.0/24
Versions:
Process bRIB/RIB SendTblVer
Speaker 9 9
Last Modified: Sep 23 02:58:15.023 for 00:10:22
Paths: (1 available, best #1)
Not advertised to any peer
Path #1: Received by speaker 0
Not advertised to any peer
Local, (received & used)
10.0.0.3 (metric 2) from 10.0.0.3 (10.0.0.3)
Origin IGP, metric 0, localpref 100, valid, internal, best, group-best
Received Path ID 0, Local Path ID 1, version 9RP/0/RP0/CPU0:R2#show bgp neighbors 10.0.0.1 advertised-routes
Wed Sep 23 03:08:39.145 UTC
Network Next Hop From AS Path
192.168.2.0/24 10.0.0.2 Local i
Processed 1 prefixes, 1 pathsR1は外部の宛先へ転送できず、R3・R5から192.168.1.0/24へも届きません。これがiBGPスプリットホライズンです。
RP/0/RP0/CPU0:R1#ping 192.168.3.1 source 192.168.1.1 count 50 timeout 1
Wed Sep 23 03:05:08.376 UTC
Type escape sequence to abort.
Sending 50, 100-byte ICMP Echos to 192.168.3.1 timeout is 1 seconds:
..................................................
Success rate is 0 percent (0/50)
RP/0/RP0/CPU0:R1#ping 192.168.5.1 source 192.168.1.1 count 50 timeout 1
Wed Sep 23 03:06:51.266 UTC
Type escape sequence to abort.
Sending 50, 100-byte ICMP Echos to 192.168.5.1 timeout is 1 seconds:
..................................................
Success rate is 0 percent (0/50)RP/0/RP0/CPU0:R3#ping 192.168.1.1 source 192.168.3.1 count 50 timeout 1
Wed Sep 23 03:09:17.697 UTC
Type escape sequence to abort.
Sending 50, 100-byte ICMP Echos to 192.168.1.1 timeout is 1 seconds:
..................................................
Success rate is 0 percent (0/50)STEP 1:R2をルートリフレクタにする
R1とR3の両方をroute-reflector-clientに指定します。commitすると2ネイバーとのセッションが張り直され、理由はRR client configuration changedと記録されます。
RP/0/RP0/CPU0:R2#show configuration commit changes last 1
Wed Sep 23 03:13:14.389 UTC
!! Building configuration...
!! IOS XR Configuration 26.1.1
router bgp 65001
neighbor 10.0.0.1
address-family ipv4 unicast
route-reflector-client
!
!
neighbor 10.0.0.3
address-family ipv4 unicast
route-reflector-client
!
!
!
endRP/0/RP0/CPU0:R2#show logging start Sep 23 03:08:59
<snip>
RP/0/RP0/CPU0:Sep 23 03:13:15.502 UTC: bgp[1084]: %ROUTING-BGP-5-ADJCHANGE : neighbor 10.0.0.1 Down - RR client configuration changed (VRF: default) (AS: 65001)
RP/0/RP0/CPU0:Sep 23 03:13:15.502 UTC: bgp[1084]: %ROUTING-BGP-5-ADJCHANGE : neighbor 10.0.0.3 Down - RR client configuration changed (VRF: default) (AS: 65001)
RP/0/RP0/CPU0:Sep 23 03:13:20.185 UTC: bgp[1084]: %ROUTING-BGP-5-ADJCHANGE : neighbor 10.0.0.3 Up (VRF: default) (AS: 65001)
RP/0/RP0/CPU0:Sep 23 03:13:20.361 UTC: bgp[1084]: %ROUTING-BGP-5-ADJCHANGE : neighbor 10.0.0.1 Up (VRF: default) (AS: 65001) route-reflector-clientの追加・削除でセッションはリセットされるので、稼働中のネットワークでは保守時間帯に行います。R1のBGPテーブルが5経路になり、反射された経路にはOriginatorとCluster listが付きます。from 10.0.0.2(R2から受信)に対して括弧内のRouter IDは10.0.0.3(R3)で、Cluster listはR2のRouter ID 10.0.0.2です。
RP/0/RP0/CPU0:R1#show bgp
Wed Sep 23 03:15:32.621 UTC
BGP router identifier 10.0.0.1, local AS number 65001
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe0000000 RD version: 9
BGP main routing table version 9
BGP NSR Initial initsync version 3 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs
Status codes: s suppressed, d damped, h history, * valid, > best
i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 192.168.1.0/24 0.0.0.0 0 32768 i
*>i192.168.2.0/24 10.0.0.2 0 100 0 i
*>i192.168.3.0/24 10.0.0.3 0 100 0 i
*>i192.168.4.0/24 10.3.4.4 0 100 0 65002 i
*>i192.168.5.0/24 10.3.4.4 100 0 65002 65003 i
Processed 5 prefixes, 5 pathsRP/0/RP0/CPU0:R1#show bgp 192.168.3.0/24
Wed Sep 23 03:15:33.871 UTC
BGP routing table entry for 192.168.3.0/24
Versions:
Process bRIB/RIB SendTblVer
Speaker 6 6
Last Modified: Sep 23 03:13:20.023 for 00:02:13
Paths: (1 available, best #1)
Not advertised to any peer
Path #1: Received by speaker 0
Not advertised to any peer
Local, (received & used)
10.0.0.3 (metric 3) from 10.0.0.2 (10.0.0.3)
Origin IGP, metric 0, localpref 100, valid, internal, best, group-best
Received Path ID 0, Local Path ID 1, version 6
Originator: 10.0.0.3, Cluster list: 10.0.0.2R2側ではクライアントから受け取った経路に(Received from a RR-client)が付き、広告先にR1が並びます。ネイバーの詳細にはCluster ID(未設定なのでRouter IDの10.0.0.2)とRoute-Reflector Clientが出ます。
RP/0/RP0/CPU0:R2#show bgp 192.168.3.0/24
Wed Sep 23 03:16:17.520 UTC
BGP routing table entry for 192.168.3.0/24
Versions:
Process bRIB/RIB SendTblVer
Speaker 16 16
Last Modified: Sep 23 03:13:20.023 for 00:02:57
Paths: (1 available, best #1)
Advertised IPv4 Unicast paths to peers (in unique update groups):
10.0.0.1
Path #1: Received by speaker 0
Advertised IPv4 Unicast paths to peers (in unique update groups):
10.0.0.1
Local, (Received from a RR-client), (received & used)
10.0.0.3 (metric 2) from 10.0.0.3 (10.0.0.3)
Origin IGP, metric 0, localpref 100, valid, internal, best, group-best
Received Path ID 0, Local Path ID 1, version 16BGP neighbor is 10.0.0.1
Remote AS 65001, local AS 65001, internal link
<snip>
Cluster ID 10.0.0.2
BGP state = Established, up for 00:02:58
<snip>
Update group: 0.2 Filter-group: 0.4 No Refresh request being processed
Route-Reflector Client
<snip>
Prefix advertised 4, suppressed 0, withdrawn 0R1 - R2間のキャプチャーのNo.22は、反射された4経路のUPDATEが入ったTCPセグメントです。192.168.3.0/24のUPDATEにCLUSTER_LISTとORIGINATOR_IDが付き、Next hopはR3の10.0.0.3のままです。
Border Gateway Protocol - UPDATE Message
<snip>
Path Attribute - MP_REACH_NLRI
<snip>
Next hop: 10.0.0.3
IPv4 Address: 10.0.0.3
<snip>
192.168.3.0/24
<snip>
Path Attribute - ORIGIN: IGP
<snip>
Path Attribute - AS_PATH: empty
<snip>
Path Attribute - MULTI_EXIT_DISC: 0
<snip>
Path Attribute - LOCAL_PREF: 100
<snip>
Path Attribute - CLUSTER_LIST: 10.0.0.2
<snip>
Cluster ID: 10.0.0.2
Path Attribute - ORIGINATOR_ID: 10.0.0.3
<snip>
Originator identifier: 10.0.0.3抜き出したファイルでは、このパケットはNo.1として表示されます。R1・R3・R5からのpingはすべて100%になります。
STEP 2:クラスタIDを明示する
既定値(Router ID)以外のクラスタIDを与えます。この変更でもセッションはリセットされ、理由はNeighbor moved to a new clusterです。
RP/0/RP0/CPU0:R2#show configuration commit changes last 1
Wed Sep 23 03:19:20.194 UTC
!! Building configuration...
!! IOS XR Configuration 26.1.1
router bgp 65001
bgp cluster-id 10.100.100.1
!
endRP/0/RP0/CPU0:R2#show logging start Sep 23 03:16:40
<snip>
RP/0/RP0/CPU0:Sep 23 03:19:21.474 UTC: bgp[1084]: %ROUTING-BGP-5-ADJCHANGE : neighbor 10.0.0.3 Down - Neighbor moved to a new cluster (VRF: default) (AS: 65001)
RP/0/RP0/CPU0:Sep 23 03:19:21.474 UTC: bgp[1084]: %ROUTING-BGP-5-ADJCHANGE : neighbor 10.0.0.1 Down - Neighbor moved to a new cluster (VRF: default) (AS: 65001)
RP/0/RP0/CPU0:Sep 23 03:19:26.180 UTC: bgp[1084]: %ROUTING-BGP-5-ADJCHANGE : neighbor 10.0.0.1 Up (VRF: default) (AS: 65001)
RP/0/RP0/CPU0:Sep 23 03:19:26.438 UTC: bgp[1084]: %ROUTING-BGP-5-ADJCHANGE : neighbor 10.0.0.3 Up (VRF: default) (AS: 65001) R1が受け取る経路のCluster listが10.100.100.1に変わり、Originatorは変わりません。
RP/0/RP0/CPU0:R1#show bgp 192.168.3.0/24
Wed Sep 23 03:21:39.805 UTC
BGP routing table entry for 192.168.3.0/24
Versions:
Process bRIB/RIB SendTblVer
Speaker 15 15
Last Modified: Sep 23 03:19:26.023 for 00:02:13
Paths: (1 available, best #1)
Not advertised to any peer
Path #1: Received by speaker 0
Not advertised to any peer
Local, (received & used)
10.0.0.3 (metric 3) from 10.0.0.2 (10.0.0.3)
Origin IGP, metric 0, localpref 100, valid, internal, best, group-best
Received Path ID 0, Local Path ID 1, version 15
Originator: 10.0.0.3, Cluster list: 10.100.100.1STEP 3:update-groupを1つにまとめる
RFC 4456 6の「クライアントからの経路はクライアントへも反射する」を実装がどう扱うかは、IOS XRではupdate-groupの構成で決まります。ここでは2台のクライアントに同名のポリシーを当てて、1つのupdate-groupにまとめます。
RP/0/RP0/CPU0:R2#show configuration commit changes last 1
Wed Sep 23 03:25:26.301 UTC
!! Building configuration...
!! IOS XR Configuration 26.1.1
route-policy TO-BOTH
pass
end-policy
!
route-policy FROM-BOTH
pass
end-policy
!
router bgp 65001
neighbor 10.0.0.1
address-family ipv4 unicast
route-policy FROM-BOTH in
route-policy TO-BOTH out
!
!
neighbor 10.0.0.3
address-family ipv4 unicast
route-policy FROM-BOTH in
route-policy TO-BOTH out
!
!
!
endR1とR3が同じグループ(index 0.1)に入り、R2がR1へ広告する経路が5本に増えます。増えた1本はFrom 10.0.0.1、つまりR1自身が広告した192.168.1.0/24です。ポリシー名の差し替えだけなので、セッションは張り直っていません。
Update group for IPv4 Unicast, index 0.1:
<snip>
Route Reflector Client
<snip>
10.0.0.1 10.0.0.3 RP/0/RP0/CPU0:R2#show bgp neighbors 10.0.0.1 advertised-routes
Wed Sep 23 03:28:32.918 UTC
Network Next Hop From AS Path
192.168.1.0/24 10.0.0.2 10.0.0.1 i
192.168.2.0/24 10.0.0.2 Local i
192.168.3.0/24 10.0.0.3 10.0.0.3 i
192.168.4.0/24 10.3.4.4 10.0.0.3 65002i
192.168.5.0/24 10.3.4.4 10.0.0.3 65002 65003i
Processed 5 prefixes, 5 pathsキャプチャーのNo.7にそのUPDATEが入っています。ORIGINATOR_IDは10.0.0.1で、受信側のR1自身のRouter IDです。
Border Gateway Protocol - UPDATE Message
<snip>
Path Attribute - MP_REACH_NLRI
<snip>
Next hop: 10.0.0.1
IPv4 Address: 10.0.0.1
<snip>
192.168.1.0/24
<snip>
Path Attribute - ORIGIN: IGP
<snip>
Path Attribute - AS_PATH: empty
<snip>
Path Attribute - MULTI_EXIT_DISC: 0
<snip>
Path Attribute - LOCAL_PREF: 100
<snip>
Path Attribute - CLUSTER_LIST: 10.100.100.1
<snip>
Cluster ID: 10.100.100.1
Path Attribute - ORIGINATOR_ID: 10.0.0.1
<snip>
Originator identifier: 10.0.0.1R1のBGPテーブルは1 availableのまま、ローカル経路だけです。ORIGINATOR_IDが自身のRouter IDと一致する経路を無視する規則(RFC 4456 8)が働いています。
RP/0/RP0/CPU0:R1#show bgp 192.168.1.0/24
Wed Sep 23 03:27:44.660 UTC
BGP routing table entry for 192.168.1.0/24
Versions:
Process bRIB/RIB SendTblVer
Speaker 3 3
Last Modified: Sep 23 02:58:09.023 for 00:29:35
Paths: (1 available, best #1)
Advertised IPv4 Unicast paths to peers (in unique update groups):
10.0.0.2
Path #1: Received by speaker 0
Advertised IPv4 Unicast paths to peers (in unique update groups):
10.0.0.2
Local
0.0.0.0 from 0.0.0.0 (10.0.0.1)
Origin IGP, metric 0, localpref 100, weight 32768, valid, local, best, group-best
Received Path ID 0, Local Path ID 1, version 3STEP 4:ネイバーごとの別名ポリシーに戻す
ポリシー名をネイバーごとに分けると、update-groupも分かれ、R2がR1へ広告する経路は4本に戻ります。送信元のクライアントに同じUPDATEが届くかどうかは、RRの規則ではなくupdate-groupの構成で決まります。
RP/0/RP0/CPU0:R2#show configuration commit changes last 1
Wed Sep 23 03:31:27.008 UTC
!! Building configuration...
!! IOS XR Configuration 26.1.1
router bgp 65001
neighbor 10.0.0.1
address-family ipv4 unicast
route-policy FROM-R1 in
route-policy TO-R1 out
!
!
neighbor 10.0.0.3
address-family ipv4 unicast
route-policy FROM-R3 in
route-policy TO-R3 out
!
!
!
endRP/0/RP0/CPU0:R2#show bgp neighbors 10.0.0.1 advertised-routes
Wed Sep 23 03:34:33.166 UTC
Network Next Hop From AS Path
192.168.2.0/24 10.0.0.2 Local i
192.168.3.0/24 10.0.0.3 10.0.0.3 i
192.168.4.0/24 10.3.4.4 10.0.0.3 65002i
192.168.5.0/24 10.3.4.4 10.0.0.3 65002 65003i
Processed 4 prefixes, 4 pathsSTEP 5:R1を非クライアントにする
R1のroute-reflector-clientだけを削除します。R1はRRの通常のiBGPピア(非クライアント)になり、ネイバーの詳細からRoute-Reflector Clientが消えます。
RP/0/RP0/CPU0:R2#show configuration commit changes last 1
Wed Sep 23 03:37:31.176 UTC
!! Building configuration...
!! IOS XR Configuration 26.1.1
router bgp 65001
neighbor 10.0.0.1
address-family ipv4 unicast
no route-reflector-client
!
!
!
endBGP neighbor is 10.0.0.1
Remote AS 65001, local AS 65001, internal link
<snip>
BGP state = Established, up for 00:03:00
<snip>
Update group: 0.1 Filter-group: 0.3 No Refresh request being processed
<snip>
Prefix advertised 4, suppressed 0, withdrawn 0クライアントのR3発の経路は非クライアントのR1へ反射され続け、非クライアントのR1発の経路もクライアントのR3へ届きます。どちらにもOriginatorとCluster listが付きます。
RP/0/RP0/CPU0:R1#show bgp 192.168.3.0/24
Wed Sep 23 03:39:51.264 UTC
BGP routing table entry for 192.168.3.0/24
Versions:
Process bRIB/RIB SendTblVer
Speaker 22 22
Last Modified: Sep 23 03:37:37.023 for 00:02:14
Paths: (1 available, best #1)
Not advertised to any peer
Path #1: Received by speaker 0
Not advertised to any peer
Local, (received & used)
10.0.0.3 (metric 3) from 10.0.0.2 (10.0.0.3)
Origin IGP, metric 0, localpref 100, valid, internal, best, group-best
Received Path ID 0, Local Path ID 1, version 22
Originator: 10.0.0.3, Cluster list: 10.100.100.1RP/0/RP0/CPU0:R3#show bgp 192.168.1.0/24
Wed Sep 23 03:41:26.354 UTC
BGP routing table entry for 192.168.1.0/24
Versions:
Process bRIB/RIB SendTblVer
Speaker 15 15
Last Modified: Sep 23 03:37:37.023 for 00:03:49
Paths: (1 available, best #1)
Advertised IPv4 Unicast paths to peers (in unique update groups):
10.3.4.4
Path #1: Received by speaker 0
Advertised IPv4 Unicast paths to peers (in unique update groups):
10.3.4.4
Local, (received & used)
10.0.0.1 (metric 3) from 10.0.0.2 (10.0.0.1)
Origin IGP, metric 0, localpref 100, valid, internal, best, group-best
Received Path ID 0, Local Path ID 1, version 15
Originator: 10.0.0.1, Cluster list: 10.100.100.1pingも通ったままです。
RP/0/RP0/CPU0:R3#ping 192.168.1.1 source 192.168.3.1 count 50 timeout 1
Wed Sep 23 03:41:16.418 UTC
Type escape sequence to abort.
Sending 50, 100-byte ICMP Echos to 192.168.1.1 timeout is 1 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (50/50), round-trip min/avg/max = 6/9/59 ms
RP/0/RP0/CPU0:R3#traceroute 192.168.1.1 source 192.168.3.1 probe 3 timeout 1 maxttl 6
Wed Sep 23 03:41:18.058 UTC
Type escape sequence to abort.
Tracing the route to 192.168.1.1
1 10.2.3.2 52 msec 5 msec 5 msec
2 10.1.2.1 9 msec * 10 msec STEP 6:クライアント指定をすべて外す(最終状態)
R3のroute-reflector-clientも削除すると反射が止まり、R1のBGPテーブルは2経路に戻ります。bgp cluster-idは残したままです。クライアントが1台も無ければ、クラスタIDだけあっても反射は起きません。
RP/0/RP0/CPU0:R2#show configuration commit changes last 1
Wed Sep 23 03:43:35.519 UTC
!! Building configuration...
!! IOS XR Configuration 26.1.1
router bgp 65001
neighbor 10.0.0.3
address-family ipv4 unicast
no route-reflector-client
!
!
!
endRP/0/RP0/CPU0:R1#show bgp
Wed Sep 23 03:48:21.902 UTC
BGP router identifier 10.0.0.1, local AS number 65001
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe0000000 RD version: 28
BGP main routing table version 28
BGP NSR Initial initsync version 3 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs
Status codes: s suppressed, d damped, h history, * valid, > best
i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 192.168.1.0/24 0.0.0.0 0 32768 i
*>i192.168.2.0/24 10.0.0.2 0 100 0 i
Processed 2 prefixes, 2 pathsRP/0/RP0/CPU0:R1#ping 192.168.5.1 source 192.168.1.1 count 50 timeout 1
Wed Sep 23 03:47:22.970 UTC
Type escape sequence to abort.
Sending 50, 100-byte ICMP Echos to 192.168.5.1 timeout is 1 seconds:
..................................................
Success rate is 0 percent (0/50)検証Configおよびshow結果
各STEPで5台すべてから、次の種類をルータごとに分けて取得しています。検証Configはこの..._run.txtです(最終状態はSTEP 6のもの)。
| ファイル | 内容 |
|---|---|
..._show.txt | show version / show interface description / show route / show bgp / show bgp summary / show route bgp / show bgp <プレフィックス>(5プレフィックス分) / show bgp neighbors / ピアごとのadvertised-routes・routes・received routes / show bgp update-group / show bgp process / show rpl route-policy。R1〜R3はshow ospf neighbor / show route ospfも含む |
..._log.txt | そのSTEPの範囲だけに絞ったshow logging。各STEPの開始時にlogmsgでマーカーを入れ、その時刻をshow logging startに指定して取得したもの |
..._run.txt | そのSTEP時点のshow running-config(=そのSTEPの検証Config) |
..._ping.txt | ping(50発)とtraceroute。R1は192.168.3.1・192.168.4.1・192.168.5.1、R3とR5は192.168.1.1宛て |
..._trace.txt | show bgp trace neighborとshow bgp trace error(BGPプロセス内部のイベント) |
..._commit.cfg | そのSTEPで実際にコミットされた設定(R2のみ) |
STEP 0:ルートリフレクタ未設定
| ルータ | show出力 | syslog | running-config | ping | trace | 投入した設定 |
|---|---|---|---|---|---|---|
| R1 | show | log | run | ping | trace | — |
| R2 | show | log | run | — | trace | — |
| R3 | show | log | run | ping | trace | — |
| R4 | show | log | run | — | trace | — |
| R5 | show | log | run | ping | trace | — |
STEP 1:R1・R3をroute-reflector-clientに指定
| ルータ | show出力 | syslog | running-config | ping | trace | 投入した設定 |
|---|---|---|---|---|---|---|
| R1 | show | log | run | ping | trace | — |
| R2 | show | log | run | — | trace | commit |
| R3 | show | log | run | ping | trace | — |
| R4 | show | log | run | — | trace | — |
| R5 | show | log | run | ping | trace | — |
STEP 2:bgp cluster-id 10.100.100.1を追加
| ルータ | show出力 | syslog | running-config | ping | trace | 投入した設定 |
|---|---|---|---|---|---|---|
| R1 | show | log | run | ping | trace | — |
| R2 | show | log | run | — | trace | commit |
| R3 | show | log | run | ping | trace | — |
| R4 | show | log | run | — | trace | — |
| R5 | show | log | run | ping | trace | — |
STEP 3:2台のクライアントに同名のポリシーを当てる
| ルータ | show出力 | syslog | running-config | ping | trace | 投入した設定 |
|---|---|---|---|---|---|---|
| R1 | show | log | run | ping | trace | — |
| R2 | show | log | run | — | trace | commit |
| R3 | show | log | run | ping | trace | — |
| R4 | show | log | run | — | trace | — |
| R5 | show | log | run | ping | trace | — |
STEP 4:ネイバーごとの別名ポリシーに戻す
| ルータ | show出力 | syslog | running-config | ping | trace | 投入した設定 |
|---|---|---|---|---|---|---|
| R1 | show | log | run | ping | trace | — |
| R2 | show | log | run | — | trace | commit |
| R3 | show | log | run | ping | trace | — |
| R4 | show | log | run | — | trace | — |
| R5 | show | log | run | ping | trace | — |
STEP 5:R1のroute-reflector-clientを削除
| ルータ | show出力 | syslog | running-config | ping | trace | 投入した設定 |
|---|---|---|---|---|---|---|
| R1 | show | log | run | ping | trace | — |
| R2 | show | log | run | — | trace | commit |
| R3 | show | log | run | ping | trace | — |
| R4 | show | log | run | — | trace | — |
| R5 | show | log | run | ping | trace | — |
STEP 6:R3のroute-reflector-clientを削除(最終状態)
| ルータ | show出力 | syslog | running-config | ping | trace | 投入した設定 |
|---|---|---|---|---|---|---|
| R1 | show | log | run | ping | trace | — |
| R2 | show | log | run | — | trace | commit |
| R3 | show | log | run | ping | trace | — |
| R4 | show | log | run | — | trace | — |
| R5 | show | log | run | ping | trace | — |
パケットキャプチャーはSTEPごとに取得しています。
| STEP | R1 - R2間 | R2 - R3間 |
|---|---|---|
| 0 | pcap | pcap |
| 1 | pcap | pcap |
| 2 | pcap | pcap |
| 3 | pcap | pcap |
| 4 | pcap | pcap |
| 5 | pcap | pcap |
| 6 | pcap | pcap |
参考
| 資料 | タイトル | 概要 |
|---|---|---|
| RFC 4456 | BGP Route Reflection: An Alternative to Full Mesh Internal BGP (IBGP) | ルートリフレクタの定義。5で用語、6で反射のルール、7で冗長RRとクラスタID、8でORIGINATOR_ID / CLUSTER_LIST、9で経路選択への影響、10でRRが変更しない属性を規定。 |
| RFC 4271 | A Border Gateway Protocol 4 (BGP-4) | BGP-4の基本仕様。9.2でiBGPスプリットホライズンを規定。 |
| IANA | Border Gateway Protocol (BGP) Parameters | パス属性のType codeなど、BGPで使われる番号の割り当て一覧。 |
関連記事
- BGP(Border Gateway Protocol)
- BGPメッセージ
- BGPネイバーの状態遷移
- iBGPとeBGPの違い
- BGP next-hop-self
- BGPルートリフレクタ
- BGPパス属性とベストパス選択
- BGP ORIGIN属性
- BGP AS_PATH属性
- BGP NEXT_HOP属性
- BGP LOCAL_PREF属性
- BGP MED属性
- BGP WEIGHT属性
- BGP COMMUNITY属性
- BGP経路集約(aggregate-address)
- MP-BGP(マルチプロトコル拡張)
- BGP Extended Community(拡張コミュニティ)
- BGPマルチパス(maximum-paths)
- BGPの4バイトAS番号(RFC 6793)
- BGPのプライベートAS番号の除去(remove-private-AS)
- BGPのADD-PATH(RFC 7911)
- BGP PIC(Prefix Independent Convergence)
- BGP Best External(ベストでない外部経路の広告)