AUF DIESER SEITE
Beispiel: Umverteilen von OSPF-Routen in IS-IS
In diesem Beispiel wird gezeigt, wie OSPF-Routen in ein IS-IS-Netzwerk umverteilt werden.
Anforderungen
Vor der Konfiguration dieses Beispiels ist keine spezielle Konfiguration erforderlich, die über die Geräteinitialisierung hinausgeht.
Überblick
Die Exportrichtlinie kann auf IS-IS angewendet werden, um die Routenneuverteilung zu erleichtern.
Junos OS unterstützt die Anwendung von Importrichtlinien für Link-State-Routing-Protokolle wie IS-IS nicht, da solche Richtlinien zu inkonsistenten Einträgen in der Link-State-Datenbank (LSDB) und damit zu Routing-Inkonsistenzen führen können.
In diesem Beispiel werden die OSPF-Routen 192.168.0/24 bis 192.168.3/24 von Gerät R2 in den IS-IS-Bereich 49.0002 umverteilt.
Darüber hinaus werden Richtlinien konfiguriert, um sicherzustellen, dass Gerät R1 Ziele im Netzwerk 10.0.0.44/30 und Gerät R3 Ziele im Netzwerk 10.0.0.36/30 erreichen kann. Dies ermöglicht eine flächendeckende Erreichbarkeit.
Abbildung 1 zeigt die in diesem Beispiel verwendete Topologie.

Die CLI-Schnellkonfiguration zeigt die Konfiguration für alle Geräte in Abbildung 1. Im Abschnitt #configuration759__isis-redist-ospf-step-by-step-r2 werden die Schritte auf Gerät R2 beschrieben. #configuration759__isis-redist-ospf-step-by-step-r3 beschreibt die Schritte auf Gerät R3.
Topologie
Konfiguration
Verfahren
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, damit sie Ihrer Netzwerkkonfiguration entsprechen, und kopieren Sie dann die Befehle, und fügen Sie sie dann in die CLI auf der [edit]
Hierarchieebene ein.
Gerät 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
Gerät 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
Gerät 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
Schritt-für-Schritt-Anleitung
So konfigurieren Sie Gerät R2:
Konfigurieren Sie die Netzwerkschnittstellen.
[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
Konfigurieren Sie IS-IS auf der Schnittstelle, die Gerät R1 und der Loopback-Schnittstelle zugewandt ist.
[edit protocols isis] user@R2# set interface fe-1/2/1.0 user@R2# set interface lo0.0
Konfigurieren Sie die Richtlinie, die es Gerät R1 ermöglicht, das Netzwerk 10.0.0.44/30 zu erreichen.
[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
Wenden Sie die Richtlinie an, die es Gerät R1 ermöglicht, das Netzwerk 10.0.0.44/30 zu erreichen.
[edit protocols isis] user@R2# set export send-direct-to-isis-neighbors
Konfigurieren Sie OSPF auf den Schnittstellen.
[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
Konfigurieren Sie die OSPF-Routenneuverteilungsrichtlinie.
[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
Wenden Sie die OSPF-Routenneuverteilungsrichtlinie auf die IS-IS-Instanz an.
[edit protocols isis] user@R2# set export ospf-isis
Konfigurieren Sie die Richtlinie, die es Gerät R3 ermöglicht, das Netzwerk 10.0.0.36/30 zu erreichen.
[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
Wenden Sie die Richtlinie an, die es Gerät R3 ermöglicht, das Netzwerk 10.0.0.36/30 zu erreichen.
[edit protocols ospf] user@R2# set export send-direct-to-ospf-neighbors
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 mehrstufigen IS-IS:
Konfigurieren Sie die Netzwerkschnittstellen.
Auf der Loopback-Schnittstelle werden mehrere Adressen konfiguriert, um mehrere Routenziele zu simulieren.
[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
Konfigurieren Sie statische Routen zu den Adressen der Loopback-Schnittstelle.
Dies sind die Routen, die in IS-IS umverteilt werden.
[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
Konfigurieren Sie OSPF auf den Schnittstellen.
[edit protocols ospf area 0.0.0.1] user@R3# set interface fe-1/2/0.0 user@R3# set interface lo0.0 passive
Konfigurieren Sie die OSPF-Richtlinie so, dass die statischen Routen exportiert werden.
[edit policy-options policy-statement ospf term 1] user@R3# set from protocol static user@R3# set then accept
Wenden Sie die OSPF-Exportrichtlinie an.
[edit protocols ospf] user@R3# set export ospf
Befund
Bestätigen Sie im Konfigurationsmodus Ihre Konfiguration, indem Sie die show interfaces
Befehle , show protocols
show policy-options
, und show routing-options
eingeben. Wenn in der Ausgabe nicht die beabsichtigte Konfiguration angezeigt wird, wiederholen Sie die Anweisungen in diesem Beispiel, um die Konfiguration zu korrigieren.
Gerät 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;
}
Gerät 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;
}
Wenn Sie mit der Konfiguration des Geräts fertig sind, wechseln commit
Sie aus dem Konfigurationsmodus.
Verifizierung
Vergewissern Sie sich, dass die Konfiguration ordnungsgemäß funktioniert.
- Überprüfen der OSPF-Routenankündigung
- Überprüfen der Route-Neuverteilung
- Überprüfen der Konnektivität
Überprüfen der OSPF-Routenankündigung
Zweck
Stellen Sie sicher, dass die erwarteten Routen von OSPF angekündigt werden.
Aktion
Geben Sie im Betriebsmodus auf Gerät R2 den show route protocol ospf
Befehl ein.
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)
Bedeutung
Die Strecken 192.168/16 werden von OSPF beworben.
Überprüfen der Route-Neuverteilung
Zweck
Stellen Sie sicher, dass die erwarteten Routen von OSPF in IS-IS umverteilt werden.
Aktion
Geben Sie im Betriebsmodus auf Gerät R1 den show route protocol isis
Befehl ein.
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)
Bedeutung
Die Strecken 192.168/16 werden in IS-IS umverteilt.
Überprüfen der Konnektivität
Zweck
Vergewissern Sie sich, dass Gerät R1 die Ziele auf Gerät R3 erreichen kann.
Aktion
Geben Sie im Betriebsmodus den ping
Befehl ein.
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
Bedeutung
Diese Ergebnisse bestätigen, dass Gerät R1 die Ziele im OSPF-Netzwerk erreichen kann.