ルート ターゲット フィルタリング
このトピックでは、静的、BGP、プロキシーのBGPルート・ターゲット・フィルタリングの設定について説明し、VPNのルート・ターゲット・フィルタリングの設定例を示します。
VPNの静的ルートターゲットフィルタリングの設定
VPN メンバーシップを決定するには、BGP VPN ルート ターゲット拡張コミュニティー(RFC 4360、 BGP 拡張コミュニティー属性)を使用します。静的ルート ターゲット フィルタリングは、メンバー PE ルーター(RFC 4684、 Border Gateway Protocol/MultiProtocol Label Switching(BGP/MPLS)インターネット プロトコル(IP)仮想プライベート ネットワーク(VPN)の欠如により、VPN ルートが必要ないネットワークの一部でリソースが消費されるのを防ぐのに役立ちます。).ルーターは、RT-Constrainプロトコルにルートを発信して、RT-Constrain NLRIに一致するルートターゲットを含むVPNルートを受信することに関心があることを示すことができます。
VPNの静的ルートターゲットフィルタリングを設定するには:
route-target-filter
階層レベルで ステートメントを[edit routing-options rib bgp.rtarget.0 static]
設定します。以下の例は、 ルートターゲットフィルター ステートメントを設定する方法を示しています。
[edit routing-options rib bgp.rtarget.0 static] route-target-filter destination { group bgp-group; local; neighbor bgp-peer; }
ルート・ターゲット・フィルタリング情報は、 コマンドを
show bgp group rtf detail
使用して表示できます。
VPNの静的ルートターゲットフィルタリングによるネットワークリソースの使用を削減
VPN メンバーシップを決定するには、BGP VPN ルート ターゲット拡張コミュニティー(RFC 4360、 BGP 拡張コミュニティー属性)を使用します。静的ルート ターゲット フィルタリングは、メンバー PE ルーター(RFC 4684、 Border Gateway Protocol/MultiProtocol Label Switching(BGP/MPLS)インターネット プロトコル(IP)仮想プライベート ネットワーク(VPN)の欠如により、VPN ルートが必要ないネットワークの一部でリソースが消費されるのを防ぐのに役立ちます。).ルーターは、RT-Constrainプロトコルにルートを発信して、RT-Constrain NLRIに一致するルートターゲットを含むVPNルートを受信することに関心があることを示すことができます。
通常、RT-Constrain機能が適切に機能するためには、ネットワーク全体に幅広く導入する必要があります。そうでない場合、この機能はあまり役に立ちません。非 RT-Constrain スピーカーが直面する RT-Constrain BGP スピーカーは、その機能をサポートしていないピアに代わって他の RT-Constrain スピーカーにデフォルトの RT-Constrain ルートをアドバタイズする必要があるためです。これにより、デフォルトの RT-Constrain ルートによって PE ルーターとすべての間にある PE ルーターがすべての VPN ルートを受信する必要があるため、ネットワークの一部でリソース節約のメリットを効果的に取り除けます。
静的RT-Constrain機能を使用すると、RT-Constrain機能を部分的にネットワークに導入できます。この機能は、RT-Constrainが設定されているネットワークの境界で有効になっています。ただし、一部の BGP VPN ピアは RT-Constrain(通常は PE ルーター)をサポートしていません。これらの PE ルーターのルート ターゲットは、ルーター上で静的に設定する必要があります。これらのルートターゲットは、RT-Constrainプロトコルを使用して発信されます。
プロキシRT-Constrain機能により、プロトコルをサポートしないBGP VPNピアが、ルートターゲットを自動的に発見して発信することを可能にします。ただし、この機能は、対称的なルート ターゲットのみをサポートできます。例えば、VRFルーティングインスタンスのインポートとエクスポートルートターゲットは同一です。ただし、ハブアンドスポーク方式 VPN の場合、インポートとエクスポートのルートターゲットは同一ではありません。このシナリオでは、インポートとエクスポートルートターゲットがRT-Constrainプロトコルで発信されるように静的に設定される場合があります。
VPNのBGPルートターゲットフィルタリングの設定
BGP ルート ターゲット フィルタリングでは、VPN ルートを必要とするルーターにのみ配信できます。BGPルート・ターゲット・フィルタリングが設定されていないVPNネットワークでは、BGPはすべてのVPNルートをすべてのVPNピアルーターに配信します。
BGPルートターゲットフィルタリングの詳細については、 RFC 4684、 境界ゲートウェイプロトコル/マルチプロトコルラベルスイッチング(BGP/MPLS)インターネットプロトコル(IP)仮想プライベートネットワーク(VPN)の制約付きルート配信を参照してください。
以下のセクションでは、BGPルートターゲットフィルタリングの概要とVPNに対して設定する方法について説明します。
BGP ルート ターゲット フィルタリングの概要
PEルーターは、ルートリフレクタとして設定されているか、EBGPセッションを実行している場合を除き、ローカルVRFインポートポリシーで指定されたルートターゲット拡張コミュニティを含まないVPNルートを破棄します。これは、Junos OSのデフォルト動作です。
ただし、VPNルートを保存しないように明示的に設定されていない限り、VPNアドレスファミリーのルートリフレクタまたはボーダールーターとして設定されたルーターは、サービスプロバイダのネットワークに存在するすべてのVPNルートを保存する必要があります。また、PE ルーターはルート ターゲット拡張コミュニティーを含まないルートを自動的に破棄できますが、ルート更新は生成および受信され続けます。
VPNルートとルート更新を受信するルーターの数を減らすことで、BGPルートターゲットフィルタリングは、VPNの実行に関連するオーバーヘッドの量を制限するのに役立ちます。BGPルートターゲットフィルタリングは、直接VPNに参加しないルートリフレクタやAS境界ルーターが多数存在するネットワーク(CEデバイスのPEルーターとして機能しない)があるネットワークで、VPN関連の管理トラフィックを削減するのに最も効果的です。
BGP ルート ターゲット フィルタリングは、標準 UPDATE メッセージを使用して、ルート ターゲット拡張コミュニティーをルーター間で配信します。UPDATE メッセージを使用することで、BGP は標準のループ検出メカニズム、パス選択、ポリシーサポート、およびデータベース交換実装を使用できます。
VPNのBGPルートターゲットフィルタリングの設定
BGPルートターゲットフィルタリングは、bgp.rtarget.0ルーティングテーブルに保存されたアドレスファミリーの交換 route-target
によって有効になります。アドレスファミリーに route-target
基づいて、ルートターゲットNLRI(アドレスファミリーインジケータ[AFI]=1、後続のAFI [SAFI]=132)がピアとネゴシエートされます。
VRFインスタンスをローカルに設定したシステムでは、BGPはポリシーで参照されるターゲットに対応するローカルルートを自動的に vrf-import
生成します。
BGPルートターゲットフィルタリングを設定するには、 ステートメントを family route-target
含めます。
family route-target { advertise-default; external-paths number; prefix-limit number; }
このステートメントを含めることができる階層レベルの一覧は、このステートメントのステートメント概要セクションを参照してください。
、 external-paths
、 prefix-limit
ステートメントはadvertise-default
、以下のようにBGPルートターゲットフィルタリング設定に影響を与えます。
ステートメントにより、ルーターは
advertise-default
デフォルトルートターゲットルート(0:0:0/0)をアドバタイズし、より具体的なすべてのルートを抑制します。これは、PE ルーターとしてのみ機能するネイバーで構成される BGP グループのルート リフレクタによって使用できます。PEルーターは、多くの場合、ルートリフレクタにすべてのルートをアドバタイズする必要があります。デフォルトルート以外のすべてのルートターゲットアドバタイズメントを抑制することで、ルートリフレクタとPEルーター間で交換される情報量が減少します。Junos OSは、非デフォルトのルートを受信しない限り、依存関係情報を維持しないことで、ルートターゲットアドバタイズオーバーヘッドを削減するのにも役立ちます。
ステートメント(デフォルト値が1)では、ルーターは
external-paths
特定のルートターゲットを参照するVPNルートをアドバタイズします。指定した数は、VPNルートを受信する外部ピアルーター(現在そのルートターゲットをアドバタイズ)の数を決定します。ステートメントは
prefix-limit
、ピアルーターから受信できるプレフィックス数を制限します。
、 advertise-default
、および external-path
ステートメントは route-target
RIB-OUT 状態に影響を与え、同じ BGP グループを共有するピア ルーター間で一貫している必要があります。ステートメントはprefix-limit
受信側にのみ影響し、BGPグループ内の異なるピアルーター間で異なる設定を行うことができます。
「」も参照
例:VPNのBGPルートターゲットフィルタリング
BGPルートターゲットフィルタリングは、適切なBGP階層レベルで ステートメントを設定 family route-target
することで有効になります。このステートメントは、bgp.rtarget.0ルーティングテーブルに格納されている新しい route-target
アドレスファミリーの交換を可能にします。
以下の構成は、 というタイトルの BGP グループに対して BGP ルート・ターゲット・ to_vpn04
フィルタリングを設定する方法を示しています。
[edit] protocols { bgp { group to_vpn04 { type internal; local-address 10.255.14.182; peer-as 200; neighbor 10.255.14.174 { family inet-vpn { unicast; } family route-target; } } } }
以下の設定は、BGPルートターゲットフィルタリングによって提供される機能を活用するために、いくつかのローカルVPNルーティングおよび転送(VRF)ルーティングインスタンスを設定する方法を示しています。この設定に基づいて、BGPはVRFインポートポリシーで参照されるルートターゲットに対応するローカルルートを自動的に生成します(ステートメントで定義されたターゲットに vrf-target
注意してください)。
[edit] routing-instances { vpn1 { instance-type vrf; interface t1-0/1/2.0; vrf-target target:200:101; protocols { ospf { export bgp-routes; area 0.0.0.0 { interface t1-0/1/2.0; } } } } vpn2 { instance-type vrf; interface t1-0/1/2.1; vrf-target target:200:102; protocols { ospf { export bgp-routes; area 0.0.0.0 { interface t1-0/1/2.1; } } } } }
show コマンドを show route table bgp.rtarget.0 発行して、BGP ルート ターゲット フィルタリング設定を確認します。
user@host> show route table bgp.rtarget.0 bgp.rtarget.0: 4 destinations, 6 routes (4 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 200:200:101/96 *[RTarget/5] 00:10:00 Local 200:200:102/96 *[RTarget/5] 00:10:00 Local 200:200:103/96 *[BGP/170] 00:09:48, localpref 100, from 10.255.14.174 AS path: I > t3-0/0/0.0 200:200:104/96 *[BGP/170] 00:09:48, localpref 100, from 10.255.14.174 AS path: I > t3-0/0/0.0
ルートターゲットプレフィックスの show
コマンド表示形式は次のとおりです。
AS number:route target extended community/length
最初の番号は、このアドバタイズメントを送信したルーターの自律システム(AS)を表しています。この画面の残りの部分は、拡張コミュニティーの Junos show
コマンド表記規則に従っています。
コマンドからの show route table bgp-rtarget.0
出力には、ローカルで生成されたルートとリモートで生成されたルートが表示されます。
最初の 2 つのエントリーは、2 つのローカル VRF ルーティング インスタンス(およびvpn2
)vpn1
に設定されたルート ターゲットに対応します。
200:200:101/96
ルーティングインスタンス内のvpn1
コミュニティ200:101
200:200:102/96
ルーティングインスタンス内のvpn2
コミュニティ200:102
最後の 2 つのエントリーは、BGP ピアから受信したプレフィックスです。
200:200:103/96
—ローカルルーターに、このコミュニティ(200:103
)でタグ付けされたルートをピアリング10.255.14.174
スルーにアドバタイズする必要があることを伝えます。t3-0/0/0.0
200:200:104/96
—ローカルルーターに、このコミュニティ(200:104
)でタグ付けされたルートをピアリング10.255.14.174
スルーにアドバタイズする必要があることを伝えます。t3-0/0/0.0
例:VPNのBGPルートターゲットフィルタリングの設定
BGPルートターゲットフィルタリングは、VPNルートとルート更新を受信するルーターの数を減らし、VPNの実行に関連するオーバーヘッドの量を制限するのに役立ちます。BGPルートターゲットフィルタリングは、VPNに直接参加しないルートリフレクタやAS境界ルーターが多数存在するネットワークでVPN関連の管理トラフィックを削減するのに最も効果的です(CEデバイスのPEルーターとして機能しません)。
図 1 は、VPN グループの BGP ルート ターゲット フィルタリングで設定されたネットワークのトポロジーを示しています。
以下のセクションでは、VPNのグループに対してBGPルートターゲットフィルタリングを設定する方法について説明します。
- ルーターPE1でBGPルートターゲットフィルタリングを設定する
- ルーターPE2でBGPルートターゲットフィルタリングを設定する
- ルートリフレクタでBGPルートターゲットフィルタリングを設定する
- ルーターPE3でBGPルートターゲットフィルタリングを設定する
ルーターPE1でBGPルートターゲットフィルタリングを設定する
このセクションでは、この例でルーターPE1でBGPルートターゲットフィルタリングを有効にする方法について説明します。
ルーターPE1のルーティングオプションを以下のように設定します。
[edit] routing-options { route-distinguisher-id 10.255.14.182; autonomous-system 198; }
ルーターPE1のBGPプロトコルを以下のように設定します。
[edit] protocols { bgp { group to_VPN_D { type internal; local-address 10.255.14.182; peer-as 198; neighbor 10.255.14.174 { family inet-vpn { unicast; } family route-target; } } } }
ルーティングインスタンスを vpn1
以下のように設定します。
[edit] routing-instances { vpn1 { instance-type vrf; interface t1-0/1/2.0; vrf-target target:198:101; protocols { ospf { export bgp-routes; area 0.0.0.0 { interface t1-0/1/2.0; } } } } }
ルーターPE1の vpn2
ルーティングインスタンスを以下のように設定します。
[edit] routing-instances { vpn2 { instance-type vrf; interface t1-0/1/2.1; vrf-target target:198:102; protocols { ospf { export bgp-routes; area 0.0.0.0 { interface t1-0/1/2.1; } } } } }
この設定を実装すると、コマンドを発行 show route table bgp.rtarget.0
すると以下が表示されます。
user@host> show route table bgp.rtarget.0 bgp.rtarget.0: 4 destinations, 6 routes (4 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 198.198:101/96 *[RTarget/5] 00:27:42 Local [BGP/170] 00:27:30, localpref 100, from 10.255.14.174 AS path: I > via t3-0/0/0.0 198.198:102/96 *[RTarget/5] 00:27:42 Local [BGP/170] 00:27:30, localpref 100, from 10.255.14.174 AS path: I > via t3-0/0/0.0 198.198:103/96 *[BGP/170] 00:27:30, localpref 100, from 10.255.14.174 AS path: I > via t3-0/0/0.0 198.198:104/96 *[BGP/170] 00:27:30, localpref 100, from 10.255.14.174 AS path: I > via t3-0/0/0.0
ルーターPE2でBGPルートターゲットフィルタリングを設定する
このセクションでは、この例でルーターPE2でBGPルートターゲットフィルタリングを有効にする方法について説明します。
ルーターPE2のルーティングオプションを以下のように設定します。
[edit] routing-options { route-distinguisher-id 10.255.14.176; autonomous-system 198; }
ルーターPE2のBGPプロトコルを以下のように設定します。
[edit] protocols { bgp { group to_vpn04 { type internal; local-address 10.255.14.176; peer-as 198; neighbor 10.255.14.174 { family inet-vpn { unicast; } family route-target; } } } }
ルーターPE2の vpn1
ルーティングインスタンスを以下のように設定します。
[edit] routing-instances { vpn1 { instance-type vrf; interface t3-0/0/0.0; vrf-target target:198:101; protocols { bgp { group vpn1 { type external; peer-as 101; as-override; neighbor 10.49.11.2; } } } } }
ルーターPE2の vpn2
ルーティングインスタンスを以下のように設定します。
[edit] routing-instances { vpn2 { instance-type vrf; interface t3-0/0/0.1; vrf-target target:198:102; protocols { bgp { group vpn2 { type external; peer-as 102; as-override; neighbor 10.49.21.2; } } } } }
ルーターPE2の vpn3
ルーティングインスタンスを以下のように設定します。
[edit] routing-instances { vpn3 { instance-type vrf; interface t3-0/0/0.2; vrf-import vpn3-import; vrf-export vpn3-export; protocols { bgp { group vpn3 { type external; peer-as 103; as-override; neighbor 10.49.31.2; } } } } }
この方法でルーターPE2を設定した後、 コマンドを発行すると、以下が表示されるはずです show route table bgp.rtarget.0
。
user@host> show route table bgp.rtarget.0 bgp.rtarget.0: 4 destinations, 7 routes (4 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 198.198:101/96 *[RTarget/5] 00:28:15 Local [BGP/170] 00:28:03, localpref 100, from 10.255.14.174 AS path: I > via t1-0/1/0.0 198.198:102/96 *[RTarget/5] 00:28:15 Local [BGP/170] 00:28:03, localpref 100, from 10.255.14.174 AS path: I > via t1-0/1/0.0 198.198:103/96 *[RTarget/5] 00:28:15 Local [BGP/170] 00:28:03, localpref 100, from 10.255.14.174 AS path: I > via t1-0/1/0.0 198.198:104/96 *[BGP/170] 00:28:03, localpref 100, from 10.255.14.174 AS path: I > via t1-0/1/0.0
ルートリフレクタでBGPルートターゲットフィルタリングを設定する
このセクションでは、この例のルートリフレクタでBGPルートターゲットフィルタリングを有効にする方法を説明します。
ルートリフレクタでルーティングオプションを次のように設定します。
[edit] routing-options { route-distinguisher-id 10.255.14.174; autonomous-system 198; }
ルートリフレクタでBGPプロトコルを次のように設定します。
[edit] protocols { bgp { group rr-group { type internal; local-address 10.255.14.174; cluster 10.255.14.174; peer-as 198; neighbor 10.255.14.182 { description to_PE1_vpn12; family inet-vpn { unicast; } family route-target; } neighbor 10.255.14.176 { description to_PE2_vpn06; family inet-vpn { unicast; } family route-target; } neighbor 10.255.14.178 { description to_PE3_vpn08; family inet-vpn { unicast; } family route-target; } } } }
この方法でルートリフレクタを設定した後、 コマンドを発行すると以下が表示されます show route table bgp.rtarget.0
。
user@host> show route table bgp.rtarget.0 bgp.rtarget.0: 4 destinations, 8 routes (4 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 198.198:101/96 *[BGP/170] 00:29:03, localpref 100, from 10.255.14.176 AS path: I > via t1-0/2/0.0 [BGP/170] 00:29:03, localpref 100, from 10.255.14.178 AS path: I > via t3-0/1/1.0 [BGP/170] 00:29:03, localpref 100, from 10.255.14.182 AS path: I > via t3-0/1/3.0 198.198:102/96 *[BGP/170] 00:29:03, localpref 100, from 10.255.14.176 AS path: I > via t1-0/2/0.0 [BGP/170] 00:29:03, localpref 100, from 10.255.14.182 AS path: I > via t3-0/1/3.0 198.198:103/96 *[BGP/170] 00:29:03, localpref 100, from 10.255.14.176 AS path: I > via t1-0/2/0.0 [BGP/170] 00:29:03, localpref 100, from 10.255.14.178 AS path: I > via t3-0/1/1.0 198.198:104/96 *[BGP/170] 00:29:03, localpref 100, from 10.255.14.178 AS path: I > via t3-0/1/1.0
ルーターPE3でBGPルートターゲットフィルタリングを設定する
以下のセクションでは、この例のルーターPE3でBGPルートターゲットフィルタリングを有効にする方法について説明します。
ルーターPE3のルーティングオプションを以下のように設定します。
[edit] routing-options { route-distinguisher-id 10.255.14.178; autonomous-system 198; }
ルーターPE3のBGPプロトコルを以下のように設定します。
[edit] protocols { bgp { group to_vpn04 { type internal; local-address 10.255.14.178; peer-as 198; neighbor 10.255.14.174 { family inet-vpn { unicast; } family route-target; } } } }
ルーターPE3の vpn1
ルーティングインスタンスを以下のように設定します。
[edit] routing-instances { vpn1 { instance-type vrf; interface t3-0/0/0.0; vrf-target target:198:101; protocols { rip { group vpn1 { export bgp-routes; neighbor t3-0/0/0.0; } } } } }
ルーターPE3の vpn3
ルーティングインスタンスを以下のように設定します。
[edit] routing-instances { vpn3 { instance-type vrf; interface t3-0/0/0.1; vrf-target target:198:103; protocols { rip { group vpn3 { export bgp-routes; neighbor t3-0/0/0.1; } } } } }
ルーターPE3の vpn4
ルーティングインスタンスを以下のように設定します。
[edit] routing-instances { vpn4 { instance-type vrf; interface t3-0/0/0.2; vrf-target target:198:104; protocols { rip { group vpn4 { export bgp-routes; neighbor t3-0/0/0.2; } } } } }
この方法でルーターPE3を設定した後、 コマンドを発行すると、以下が表示されます show route table bgp.rtarget.0
。
user@host> show route table bgp.rtarget.0 bgp.rtarget.0: 4 destinations, 7 routes (4 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 198.198:101/96 *[RTarget/5] 00:29:42 Local [BGP/170] 00:29:30, localpref 100, from 10.255.14.174 AS path: I > via t3-0/0/1.0 198.198:102/96 *[BGP/170] 00:29:29, localpref 100, from 10.255.14.174 AS path: I > via t3-0/0/1.0 198.198:103/96 *[RTarget/5] 00:29:42 Local [BGP/170] 00:29:30, localpref 100, from 10.255.14.174 AS path: I > via t3-0/0/1.0 198.198:104/96 *[RTarget/5] 00:29:42 Local [BGP/170] 00:29:30, localpref 100, from 10.255.14.174 AS path: I > via t3-0/0/1.0
例:VPNのBGPルートターゲットフィルタリングのエクスポートポリシーの設定
この例では、BGPルートターゲットフィルタリング(ルートターゲット制約、または RTCとも呼ばれます)にエクスポートルーティングポリシーを設定する方法を示します。
要件
この例では、以下のハードウェアとソフトウェアのコンポーネントを使用しています。
BGP ルート ターゲット フィルタリングをサポートする 4 台のジュニパーネットワークス デバイス。
プロキシBGPルートフィルタリング用に設定された1つ以上のデバイス上のJunos OSリリース12.2以降。この例では、ルートリフレクタにプロキシBGPルートフィルタリングを明示的に設定します。
BGP ルート ターゲット フィルタリングのエクスポート ポリシーを設定する前に、以下の概念に精通し、理解していることを確認してください。
概要
BGPルートターゲットフィルタリングでは、ネットワーク全体にルートターゲットメンバーシップ(RTメンバーシップ)アドバタイズメントを配信することで、ネットワークリソースの消費量を削減できます。BGPは、RTメンバーシップ情報を使用して、VPNルートをネットワークに必要なデバイスにのみ送信します。他のタイプの BGP 到達可能性と同様に、ルーティング ポリシーを適用して、ターゲット フィルタリング ルートをルーティングしてネットワークに影響を与えることができます。ルートターゲットフィルタリングが設定されている場合、ルートターゲットフィルタリングルートのフローを制限すると、このRTメンバーシップによって引き付けられる可能性のあるVPNルートも制限されます。このポリシーの設定には、以下が含まれます。
ルート ターゲット プレフィックスのリストを定義するフィルターを作成します。
BGPルート・ターゲット・フィルタリングに使用するルート・ターゲット・フィルターのサブセットを選択するポリシーの作成。
ルートターゲットプレフィックスのリストを定義するには:
階層レベルで ステートメントを
rtf-prefix-list
[edit policy-options]
設定して、ルートターゲットプレフィックスリストの名前と、使用する1つ以上のルートターゲットプレフィックスを指定します。この設定により、デバイスが使用する受信ルート ターゲット フィルタリング ルートを指定し、ネットワーク全体に配信できます。
ルーティングポリシーを設定し、そのポリシーにルートターゲットプレフィックスリストを適用するには、以下のポリシーオプションを指定します。
-
family route-target
—(オプション)ルートターゲットファミリーの一致条件は、一致するBGPルートターゲットフィルタリングルートを指定します。この基準は、 ステートメントでfrom
定義します。この例では、 一致条件を使用してエクスポート・ポリシーを作成する方法をfamily route-target
示しています。メモ:ジュニパーは、inet.3テーブルを使用して、設定時
family route-target
にネクストホップアドレスを解決します。 protocol route-target
—(オプション)ルートターゲットプロトコルの一致条件は、受信ルートが一致する必要がある基準を定義します。この基準は、 ステートメントでfrom
定義します。このステートメントは、主に、ポリシーをローカルで生成されたルート・ターゲット・フィルタリング・ルートに制限する場合に便利です。メモ:コマンドを
show route table bgp.rtarget.0
使用してプロキシBGPルートターゲットフィルタリングルートを表示すると、受信ルートのBGPプロトコルと、ローカルルートターゲットフィルタリングルートのルートターゲットプロトコルルートが表示されます。rtf-prefix-list name
- rtf-prefix-list ステートメントは、すでにポリシーに設定したルート ターゲット プレフィックスのリストを適用します。この基準は、 ステートメントでfrom
定義します。
トポロジー図
図 2 は、この例で使用したトポロジーを示しています。
この例では、BGPルートターゲットフィルタリングは、ルートリフレクタ(デバイスRR1およびデバイスRR2)とプロバイダーエッジ(PE)デバイスPE2に設定されています。もう1つのPEであるデバイスPE1は、BGPルートターゲットフィルタリングをサポートしていません。プロキシーBGPルートターゲットフィルタリングは、ルートリフレクタとデバイスPE1間のピアリングセッションでも設定され、デバイスPE1で処理されるVPNルート更新の数を最小限に抑えます。デバイスPE2には4つのVPN(vpn1、vpn2、vpn3、vpn4)が設定されており、デバイスPE1には2つのVPN(vpn1とvpn2)が設定されています。サンプルトポロジーでは、すべてのデバイスが自律システム(AS)203に参加し、OSPFは設定された内部ゲートウェイプロトコル(IGP)であり、LDPはVPNで使用されるシグナリングプロトコルです。この例では、VPNルーティングおよび転送(VRF)インスタンスで静的ルートを使用してVPNルートを生成します。これは、OSPFやBGPなどのPEからカスタマーエッジ(CE)プロトコルを使用する代わりに行われます。
この例では、vpn3ルートがデバイスRR1にアドバタイズされるのを防ぐために、デバイスPE2上でエクスポートポリシーを設定することで、デバイスPE2からデバイスPE1にアドバタイズされるルートをさらに制御します。一致条件を指定するポリシーを family route-target
作成し、ルートターゲットプレフィックスのリストを定義し、基準を定義することでルートターゲットプレフィックスのリストを rtf-prefix-list
適用します。
構成
CLI クイックコンフィギュレーション
この例を迅速に設定するには、以下のコマンドをコピーしてテキスト ファイルに貼り付け、改行を削除し、ネットワーク設定に合わせて必要な詳細を変更し、コマンドを 階層レベルの CLI [edit]
にコピー アンド ペーストします。
デバイスPE1
set interfaces ge-1/0/0 unit 0 description PE1-to-RR1 set interfaces ge-1/0/0 unit 0 family inet address 10.49.0.1/30 set interfaces ge-1/0/0 unit 0 family mpls set interfaces ge-1/0/1 unit 0 description PE1-to-RR2 set interfaces ge-1/0/1 unit 0 family inet address 10.49.10.1/30 set interfaces ge-1/0/1 unit 0 family mpls set protocols ldp interface ge-1/0/0 set protocols ldp interface ge-1/0/1 set protocols bgp group internal type internal set protocols bgp group internal local-address 10.255.163.58 set protocols bgp group internal neighbor 10.255.165.220 family inet-vpn unicast set protocols bgp group internal neighbor 10.255.165.28 family inet-vpn unicast set protocols ospf area 0.0.0.0 interface ge-1/0/0 set protocols ospf area 0.0.0.0 interface ge-1/0/1 set protocols ospf area 0.0.0.0 interface lo0.0 passive set routing-options route-distinguisher-id 10.255.163.58 set routing-options autonomous-system 203 set routing-instances vpn1 instance-type vrf set routing-instances vpn1 vrf-target target:203:100 set routing-instances vpn1 routing-options static route 203.0.113.1/24 discard set routing-instances vpn2 instance-type vrf set routing-instances vpn2 vrf-target target:203:101 set routing-instances vpn2 routing-options static route 203.0.113.2/24 discard
デバイスRR1
set interfaces ge-1/0/0 unit 0 description RR1-to-PE1 set interfaces ge-1/0/0 unit 0 family inet address 10.49.0.2/30 set interfaces ge-1/0/0 unit 0 family mpls set interfaces ge-1/0/1 unit 0 description RR1-to-PE2 set interfaces ge-1/0/1 unit 0 family inet address 10.50.0.2/30 set interfaces ge-1/0/1 unit 0 family mpls set protocols ldp interface ge-1/0/0 set protocols ldp interface ge-1/0/1 set protocols bgp group internal type internal set protocols bgp group internal local-address 198.51.100.0 set protocols bgp group internal cluster 198.51.100.1 set protocols bgp group internal neighbor 10.255.163.58 description vpn1-to-pe1 family inet-vpn unicast set protocols bgp group internal neighbor 10.255.163.58 family route-target proxy-generate set protocols bgp group internal neighbor 10.255.168.42 description vpn1-to-pe2 family inet-vpn unicast set protocols ospf area 0.0.0.0 interface ge-1/0/0 set protocols ospf area 0.0.0.0 interface ge-1/0/1 set protocols ospf area 0.0.0.0 interface lo0.0 passive set routing-options route-distinguisher-id 10.255.165.220 set routing-options autonomous-system 203
デバイスRR2
set interfaces ge-1/0/0 unit 0 description RR2-to-PE1 set interfaces ge-1/0/0 unit 0 family inet address 10.49.10.2/30 set interfaces ge-1/0/0 unit 0 family mpls set interfaces ge-1/0/1 unit 0 description RR2-to-PE2 set interfaces ge-1/0/1 unit 0 family inet address 10.50.10.2/30 set interfaces ge-1/0/1 unit 0 family mpls set protocols ldp interface ge-1/0/0 set protocols ldp interface ge-1/0/1 set protocols bgp group internal type internal set protocols bgp group internal local-address 10.255.165.28 set protocols bgp group internal cluster 198.51.100.1 set protocols bgp group internal neighbor 10.255.163.58 description vpn2-to-pe1 family inet-vpn unicast set protocols bgp group internal neighbor 10.255.163.58 family route-target proxy-generate set protocols bgp group internal neighbor 10.255.168.42 description vpn2-to-pe2 family inet-vpn unicast set protocols bgp group internal neighbor 10.255.163.58 family route-target set protocols ospf area 0.0.0.0 interface ge-1/0/0 set protocols ospf area 0.0.0.0 interface ge-1/0/1 set protocols ospf area 0.0.0.0 interface lo0.0 passive set routing-options route-distinguisher-id 10.255.165.28 set routing-options autonomous-system 203
デバイスPE2
set interfaces ge-1/0/0 unit 0 description PE2-to-RR1 set interfaces ge-1/0/0 unit 0 family inet address 10.50.0.1/30 set interfaces ge-1/0/0 unit 0 family mpls set interfaces ge-1/0/1 unit 0 description PE2-to-RR2 set interfaces ge-1/0/1 unit 0 family inet address 10.50.10.2/30 set interfaces ge-1/0/1 unit 0 family mpls set protocols ldp interface ge-1/0/0 set protocols ldp interface ge-1/0/1 set protocols bgp group internal type internal set protocols bgp group internal local-address 10.255.168.42 set protocols bgp group internal family inet-vpn unicast set protocols bgp group internal family route-target set protocols bgp group internal neighbor 10.255.165.220 export filter-rtc set protocols bgp group internal neighbor 10.255.165.28 set protocols ospf area 0.0.0.0 interface ge-1/0/0 set protocols ospf area 0.0.0.0 interface ge-1/0/1 set protocols ospf area 0.0.0.0 interface lo0.0 passive set policy-options rtf-prefix-list exclude-103 203:203:103/96 set policy-options policy-statement filter-rtc from family route-target set policy-options policy-statement filter-rtc from rtf-prefix-list exclude-103 set policy-options policy-statement filter-rtc then reject set routing-options route-distinguisher-id 10.255.168.42 set routing-options autonomous-system 203 set routing-instances vpn1 instance-type vrf set routing-instances vpn1 vrf-target target:203:100 set routing-instances vpn1 routing-options static route 203.0.113.1/24 discard set routing-instances vpn2 instance-type vrf set routing-instances vpn2 vrf-target target:203:101 set routing-instances vpn2 routing-options static route 203.0.113.2/24 discard set routing-instances vpn3 instance-type vrf set routing-instances vpn3 vrf-target target:203:103 set routing-instances vpn3 routing-options static route 203.0.113.3/24 discard set routing-instances vpn4 instance-type vrf set routing-instances vpn4 vrf-target target:203:104 set routing-instances vpn4 routing-options static route 203.0.113.4/24 discard
デバイスPE1の設定
手順
次の例では、設定階層内のさまざまなレベルに移動する必要があります。CLIのナビゲーションについては、 設定モードでのCLIエディターの使用を参照してください。
デバイスPE1を設定するには:
インターフェイスを設定します。
[edit interfaces] user@PE1# set ge-1/0/0 unit 0 description PE1-to-RR1 user@PE1# set ge-1/0/0 unit 0 family inet address 10.49.0.1/30 user@PE1# set ge-1/0/0 unit 0 family mpls user@PE1#set ge-1/0/1 unit 0 description PE1-to-RR2 user@PE1#set ge-1/0/1 unit 0 family inet address 10.49.10.1/30 user@PE1# set ge-1/0/1 unit 0 family mpls
ルート識別とAS番号を設定します。
[edit routing-options] user@PE1# set route-distinguisher-id 10.255.163.58 user@PE1# set autonomous-system 203
VPN で使用されるシグナリング プロトコルとして LDP を設定します。
[edit protocols ldp] user@PE1# set interface ge-1/0/0 user@PE1# set interface ge-1/0/1
BGPを設定します。
[edit protocols bgp group internal] user@PE1# set type internal user@PE1# set local-address 10.255.163.58 user@PE1# set neighbor 10.255.165.220 family inet-vpn unicast user@PE1# set neighbor 10.255.165.28 family inet-vpn unicast
OSPFを設定します。
[edit protocols ospf area 0.0.0.0] user@PE1# set interface ge-1/0/0 user@PE1# set interface ge-1/0/1 user@PE1# set interface lo0.0 passive
VPN ルーティング インスタンスを設定します。
[edit routing-instances vpn1] user@PE1# set instance-type vrf user@PE1# set vrf-target target:203:100 user@PE1# set routing-options static route 203.0.113.1/24 discard
[edit routing-instances vpn2] user@PE1# set instance-type vrf user@PE1# set vrf-target target:203:101 user@PE1# set routing-options static route 203.0.113.2/24 discard
デバイスの設定が完了したら、設定をコミットします。
[edit] user@PE1# commit
結果
設定モードから、 、show routing-options
show protocols
および のコマンドをshow interfaces
入力して設定をshow routing-instances
確認します。出力結果に意図した設定が表示されない場合は、この例の手順を繰り返して設定を修正します。
user@PE1# show interfaces ge-1/0/0 { unit 0 { description PE1-to-RR1; family inet { address 10.49.0.1/30; } family mpls; } } ge-1/0/1 { unit 0 { description PE1-to-RR2; family inet { address 10.49.10.1/30; } family mpls; } }
user@PE1# show protocols bgp { group internal { type internal; local-address 10.255.163.58; neighbor 10.255.165.220 { family inet-vpn { unicast; } } neighbor 10.255.165.28 { family inet-vpn { unicast; } } } } ospf { area 0.0.0.0 { interface ge-1/0/0.0; interface ge-1/0/1.0; interface lo0.0 { passive; } } } ldp { interface ge-1/0/0.0; interface ge-1/0/1.0; }
user@PE1# show routing-options route-distinguisher-id 10.255.14.182; autonomous-system 203;
user@PE1# show routing-instances vpn1 { instance-type vrf; vrf-target target:203:100; routing-options { static { route 203.0.113.1/24 discard; } } } vpn2 { instance-type vrf; vrf-target target:203:101; routing-options { static { route 203.0.113.2/24 discard; } } }
デバイスRR1の設定
手順
次の例では、設定階層内のさまざまなレベルに移動する必要があります。CLIのナビゲーションについては、 設定モードでのCLIエディターの使用を参照してください。
デバイスRR1を設定するには:
インターフェイスを設定します。
[edit interfaces] user@RR1# set ge-1/0/0 unit 0 description RR1-to-PE1 user@RR1# set ge-1/0/0 unit 0 family inet address 10.49.0.2/30 user@RR1# set ge-1/0/0 unit 0 family mpls user@RR1# set ge-1/0/1 unit 0 description RR1-to-PE2 user@RR1# set ge-1/0/1 unit 0 family inet address 10.50.0.2/30 user@RR1# set ge-1/0/1 unit 0 family mpls
ルート識別とAS番号を設定します。
[edit routing-options] user@RR1# set route-distinguisher-id 10.255.165.220 user@RR1# set autonomous-system 203
VPN で使用されるシグナリング プロトコルとして LDP を設定します。
[edit protocols ldp] user@RR1# set interface ge-1/0/0 user@RR1# set interface ge-1/0/1
BGPを設定します。
[edit protocols bgp group internal] user@RR1# set type internal user@RR1# set local-address 10.255.165.220 user@RR1# set cluster 198.51.100.1 user@RR1# set neighbor 10.255.163.58 description vpn1-to-pe1 family inet-vpn unicast user@RR1# set neighbor 10.255.168.42 description vpn1-to-pe2 family inet-vpn unicast
デバイスPE2とのピアリングセッションでBGPルートターゲットフィルタリングを設定します。
[edit protocols bgp group internal] user@RR1# set neighbor 10.255.168.42 family route-target
デバイスPE1とのピアリングセッションでプロキシBGPルートターゲットフィルタリングを設定します。
[edit protocols bgp group internal] user@RR1# set neighbor 10.255.163.58 family route-target proxy-generate
OSPFを設定します。
[edit protocols ospf area 0.0.0.0] user@RR1# set interface ge-1/0/0 user@RR1# set interface ge-1/0/1 user@RR1# set interface lo0.0 passive
デバイスの設定が完了したら、設定をコミットします。
[edit] user@RR1# commit
結果
設定モードから、 、 、 show protocols
コマンドを入力して設定をshow interfaces
show routing-options
確認します。出力結果に意図した設定が表示されない場合は、この例の手順を繰り返して設定を修正します。
user@RR1# show interfaces ge-1/0/0 { unit 0 { description RR1-to-PE1; family inet { address 10.49.0.2/30; } family mpls; } } ge-1/0/1 { unit 0 { description RR1-to-PE2; family inet { address 10.50.0.2/30; } family mpls; } }
user@RR1# show protocols bgp { group internal { type internal; local-address 198.51.100.0; cluster 198.51.100.1; neighbor 10.255.163.58 { description vpn1-to-pe1; family inet-vpn { unicast; } family route-target { proxy-generate; } } neighbor 10.255.168.42 { description vpn1-to-pe2; family inet-vpn { unicast; } family route-target; } } } ospf { area 0.0.0.0 { interface ge-1/0/0.0; interface ge-1/0/1.0; interface lo0.0 { passive; } } } ldp { interface ge-1/0/0.0; interface ge-1/0/1.0; } ospf { area 0.0.0.0 { interface ge-1/0/0.0; interface ge-1/0/1.0; interface lo0.0 { passive; } } } ldp { interface ge-1/0/0.0; interface ge-1/0/1.0; }
user@RR1# show routing-options route-distinguisher-id 10.255.165.220; autonomous-system 203;
デバイスRR2の設定
手順
次の例では、設定階層内のさまざまなレベルに移動する必要があります。CLIのナビゲーションについては、 設定モードでのCLIエディターの使用を参照してください。
デバイスRR2を設定するには:
インターフェイスを設定します。
[edit interfaces] user@RR2# set ge-1/0/0 unit 0 description RR2-to-PE1 user@RR2# set ge-1/0/0 unit 0 family inet address 10.49.10.2/30 user@RR2# set ge-1/0/0 unit 0 family mpls user@RR2# set ge-1/0/1 unit 0 description RR2-to-PE2 user@RR2# set ge-1/0/1 unit 0 family inet address 10.50.10.2/30 user@RR2# set ge-1/0/1 unit 0 family mpls
ルート識別とAS番号を設定します。
[edit routing-options] user@RR2# set route-distinguisher-id 10.255.165.28 user@RR2# set autonomous-system 203
VPN で使用されるシグナリング プロトコルとして LDP を設定します。
[edit protocols ldp] user@RR2# set interface ge-1/0/0 user@RR2# set interface ge-1/0/1
BGPを設定します。
[edit protocols bgp group internal] user@RR2# set type internal user@RR2# set local-address 10.255.165.28 user@RR2# set cluster 198.51.100.1 user@RR2# set neighbor 10.255.163.58 description vpn2-to-pe1 family inet-vpn unicast user@RR2# set neighbor 10.255.168.42 description vpn2-to-pe2 family inet-vpn unicast
デバイスPE2とのピアリングセッションでBGPルートターゲットフィルタリングを設定します。
[edit protocols bgp group internal] user@RR2# set neighbor 10.255.168.42 family route-target
デバイスPE1とのピアリングセッションでプロキシBGPルートターゲットフィルタリングを設定します。
[edit protocols bgp group internal] user@RR2# set neighbor 10.255.163.58 family route-target proxy-generate
OSPFを設定します。
[edit protocols ospf area 0.0.0.0] user@RR2# set interface ge-1/0/0 user@RR2# set interface ge-1/0/1 user@RR2# set interface lo0.0 passive
デバイスの設定が完了したら、設定をコミットします。
[edit] user@RR2# commit
結果
設定モードから、 、 、 show protocols
コマンドを入力して設定をshow interfaces
show routing-options
確認します。出力結果に意図した設定が表示されない場合は、この例の手順を繰り返して設定を修正します。
user@RR2# show interfaces ge-1/0/0 { unit 0 { description RR2-to-PE1; family inet { address 10.49.10.2/30; } family mpls; } } ge-1/0/1 { unit 0 { description RR2-to-PE2; family inet { address 10.50.10.2/30; } family mpls; } }
user@RR2# show protocols bgp { group internal { local-address 10.255.165.28; cluster 198.51.100.1; neighbor 10.255.163.58 { description vpn2-to-pe1; family inet-vpn { unicast; } family route-target { proxy-generate; } } neighbor 10.255.168.42 { description vpn2-to-pe2; family inet-vpn { unicast; } family route-target; } } } ospf { area 0.0.0.0 { interface ge-1/0/0.0; interface ge-1/0/1.0; interface lo0.0 { passive; } } } ldp { interface ge-1/0/0.0; interface ge-1/0/1.0; }
user@RR2# show routing-options route-distinguisher-id 10.255.165.28; autonomous-system 203;
デバイスPE2の設定
手順
次の例では、設定階層内のさまざまなレベルに移動する必要があります。CLIのナビゲーションについては、 設定モードでのCLIエディターの使用を参照してください。
デバイスPE2を設定するには:
インターフェイスを設定します。
[edit interfaces] user@PE2# set ge-1/0/0 unit 0 description PE2-to-RR1 user@PE2# set ge-1/0/0 unit 0 family inet address 10.50.0.1/30 user@PE2# set ge-1/0/0 unit 0 family mpls user@PE2#set ge-1/0/1 unit 0 description PE2-to-RR2 user@PE2#set ge-1/0/1 unit 0 family inet address 10.50.10.2/30 user@PE2# set ge-1/0/1 unit 0 family mpls
ルート識別とAS番号を設定します。
[edit routing-options] user@PE2# set route-distinguisher-id 10.255.168.42 user@PE2# set autonomous-system 203
VPN で使用されるシグナリング プロトコルとして LDP を設定します。
[edit protocols ldp] user@PE2# set interface ge-1/0/0 user@PE2# set interface ge-1/0/1
BGPを設定します。
[edit protocols bgp group internal] user@PE2# set type internal user@PE2# set local-address 10.255.168.42 user@PE2# set family inet-vpn unicast user@PE2# set family route-target user@PE2# set neighbor 10.255.165.220 user@PE2# set neighbor 10.255.165.28
OSPFを設定します。
[edit protocols ospf area 0.0.0.0] user@PE2# set interface ge-1/0/0 user@PE2# set interface ge-1/0/1 user@PE2# set interface lo0.0 passive
VPN ルーティング インスタンスを設定します。
[edit routing-instances vpn1] user@PE2# set instance-type vrf user@PE2# set vrf-target target:203:100 user@PE2# set routing-options static route 203.0.113.1/24 discard
[edit routing-instances vpn2] user@PE2# set instance-type vrf user@PE2# set vrf-target target:203:101 user@PE2# set routing-options static route 203.0.113.2/24 discard
[edit routing-instances vpn3] user@PE2# set instance-type vrf user@PE2# set vrf-target target:203:103 user@PE2# set routing-options static route 203.0.113.3/24 discard
[edit routing-instances vpn4] user@PE2# set instance-type vrf user@PE2# set vrf-target target:203:104 user@PE2# set routing-options static route 203.0.113.4/24 discard
エクスポートルーティングポリシーを設定および適用します。
[edit policy-options] user@PE2# set rtf-prefix-list exclude-103 203:203:103/96 [edit policy-options policy-statement filter-rtc] user@PE2# set from family route-target user@PE2# set from rtf-prefix-list exclude-103 user@PE2# set then reject [edit protocols bgp group internal] user@PE2# set neighbor 10.255.165.220 export filter-rtc
デバイスの設定が完了したら、設定をコミットします。
[edit] user@PE2# commit
結果
設定モードから、 、show routing-options
show protocols
show policy-options
および のコマンドをshow interfaces
入力して、設定をshow routing-instances
確認します。出力結果に意図した設定が表示されない場合は、この例の手順を繰り返して設定を修正します。
user@PE2# show interfaces ge-1/0/0 { unit 0 { description PE2-to-RR1; family inet { address 10.50.0.1/30; } family mpls; } } ge-1/0/1 { unit 0 { description PE2-to-RR2; family inet { address 10.50.10.2/30; } family mpls; } }
user@PE2# show protocols bgp { group internal { type internal; local-address 10.255.168.42; family inet-vpn { unicast; } family route-target; neighbor 10.255.165.220 { export filter-rtc; } neighbor 10.255.165.28; } } ospf { area 0.0.0.0 { interface ge-1/0/0.0; interface ge-1/0/1.0; interface lo0.0 { passive; } } } ldp { interface ge-1/0/0.0; interface ge-1/0/1.0; }
user@PE2# show routing-options route-distinguisher-id 10.255.168.42; autonomous-system 203;
user@PE2# show policy-options policy-statement filter-rtc { from { family route-target; rtf-prefix-list exclude-103; } then reject; } rtf-prefix-list exclude-103 { 203:203:103/96; }
user@PE2# show routing-instances vpn1 { instance-type vrf; vrf-target target:203:100; routing-options { static { route 203.0.113.1/24 discard; } } } vpn2 { instance-type vrf; vrf-target target:203:101; routing-options { static { route 203.0.113.2/24 discard; } } } vpn3 { instance-type vrf; vrf-target target:203:103; routing-options { static { route 203.0.113.3/24 discard; } } } vpn4 { instance-type vrf; vrf-target target:203:104; routing-options { static { route 203.0.113.4/24 discard; } } }
検証
設定が正しく機能していることを確認します。
デバイスRR1のbgp.rtarget.0ルーティングテーブル内のルートを検証する
目的
vpn3のルートプレフィックスがデバイスRR1のbgp.rtarget.0テーブルにないことを確認します。デバイスPE2のエクスポートポリシーは、デバイスRR1へのvpn3ルートのアドバタイズを防ぐために適用されたので、デバイスRR1はこれらのアドバタイズを受信しないでください。
アクション
動作モードから、 コマンドを show route advertising-protocol bgp 10.255.165.220 table bgp.rtarget.0
入力します。
user@PE2# show route advertising-protocol bgp 10.255.165.220 table bgp.rtarget.0
bgp.rtarget.0: 4 destinations, 11 routes
(4 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
203:203:100/96 * Self 100 I
203:203:101/96 * Self 100 I
203:203:104/96 * Self 100 I
意味
bgp.rtartget.0 テーブルには、vpn3 のルート プレフィックスである 203:203:103/96 は表示されません。つまり、エクスポートポリシーが正しく適用されているということです。
デバイスRR2のbgp.rtarget.0ルーティングテーブル内のルートを検証する
目的
vpn3のルートプレフィックスがデバイスRR2のbgp.rtarget.0テーブルであることを確認します。デバイスRR2へのvpn3ルートのアドバタイズを防ぐために、エクスポートポリシーがデバイスPE2に適用されていないため、デバイスRR2はすべてのVPNからアドバタイズを受信する必要があります。
アクション
動作モードから、 コマンドを show route advertising-protocol bgp 10.255.165.28 table bgp.rtarget.0
入力します。
user@PE2# show route advertising-protocol bgp 10.255.165.28 table bgp.rtarget.0
bgp.rtarget.0: 4 destinations, 11 routes (4 active, 0 holddown, 0 hidden)
(4 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
203:203:100/96 * Self 100 I
203:203:101/96 * Self 100 I
203:203:103/96 * Self 100 I
203:203:104/96 * Self 100 I
意味
bgp.rtartget.0 テーブルには、すべての VPN のルート プレフィックスが表示されます。
例:ルート フィルターのレイヤー 3 VPN プロトコル ファミリー修飾子の設定
この例では、BGPインポートポリシーにファミリー修飾子を設定することで、BGPインポートポリシーのスコープを制御する方法を示しています。ファミリー修飾子は、タイプ inet
、 、inet6
inet-vpn
または のルートを指定しますinet6-vpn
。
要件
この例では、Junos OS リリース 10.0 以降を使用しています。
開始する前に、以下を行います。
デバイス インターフェイスを設定します。
内部ゲートウェイプロトコルを設定します。 Junos OS ルーティング プロトコル ライブラリを参照してください。
複数のルートタイプに対してBGPセッションを設定します。例えば、ファミリールートとファミリー
inet
ルートの両方に対してinet-vpn
セッションを設定します。 VPN における PE ルーター間の IBGP セッションの 設定と 、IPv6 トラフィックを伝送するためのレイヤー 3 VPN の設定を参照してください。
概要
ファミリー修飾子により、ルート フィルターは 1 つの特定のファミリーにのみ一致します。ここに示すように、ファミリー修飾子なしでIPv4ルートフィルターを設定すると、ルートフィルターは一致 inet
し inet-vpn
、ルートになります。
route-filter ipv4-address/mask;
同様に、ここに示すようにファミリー修飾子なしでIPv6ルートフィルターを設定すると、ルートフィルターが一致 inet6
し inet6-vpn
、ルートになります。
route-filter ipv6-address/mask;
BGPセッションがファミリールートとファミリー inet
inet-vpn
ルートの両方に設定されており、このBGPセッションに対してインポートポリシーが設定されている場合を考慮してください。これは、受け取ったファミリー inet
ルートとファミリー inet-vpn
ルートの両方が、同じインポートポリシーを共有することを意味します。ポリシー条件は次のようになります。
from { route-filter 0.0.0.0/0 exact; } then { next-hop self; accept; }
このルートフィルター論理は、 inet
0.0.0.0 のルートと、 inet-vpn
IPv4 アドレス部分が 0.0.0.0 であるルートと一致します。ルートの 8 バイト ルート区別部分 inet-vpn
は、ルート フィルターマッチングでは考慮されません。これは、Junos OSリリース10.0で導入されたJunos OS動作の変更です。
両方のタイプのルートにポリシーを一致させたい場合は、ファミリー修飾子をポリシーに追加します。ルートフィルターがルートのみに inet
一致するようにするには、ファミリー inet
ポリシー修飾子を追加します。ルートフィルターがルートのみに inet-vpn
一致するようにするには、ファミリー inet-vpn
ポリシー修飾子を追加します。
ファミリー修飾子は、ルートフィルターが評価される前に評価されます。したがって、ファミリー一致に失敗した場合、ルートフィルターは評価されません。同じロジックは、ファミリーとファミリー inet6
inet6-vpn
に適用されます。この例で使用する inet6
ルートフィルターは、IPv6アドレスを使用する必要があります。ファミリー修飾子を使用すると、他のほとんどの修飾子より前にファミリー修飾子がテストされ、望ましくないファミリからのルートをすばやく削除できるため、効率が向上する可能性があります。
構成
手順
CLI クイックコンフィギュレーション
この例を迅速に設定するには、以下のコマンドをコピーしてテキスト ファイルに貼り付け、改行を削除し、ネットワーク設定に合わせて必要な詳細を変更し、コマンドを 階層レベルの CLI [edit]
にコピー アンド ペーストします。
inet の例
set policy-options policy-statement specific-family from family inet set policy-options policy-statement specific-family from route-filter 0.0.0.0/0 exact set policy-options policy-statement specific-family then next-hop self set policy-options policy-statement specific-family then accept set protocols bgp import specific-family
Inet-vpn の例
set policy-options policy-statement specific-family from family inet-vpn set policy-options policy-statement specific-family from route-filter 0.0.0.0/0 exact set policy-options policy-statement specific-family then next-hop self set policy-options policy-statement specific-family then accept set protocols bgp import specific-family
inet6の例
set policy-options policy-statement specific-family from family inet6 set policy-options policy-statement specific-family from route-filter 0::0/0 exact set policy-options policy-statement specific-family then next-hop self set policy-options policy-statement specific-family then accept set protocols bgp import specific-family
Inet6-vpnの例
set policy-options policy-statement specific-family from family inet6-vpn set policy-options policy-statement specific-family from route-filter 0::0/0 exact set policy-options policy-statement specific-family then next-hop self set policy-options policy-statement specific-family then accept set protocols bgp import specific-family
手順
次の例では、設定階層内のさまざまなレベルに移動する必要があります。CLIのナビゲーションについては、 CLIユーザーガイドの設定モードでのCLIエディターの使用を参照してください。
フローマップを設定するには:
ファミリー修飾子を設定します。
[edit policy-options] user@host# set policy-statement specific-family from family inet
ルートフィルターを設定します。
[edit policy-options] user@host# set policy-statement specific-family from route-filter 0.0.0.0/0 exact
ポリシーアクションを設定します。
[edit policy-options] user@host# set policy-statement specific-family then next-hop self user@host# set policy-statement specific-family then accept
ポリシーを適用します。
[edit protocols bgp] user@host# set import specific-family
結果
設定モードから、 および show policy-options
コマンドを発行して設定をshow protocols
確認します。出力結果に意図した設定が表示されない場合は、この例の手順を繰り返して設定を修正します。
user@host# show protocols bgp { import specific-family; } user@host# show policy-options policy-statement specific-family { from { family inet; route-filter 0.0.0.0/0 exact; } then { next-hop self; accept; } }
デバイスの設定が完了したら、設定モードから を入力します commit 。
特定のルートフィルターポリシーが必要な各プロトコルファミリーに対して、手順を繰り返します。
検証
設定を確認するには、以下のコマンドを実行します。
show route advertising-protocol bgp neighbor detail
show route instance instance-name detail
VPNのプロキシBGPルートターゲットフィルタリングについて
BGPルートターゲットフィルタリング(ルートターゲット制約、RTCとも呼ばれます)では、VPNルートを必要なデバイスにのみ配信できます。BGPルートターゲットフィルタリングが設定されていないVPNネットワークでは、BGPはすべてのVPNルートをすべてのVPNピアデバイスに配信し、ネットワークリソースに負担がかかる可能性があります。ルート ターゲット フィルタリング機能を導入すると、VPN ルートと VPN ルーティングの更新を受信するデバイスの数が減り、VPN の実行に関連するオーバーヘッドの量が制限されました。BGP ルート ターゲット フィルタリングの Junos OS の実装は、RFC 4684、 Constrained Route Distribution for Border Gateway Protocol/MultiProtocol Label Switching (BGP/MPLS) Internet Protocol (IP) Virtual Private Networks (VPNs)に基づいています。
ルートターゲットフィルタリングが広く導入されていないネットワーク環境がある場合や、ルートターゲットフィルタリングをサポートしていないデバイスがある場合はどうなりますか?例えば、ルート・ターゲット・フィルタリングが有効になっている BGP スピーカーを、ルート・ターゲット・フィルタリングをサポートしていない、またはルート・ターゲット・フィルタリングが設定されている BGP スピーカーとピアリングしている場合があります。この場合、ルートターゲットフィルタリングが設定されたBGPスピーカーは、ピアに代わってデフォルトルートターゲットメンバーシップ(RTメンバーシップ)をアドバタイズする必要があります。フィルタリングをサポートするデバイスは、フィルターをサポートしていないデバイスにすべての VPN ルートを送信する必要があるため、リソース節約のルート ターゲットは未実現です。プロキシーBGPルートターゲットフィルタリング(または Proxy RTC)は、ルートターゲットフィルタリングをサポートしていないデバイスのRTメンバーシップの生成を可能にします。これにより、不完全に導入されているか、完全にサポートされていないネットワークでのルート ターゲット フィルタリングの導入が容易になります。
プロキシBGPルートターゲットフィルタリングでは、受信したBGP VPNルートから作成されたプロキシRTメンバーシップアドバタイズメントを、それらを必要とするネットワーク内の他のデバイスに配信できます。これはプロキシアドバタイズメントと呼ばれ、デバイスがルートターゲットフィルタリング機能を使用せずにピアに代わってRTメンバーシップを作成するためです。プロキシーBGPルートターゲットフィルタリングは、特定のBGPスピーカーにエクスポートされるBGPルートターゲット拡張コミュニティを使用してルートターゲットを生成します。生成されたプロキシ RTC ルートは、bgp.rtarget.0 ルーティング テーブルに保存されます。
プロキシ RTC ルートの生成に使用する VPN ルートを制御するポリシーを設定することもできます。これにより、プロキシ デバイスによって生成される RT メンバーシップを制御できます。さらに、ポリシーを設定して、プロキシ RTC に関連するメモリオーバーヘッドを削減できます。プロキシー RTC は、RT メンバーシップの生成にポリシーを使用することが許可されている場合にのみ、VPN ルートごとに追加メモリを使用します。
例:VPNのプロキシBGPルートターゲットフィルタリングの設定
この例では、プロキシBGPルートターゲットフィルタリング(プロキシルートターゲット制約、またはプロキシRTCとも呼ばれます)を設定する方法を示します。
要件
この例では、以下のハードウェアとソフトウェアのコンポーネントを使用しています。
M シリーズ、MX シリーズ、または T シリーズ ルーターの組み合わせが可能な 4 台のジュニパーネットワークス デバイス。
プロキシBGPルートフィルタリング用に設定された1つ以上のデバイス上のJunos OSリリース12.2以降。この例では、ルートリフレクタにプロキシBGPルートフィルタリングを明示的に設定します。
プロキシBGPルートターゲットフィルタリングを設定する前に、以下の概念に精通し、理解していることを確認してください。
概要
ルート ターゲット フィルタリングは、不要な VPN ルートを受信するネットワーク内のデバイスの数を減らします。プロキシBGPルートターゲットフィルタリングにより、ネットワークは、この機能が現在サポートされていない場所でルートターゲットフィルタリングを活用できます。この機能を設定することで、ネットワークが BGP ルート ターゲット フィルタリングを完全にサポートしている場合に利用できるのと同じネットワーク リソースの多くを実現できます。
プロキシBGPルートターゲットフィルタリングを設定するには、BGPルートターゲットフィルタリングを family route-target proxy-generate
サポートしていないデバイスにプロキシルートターゲットメンバーシップ(RTメンバーシップ)アドバタイズメントを配布するデバイスに ステートメントを含めます。その後、プロキシBGPルートターゲットフィルタリングルートは、bgp.rtarget.0ルーティングテーブルに格納されます。
プロキシーBGPルートターゲットフィルタリングは、BGPルートターゲットフィルタリング機能をサポートしていないデバイスに対してRTメンバーシップアドバタイズを作成することを目的としています。 proxy-generate
ステートメントが存在するが、ルートターゲットファミリーがBGPピアとネゴシエートされている場合、プロキシ生成機能は無効になります。これにより、グループ内のピアの一部がルートターゲットフィルタリングをサポートしているが、それ以外はサポートしないBGPピアグループの簡単な設定が可能になります。このような例では、 ステートメントが family route-target proxy-generate
BGPピアグループ設定の一部である可能性があります。
ネットワークにプロキシBGPルートターゲットフィルタリングを展開する場合、BGPルートターゲットフィルタリングのステートメントにより、 advertise-default
デバイスはデフォルトルートターゲットルート(0:0:0/0)をアドバタイズし、より具体的なすべてのルートを抑制します。1つのデバイスにプロキシBGPルートターゲットフィルタリングが設定されており、1つ以上のピア advertise-default
がBGPルートターゲットフィルタリング設定の一部としてステートメントを設定している場合、アドバタイズデフォルト設定は無視されます。
トポロジー図
図 3 は、この例で使用したトポロジーを示しています。
この例では、BGPルートターゲットフィルタリングは、ルートリフレクタ(デバイスRR1およびデバイスRR2)とプロバイダーエッジ(PE)デバイスPE2で設定されていますが、もう1つのPEであるデバイスPE1は、BGPルートターゲットフィルタリング機能をサポートしていません。デバイスPE2には、4つのVPN(vpn1、vpn2、vpn3、vpn4)が設定されています。デバイスPE1には2つのVPN(vpn1およびvpn2)が設定されているため、このデバイスはvpn1とvpn2のルート更新の受信にのみ関心があります。現在、これは不可能です。ルートリフレクタ(デバイスRR1とデバイスRR2)の両方が、すべての着信VPNルート(vpn1~vpn4)に関する情報をデバイスPE1で学習し、共有するためです。サンプルトポロジーでは、すべてのデバイスが自律システム(AS)203に参加し、OSPFは設定された内部ゲートウェイプロトコル(IGP)であり、LDPはVPNで使用されるシグナリングプロトコルです。この例では、VPNルーティングおよび転送(VRF)インスタンスで静的ルートを使用してVPNルートを生成します。これは、OSPFやBGPなどのPEからカスタマーエッジ(CE)プロトコルを使用する代わりに行われます。
デバイスPE1で処理されるVPNルート更新の数を最小限に抑えるために、各ルートリフレクタにプロキシBGPルートターゲットフィルタリングを設定する ステートメントを含 family route-target proxy-generate
めます。各ルートリフレクタは、デバイスPE1とのピアリングセッションを持ち、コアへのルートターゲットフィルタリングをサポートしています。ただし、デバイス PE1 はルート ターゲット フィルタリングをサポートしていないため、すべての VPN アップデートを受信するため、ネットワーク リソースの節約はデバイス PE1 によって実現されません。デバイスPE1に接続するピアリングセッションにプロキシBGPルートターゲットフィルタリングを設定することで、デバイスPE1で処理されるVPN更新の数を制限し、ルートリフレクタはネットワーク全体でデバイスPE1のプロキシBGPルートターゲットルートを生成します。
構成
CLI クイックコンフィギュレーション
この例を迅速に設定するには、以下のコマンドをコピーしてテキスト ファイルに貼り付け、改行を削除し、ネットワーク設定に合わせて必要な詳細を変更し、コマンドを 階層レベルの CLI [edit]
にコピー アンド ペーストします。
デバイスPE1
set interfaces ge-1/0/0 unit 0 description PE1-to-RR1 set interfaces ge-1/0/0 unit 0 family inet address 10.49.0.1/30 set interfaces ge-1/0/0 unit 0 family mpls set interfaces ge-1/0/1 unit 0 description PE1-to-RR2 set interfaces ge-1/0/1 unit 0 family inet address 10.49.10.1/30 set interfaces ge-1/0/1 unit 0 family mpls set protocols ldp interface ge-1/0/0 set protocols ldp interface ge-1/0/1 set protocols bgp group internal type internal set protocols bgp group internal local-address 10.255.163.58 set protocols bgp group internal neighbor 10.255.165.220 family inet-vpn unicast set protocols bgp group internal neighbor 10.255.165.28 family inet-vpn unicast set protocols ospf area 0.0.0.0 interface ge-1/0/0 set protocols ospf area 0.0.0.0 interface ge-1/0/1 set protocols ospf area 0.0.0.0 interface lo0.0 passive set routing-options route-distinguisher-id 10.255.163.58 set routing-options autonomous-system 203 set routing-instances vpn1 instance-type vrf set routing-instances vpn1 vrf-target target:203:100 set routing-instances vpn1 routing-options static route 203.0.113.1/24 discard set routing-instances vpn2 instance-type vrf set routing-instances vpn2 vrf-target target:203:101 set routing-instances vpn2 routing-options static route 203.0.113.2/24 discard
デバイスRR1
set interfaces ge-1/0/0 unit 0 description RR1-to-PE1 set interfaces ge-1/0/0 unit 0 family inet address 10.49.0.2/30 set interfaces ge-1/0/0 unit 0 family mpls set interfaces ge-1/0/1 unit 0 description RR1-to-PE2 set interfaces ge-1/0/1 unit 0 family inet address 10.50.0.2/30 set interfaces ge-1/0/1 unit 0 family mpls set protocols ldp interface ge-1/0/0 set protocols ldp interface ge-1/0/1 set protocols bgp group internal type internal set protocols bgp group internal local-address 198.51.100.1 set protocols bgp group internal cluster 198.51.100.1 set protocols bgp group internal neighbor 10.255.163.58 description vpn1-to-pe1 family inet-vpn unicast set protocols bgp group internal neighbor 10.255.163.58 family route-target proxy-generate set protocols bgp group internal neighbor 10.255.168.42 description vpn1-to-pe2 family inet-vpn unicast set protocols bgp group internal neighbor 10.255.168.42 family route-target set protocols ospf area 0.0.0.0 interface ge-1/0/0 set protocols ospf area 0.0.0.0 interface ge-1/0/1 set protocols ospf area 0.0.0.0 interface lo0.0 passive set routing-options route-distinguisher-id 10.255.165.220 set routing-options autonomous-system 203
デバイスRR2
set interfaces ge-1/0/0 unit 0 description RR2-to-PE1 set interfaces ge-1/0/0 unit 0 family inet address 10.49.10.2/30 set interfaces ge-1/0/0 unit 0 family mpls set interfaces ge-1/0/1 unit 0 description RR2-to-PE2 set interfaces ge-1/0/1 unit 0 family inet address 10.50.10.2/30 set interfaces ge-1/0/1 unit 0 family mpls set protocols ldp interface ge-1/0/0 set protocols ldp interface ge-1/0/1 set protocols bgp group internal type internal set protocols bgp group internal local-address 10.255.165.28 set protocols bgp group internal cluster 198.51.100.1 set protocols bgp group internal neighbor 10.255.163.58 description vpn2-to-pe1 family inet-vpn unicast set protocols bgp group internal neighbor 10.255.163.58 family route-target proxy-generate set protocols bgp group internal neighbor 10.255.168.42 description vpn2-to-pe2 family inet-vpn unicast set protocols bgp group internal neighbor 10.255.168.42 family route-target set protocols ospf area 0.0.0.0 interface ge-1/0/0 set protocols ospf area 0.0.0.0 interface ge-1/0/1 set protocols ospf area 0.0.0.0 interface lo0.0 passive set routing-options route-distinguisher-id 10.255.165.28 set routing-options autonomous-system 203
デバイスPE2
set interfaces ge-1/0/0 unit 0 description PE2-to-RR1 set interfaces ge-1/0/0 unit 0 family inet address 10.50.0.1/30 set interfaces ge-1/0/0 unit 0 family mpls set interfaces ge-1/0/1 unit 0 description PE2-to-RR2 set interfaces ge-1/0/1 unit 0 family inet address 10.50.10.1/30 set interfaces ge-1/0/1 unit 0 family mpls set protocols ldp interface ge-1/0/0 set protocols ldp interface ge-1/0/1 set protocols bgp group internal type internal set protocols bgp group internal local-address 10.255.168.42 set protocols bgp group internal family inet-vpn unicast set protocols bgp group internal family route-target set protocols bgp group internal neighbor 10.255.165.220 set protocols bgp group internal neighbor 10.255.165.28 set protocols ospf area 0.0.0.0 interface ge-1/0/0 set protocols ospf area 0.0.0.0 interface ge-1/0/1 set protocols ospf area 0.0.0.0 interface lo0.0 passive set routing-options route-distinguisher-id 10.255.168.42 set routing-options autonomous-system 203 set routing-instances vpn1 instance-type vrf set routing-instances vpn1 vrf-target target:203:100 set routing-instances vpn1 routing-options static route 203.0.113.1/24 discard set routing-instances vpn2 instance-type vrf set routing-instances vpn2 vrf-target target:203:101 set routing-instances vpn2 routing-options static route 203.0.113.2/24 discard set routing-instances vpn3 instance-type vrf set routing-instances vpn3 vrf-target target:203:103 set routing-instances vpn3 routing-options static route 203.0.113.3/24 discard set routing-instances vpn4 instance-type vrf set routing-instances vpn4 vrf-target target:203:104 set routing-instances vpn4 routing-options static route 203.0.113.4/24 discard
デバイスPE1の設定
手順
次の例では、設定階層内のさまざまなレベルに移動する必要があります。CLIのナビゲーションについては、 設定モードでのCLIエディターの使用を参照してください。
デバイスPE1を設定するには:
インターフェイスを設定します。
[edit interfaces] user@PE1# set ge-1/0/0 unit 0 description PE1-to-RR1 user@PE1# set ge-1/0/0 unit 0 family inet address 10.49.0.1/30 user@PE1# set ge-1/0/0 unit 0 family mpls user@PE1# set ge-1/0/1 unit 0 description PE1-to-RR2 user@PE1# set ge-1/0/1 unit 0 family inet address 10.49.10.1/30 user@PE1# set ge-1/0/1 unit 0 family mpls
ルート識別とAS番号を設定します。
[edit routing-options] user@PE1# set route-distinguisher-id 10.255.163.58 user@PE1# set autonomous-system 203
VPN で使用されるシグナリング プロトコルとして LDP を設定します。
[edit protocols ldp] user@PE1# set interface ge-1/0/0 user@PE1# set interface ge-1/0/1
BGPを設定します。
[edit protocols bgp group internal] user@PE1# set type internal user@PE1# set local-address 10.255.163.58 user@PE1# set neighbor 10.255.165.220 family inet-vpn unicast user@PE1# set neighbor 10.255.165.28 family inet-vpn unicast
OSPFを設定します。
[edit protocols ospf area 0.0.0.0] user@PE1# set interface ge-1/0/0 user@PE1# set interface ge-1/0/1 user@PE1# set interface lo0.0 passive
VPN ルーティング インスタンスを設定します。
[edit routing-instances vpn1] user@PE1# set instance-type vrf user@PE1# set vrf-target target:203:100 user@PE1# set routing-options static route 203.0.113.1/24 discard
[edit routing-instances vpn2] user@PE1# set instance-type vrf user@PE1# set vrf-target target:203:101 user@PE1# set routing-options static route 203.0.113.2/24 discard
デバイスの設定が完了したら、設定をコミットします。
[edit] user@PE1# commit
結果
設定モードから、 、show routing-options
show protocols
および のコマンドをshow interfaces
入力して設定をshow routing-instances
確認します。出力結果に意図した設定が表示されない場合は、この例の手順を繰り返して設定を修正します。
user@PE1# show interfaces ge-1/0/0 { unit 0 { description PE1-to-RR1; family inet { address 10.49.0.1/30; } family mpls; } } ge-1/0/1 { unit 0 { description PE1-to-RR2; family inet { address 10.49.10.1/30; } family mpls; } }
user@PE1# show protocols bgp { group internal { type internal; local-address 10.255.163.58; neighbor 10.255.165.220 { family inet-vpn { unicast; } } neighbor 10.255.165.28 { family inet-vpn { unicast; } } } } ospf { area 0.0.0.0 { interface ge-1/0/0.0; interface ge-1/0/1.0; interface lo0.0 { passive; } } } ldp { interface ge-1/0/0.0; interface ge-1/0/1.0; }
user@PE1# show routing-options route-distinguisher-id 10.255.14.182; autonomous-system 203;
user@PE1# show routing-instances vpn1 { instance-type vrf; vrf-target target:203:100; routing-options { static { route 203.0.113.1/24 discard; } } } vpn2 { instance-type vrf; vrf-target target:203:101; routing-options { static { route 203.0.113.2/24 discard; } } }
デバイスRR1の設定
手順
次の例では、設定階層内のさまざまなレベルに移動する必要があります。CLIのナビゲーションについては、 設定モードでのCLIエディターの使用を参照してください。
デバイスRR1を設定するには:
インターフェイスを設定します。
[edit interfaces] user@RR1# set ge-1/0/0 unit 0 description RR1-to-PE1 user@RR1# set ge-1/0/0 unit 0 family inet address 10.49.0.2/30 user@RR1# set ge-1/0/0 unit 0 family mpls user@RR1# set ge-1/0/1 unit 0 description RR1-to-PE2 user@RR1# set ge-1/0/1 unit 0 family inet address 10.50.0.2/30 user@RR1# set ge-1/0/1 unit 0 family mpls
ルート識別とAS番号を設定します。
[edit routing-options] user@RR1# set route-distinguisher-id 10.255.165.220 user@RR1# set autonomous-system 203
VPN で使用されるシグナリング プロトコルとして LDP を設定します。
[edit protocols ldp] user@RR1# set interface ge-1/0/0 user@RR1# set interface ge-1/0/1
BGPを設定します。
[edit protocols bgp group internal] user@RR1# set type internal user@RR1# set local-address 10.255.165.220 user@RR1# set cluster 198.51.100.1 user@RR1# set neighbor 10.255.163.58 description vpn1-to-pe1 family inet-vpn unicast user@RR1# set neighbor 10.255.168.42 description vpn1-to-pe2 family inet-vpn unicast
デバイスPE2とのピアリングセッションでBGPルートターゲットフィルタリングを設定します。
[edit protocols bgp group internal] user@RR1# set neighbor 10.255.168.42 family route-target
デバイスPE1とのピアリングセッションでプロキシBGPルートターゲットフィルタリングを設定します。
[edit protocols bgp group internal] user@RR1# set neighbor 10.255.163.58 family route-target proxy-generate
OSPFを設定します。
[edit protocols ospf area 0.0.0.0] user@RR1# set interface ge-1/0/0 user@RR1# set interface ge-1/0/1 user@RR1# set interface lo0.0 passive
デバイスの設定が完了したら、設定をコミットします。
[edit] user@RR1# commit
結果
設定モードから、 、 show protocols
および show routing-options
コマンドを入力して設定をshow interfaces
確認します。出力結果に意図した設定が表示されない場合は、この例の手順を繰り返して設定を修正します。
user@RR1# show interfaces ge-1/0/0 { unit 0 { description RR1-to-PE1; family inet { address 10.49.0.2/30; } family mpls; } } ge-1/0/1 { unit 0 { description RR1-to-PE2; family inet { address 10.50.0.2/30; } family mpls; } }
user@RR1# show protocols bgp { group internal { type internal; local-address 198.51.100.1; cluster 198.51.100.1; neighbor 10.255.163.58 { description vpn1-to-pe1; family inet-vpn { unicast; } family route-target { proxy-generate; } } neighbor 10.255.168.42 { description vpn1-to-pe2; family inet-vpn { unicast; } family route-target; } } } ospf { area 0.0.0.0 { interface ge-1/0/0.0; interface ge-1/0/1.0; interface lo0.0 { passive; } } } ldp { interface ge-1/0/0.0; interface ge-1/0/1.0; }
user@RR1# show routing-options route-distinguisher-id 10.255.165.220; autonomous-system 203;
デバイスRR2の設定
手順
次の例では、設定階層内のさまざまなレベルに移動する必要があります。CLIのナビゲーションについては、 設定モードでのCLIエディターの使用を参照してください。
デバイスRR2を設定するには:
インターフェイスを設定します。
[edit interfaces] user@RR2# set ge-1/0/0 unit 0 description RR2-to-PE1 user@RR2# set ge-1/0/0 unit 0 family inet address 10.49.10.2/30 user@RR2# set ge-1/0/0 unit 0 family mpls user@RR2# set ge-1/0/1 unit 0 description RR2-to-PE2 user@RR2# set ge-1/0/1 unit 0 family inet address 10.50.10.2/30 user@RR2# set ge-1/0/1 unit 0 family mpls
ルート識別とAS番号を設定します。
[edit routing-options] user@RR2# set route-distinguisher-id 10.255.165.28 user@RR2# set autonomous-system 203
VPN で使用されるシグナリング プロトコルとして LDP を設定します。
[edit protocols ldp] user@RR2# set interface ge-1/0/0 user@RR2# set interface ge-1/0/1
BGPを設定します。
[edit protocols bgp group internal] user@RR2# set type internal user@RR2# set local-address 10.255.165.28 user@RR2# set cluster 198.51.100.1 user@RR2# set neighbor 10.255.163.58 description vpn2-to-pe1 family inet-vpn unicast user@RR2# set neighbor 10.255.168.42 description vpn2-to-pe2 family inet-vpn unicast
デバイスPE2とのピアリングセッションでBGPルートターゲットフィルタリングを設定します。
[edit protocols bgp group internal] user@RR2# set neighbor 10.255.168.42 family route-target
デバイスPE1とのピアリングセッションでプロキシBGPルートターゲットフィルタリングを設定します。
[edit protocols bgp group internal] user@RR2# set neighbor 10.255.163.58 family route-target proxy-generate
OSPFを設定します。
[edit protocols ospf area 0.0.0.0] user@RR2# set interface ge-1/0/0 user@RR2# set interface ge-1/0/1 user@RR2# set interface lo0.0 passive
デバイスの設定が完了したら、設定をコミットします。
[edit] user@RR2# commit
結果
設定モードから、 、 、 show protocols
コマンドを入力して設定をshow interfaces
show routing-options
確認します。出力結果に意図した設定が表示されない場合は、この例の手順を繰り返して設定を修正します。
user@RR2# show interfaces ge-1/0/0 { unit 0 { description RR2-to-PE1; family inet { address 10.49.10.2/30; } family mpls; } } ge-1/0/1 { unit 0 { description RR2-to-PE2; family inet { address 10.50.10.2/30; } family mpls; } }
user@RR2# show protocols bgp { group internal { local-address 10.255.165.28; cluster 198.51.100.1; neighbor 10.255.163.58 { description vpn2-to-pe1; family inet-vpn { unicast; } family route-target { proxy-generate; } } neighbor 10.255.168.42 { description vpn2-to-pe2; family inet-vpn { unicast; } family route-target; } } } ospf { area 0.0.0.0 { interface ge-1/0/0.0; interface ge-1/0/1.0; interface lo0.0 { passive; } } } ldp { interface ge-1/0/0.0; interface ge-1/0/1.0; }
user@RR2# show routing-options route-distinguisher-id 10.255.165.28; autonomous-system 203;
デバイスPE2の設定
手順
次の例では、設定階層内のさまざまなレベルに移動する必要があります。CLIのナビゲーションについては、 設定モードでのCLIエディターの使用を参照してください。
デバイスPE2を設定するには:
インターフェイスを設定します。
[edit interfaces] user@PE2# set ge-1/0/0 unit 0 description PE2-to-RR1 user@PE2# set ge-1/0/0 unit 0 family inet address 10.50.0.1/30 user@PE2# set ge-1/0/0 unit 0 family mpls user@PE2# set ge-1/0/1 unit 0 description PE2-to-RR2 user@PE2# set ge-1/0/1 unit 0 family inet address 10.50.10.1/30 user@PE2# set ge-1/0/1 unit 0 family mpls
ルート識別とAS番号を設定します。
[edit routing-options] user@PE2# set route-distinguisher-id 10.255.168.42 user@PE2# set autonomous-system 203
VPN で使用されるシグナリング プロトコルとして LDP を設定します。
[edit protocols ldp] user@PE2# set interface ge-1/0/0 user@PE2# set interface ge-1/0/1
BGPを設定します。
[edit protocols bgp group internal] user@PE2# set type internal user@PE2# set local-address 10.255.168.42 user@PE2# set family inet-vpn unicast user@PE2# set family route-target user@PE2# set neighbor 10.255.165.220 user@PE2# set neighbor 10.255.165.28
OSPFを設定します。
[edit protocols ospf area 0.0.0.0] user@PE2# set interface ge-1/0/0 user@PE2# set interface ge-1/0/1 user@PE2# set interface lo0.0 passive
VPN ルーティング インスタンスを設定します。
[edit routing-instances vpn1] user@PE2# set instance-type vrf user@PE2# set vrf-target target:203:100 user@PE2# set routing-options static route 203.0.113.1/24 discard
[edit routing-instances vpn2] user@PE2# set instance-type vrf user@PE2# set vrf-target target:203:101 user@PE2# set routing-options static route 203.0.113.2/24 discard
[edit routing-instances vpn3] user@PE2# set instance-type vrf user@PE2# set vrf-target target:203:103 user@PE2# set routing-options static route 203.0.113.3/24 discard
[edit routing-instances vpn4] user@PE2# set instance-type vrf user@PE2# set vrf-target target:203:104 user@PE2# set routing-options static route 203.0.113.4/24 discard
デバイスの設定が完了したら、設定をコミットします。
[edit] user@PE2# commit
結果
設定モードから、 、show routing-options
show protocols
および のコマンドをshow interfaces
入力して設定をshow routing-instances
確認します。出力結果に意図した設定が表示されない場合は、この例の手順を繰り返して設定を修正します。
user@PE2# show interfaces ge-1/0/0 { unit 0 { description PE2-to-RR1; family inet { address 10.50.0.1/30; } family mpls; } } ge-1/0/1 { unit 0 { description PE2-to-RR2; family inet { address 10.50.10.1/30; } family mpls; } }
user@PE2# show protocols bgp { group internal { type internal; local-address 10.255.168.42; family inet-vpn { unicast; } family route-target; neighbor 10.255.165.220; neighbor 10.255.165.28; } } ospf { area 0.0.0.0 { interface ge-1/0/0.0; interface ge-1/0/1.0; interface lo0.0 { passive; } } } ldp { interface ge-1/0/0.0; interface ge-1/0/1.0; }
user@PE2# show routing-options route-distinguisher-id 10.255.168.42; autonomous-system 203;
user@PE2# show routing-instances vpn1 { instance-type vrf; vrf-target target:203:100; routing-options { static { route 203.0.113.1/24 discard; } } } vpn2 { instance-type vrf; vrf-target target:203:101; routing-options { static { route 203.0.113.2/24 discard; } } } vpn3 { instance-type vrf; vrf-target target:203:103; routing-options { static { route 203.0.113.3/24 discard; } } } vpn4 { instance-type vrf; vrf-target target:203:104; routing-options { static { route 203.0.113.4/24 discard; } } }
検証
設定が正しく機能していることを確認します。
プロキシBGPルートターゲットルートの検証
目的
プロキシBGPルートターゲットルートが、デバイスRR1のbgp.rtarget.0テーブルに表示されていることを確認します。
アクション
運用モードから、 コマンドを show route table bgp.rtartget.0
入力してプロキシBGPルートターゲットを表示します。
user@RR1# show route table bgp.rtarget.0 4 destinations, 6 routes (4 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 203:203:100/96 *[RTarget/5] 00:01:22 Type Proxy for 10.255.163.58 Local [BGP/170] 00:04:55, localpref 100, from 10.255.168.42 AS path: I, validation-state: unverified > to 10.50.0.1 via ge-1/0/1 203:203:101/96 *[RTarget/5] 00:01:22 Type Proxy for 10.255.163.58 Local [BGP/170] 00:04:55, localpref 100, from 10.255.168.42 AS path: I, validation-state: unverified > to 10.50.0.1 via ge-1/0/1 203:203:103/96 *[BGP/170] 00:04:55, localpref 100, from 10.255.168.42 AS path: I, validation-state: unverified > to 10.50.0.1 via ge-1/0/1 203:203:104/96 *[BGP/170] 00:04:55, localpref 100, from 10.255.168.42 AS path: I, validation-state: unverified > to 10.50.0.1 via ge-1/0/1
意味
デバイスRR1は、ピアデバイスPE1に代わってプロキシBGPルートターゲットルートを生成しています。プロキシBGPルートターゲットルートは、 のプロトコルと優先度 [RTarget/5]
、ルートターゲットタイプ Proxy
で識別されます。