cRPD でのレイヤー 3 オーバーレイのサポート
cRPDでのレイヤー3オーバーレイVRFサポートについて
Junos OS リリース 19.4R1 以降、仮想ルーティングおよび転送(VRF)インスタンスは、MPLS およびマルチプロトコル BGP のサポートとともに cRPD でサポートされ、オーバーレイ機能を提供します。
ルーティングインスタンスは、ルーティングテーブル、インターフェイス、ルーティングプロトコルパラメーターの集合です。レイヤー 3 VPN を実装するには、VPN ごとに 1 つのルーティング インスタンスを設定します。VRF は Linux カーネル内のネットワーク デバイスであり、デバイスは に table-id
関連付けられています。ルーティング インスタンスは、PE ルーターでのみ設定します。Linux ネットワークで VRF を作成できます。VRF デバイスの実装は、レイヤー 3 以上にのみ影響します。各 VPN ルーティング インスタンスは、以下のコンポーネントで構成されています。
VRFテーブル—各PEルーターで、VPNごとに1つのVRFテーブルを設定します。
ポリシールール—これらのコントロールは、VRFテーブルへのルートのインポートと、VRFテーブルからのルートのエクスポートを制御します。
CE ルーターからのルートを VRF テーブルにインストールする 1 つ以上のルーティング プロトコル - BGP、OSPF、RIP ルーティング プロトコルを使用でき、静的ルートを使用できます。
VRF デバイスが作成されると、ルーティング テーブルに関連付けられます。奴隷されたデバイスから VRF に送信されるパケットは、VRF デバイスに関連付けられたルーティング テーブルで検索されます。同様に、エグレス ルーティング ルールは、実際のインターフェイスで送信する前に VRF ドライバーにパケットを送信するために使用されます。
VRF は、VRF の独立した転送テーブルに基づいてルートを管理し、トラフィックを転送するために使用されます。RPD は、タイプのルーティング インスタンスごとに複数のルーティング テーブルを作成します vrf
。テーブルは、各アドレスファミリーに対して1つです。VPNに参加している各PEルーター上で、各VPNのルーティングインスタンスを設定する必要があります。階層を使用してルーティングインスタンスを [edit routing-instances]
設定できます。タイプ vrf
のルーティングインスタンスは、cRPDでのみサポートされています。
階層を使用して、VRF の下に、BFD、BGP、IS-IS、OSPF バージョン 2(OSPF)、OSPF バージョン 3(OSPFv3)、ICMP ルーター検出の複数のインスタンスを [edit routing-instances routing-instance-name protocols]
作成できます。階層を使用して、プロトコル非依存型ルーティングを edit routing-instances instance-name routing-options
設定できます。
レイヤー 3 オーバーレイは、cRPD で以下のトンネリング プロトコルをサポートしています。
inet.3 の静的ルート
BGP ラベル付きユニキャスト
GRE トンネリング
MPLS 静的 LSP
Programmable-rpd API を使用してプログラムされたルート
MPLS 対応インターフェイスでのダイレクト ebgp ピアリング
VRF の下のインターフェイスの移動
デバイスの奴隷は、ルーティングインスタンスで設定されたインターフェイスであるRPDによって行われ、カーネルに送信されたnetlinkメッセージを使用してRPDによってvrf-デバイスに移行(奴隷)されます。
タイプ vrf
のルーティング インスタンスの下でインターフェイスが設定されている場合、そのようなリンクがカーネルから学習され、リンクが正しいテーブルに関連付けられていない場合、RPD はネットリンク通知を送信してリンクを奴隷にします。リンクが存在しない場合、またはRPDがリンクについて学習していない場合、リンクが作成されたり、RPDがそのリンクを学習するたびに、設定に基づいてリンクが正しく利用されます。
例:cRPD インスタンスでのレイヤー 3 VPN(VRF)の設定
この例では、VRFテーブルからのルートのインポートとVRFテーブルからのルートのエクスポートを制御する特定のポリシーでPEルーターを設定し、BGPラベル付きユニキャストを使用して学習したネクストホップを使用してPEルーターを設定することで、PEルーターとルートリフレクタのVPNv4ルート解決を示しています。この例では、トラフィックは CE1 から CE2 に流れます。
要件
この例では、以下のハードウェアとソフトウェアのコンポーネントを使用しています。
-
Ubuntu ソフトウェア バージョン 18.04
-
Linux カーネル バージョン 4.5 以降
-
cRPD ソフトウェア リリース バージョン 19.4R1 以降
レイヤー 3 VPN(VRF)を設定する前に、基本的なコンポーネントをインストールする必要があります。
-
cRPDインスタンスが作成されるホストOS上のMPLSモジュール。詳細については、 ホストOSでの設定の構成を参照してください。
-
PE1(プロバイダ エッジ ルーター)、P(プロバイダ ルーター)、PE2(プロバイダ エッジ ルーター)インストールについては、 DockerへのcRPDのインストールを参照してください。
概要
VPNv4ルート解決を設定するには、VPNに参加している各PEルーター上の各VPNに対してVRFタイプのルーティングインスタンスを設定し、それに静的ルートを追加する必要があります。ステートメントは static
、ルーティングテーブルにインストールされた静的ルートを vrfblue.inet.0
設定します。Linux カーネルで作成されたすべての VRF デバイスのループバック インターフェイスまたはデバイスはありません。しかし、ループバックホストアドレスは、RPDによって学習できるVRFデバイスに直接追加されます。
構成
BGP LU を使用した PE1 ルーターの設定
手順
次の例では、設定階層内のさまざまなレベルに移動する必要があります。
-
テーブル mpls.0 を作成します。
user@crpd1# set routing-options rib mpls.0
-
ルートを受け入れるポリシーを設定します。
[edit policy-options policy-statement] user@crpd1# set EXPORT_LO term 10 from route-filter 10.2.2.2/32 exact user@crpd1# set EXPORT_LO term 10 then accept user@crpd1# set NH_SELF term 10 then next-hop self
-
PE1とその他のルーティングインスタンスパラメータでVRFルーティングインスタンスを設定します。
[edit routing-instances vrfblue] user@crpd1# set routing-options static route 10.1.1.1/32 next-hop 10.10.10.1 user@crpd1# set instance-type vrf user@crpd1# set route-distinguisher 100:100 user@crpd1# set vrf-target target:100:100
-
ルーターIDを設定します。
user@crpd1# set routing-options router-id 10.2.2.2
-
BGP セッションを設定します。
[edit protocols bgp group] user@crpd1# set underlay type external family inet unicast user@crpd1# set underlay type external export EXPORT_LO neighbor 10.20.20.3 family inet labeled-unicast resolve-vpn user@crpd1# set underlay type external export EXPORT_LO neighbor 10.20.20.3 peer-as 65002 local-as 65001 user@crpd1# set VPN type internal local-address 10.2.2.2 family inet-vpn unicast user@crpd1# set VPN local-as 65005 user@crpd1# set VPN neighbor 10.4.4.4 family inet-vpn unicast
-
MPLS のインターフェイスを設定します。
user@crpd1# set protocols mpls interface all
結果
設定モードから、 および show routing-instances
コマンドを入力して設定をshow protocols bgp
確認します。出力に意図した設定が表示されない場合は、この例の設定手順を繰り返して修正します。
user@crpd1# show routing-instances vrfblue { routing-options { static { route 10.1.1.1/32 next-hop 10.10.10.1; } } instance-type vrf; route-distinguisher 100:100; vrf-target target:100:100; } user@crpd1# show protocols bgp group underlay { type external; family inet { unicast; } export EXPORT_LO; neighbor 10.20.20.3 { family inet { labeled-unicast { resolve-vpn; } } peer-as 65002; local-as 65001; } neighbor 10.20.20.2 { family inet { labeled-unicast { resolve-vpn; } } peer-as 65001; local-as 65002; } neighbor 10.30.30.4 { family inet { labeled-unicast { resolve-vpn; } } peer-as 65003; local-as 65004; } } group VPN { type internal; local-address 10.2.2.2; family inet-vpn { unicast; } local-as 65005; neighbor 10.4.4.4 { family inet-vpn { unicast; } } }
デバイスの設定が完了したら、設定モードからコミットを入力します。
BGP LU を使用した P ルーターの設定
手順
次の例では、設定階層内のさまざまなレベルに移動する必要があります。
-
テーブル mpls.0 を作成します。
user@crpd2# set routing-options rib mpls.0
-
ルートを受け入れるポリシーを設定します。
[edit policy-options policy-statement] user@crpd2# set EXPORT_LO term 10 from route-filter 10.3.3.3/32 exact user@crpd2# set EXPORT_LO term 10 then accept user@crpd2# set NH_SELF term 10 then next-hop self
-
BGP セッションを設定します。
[edit protocols bgp group] user@crpd2# set underlay type external export EXPORT_LO neighbor 10.20.20.2 family inet labeled-unicast resolve-vpn user@crpd2# set underlay type external export EXPORT_LO neighbor 10.20.20.2 peer-as 65001 user@crpd2# set underlay type external export EXPORT_LO neighbor 10.20.20.2 local-as 65002 user@crpd2# set underlay type external export EXPORT_LO neighbor 10.30.30.4 family inet labeled-unicast resolve-vpn user@crpd2# set underlay type external export EXPORT_LO neighbor 10.30.30.4 peer-as 65003 user@crpd2# set underlay type external export EXPORT_LO neighbor 10.30.30.4 local-as 65004
-
ルーターIDを設定します。
user@crpd2# set routing-options router-id 10.3.3.3
-
MPLS のインターフェイスを設定します。
user@crpd2# set protocols mpls interface all
結果
設定モードから、 および show policy-options
コマンドを入力して設定をshow protocols bgp
確認します。出力結果に意図した設定が表示されない場合は、この例の手順を繰り返して設定を修正します。
user@crpd2# show protocols bgp group underlay { type external; export EXPORT_LO; neighbor 10.20.20.2 { family inet { labeled-unicast { resolve-vpn; } } peer-as 65001; local-as 65002; } neighbor 10.30.30.4 { family inet { labeled-unicast { resolve-vpn; } } peer-as 65003; local-as 65004; } }
user@crpd2# show policy-options policy-statement EXPORT_LO { term 10 { from { route-filter 10.3.3.3/32 exact; } then accept; } } policy-statement NH_SELF { term 10 { then { next-hop self; } } }
BGP LU を使用した PE2 ルーターの設定
手順
次の例では、設定階層内のさまざまなレベルに移動する必要があります。
-
テーブル mpls.0 を作成します。
user@crpd3# set routing-options rib mpls.0
-
ルートを受け入れるポリシーを設定します。
[edit policy-options policy-statement] user@crpd3# set EXPORT_LO term 10 from route-filter 10.4.4.4/32 exact user@crpd3# set EXPORT_LO term 10 then accept user@crpd3# set NH_SELF term 10 then next-hop self
-
PE2とその他のルーティングインスタンスパラメータでVRFルーティングインスタンスを設定します。
[edit routing-instances vrfblue] user@crpd3# set routing-options static route 10.5.5.5/32 next-hop 10.40.40.5 user@crpd3# set instance-type vrf user@crpd3# set route-distinguisher 100:100 user@crpd3# set vrf-target target:100:100 user@crpd3# set interface all
-
BGP セッションを設定します。
[edit protocols bgp group] user@crpd3# set underlay type external export EXPORT_LO neighbor 10.30.30.3 family inet labeled-unicast resolve-vpn user@crpd3# set underlay type external export EXPORT_LO neighbor 10.30.30.3 peer-as 65004 user@crpd3# set underlay type external export EXPORT_LO neighbor 10.30.30.3 local-as 65003 user@crpd3# set VPN type internal local-address 10.4.4.4 family inet-vpn unicast user@crpd3# set VPN local-as 65005 user@crpd3# set VPN neighbor 10.2.2.2 family inet-vpn unicast
-
ルーターIDを設定します。
user@crpd3# set routing-options router-id 10.4.4.4
-
MPLS のインターフェイスを設定します。
user@crpd3# set protocols mpls interface all
結果
設定モードから、 および show routing-instances
コマンドを入力して設定をshow protocols bgp
確認します。出力結果に意図した設定が表示されない場合は、この例の手順を繰り返して設定を修正します。
user@crpd3# show protocols bgp group underlay { export EXPORT_LO; neighbor 10.30.30.3 { family inet { labeled-unicast { resolve-vpn; } } peer-as 65004; local-as 65003; } } group VPN { type internal; local-address 10.4.4.4; family inet-vpn { unicast; } local-as 65005; neighbor 10.2.2.2 { family inet-vpn { unicast; } } }
user@crpd3# show routing-instances vrfblue { routing-options { static { route 10.5.5.5/32 next-hop 10.40.40.5; } } interface all; instance-type vrf; route-distinguisher 100:100; vrf-target target:100:100; }
検証
PE1でのVPNv4解決の検証
目的
PE1でVPNv4ルートを検証するには:
アクション
動作モードから、 コマンドを show route table vrfblue.inet.0 10.5.5.5
入力します。
user@crpd1> show route table vrfblue.inet.0 10.5.5.5
vrfblue.inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.5.5.5/32 *[BGP/170] 00:00:14, localpref 100, from 10.4.4.4 AS path: I, validation-state: unverified > to 10.20.20.3 via pe1-p, Push 299808, Push 299792(top)
動作モードから、 コマンドを show route table mpls.0
入力します。
user@crpd1> show route table mpls.0
mpls.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 299808 *[VPN/170] 00:01:45 > to 10.10.10.1 via pe1-ce1, Pop 299808(S=0) *[VPN/170] 00:01:45 > to 10.10.10.1 via pe1-ce1, Pop 299824 *[VPN/170] 00:01:45 receive table vrfblue.inet.0, Pop
bashモードから コマンドを ip route list table 5 5.5.5.5
入力します。
user@crpd1> ip route list table 5 10.5.5.5
10.5.5.5 encap mpls 299792/299808 via 10.20.20.3 dev pe1-p proto 22
bashモードから コマンドを ip -f mpls route
入力します。
user@crpd1> ip -f mpls route
299808 via inet 10.10.10.1 dev pe1-ce1 proto 22
意味
PE1にはCE2へのルート vrfblue.inet.0
があり、ネクストホップ10.4.4.4.4でPE2から学習されており、PルーターからのBGP LUを使用して解決されています。
P での BGP LU の検証
目的
P で VPNv4 ルートを検証するには、次の手順に沿います。
アクション
bashモードから コマンドを ip -f mpls route show
入力します。
user@crpd2> ip -f mpls route show
299776 via inet 10.20.20.2 dev p-pe1 proto 22 299792 via inet 10.30.30.4 dev p-pe2 proto 22
動作モードから、 コマンドを show route table mpls.0
入力します。
user@crpd2> show route table mpls.0
mpls.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 0 *[MPLS/0] 01:40:42, metric 1 Receive 1 *[MPLS/0] 01:40:42, metric 1 Receive 2 *[MPLS/0] 01:40:42, metric 1 Receive 13 *[MPLS/0] 01:40:42, metric 1 Receive 299776 *[VPN/170] 01:19:24 > to 10.20.20.2 via p-pe1, Pop 299776(S=0) *[ VPN/170] 01:19:24 > to 10.20.20.2 via p-pe1, Pop 299792 *[VPN/170] 01:19:20 > to 10.30.30.4 via p-pe2, Pop 299792(S=0) *[VPN/170] 01:19:20 > to 10.30.30.4 via p-pe2, Pop
意味
P から PE1、P から PE2 への MPLS および VPN ルートを表示できます。
PE2でのVPNv4解決の検証
目的
PE2でVPNv4ルートを検証するには:
アクション
動作モードから、 コマンドを show route table vrfblue.inet.0 10.1.1.1
入力します。
user@crpd3> show route table vrfblue.inet.0 10.1.1.1
vrfblue.inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.1.1.1/32 *[BGP/170] 00:00:26, localpref 100, from 10.2.2.2 AS path: I, validation-state: unverified > to 10.30.30.3 via pe2-p, Push 299808, Push 299776(top)
動作モードから、 コマンドを show route table mpls.0
入力します。
user@crpd3> show route table mpls.0
mpls.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 0 *[MPLS/0] 01:34:39, metric 1 Receive 1 *[MPLS/0] 01:34:39, metric 1 Receive 2 *[MPLS/0] 01:34:39, metric 1 Receive 13 *[MPLS/0] 01:34:39, metric 1 Receive 299808 *[VPN/170] 00:00:43 > to 10.40.40.5 via pe2-ce2, Pop 299808(S=0) *[VPN/170] 00:00:43 > to 10.40.40.5 via pe2-ce2, Pop 299824 *[VPN/170] 00:00:43 receive table vrfblue.inet.0, Pop
bashモードから コマンドを ip route list table 5 10.1.1.1
入力します。
user@crpd3> ip route list table 5 10.1.1.1
10.1.1.1 encap mpls 299776/299808 via 10.30.30.3 dev pe2-p proto 22
bashモードから コマンドを ip -f mpls route
入力します。
user@crpd3> ip -f mpls route
299808 via inet 10.40.40.5 dev pe2-ce2 proto 22
意味
PE2 ルーターでは、PE1 は BGP LU 約 10.1.1.1 を VPNv4 プレフィックスとして、ネクストホップを 10.2.2.2 として使用する VRF テーブル vrfblue.inet.0
のルートを表示します。