RIP インスタンス間のルート再分配
RIP インスタンス間のルート再分配について
RIP プロセス間でルートを再分配できます。これを言うもう 1 つの方法は、RIP インスタンスから他の RIP インスタンスに RIP ルートをエクスポートすることです。
Junos OSでは、ルーティングインスタンス間のルート再分配は、RIBグループとも呼ばれるルーティングテーブルグループを使用することで実現されます。ルーティング テーブル グループを使用すると、あるルーティング テーブル内のプロトコルから別のルーティング テーブルにルートをインポートおよびエクスポートできます。このトピックで説明する RIP インスタンス間でルートを再分配する機能は、Junos OS リリース 15.1X49、15.1X49-D30、または 15.1X49-D40 ではサポートされていません。
対照的に、ポリシーベースのインポートおよびエクスポート機能では、同じルーティングテーブル内の異なるプロトコル間でルートのインポートとエクスポートが可能です。
次の部分的な例を考えてみましょう。
protocols { rip { rib-group inet-to-voice; } } routing-instances { voice { protocols { rip { rib-group voice-to-inet; } } } } routing-options { rib-groups { inet-to-voice { import-rib [ inet.0 voice.inet.0 ]; } voice-to-inet { import-rib [ voice.inet.0 inet.0 ]; } } }
ステートメントの読み取り import-rib
方法は次のとおりです。プロトコル(RIP、この場合)からルートを取得し、プライマリ(またはローカル)ルーティングテーブルにインポートし、その後にリストされている他のルーティングテーブルにインポートします。プライマリ ルーティング テーブルは、ルーティング テーブル グループが使用されているルーティング テーブルです。これは、メイン ルーティング インスタンスで使用する場合は inet.0 、ルーティング インスタンス内で使用する場合は voice.inet.0 のいずれかになります。 inet-to-voice ルーティング テーブル グループでは、このルーティング テーブル グループがメイン ルーティング インスタンスで使用されるため、 inet.0 が最初にリストされます。 voice-to-inet ルーティング テーブル グループでは、このルーティング テーブル グループが voice ルーティング インスタンスで使用されるため、 voice.inet.0 が最初にリストされます。
例:2 つの RIP インスタンス間でルートを再分配する
この例では、RIP ルーティング インスタンスを設定し、ルーティング インスタンスとプライマリ インスタンス間の RIP ルートの再分配を制御する方法を示します。
要件
この例を設定する前に、デバイス初期化以外の特別な設定は必要ありません。
概要
voice と呼ばれるルーティング インスタンスを作成すると、Junos OS は voice.inet.0 と呼ばれるルーティング テーブルを作成します。この例では、プライマリ RIP インスタンスを介して学習したルートを voice.inet.0 ルーティング テーブルにインストールする方法を示しています。この例では、voice ルーティング インスタンスを介して学習したルートを inet.0 にインストールする方法も示しています。これは、ルーティングテーブルグループを設定することで行われます。RIP ルートは、ルーティング テーブル グループに属する各ルーティング テーブルにインストールされます。
図 1 は、この例で使用したトポロジーを示しています。

CLI クイック設定 は、 図 1 にすべてのデバイスの設定を示しています。セクション #d72e63__d72e212 では、デバイス R2 の手順について説明します。
トポロジ
構成
手順
CLI クイックコンフィギュレーション
この例を迅速に設定するには、以下のコマンドをコピーしてテキスト ファイルに貼り付け、改行を削除し、ネットワーク設定に一致させる必要がある詳細情報を変更し、コマンドを 階層レベルの [edit]
CLI にコピー アンド ペーストして、設定モードから を入力 commit
します。
デバイス R1
set interfaces fe-1/2/0 unit 1 family inet address 10.0.0.1/30 set interfaces lo0 unit 1 family inet address 172.16.0.1/32 set interfaces lo0 unit 1 family inet address 192.168.1.1/32 set protocols rip group to-R2 export advertise-routes-through-rip set protocols rip group to-R2 neighbor fe-1/2/0.1 set policy-options policy-statement advertise-routes-through-rip term 1 from protocol direct set policy-options policy-statement advertise-routes-through-rip term 1 from protocol rip set policy-options policy-statement advertise-routes-through-rip term 1 then accept
デバイスR2
set interfaces fe-1/2/0 unit 2 family inet address 10.0.0.2/30 set interfaces fe-1/2/1 unit 5 family inet address 10.0.0.5/30 set interfaces lo0 unit 2 family inet address 192.168.2.2/32 set interfaces lo0 unit 2 family inet address 172.16.2.2/32 set protocols rip rib-group inet-to-voice set protocols rip group to-R3 export advertise-routes-through-rip set protocols rip group to-R3 neighbor fe-1/2/1.5 set policy-options policy-statement advertise-routes-through-rip term 1 from protocol direct set policy-options policy-statement advertise-routes-through-rip term 1 from protocol rip set policy-options policy-statement advertise-routes-through-rip term 1 then accept set routing-instances voice protocols rip group to-R1 export advertise-routes-through-rip set routing-instances voice interface fe-1/2/0.2 set routing-instances voice protocols rip rib-group voice-to-inet set routing-instances voice protocols rip group to-R1 neighbor fe-1/2/0.2 set routing-options rib-groups inet-to-voice import-rib inet.0 set routing-options rib-groups inet-to-voice import-rib voice.inet.0 set routing-options rib-groups voice-to-inet import-rib voice.inet.0 set routing-options rib-groups voice-to-inet import-rib inet.0
デバイスR3
set interfaces fe-1/2/0 unit 6 family inet address 10.0.0.6/30 set interfaces lo0 unit 3 family inet address 192.168.3.3/32 set interfaces lo0 unit 3 family inet address 172.16.3.3/32 set protocols rip group to-R2 export advertise-routes-through-rip set protocols rip group to-R2 neighbor fe-1/2/0.6 set policy-options policy-statement advertise-routes-through-rip term 1 from protocol direct set policy-options policy-statement advertise-routes-through-rip term 1 from protocol rip set policy-options policy-statement advertise-routes-through-rip term 1 then accept
手順
次の例では、設定階層内のさまざまなレベルに移動する必要があります。CLIのナビゲーションについては、 CLIユーザーガイドの設定モードでのCLIエディターの使用を参照してください。
ルーティング インスタンス間で RIP ルートを再分配するには、次の手順に沿います。
ネットワーク インターフェイスを設定します。
[edit interfaces] user@R2# set fe-1/2/0 unit 2 family inet address 10.0.0.2/30 user@R2# set fe-1/2/1 unit 5 family inet address 10.0.0.5/30 user@R2# set lo0 unit 2 family inet address 192.168.2.2/32 user@R2# set lo0 unit 2 family inet address 172.16.2.2/32
ルーティングインスタンスを作成し、1つ以上のインターフェイスをルーティングインスタンスに追加します。
[edit routing-instances voice] user@R2# set interface fe-1/2/0.2
RIP グループを作成し、インターフェイスを追加します。
[edit protocols rip group to-R3] user@R2# set neighbor fe-1/2/1.5 [edit routing-instances voice protocols rip group to-R1] user@R2# set neighbor fe-1/2/0.2
ルーティング テーブル グループを作成します。
[edit routing-options rib-groups] user@R2# set inet-to-voice import-rib inet.0 user@R2# set inet-to-voice import-rib voice.inet.0 user@R2# set voice-to-inet import-rib voice.inet.0 user@R2# set voice-to-inet import-rib inet.0
ルーティング・テーブル・グループを適用します。
[edit protocols rip] user@R2# set rib-group inet-to-voice [edit routing-instances voice protocols rip] user@R2# set rib-group voice-to-inet
直接ルートと RIP 学習ルートの両方をアドバタイズするルーティング ポリシーを作成します。
[edit policy-options policy-statement advertise-routes-through-rip term 1] user@R2# set from protocol direct user@R2# set from protocol rip user@R2# set then accept
ルーティング ポリシーを適用します。
Junos OS では、RIP エクスポート ポリシーはグループ レベルでのみ適用できます。
[edit protocols rip group to-R3] user@R2# set export advertise-routes-through-rip [edit routing-instances voice protocols rip group to-R1] user@R2# set export advertise-routes-through-rip
結果
設定モードから、 、show routing-instances
show protocols
show policy-options
および のコマンドをshow interfaces
入力して、設定をshow routing-options
確認します。出力に意図した設定が表示されない場合は、この例の設定手順を繰り返して修正します。
user@R2# show interfaces
fe-1/2/0 {
unit 2 {
family inet {
address 10.0.0.2/30;
}
}
}
fe-1/2/1 {
unit 5 {
family inet {
address 10.0.0.5/30;
}
}
}
lo0 {
unit 2 {
family inet {
address 192.168.2.2/32;
address 172.16.2.2/32;
}
}
}
user@R2# show protocols
rip {
rib-group inet-to-voice;
group to-R3 {
export advertise-routes-through-rip;
neighbor fe-1/2/1.5;
}
}
user@R2# show policy-options
policy-statement advertise-routes-through-rip {
term 1 {
from protocol [ direct rip ];
then accept;
}
}
user@R2# show routing-instances
voice {
interface fe-1/2/0.2;
protocols {
rip {
rib-group voice-to-inet;
group to-R1 {
export advertise-routes-through-rip;
neighbor fe-1/2/0.2;
}
}
}
}
user@R2# show routing-options
rib-groups {
inet-to-voice {
import-rib [ inet.0 voice.inet.0 ];
}
voice-to-inet {
import-rib [ voice.inet.0 inet.0 ];
}
}
デバイスの設定が完了したら、設定モードから コミット を入力します。
検証
設定が正しく機能していることを確認します。
ルーティング テーブルの確認
目的
ルーティングテーブルに期待されるルートが含まれていることを確認します。
アクション
動作モードから、 コマンドを show route protocol rip
入力します。
user@R2> show route protocol rip inet.0: 9 destinations, 9 routes (9 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 172.16.0.1/32 *[RIP/100] 01:58:14, metric 2, tag 0 > to 10.0.0.1 via fe-1/2/0.2 172.16.3.3/32 *[RIP/100] 02:06:03, metric 2, tag 0 > to 10.0.0.6 via fe-1/2/0.5 192.168.1.1/32 *[RIP/100] 01:58:14, metric 2, tag 0 > to 10.0.0.1 via fe-1/2/0.2 192.168.3.3/32 *[RIP/100] 02:06:03, metric 2, tag 0 > to 10.0.0.6 via fe-1/2/0.5 224.0.0.9/32 *[RIP/100] 01:44:13, metric 1 MultiRecv voice.inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 172.16.0.1/32 *[RIP/100] 02:06:03, metric 2, tag 0 > to 10.0.0.1 via fe-1/2/0.2 172.16.3.3/32 *[RIP/100] 01:58:14, metric 2, tag 0 > to 10.0.0.6 via fe-1/2/0.5 192.168.1.1/32 *[RIP/100] 02:06:03, metric 2, tag 0 > to 10.0.0.1 via fe-1/2/0.2 192.168.3.3/32 *[RIP/100] 01:58:14, metric 2, tag 0 > to 10.0.0.6 via fe-1/2/0.5 224.0.0.9/32 *[RIP/100] 01:44:13, metric 1 MultiRecv
意味
出力では、両方のルーティング テーブルにすべての RIP ルートが含まれていることが示されています。