論理システムでの OSPF の設定
論理システムにおける OSPF サポート
このトピックでは、次の情報について説明します。
論理システム概論
Junos OS では、単一の物理ルーターを、独立したルーティング タスクを実行する複数の論理デバイスに分割できます。論理システムは、かつてメインルーターで処理されたタスクのサブセットを実行するため、論理システムは、単一のルーティングまたはスイッチングプラットフォームを最大限に活用する効果的な方法を提供します。論理システムには、独自のルーティングテーブル、インターフェイス、ポリシー、ルーティングインスタンスがあります。
OSPF と論理システム
論理システムには、OSPF バージョン 2(OSPFv2)と OSPF バージョン 3(OSPFv3)の両方を設定できます。OSPFv3 の場合、論理システムに OSPFv3 レルムを設定することもでき、OSPFv3 がユニキャスト IPv6 以外のアドレス ファミリーをアドバタイズできるようになります。
論理システムの OSPF は、以下の階層レベルで設定します。
[edit logical-systems logical-system-name protocols (ospf | ospf3)]
[edit logical-systems logical-system-name protocols ospf3 realm (ipv4-unicast | ipv4-multicast | ipv6-multicast)]
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols (ospf | ospf3)]
[edit logical-systems logical-system-name routing-instances routing-instance-name protocols ospf3 realm (ipv4-unicast | ipv4-multicast | ipv6-multicast)]
例:同一ルーター内の論理システムでの OSPF の設定
この例では、単一の物理ルーターで実行されている複数の論理システムを使用してOSPFネットワークを設定する方法を示しています。論理システムは、論理トンネル インターフェイスによって接続されています。
必要条件
論理トンネル(lt)インターフェイスを使用して、論理システムを接続する必要があります。 例:MXシリーズルーターとEXシリーズスイッチで論理トンネルインターフェイスを使用した同一デバイス内の論理システムの接続を参照してください。
概要
この例は、1 つの物理ルーター上で 3 つの論理システムを実行する単一の OSPF エリアの設定を示しています。各論理システムには、独自のルーティングテーブルがあります。この設定では、OSPF ドメインに参加するすべての論理システム インターフェイスでプロトコルを有効にし、インターフェイスが存在するエリアを指定します。
構成
CLIクイック構成
この例を素早く設定するには、以下のコマンドをコピーしてテキスト・ファイルに貼り付け、改行を削除し、ネットワーク・コンフィギュレーションに合わせて必要な詳細を変更し、[edit]階層レベルのCLIにコマンドをコピー&ペーストし、コンフィギュレーション・モードから commit を入力してください。
set logical-systems LS1 interfaces lt-1/2/0 unit 0 description LS1->LS3 set logical-systems LS1 interfaces lt-1/2/0 unit 0 encapsulation ethernet set logical-systems LS1 interfaces lt-1/2/0 unit 0 peer-unit 5 set logical-systems LS1 interfaces lt-1/2/0 unit 0 family inet address 10.0.1.2/30 set logical-systems LS1 interfaces lt-1/2/0 unit 2 description LS1->LS2 set logical-systems LS1 interfaces lt-1/2/0 unit 2 encapsulation ethernet set logical-systems LS1 interfaces lt-1/2/0 unit 2 peer-unit 1 set logical-systems LS1 interfaces lt-1/2/0 unit 2 family inet address 10.0.0.1/30 set logical-systems LS1 protocols ospf area 0.0.0.0 interface lt-1/2/0.0 set logical-systems LS1 protocols ospf area 0.0.0.0 interface lt-1/2/0.2 set logical-systems LS2 interfaces lt-1/2/0 unit 1 description LS2->LS1 set logical-systems LS2 interfaces lt-1/2/0 unit 1 encapsulation ethernet set logical-systems LS2 interfaces lt-1/2/0 unit 1 peer-unit 2 set logical-systems LS2 interfaces lt-1/2/0 unit 1 family inet address 10.0.0.2/30 set logical-systems LS2 interfaces lt-1/2/0 unit 4 description LS2->LS3 set logical-systems LS2 interfaces lt-1/2/0 unit 4 encapsulation ethernet set logical-systems LS2 interfaces lt-1/2/0 unit 4 peer-unit 3 set logical-systems LS2 interfaces lt-1/2/0 unit 4 family inet address 10.0.2.2/30 set logical-systems LS2 protocols ospf area 0.0.0.0 interface lt-1/2/0.1 set logical-systems LS2 protocols ospf area 0.0.0.0 interface lt-1/2/0.4 set logical-systems LS3 interfaces lt-1/2/0 unit 3 description LS3->LS2 set logical-systems LS3 interfaces lt-1/2/0 unit 3 encapsulation ethernet set logical-systems LS3 interfaces lt-1/2/0 unit 3 peer-unit 4 set logical-systems LS3 interfaces lt-1/2/0 unit 3 family inet address 10.0.2.1/30 set logical-systems LS3 interfaces lt-1/2/0 unit 5 description LS3->LS1 set logical-systems LS3 interfaces lt-1/2/0 unit 5 encapsulation ethernet set logical-systems LS3 interfaces lt-1/2/0 unit 5 peer-unit 0 set logical-systems LS3 interfaces lt-1/2/0 unit 5 family inet address 10.0.1.1/30 set logical-systems LS3 protocols ospf area 0.0.0.0 interface lt-1/2/0.5 set logical-systems LS3 protocols ospf area 0.0.0.0 interface lt-1/2/0.3
プロシージャ
手順
次の例では、設定階層のいくつかのレベルに移動する必要があります。CLIのナビゲーションについては、CLIユーザー・ガイド の コンフィギュレーション・モードでのCLIエディタの使用を参照してください。
論理システムで OSPF を設定するには:
論理システム LS2 に接続する論理システム LS1 で論理トンネル インターフェイスを設定します。
[edit] user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 2 description LS1->LS2 user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 2 encapsulation ethernet user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 2 peer-unit 1 user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 2 family inet address 10.0.0.1/30
論理システム LS3 に接続する論理システム LS1 で論理トンネル インターフェイスを設定します。
[edit] user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 0 description LS1->LS3 user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 0 encapsulation ethernet user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 0 peer-unit 5 user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 0 family inet address 10.0.1.2/30
論理システム LS1 に接続する論理システム LS2 で論理トンネル インターフェイスを設定します。
[edit] user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 1 description LS2->LS1 user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 1 encapsulation ethernet user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 1 peer-unit 2 user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 1 family inet address 10.0.0.2/30
論理システム LS3 に接続する論理システム LS2 で論理トンネル インターフェイスを設定します。
[edit] user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 4 description LS2->LS3 user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 4 encapsulation ethernet user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 4 peer-unit 3 user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 4 family inet address 10.0.2.2/30
論理システム LS2 に接続する論理システム LS3 で論理トンネル インターフェイスを設定します。
[edit] user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 3 description LS3->LS2 user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 3 encapsulation ethernet user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 3 peer-unit 4 user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 3 family inet address 10.0.2.1/30
論理システム LS1 に接続する論理システム LS3 で論理トンネル インターフェイスを設定します。
[edit] user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 5 description LS3->LS1 user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 5 encapsulation ethernet user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 5 peer-unit 0 user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 5 family inet address 10.0.1.1/30
すべてのインターフェイスで OSPF を設定します。
[edit] user@host# set logical-systems LS1 protocols ospf area 0.0.0.0 interface lt-1/2/0.0 user@host# set logical-systems LS1 protocols ospf area 0.0.0.0 interface lt-1/2/0.2 user@host# set logical-systems LS2 protocols ospf area 0.0.0.0 interface lt-1/2/0.1 user@host# set logical-systems LS2 protocols ospf area 0.0.0.0 interface lt-1/2/0.4 user@host# set logical-systems LS3 protocols ospf area 0.0.0.0 interface lt-1/2/0.5 user@host# set logical-systems LS3 protocols ospf area 0.0.0.0 interface lt-1/2/0.3
デバイスの設定が完了したら、設定をコミットします。
[edit] user@host# commit
業績
show logical-systemsコマンドを発行して、設定を確認します。
show logical-systems
LS1 {
interfaces {
lt-1/2/0 {
unit 0 {
description LS1->LS3;
encapsulation ethernet;
peer-unit 5;
family inet {
address 10.0.1.2/30;
}
}
unit 2 {
description LS1->LS2;
encapsulation ethernet;
peer-unit 1;
family inet {
address 10.0.0.1/30;
}
}
}
}
protocols {
ospf {
area 0.0.0.0 {
interface lt-1/2/0.0;
interface lt-1/2/0.2;
}
}
}
}
LS2 {
interfaces {
lt-1/2/0 {
unit 1 {
description LS2->LS1;
encapsulation ethernet;
peer-unit 2;
family inet {
address 10.0.0.2/30;
}
}
unit 4 {
description LS2->LS3;
encapsulation ethernet;
peer-unit 3;
family inet {
address 10.0.2.2/30;
}
}
}
}
protocols {
ospf {
area 0.0.0.0 {
interface lt-1/2/0.1;
interface lt-1/2/0.4;
}
}
}
}
LS3 {
interfaces {
lt-1/2/0 {
unit 3 {
description LS3->LS2;
encapsulation ethernet;
peer-unit 4;
family inet {
address 10.0.2.1/30;
}
}
unit 5 {
description LS3->LS1;
encapsulation ethernet;
peer-unit 0;
family inet {
address 10.0.1.1/30;
}
}
}
}
protocols {
ospf {
area 0.0.0.0 {
interface lt-1/2/0.5;
interface lt-1/2/0.3;
}
}
}
}
検証
設定が正常に機能していることを確認します。
論理システムが稼働していることの確認
目的
インターフェイスが正しく設定されていることを確認します。
アクション
user@host> show interfaces terse Interface Admin Link Proto Local Remote ... lt-1/2/0 up up lt-1/2/0.0 up up inet 10.0.1.2/30 lt-1/2/0.1 up up inet 10.0.0.2/30 lt-1/2/0.2 up up inet 10.0.0.1/30 lt-1/2/0.3 up up inet 10.0.2.1/30 lt-1/2/0.4 up up inet 10.0.2.2/30 lt-1/2/0.5 up up inet 10.0.1.1/30 ...
論理システム間の接続の検証
目的
OSPFネイバーテーブルを確認し、ルーティングテーブルを確認し、論理システムにpingを実行することにより、OSPF隣接関係が確立されていることを確認します。
アクション
user@host> show ospf neighbor logical-system LS1 Address Interface State ID Pri Dead 10.0.1.1 lt-1/2/0.0 Full 10.0.1.1 128 37 10.0.0.2 lt-1/2/0.2 Full 10.0.0.2 128 33
user@host> show ospf neighbor logical-system LS2 Address Interface State ID Pri Dead 10.0.0.1 lt-1/2/0.1 Full 10.0.0.1 128 32 10.0.2.1 lt-1/2/0.4 Full 10.0.1.1 128 36
user@host> show ospf neighbor logical-system LS3 Address Interface State ID Pri Dead 10.0.2.2 lt-1/2/0.3 Full 10.0.0.2 128 36 10.0.1.2 lt-1/2/0.5 Full 10.0.0.1 128 37
user@host> show route logical-system LS1
inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.0.0.0/30 *[Direct/0] 00:28:00
> via lt-1/2/0.2
10.0.0.1/32 *[Local/0] 00:28:00
Local via lt-1/2/0.2
10.0.1.0/30 *[Direct/0] 00:28:00
> via lt-1/2/0.0
10.0.1.2/32 *[Local/0] 00:28:00
Local via lt-1/2/0.0
10.0.2.0/30 *[OSPF/10] 00:27:05, metric 2
> to 10.0.1.1 via lt-1/2/0.0
to 10.0.0.2 via lt-1/2/0.2
224.0.0.5/32 *[OSPF/10] 00:28:03, metric 1
MultiRecv
user@host> show route logical-system LS2
inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.0.0.0/30 *[Direct/0] 00:28:31
> via lt-1/2/0.1
10.0.0.2/32 *[Local/0] 00:28:32
Local via lt-1/2/0.1
10.0.1.0/30 *[OSPF/10] 00:27:38, metric 2
> to 10.0.0.1 via lt-1/2/0.1
to 10.0.2.1 via lt-1/2/0.4
10.0.2.0/30 *[Direct/0] 00:28:32
> via lt-1/2/0.4
10.0.2.2/32 *[Local/0] 00:28:32
Local via lt-1/2/0.4
224.0.0.5/32 *[OSPF/10] 00:28:34, metric 1
MultiRecv
user@host> show route logical-system LS3
inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.0.0.0/30 *[OSPF/10] 00:28:23, metric 2
> to 10.0.2.2 via lt-1/2/0.3
to 10.0.1.2 via lt-1/2/0.5
10.0.1.0/30 *[Direct/0] 00:29:13
> via lt-1/2/0.5
10.0.1.1/32 *[Local/0] 00:29:15
Local via lt-1/2/0.5
10.0.2.0/30 *[Direct/0] 00:29:14
> via lt-1/2/0.3
10.0.2.1/32 *[Local/0] 00:29:15
Local via lt-1/2/0.3
224.0.0.5/32 *[OSPF/10] 00:29:16, metric 1
MultiRecv
LS1 から、LS3 に ping を実行します。
user@host> set cli logical-system LS1
user@host:LS1> ping 10.0.2.1 PING 10.0.2.1 (10.0.2.1): 56 data bytes 64 bytes from 10.0.2.1: icmp_seq=0 ttl=64 time=1.215 ms 64 bytes from 10.0.2.1: icmp_seq=1 ttl=64 time=1.150 ms 64 bytes from 10.0.2.1: icmp_seq=2 ttl=64 time=1.134 ms
LS3 から、LS1 に ping を実行します。
user@host> set cli logical-system LS3
user@host:LS3> ping 10.0.0.1 PING 10.0.0.1 (10.0.0.1): 56 data bytes 64 bytes from 10.0.0.1: icmp_seq=0 ttl=64 time=1.193 ms 64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=1.114 ms 64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=1.190 ms
