OSPF auf logischen Systemen konfigurieren
OSPF-Unterstützung für logische Systeme
In diesem Thema werden die folgenden Informationen beschrieben:
Einführung in logische Systeme
Mit Junos OS können Sie einen einzelnen physischen Router in mehrere logische Geräte partitionieren, die unabhängige Routing-Aufgaben ausführen. Da logische Systeme einen Teil der Aufgaben ausführen, die früher vom Hauptrouter erledigt wurden, bieten logische Systeme eine effektive Möglichkeit, die Nutzung einer einzelnen Routing- oder Switching-Plattform zu maximieren. Logische Systeme haben ihre eigenen Routing-Tabellen, Schnittstellen, Richtlinien und Routing-Instanzen.
OSPF und logische Systeme
Sie können sowohl OSPF Version 2 (OSPFv2) als auch OSPF Version 3 (OSPFv3) für logische Systeme konfigurieren. Im Fall von OSPFv3 können Sie auch OSPFv3-Bereiche für logische Systeme konfigurieren, wodurch OSPFv3 andere Adressfamilien als Unicast-IPv6 ankündigen kann.
Sie konfigurieren OSPF für logische Systeme auf folgenden Hierarchieebenen:
[Protokolle für logische Systeme logical-system-name bearbeiten (OSPF | OSPF3)]
[Logische-Systemprotokolle logical-system-name OSPF3-Bereich bearbeiten (IPv4-Unicast | IPv4-Multicast | IPv6-Multicast)]
[Routinginstanzprotokolle routing-instance-name für logische Systeme logical-system-name bearbeiten (OSPF | OSPF3)]
[Logische-Systeme logical-system-name , Routinginstanzen, routing-instance-name Protokolle, OSPF3-Bereich, bearbeiten (IPv4-Unicast | IPv4-Multicast | IPv6-Multicast)]
Beispiel: Konfigurieren von OSPF auf logischen Systemen innerhalb desselben Routers
In diesem Beispiel wird gezeigt, wie ein OSPF-Netzwerk mit mehreren logischen Systemen konfiguriert wird, die auf einem einzigen physischen Router ausgeführt werden. Die logischen Systeme sind über logische Tunnelschnittstellen miteinander verbunden.
Anforderungen
Sie müssen die logischen Systeme über logische Tunnelschnittstellen (lt) verbinden. Siehe Beispiel: Verbinden logischer Systeme innerhalb desselben Geräts über logische Tunnelschnittstellen an Routern der MX-Serie und Switches der EX-Serie.
Überblick
Dieses Beispiel zeigt die Konfiguration eines einzelnen OSPF-Bereichs mit drei logischen Systemen, die auf einem physischen Router ausgeführt werden. Jedes logische System verfügt über eine eigene Routing-Tabelle. Die Konfiguration aktiviert das Protokoll auf allen logischen Systemschnittstellen, die an der OSPF-Domäne beteiligt sind, und gibt den Bereich an, in dem sich die Schnittstellen befinden.
Konfiguration
CLI Schnellkonfiguration
Um dieses Beispiel schnell zu konfigurieren, kopieren Sie die folgenden Befehle, fügen Sie sie in eine Textdatei ein, entfernen Sie alle Zeilenumbrüche, ändern Sie alle erforderlichen Details, um sie an Ihre Netzwerkkonfiguration anzupassen, kopieren Sie die Befehle, fügen Sie sie in die CLI auf der Hierarchieebene [Bearbeiten] ein und geben Sie sie dann aus dem Konfigurationsmodus ein 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
Verfahren
Schritt-für-Schritt-Anleitung
Im folgenden Beispiel müssen Sie durch verschiedene Ebenen in der Konfigurationshierarchie navigieren. Weitere Informationen zum Navigieren in der CLI finden Sie unter Verwenden des CLI-Editors im Konfigurationsmodus im CLI-Benutzerhandbuch.
So konfigurieren Sie OSPF auf logischen Systemen:
Konfigurieren Sie die logische Tunnelschnittstelle auf dem logischen System LS1, das eine Verbindung zum logischen System LS2 herstellt.
[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
Konfigurieren Sie die logische Tunnelschnittstelle auf dem logischen System LS1, das eine Verbindung zum logischen System LS3 herstellt.
[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
Konfigurieren Sie die logische Tunnelschnittstelle auf dem logischen System LS2, das eine Verbindung zum logischen System LS1 herstellt.
[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
Konfigurieren Sie die logische Tunnelschnittstelle auf dem logischen System LS2, das eine Verbindung zum logischen System LS3 herstellt.
[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
Konfigurieren Sie die logische Tunnelschnittstelle auf dem logischen System LS3, das eine Verbindung zum logischen System LS2 herstellt.
[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
Konfigurieren Sie die logische Tunnelschnittstelle auf dem logischen System LS3, das eine Verbindung zum logischen System LS1 herstellt.
[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
Konfigurieren Sie OSPF auf allen Schnittstellen.
[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
Wenn Sie mit der Konfiguration des Geräts fertig sind, bestätigen Sie die Konfiguration.
[edit] user@host# commit
Befund
Bestätigen Sie Ihre Konfiguration, indem Sie den show logical-systems
Befehl eingeben.
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; } } } }
Verifizierung
Vergewissern Sie sich, dass die Konfiguration ordnungsgemäß funktioniert.
- Überprüfen, ob die logischen Systeme betriebsbereit sind
- Überprüfen der Konnektivität zwischen den logischen Systemen
Überprüfen, ob die logischen Systeme betriebsbereit sind
Zweck
Stellen Sie sicher, dass die Schnittstellen ordnungsgemäß konfiguriert sind.
Aktion
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 ...
Überprüfen der Konnektivität zwischen den logischen Systemen
Zweck
Stellen Sie sicher, dass die OSPF-Nachbarschaften hergestellt sind, indem Sie die OSPF-Nachbartabellen überprüfen, die Routingtabellen überprüfen und die logischen Systeme pingen.
Aktion
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
Von LS1, Ping LS3
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
Von LS3, Ping LS1
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