例:OSPF ルートを IS-IS に再分配する
この例では、OSPFルートをIS-ISネットワークに再分配する方法を示しています。
要件
この例を設定する前に、デバイス初期化以外の特別な設定は必要ありません。
概要
エクスポート ポリシーを IS-IS に適用して、ルート再分配を促進できます。
Junos OSは、IS-ISなどのリンクステートルーティングプロトコルに対するインポートポリシーの適用をサポートしていません。その理由は、そのようなポリシーによってLSDB(リンクステートデータベース)エントリーの不整合が発生し、その結果、ルーティングがインスタンス化しない可能性があるためです。
この例では、OSPF ルート 192.168.0/24~192.168.3/24 は、デバイス R2 から IS-IS エリア 49.0002 に再分配されます。
さらに、デバイス R1 が 10.0.0.44/30 ネットワークの宛先に到達できるようにポリシーが設定されており、デバイス R3 は 10.0.0.36/30 ネットワーク上の宛先に到達できます。これにより、エンドツーエンドの到達可能性が実現します。
図 1 は、この例で使用したトポロジーを示しています。

CLI クイック設定 は、 図 1 にすべてのデバイスの設定を示しています。セクション #configuration759__isis-redist-ospf-step-by-r2 では、デバイス R2 の手順について説明します。 #configuration759__isis-redist-ospf-step-by-step-r3 では、デバイス R3 の手順について説明します。
トポロジ
構成
手順
CLI クイックコンフィギュレーション
この例を迅速に設定するには、以下のコマンドをコピーしてテキスト ファイルに貼り付け、改行を削除し、ネットワーク設定に合わせて必要な詳細を変更してから、 階層レベルの CLI にコマンドを [edit]
コピー アンド ペーストします。
デバイス R1
set interfaces fe-1/2/0 unit 0 description to-R7 set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.38/30 set interfaces fe-1/2/0 unit 0 family iso set interfaces lo0 unit 0 family inet address 172.16.3.5/32 set interfaces lo0 unit 0 family iso address 49.0002.0172.0016.0305.00 set protocols isis interface fe-1/2/0.0 set protocols isis interface lo0.0
デバイスR2
set interfaces fe-1/2/1 unit 0 description to-R5 set interfaces fe-1/2/1 unit 0 family inet address 10.0.0.37/30 set interfaces fe-1/2/1 unit 0 family iso set interfaces fe-1/2/0 unit 0 description to-OSPF-network set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.45/30 set interfaces lo0 unit 0 family inet address 172.16.9.7/32 set interfaces lo0 unit 0 family iso address 49.0002.0172.0016.0907.00 set protocols isis export ospf-isis set protocols isis export send-direct-to-isis-neighbors set protocols isis interface fe-1/2/1.0 set protocols isis interface lo0.0 set protocols ospf export send-direct-to-ospf-neighbors set protocols ospf area 0.0.0.1 interface fe-1/2/0.0 set protocols ospf area 0.0.0.1 interface lo0.0 passive set policy-options policy-statement ospf-isis term 1 from protocol ospf set policy-options policy-statement ospf-isis term 1 from route-filter 192.168.0.0/22 longer set policy-options policy-statement ospf-isis term 1 then accept set policy-options policy-statement send-direct-to-isis-neighbors from protocol direct set policy-options policy-statement send-direct-to-isis-neighbors from route-filter 10.0.0.44/30 exact set policy-options policy-statement send-direct-to-isis-neighbors then accept set policy-options policy-statement send-direct-to-ospf-neighbors from protocol direct set policy-options policy-statement send-direct-to-ospf-neighbors from route-filter 10.0.0.36/30 exact set policy-options policy-statement send-direct-to-ospf-neighbors then accept
デバイスR3
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.46/30 set interfaces lo0 unit 0 family inet address 192.168.1.1/32 set interfaces lo0 unit 0 family inet address 192.168.2.1/32 set interfaces lo0 unit 0 family inet address 192.168.3.1/32 set interfaces lo0 unit 0 family inet address 192.168.0.1/32 set protocols ospf export ospf set protocols ospf area 0.0.0.1 interface fe-1/2/0.0 set protocols ospf area 0.0.0.1 interface lo0.0 passive set policy-options policy-statement ospf term 1 from protocol static set policy-options policy-statement ospf term 1 then accept set routing-options static route 192.168.0.0/24 discard set routing-options static route 192.168.1.0/24 discard set routing-options static route 192.168.3.0/24 discard set routing-options static route 192.168.2.0/24 discard
手順
デバイスR2を設定するには:
ネットワーク インターフェイスを設定します。
[edit interfaces] user@R2# set fe-1/2/1 unit 0 description to-R5 user@R2# set fe-1/2/1 unit 0 family inet address 10.0.0.37/30 user@R2# set fe-1/2/1 unit 0 family iso user@R2# set fe-1/2/0 unit 0 description to-OSPF-network user@R2# set fe-1/2/0 unit 0 family inet address 10.0.0.45/30 user@R2# set lo0 unit 0 family inet address 172.16.9.7/32 user@R2# set lo0 unit 0 family iso address 49.0002.0172.0016.0907.00
デバイスR1とループバックインターフェイスに面するインターフェイスでIS-ISを設定します。
[edit protocols isis] user@R2# set interface fe-1/2/1.0 user@R2# set interface lo0.0
デバイスR1が10.0.0.44/30ネットワークに到達できるようにポリシーを設定します。
[edit policy-options policy-statement send-direct-to-isis-neighbors] user@R2# set from protocol direct user@R2# set from route-filter 10.0.0.44/30 exact user@R2# set then accept
デバイスR1が10.0.0.44/30ネットワークに到達できるようにするポリシーを適用します。
[edit protocols isis] user@R2# set export send-direct-to-isis-neighbors
インターフェイスにOSPFを設定します。
[edit protocols ospf] user@R2# set area 0.0.0.1 interface fe-1/2/0.0 user@R2# set area 0.0.0.1 interface lo0.0 passive
OSPFルート再分配ポリシーを設定します。
[edit policy-options policy-statement ospf-isis term 1] user@R2# set from protocol ospf user@R2# set from route-filter 192.168.0.0/22 longer user@R2# set then accept
OSPFルート再分配ポリシーをIS-ISインスタンスに適用します。
[edit protocols isis] user@R2# set export ospf-isis
デバイスR3が10.0.0.36/30ネットワークに到達できるようにするポリシーを設定します。
[edit policy-options policy-statement send-direct-to-ospf-neighbors] user@R2# set from protocol direct user@R2# set from route-filter 10.0.0.36/30 exact user@R2# set then accept
デバイスR3が10.0.0.36/30ネットワークに到達できるようにするポリシーを適用します。
[edit protocols ospf] user@R2# set export send-direct-to-ospf-neighbors
手順
次の例では、設定階層内のさまざまなレベルに移動する必要があります。CLIのナビゲーションについては、 CLIユーザーガイドの設定モードでのCLIエディターの使用を参照してください。
マルチレベルIS-ISを設定するには:
ネットワーク インターフェイスを設定します。
ループバックインターフェイスには、複数のルート宛先をシミュレートするために、複数のアドレスが設定されています。
[edit interfaces] user@R3# set fe-1/2/0 unit 0 family inet address 10.0.0.46/30 user@R3# set lo0 unit 0 family inet address 192.168.1.1/32 user@R3# set lo0 unit 0 family inet address 192.168.2.1/32 user@R3# set lo0 unit 0 family inet address 192.168.3.1/32 user@R3# set lo0 unit 0 family inet address 192.168.0.1/32
ループバックインターフェイスアドレスへの静的ルートを設定します。
これらは、IS-IS に再配布されるルートです。
[edit routing-options static] user@R3# set route 192.168.0.0/24 discard user@R3# set route 192.168.1.0/24 discard user@R3# set route 192.168.3.0/24 discard user@R3# set route 192.168.2.0/24 discard
インターフェイスにOSPFを設定します。
[edit protocols ospf area 0.0.0.1] user@R3# set interface fe-1/2/0.0 user@R3# set interface lo0.0 passive
静的ルートをエクスポートするようにOSPFポリシーを設定します。
[edit policy-options policy-statement ospf term 1] user@R3# set from protocol static user@R3# set then accept
OSPF エクスポート ポリシーを適用します。
[edit protocols ospf] user@R3# set export ospf
結果
設定モードから、 、show policy-options
show protocols
および のコマンドをshow interfaces
入力して設定をshow routing-options
確認します。出力結果に意図した設定が表示されない場合は、この例の手順を繰り返して設定を修正します。
デバイスR2
user@R2# show interfaces
fe-1/2/1 {
unit 0 {
description to-R5;
family inet {
address 10.0.0.37/30;
}
family iso;
}
}
fe-1/2/0 {
unit 0 {
description to-OSPF-network;
family inet {
address 10.0.0.45/30;
}
}
}
lo0 {
unit 0 {
family inet {
address 172.16.9.7/32;
}
family iso {
address 49.0002.0172.0016.0907.00;
}
}
}
user@R2# show protocols
isis {
export [ ospf-isis send-direct-to-isis-neighbors ];
interface fe-1/2/1.0;
interface lo0.0;
}
ospf {
export send-direct-to-ospf-neighbors;
area 0.0.0.1 {
interface fe-1/2/0.0;
interface lo0.0 {
passive;
}
}
}
user@R2# show policy-options
policy-statement ospf-isis {
term 1 {
from {
protocol ospf;
route-filter 192.168.0.0/22 longer;
}
then accept;
}
}
policy-statement send-direct-to-isis-neighbors {
from {
protocol direct;
route-filter 10.0.0.44/30 exact;
}
then accept;
}
policy-statement send-direct-to-ospf-neighbors {
from {
protocol direct;
route-filter 10.0.0.36/30 exact;
}
then accept;
}
デバイスR3
user@R3# show interfaces
fe-1/2/0 {
unit 0 {
family inet {
address 10.0.0.46/30;
}
}
}
lo0 {
unit 0 {
family inet {
address 192.168.1.1/32;
address 192.168.2.1/32;
address 192.168.3.1/32;
address 192.168.0.1/32;
}
}
}
user@R3# show protocols
ospf {
export ospf;
area 0.0.0.1 {
interface fe-1/2/0.0;
interface lo0.0 {
passive;
}
}
}
user@R3# show policy-options
policy-statement ospf {
term 1 {
from protocol static;
then accept;
}
}
user@R3# show routing-options
static {
route 192.168.0.0/24 discard;
route 192.168.1.0/24 discard;
route 192.168.3.0/24 discard;
route 192.168.2.0/24 discard;
}
デバイスの設定が完了したら、設定モードから を入力します commit
。
検証
設定が正しく機能していることを確認します。
OSPFルートアドバタイズメントの検証
目的
期待されるルートがOSPFによってアドバタイズされていることを確認します。
アクション
デバイスR2の動作モードから、 コマンドを show route protocol ospf
入力します。
user@R2> show route protocol ospf inet.0: 15 destinations, 15 routes (15 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 192.168.0.0/24 *[OSPF/150] 03:54:21, metric 0, tag 0 > to 10.0.0.46 via fe-1/2/0.0 192.168.0.1/32 *[OSPF/10] 03:54:21, metric 1 > to 10.0.0.46 via fe-1/2/0.0 192.168.1.0/24 *[OSPF/150] 03:54:21, metric 0, tag 0 > to 10.0.0.46 via fe-1/2/0.0 192.168.1.1/32 *[OSPF/10] 03:54:21, metric 1 > to 10.0.0.46 via fe-1/2/0.0 192.168.2.0/24 *[OSPF/150] 03:54:21, metric 0, tag 0 > to 10.0.0.46 via fe-1/2/0.0 192.168.2.1/32 *[OSPF/10] 03:54:21, metric 1 > to 10.0.0.46 via fe-1/2/0.0 192.168.3.0/24 *[OSPF/150] 03:54:21, metric 0, tag 0 > to 10.0.0.46 via fe-1/2/0.0 192.168.3.1/32 *[OSPF/10] 03:54:21, metric 1 > to 10.0.0.46 via fe-1/2/0.0 224.0.0.5/32 *[OSPF/10] 03:56:03, metric 1 MultiRecv iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
意味
192.168/16ルートはOSPFによってアドバタイズされます。
ルート再分配の検証
目的
期待されるルートがOSPFからIS-ISに再配布されていることを確認します。
アクション
デバイスR1の動作モードから、 コマンドを show route protocol isis
入力します。
user@R1> show route protocol isis inet.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.44/30 *[IS-IS/160] 03:45:24, metric 20 > to 10.0.0.37 via fe-1/2/0.0 172.16.9.7/32 *[IS-IS/15] 03:49:46, metric 10 > to 10.0.0.37 via fe-1/2/0.0 192.168.0.0/24 *[IS-IS/160] 03:49:46, metric 10 > to 10.0.0.37 via fe-1/2/0.0 192.168.0.1/32 *[IS-IS/160] 03:49:46, metric 11, tag2 1 > to 10.0.0.37 via fe-1/2/0.0 192.168.1.0/24 *[IS-IS/160] 03:49:46, metric 10 > to 10.0.0.37 via fe-1/2/0.0 192.168.1.1/32 *[IS-IS/160] 03:49:46, metric 11, tag2 1 > to 10.0.0.37 via fe-1/2/0.0 192.168.2.0/24 *[IS-IS/160] 03:49:46, metric 10 > to 10.0.0.37 via fe-1/2/0.0 192.168.2.1/32 *[IS-IS/160] 03:49:46, metric 11, tag2 1 > to 10.0.0.37 via fe-1/2/0.0 192.168.3.0/24 *[IS-IS/160] 03:49:46, metric 10 > to 10.0.0.37 via fe-1/2/0.0 192.168.3.1/32 *[IS-IS/160] 03:49:46, metric 11, tag2 1 > to 10.0.0.37 via fe-1/2/0.0 iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
意味
192.168/16 ルートは IS-IS に再配布されます。
接続性の検証
目的
デバイス R1 がデバイス R3 の宛先に到達できることを確認します。
アクション
動作モードから、 コマンドを ping
入力します。
user@R1> ping 192.168.1.1 PING 192.168.1.1 (192.168.1.1): 56 data bytes 64 bytes from 192.168.1.1: icmp_seq=0 ttl=63 time=2.089 ms 64 bytes from 192.168.1.1: icmp_seq=1 ttl=63 time=1.270 ms 64 bytes from 192.168.1.1: icmp_seq=2 ttl=63 time=2.135 ms
意味
これらの結果は、デバイス R1 が OSPF ネットワーク内の宛先に到達できることを確認します。