項目一覧
ルートターゲットフィルタリング
このトピックでは、静的、BGP、およびプロキシBGPルートターゲットフィルタリングの設定について説明し、VPNのルートターゲットフィルタリングの設定例を示します。
VPN の静的ルート ターゲット フィルタリングの設定
BGP VPN ルート ターゲット拡張コミュニティー(RFC 4360、 BGP 拡張コミュニティ属性)は、VPN メンバーシップを決定するために使用されます。静的ルート ターゲット フィルタリングは、メンバー PE ルーターがないために VPN ルートが不要なネットワークの部分でリソースが消費されるのを防ぐのに役立ちます(RFC 4684、 Constrained Route Distribution for 境界ゲートウェイプロトコル/マルチプロトコル ラベル スイッチング(BGP/MPLS)インターネット プロトコル(IP)仮想プライベート ネットワーク(VPN))).ルーターは、RT-Contrainプロトコルにルートを発信して、RT-ContrainNLRIに一致するルートターゲットを含むVPNルートの受信に関心があることを示すことができます。
VPN の静的ルート ターゲット フィルタリングを設定するには、次の手順に従います。
[edit routing-options rib bgp.rtarget.0 static]階層レベルでroute-target-filterステートメントを設定します。次の例は、 route-target-filter ステートメントの設定方法を示しています。
[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の静的ルートターゲットフィルタリングによるネットワークリソース使用量の削減
BGP VPN ルート ターゲット拡張コミュニティー(RFC 4360、 BGP 拡張コミュニティ属性)は、VPN メンバーシップを決定するために使用されます。静的ルート ターゲット フィルタリングは、メンバー PE ルーターがないために VPN ルートが不要なネットワークの部分でリソースが消費されるのを防ぐのに役立ちます(RFC 4684、 Constrained Route Distribution for 境界ゲートウェイプロトコル/マルチプロトコル ラベル スイッチング(BGP/MPLS)インターネット プロトコル(IP)仮想プライベート ネットワーク(VPN))).ルーターは、RT-Contrainプロトコルにルートを発信して、RT-ContrainNLRIに一致するルートターゲットを含むVPNルートの受信に関心があることを示すことができます。
通常、RT-Contrain機能が正しく機能するためには、ネットワーク全体に広く導入する必要があります。そうでない場合は、非RT-Constrain スピーカと対向する RT-Constrain BGPスピーカーが、この機能をサポートしないピアに代わって、他の RT-Constrain スピーカにデフォルトの RT-Constrain ルートをアドバタイズする必要があるため、この機能はあまり役に立ちません。これにより、デフォルトのRT-Contrainルートにより、PEルーターとすべての介在するPEルーターがすべてのVPNルートを受信する必要があるため、サポートされていないネットワークの一部で、この機能のリソース節約の利点が効果的に失われます。
静的RT-Contrain機能により、RT-Contrain機能をネットワークに部分的に展開することができます。この機能は、RT-Constrain が設定されているネットワーク内の境界で有効になります。しかし、一部のBGP VPNピア(通常はPEルーター)はRT-Constrainに対応していません。これらのPEルーターのルートターゲットは、ルーター上で静的に設定する必要があります。これらのルートターゲットは、RT-Constraプロトコルを使用して配信されます。
プロキシのRT-Contrain機能により、このプロトコルをサポートしないBGP VPNピアは、ルートターゲットを自動的に検出して配布することができます。ただし、この機能は対称ルートターゲットのみをサポートします。例えば、VRF ルーティング インスタンスのインポートとエクスポートのルートターゲットは同一です。ただし、ハブアンドスポーク方式 VPN の場合、インポートとエクスポートのルートターゲットは同一ではありません。このシナリオでは、インポートとエクスポートのルートターゲットを、RT-Contrainプロトコルで配布されるように静的に設定できます。
VPN の BGP ルート ターゲット フィルタリングの設定
BGPルートターゲットフィルタリングにより、VPNルートを必要とするルーターのみに配信することができます。BGP ルート ターゲット フィルタリングが設定されていない VPN ネットワークでは、BGP はすべての VPN ルートをすべての VPN ピア ルーターに配信します。
BGPルートターゲットフィルタリングの詳細については、RFC 4684, Constrained Route Distribution for 境界ゲートウェイプロトコル/マルチプロトコルラベルスイッチング(BGP/MPLS)インターネットプロトコル(IP)仮想プライベートネットワーク(VPN)をご覧ください。
次のセクションでは、BGPルートターゲットフィルタリングの概要と、VPNでの設定方法について説明します。
BGPルートターゲットフィルタリングの概要
PE ルーターは、ルート リフレクタとして設定されている場合、または EBGP セッションを実行している場合を除き、ローカル VRF インポート ポリシーで指定されているルート ターゲット拡張コミュニティを含まない VPN ルートを破棄します。これは Junos OS のデフォルトの動作です。
ただし、VPN ルートを保存しないように明示的に設定されていない限り、VPN アドレス ファミリーのルート リフレクタまたは境界ルーターとして設定されたルーターは、サービス プロバイダーのネットワークに存在するすべての VPN ルートを保存する必要があります。また、PE ルーターはルート ターゲット拡張コミュニティーを含まないルートを自動的に破棄できますが、ルート更新は引き続き生成および受信されます。
BGPルートターゲットフィルタリングは、VPNルートとルート更新を受信するルーターの数を減らすことで、VPNの実行に関連するオーバーヘッドの量を制限するのに役立ちます。BGPルートターゲットフィルタリングは、VPNに直接参加しない(CEデバイスのPEルーターとして機能しない)ルートリフレクタやASボーダールーターが多数存在するネットワークにおいて、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; }
このステートメントを含めることができる階層レベルの一覧は、このステートメントのステートメント概要のセクションを参照してください。
advertise-default、external-paths、およびprefix-limitステートメントは、BGPルートターゲットのフィルタリング設定に以下のように影響します。
advertise-defaultステートメントにより、ルーターはデフォルトルートターゲットルート(0:0:0/0)をアドバタイズし、より具体的なルートをすべて抑制します。これは、PE ルーターとしてのみ動作するネイバーで構成される BGP グループのルート リフレクタで使用できます。PE ルーターは、多くの場合、ルート リフレクタにすべてのルートをアドバタイズする必要があります。デフォルト ルート以外のすべてのルート ターゲット アドバタイズを抑制することで、ルート リフレクタと PE ルーター間で交換される情報量が減少します。さらに Junos OS では、デフォルト以外のルートを受信しない限り依存関係情報を保持しないため、ルート ターゲットのアドバタイズ オーバーヘッドを削減することができます。
external-pathsステートメント(デフォルト値は1)により、ルーターは特定のルートターゲットを参照するVPNルートをアドバタイズします。指定した数によって、VPNルートを受信する外部ピアルーター(現在そのルートターゲットをアドバタイズしている)の数が決まります。prefix-limitステートメントは、ピア ルーターから受信できるプレフィックスの数を制限します。
route-target、advertise-default、およびexternal-pathステートメントは、RIB-OUT状態に影響し、同じBGPグループを共有するピアルーター間で一貫している必要があります。prefix-limitステートメントは受信側にのみ影響し、BGPグループ内の異なるピアルーター間で異なる設定を持つことができます。
参照
例:VPN の BGP ルート ターゲット フィルタリング
BGPルートターゲットフィルタリングは、適切なBGP階層レベルで family route-target ステートメントを設定することで有効になります。このステートメントにより、bgp.rtarget.0ルーティングテーブルに格納されている新しい route-target アドレスファミリーの交換が可能になります。
次の設定は、 to_vpn04というタイトルのBGPグループに対してBGPルートターゲットフィルタリングを設定する方法を示しています。
[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 route table bgp.rtarget.0 showコマンドを発行して、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 ルーティング インスタンス(vpn1 と vpn2)に設定されたルート ターゲットに対応しています。
200:200:101/96—vpn1ルーティング インスタンスにおけるコミュニティ200:101200:200:102/96—vpn2ルーティング インスタンスにおけるコミュニティ200:102
最後の 2 つのエントリーは、BGPピアから受信したプレフィックスです。
200:200:103/96—このコミュニティ(200:103)でタグ付けされたルートを、を介してピア10.255.14.174にアドバタイズする必要があることをローカルルーターに伝えますt3-0/0/0.0200:200:104/96—このコミュニティ(200:104)でタグ付けされたルートを、を介してピア10.255.14.174にアドバタイズする必要があることをローカルルーターに伝えますt3-0/0/0.0
例:VPN の BGP ルート ターゲット フィルタリングの設定
BGPルートターゲットフィルタリングは、VPNルートとルート更新を受信するルーターの数を削減し、VPNの実行に関連するオーバーヘッドの量を制限するのに役立ちます。BGPルートターゲットフィルタリングは、VPNに直接参加しない(CEデバイスのPEルーターとして機能しない)ルートリフレクタまたはAS境界ルーターが多数存在するネットワークで、VPN関連の管理トラフィックを削減する場合に最も効果的です。
図 1 は、VPN のグループに対して BGP ルート ターゲット フィルタリングで構成されたネットワークのトポロジーを示しています。
のグループに対して有効になっている 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 つのデバイスの。
Junos OS リリース 12.2 以降(プロキシ BGP ルートフィルタリング用に設定された 1 台以上のデバイス上)この例では、ルートリフレクタでプロキシBGPルートフィルタリングを明示的に設定します。
BGPルートターゲットフィルタリングのエクスポートポリシーを設定する前に、以下の概念をよく理解しておいてください。
概要
BGPルートターゲットフィルタリングでは、ルートターゲットメンバーシップ(RTメンバーシップ)の広告をネットワーク全体に配信することで、ネットワークリソースの消費を削減することができます。BGPは、RTメンバーシップ情報を使用して、ネットワーク内でVPNルートを必要とするデバイスにのみVPNルートを送信します。他のタイプのBGPの到達可能性と同様に、ルーティングポリシーをルーティングターゲットフィルタリングルートに適用して、ネットワークに影響を与えることができます。ルート ターゲット フィルタリングが設定されている場合、ルート ターゲット フィルタリング ルートのフローを制限すると、この RT メンバーシップに引き付けられる可能性のある VPN ルートも制限されます。このポリシーを構成するには、次の作業が含まれます。
ルート ターゲット プレフィックスのリストを定義するフィルターを作成します。
BGPルート・ターゲット・フィルタリングに使用するルート・ターゲット・フィルタのサブセットを選択するポリシーを作成する。
ルートターゲットプレフィックスのリストを定義するには、次のようにします。
[edit policy-options]階層レベルでrtf-prefix-listステートメントを設定して、ルートターゲットプレフィックスリストの名前と、使用する1つ以上のルートターゲットプレフィックスを指定します。この構成では、デバイスが使用する受信ルート ターゲット フィルタリング ルートを指定し、ネットワーク全体に配信できます。
ルーティングポリシーを構成し、そのポリシーにルートターゲットプレフィックスリストを適用するには、以下のポリシーオプションを指定できます。
-
family route-target—(オプション)ルートターゲット ファミリー一致条件で、一致する BGP ルート ターゲット フィルタリング ルートを指定します。この基準は、fromステートメントで定義します。この例では、family route-target一致条件を使用してエクスポートポリシーを作成する方法を示しています。手記:ジュニパーは、
family route-targetが設定されている場合、inet.3テーブルを使用してネクストホップアドレスを解決します。 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ルートターゲットフィルタリングをサポートしていません。ルートリフレクタとデバイスPE1間のピアリングセッションでは、プロキシBGPルートターゲットフィルタリングも設定され、デバイス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 to Customer Edge(CE)プロトコルを使用する代わりに行われます。
この例では、vpn3 ルートがデバイス RR1 にアドバタイズされないようにデバイス PE2 でエクスポート ポリシーを設定することで、デバイス PE2 からデバイス PE1 にアドバタイズされるルートをさらに制御します。 family route-target 一致条件を指定するポリシーを作成し、ルートターゲットプレフィックスのリストを定義し、 rtf-prefix-list 条件を定義することでルートターゲットプレフィックスのリストを適用します。
構成
CLIクイック構成
この例をすばやく設定するには、次のコマンドをコピーしてテキストファイルに貼り付け、改行を削除して、ネットワーク構成に合わせて必要な詳細を変更し、 [edit] 階層レベルのCLIにコマンドをコピー&ペーストしてください。
デバイス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のナビゲーションについては、「 1 コンフィグレーション・モードでの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 interfaces、 show protocols、 show routing-options、および 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のナビゲーションについては、「 1 コンフィグレーション・モードでの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 interfaces、 show protocols、および 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のナビゲーションについては、「 1 コンフィグレーション・モードでの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 interfaces、 show protocols、および 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のナビゲーションについては、「 1 コンフィグレーション・モードでの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 interfaces、 show protocols、 show policy-options、 show routing-options、 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ルーティングテーブル内のルートをフィルタリングするルートターゲットの検証
- デバイスRR2のbgp.rtarget.0ルーティングテーブル内のルートをフィルタリングするルートターゲットの検証
デバイスRR1のbgp.rtarget.0ルーティングテーブル内のルートをフィルタリングするルートターゲットの検証
目的
vpn3のルートプレフィックスがデバイスRR1のbgp.rtarget.0テーブルにないことを確認します。デバイス RR1 への vpn3 ルートのアドバタイズメントを防ぐために、デバイス PE2 のエクスポート ポリシーが適用されているため、デバイス 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;
}
このルートフィルター ロジックは、0.0.0.0 の inet ルートと、IPv4 アドレス部分が 0.0.0.0 の inet-vpn ルートを照合します。 inet-vpn ルートの 8 バイト ルート識別部分は、ルートフィルターのマッチングでは考慮されません。これは、Junos OS リリース 10.0 で導入された Junos OS の動作の変更です。
ポリシーを両方のタイプのルートを一致させたくない場合は、ポリシーにファミリー修飾子を追加します。ルート フィルターを inet ルートのみ一致させるには、ポリシー修飾子ファミリー inet を追加します。ルート フィルターが inet-vpn つのルートのみと一致するようにするには、ポリシー修飾子ファミリー inet-vpn を追加します。
ファミリー修飾子は、ルートフィルターが評価される前に評価されます。そのため、ファミリー一致に失敗した場合、ルートフィルターは評価されません。同じ論理が家族の inet6 と家族の inet6-vpnにも当てはまります。 inet6 例で使用されるルートフィルターは、IPv6 アドレスを使用する必要があります。ファミリー修飾子を使用すると、ファミリー修飾子が他のほとんどの修飾子の前にテストされ、望ましくないファミリーからのルートが迅速に排除されるため、効率が向上する可能性があります。
構成
プロシージャ
CLIクイック構成
この例をすばやく設定するには、次のコマンドをコピーしてテキストファイルに貼り付け、改行を削除して、ネットワーク構成に合わせて必要な詳細を変更し、 [edit] 階層レベルのCLIにコマンドをコピー&ペーストしてください。
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 protocols and show policy-options コマンドを発行して設定を確認します。出力結果に意図した設定内容が表示されない場合は、この例の手順を繰り返して設定を修正します。
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 detailshow 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ルートターゲットフィルタリング(またはプロキシ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 Series、MXシリーズ、または T Series ルーターの組み合わせが可能な 4 台のデバイスの。
Junos OS リリース 12.2 以降(プロキシ BGP ルートフィルタリング用に設定された 1 台以上のデバイス上)この例では、ルートリフレクタでプロキシBGPルートフィルタリングを明示的に設定します。
プロキシBGPルート・ターゲット・フィルタリングを設定する前に、以下の概念をよく理解しておいてください。
概要
ルートターゲットフィルタリングは、不要なVPNルートを受信するネットワーク内のデバイスの数を減らします。プロキシBGPルートターゲットフィルタリングにより、ネットワークは、この機能が現在サポートされていない場所でも、ルートターゲットフィルタリングを利用することができます。この機能を設定することで、ネットワークが BGP ルート ターゲット フィルタリングを完全にサポートしている場合に利用できるのと同じネットワーク リソースの節約の多くを実現できます。
プロキシBGPルートターゲットフィルタリングを設定するには、BGPルートターゲットフィルタリングをサポートしないデバイスに対して、プロキシルートターゲットメンバーシップ(RTメンバーシップ)広告を配信するデバイスに family route-target proxy-generate ステートメントを含めます。プロキシ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つ以上のピアにBGPルートターゲットフィルタリング設定の一部として advertise-default ステートメントが設定されている場合、アドバタイズデフォルト設定は無視されます。
トポロジー図
図 3 は、この例で使用されているトポロジーを示しています。
この例では、ルートリフレクタ(デバイスRR1とデバイスRR2)とプロバイダエッジ(PE)デバイスPE2でBGPルートターゲットフィルタリングが設定されていますが、もう一方の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 to Customer Edge(CE)プロトコルを使用する代わりに行われます。
デバイス PE1 によって処理される VPN ルート更新の数を最小限に抑えるには、 family route-target proxy-generate ステートメントを含めて、各ルート リフレクタにプロキシ BGP ルート ターゲット フィルタリングを設定します。各ルート リフレクタは、デバイス PE1 とのピアリング セッションを持ち、コアへのルート ターゲット フィルタリングをサポートします。ただし、デバイス PE1 はルート ターゲット フィルタリングをサポートしていないため、デバイス PE1 はすべての VPN 更新を受信するため、ネットワーク リソースの節約は実現されません。デバイス PE1 が直面しているピアリング セッションでプロキシ BGP ルート ターゲット フィルタリングを設定することで、デバイス PE1 が処理する VPN アップデートの数を制限し、ルート リフレクターがネットワーク全体でデバイス PE1 のプロキシ BGP ルート ターゲット ルートを生成します。
構成
CLIクイック構成
この例をすばやく設定するには、次のコマンドをコピーしてテキストファイルに貼り付け、改行を削除して、ネットワーク構成に合わせて必要な詳細を変更し、 [edit] 階層レベルのCLIにコマンドをコピー&ペーストしてください。
デバイス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のナビゲーションについては、「 1 コンフィグレーション・モードでの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 interfaces、 show protocols、 show routing-options、および 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のナビゲーションについては、「 1 コンフィグレーション・モードでの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 interfaces、 show protocols 、および 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.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のナビゲーションについては、「 1 コンフィグレーション・モードでの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 interfaces、 show protocols、および 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のナビゲーションについては、「 1 コンフィグレーション・モードでの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 interfaces、 show protocols、 show routing-options、 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で識別されます。