AUF DIESER SEITE
Beispiel: Konfigurieren einer Routing-Richtlinie zur Neuverteilung von BGP-Routen mit einem bestimmten Community-Tag in IS-IS
In diesem Beispiel wird eine Richtlinie definiert, die BGP-Routen aus der Community mit einer Edu
Metrik von 63 in IS-IS platziert.
Anforderungen
Vor der Konfiguration dieses Beispiels ist keine spezielle Konfiguration erforderlich, die über die Geräteinitialisierung hinausgeht.
Überblick
Abbildung 1 zeigt die in diesem Beispiel verwendete Topologie.

In diesem Beispiel befinden sich Gerät A, Gerät B, Gerät C und Gerät D im autonomen System (AS) 1 und führen IS-IS aus. Alle AS 1-Geräte, mit Ausnahme von Gerät D, führen internes BGP (IBGP) aus.
Gerät E befindet sich in AS 2 und verfügt über eine externe BGP (EBGP)-Peering-Sitzung mit Gerät C. Gerät E verfügt über zwei statische Routen, 10.2.0.0/16 und 10.3.0.0/16. Diese Routen sind mit dem Community-Attribut "Edu 2:5" gekennzeichnet und werden über EBGP an Gerät C angekündigt.
Gerät C akzeptiert die BGP-Routen, die mit dem Community-Attribut "Edu 2:5" gekennzeichnet sind, verteilt die Routen in IS-IS neu und wendet eine IS-IS-Metrik von 63 auf diese Routen an.
Die CLI-Schnellkonfiguration zeigt die Konfiguration für alle Geräte in Abbildung 1. Im Abschnitt #configuration589__isis-community-step-by-step werden die Schritte auf Gerät C und Gerät E beschrieben.
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 A
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.5/30 set interfaces fe-1/2/0 unit 0 family iso set interfaces lo0 unit 0 family inet address 192.168.0.1/32 set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0001.00 set protocols bgp group int type internal set protocols bgp group int local-address 192.168.0.1 set protocols bgp group int neighbor 192.168.0.2 set protocols bgp group int neighbor 192.168.0.3 set protocols isis interface fe-1/2/0.0 level 1 disable set protocols isis interface lo0.0 set routing-options router-id 192.168.0.1 set routing-options autonomous-system 1
Gerät B
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.6/30 set interfaces fe-1/2/0 unit 0 family iso set interfaces fe-1/2/1 unit 0 family inet address 10.0.0.9/30 set interfaces fe-1/2/1 unit 0 family iso set interfaces lo0 unit 0 family inet address 192.168.0.2/32 set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0002.00 set protocols bgp group int type internal set protocols bgp group int local-address 192.168.0.2 set protocols bgp group int neighbor 192.168.0.1 set protocols bgp group int neighbor 192.168.0.3 set protocols isis interface fe-1/2/0.0 level 1 disable set protocols isis interface fe-1/2/1.0 level 1 disable set protocols isis interface lo0.0 set routing-options router-id 192.168.0.2 set routing-options autonomous-system 1
Gerät C
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.10/30 set interfaces fe-1/2/0 unit 0 family iso set interfaces fe-1/2/1 unit 0 family inet address 10.0.0.13/30 set interfaces fe-1/2/1 unit 0 family iso set interfaces fe-1/2/2 unit 0 family inet address 10.0.0.25/30 set interfaces fe-1/2/2 unit 0 family iso set interfaces lo0 unit 0 family inet address 192.168.0.3/32 set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0003.00 set protocols bgp group int type internal set protocols bgp group int local-address 192.168.0.3 set protocols bgp group int neighbor 192.168.0.1 set protocols bgp group int neighbor 192.168.0.2 set protocols bgp group external-peers type external set protocols bgp group external-peers export send-isis-and-direct set protocols bgp group external-peers peer-as 2 set protocols bgp group external-peers neighbor 10.0.0.26 set protocols isis export Edu-to-isis set protocols isis interface fe-1/2/0.0 level 1 disable set protocols isis interface fe-1/2/1.0 level 1 disable set protocols isis interface fe-1/2/2.0 level 1 disable set protocols isis interface fe-1/2/2.0 level 2 passive set protocols isis interface lo0.0 set policy-options policy-statement Edu-to-isis term 1 from protocol bgp set policy-options policy-statement Edu-to-isis term 1 from community Edu set policy-options policy-statement Edu-to-isis term 1 then metric 63 set policy-options policy-statement Edu-to-isis term 1 then accept set policy-options policy-statement send-isis-and-direct term 1 from protocol isis set policy-options policy-statement send-isis-and-direct term 1 from protocol direct set policy-options policy-statement send-isis-and-direct term 1 from route-filter 10.0.0.0/16 orlonger set policy-options policy-statement send-isis-and-direct term 1 from route-filter 192.168.0.0/16 orlonger set policy-options policy-statement send-isis-and-direct term 1 then accept set policy-options community Edu members 2:5 set routing-options router-id 192.168.0.3 set routing-options autonomous-system 1
Gerät D
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.14/30 set interfaces fe-1/2/0 unit 0 family iso set interfaces lo0 unit 0 family inet address 192.168.0.4/32 set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0004.00 set protocols isis interface fe-1/2/0.0 level 1 disable set protocols isis interface lo0.0 set routing-options router-id 192.168.0.4 set routing-options autonomous-system 1
Gerät E
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.26/30 set interfaces lo0 unit 7 family inet address 192.168.0.5/32 primary set interfaces lo0 unit 7 family inet address 10.2.0.1/32 set interfaces lo0 unit 7 family inet address 10.3.0.1/32 set protocols bgp group external-peers type external set protocols bgp group external-peers export statics set protocols bgp group external-peers peer-as 1 set protocols bgp group external-peers neighbor 10.0.0.25 set policy-options policy-statement statics from protocol static set policy-options policy-statement statics then community add Edu set policy-options policy-statement statics then accept set policy-options community Edu members 2:5 set routing-options static route 10.2.0.0/16 reject set routing-options static route 10.2.0.0/16 install set routing-options static route 10.3.0.0/16 reject set routing-options static route 10.3.0.0/16 install set routing-options router-id 192.168.0.5 set routing-options autonomous-system 2
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 Gerät E:
Konfigurieren Sie die Schnittstellen.
[edit interfaces] user@E# set fe-1/2/0 unit 0 family inet address 10.0.0.26/30 user@E# set lo0 unit 7 family inet address 192.168.0.5/32 primary user@E# set lo0 unit 7 family inet address 10.2.0.1/32 user@E# set lo0 unit 7 family inet address 10.3.0.1/32
Konfigurieren Sie die
statics
Richtlinie, die den statischen Routen dasEdu
Attribut "community" hinzufügt.[edit policy-options] user@E# set policy-statement statics from protocol static user@E# set policy-statement statics then community add Edu user@E# set policy-statement statics then accept user@E# set community Edu members 2:5
Konfigurieren Sie EBGP, und wenden Sie die
statics
Richtlinie an.[edit protocols bgp group external-peers] user@E# set type external user@E# set export statics user@E# set peer-as 1 user@E# set protocols bgp group external-peers neighbor 10.0.0.25
Konfigurieren Sie die statischen Routen.
[edit routing-options static] user@E# set route 10.2.0.0/16 reject user@E# set route 10.2.0.0/16 install user@E# set route 10.3.0.0/16 reject user@E# set route 10.3.0.0/16 install
Konfigurieren Sie die Router-ID und die AS-Nummer.
[edit routing-options] user@E# set router-id 192.168.0.5 user@E# set autonomous-system 2
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 Gerät C:
Konfigurieren Sie die Schnittstellen.
[edit interfaces] user@C# set fe-1/2/0 unit 0 family inet address 10.0.0.10/30 user@C# set fe-1/2/0 unit 0 family iso user@C# set fe-1/2/1 unit 0 family inet address 10.0.0.13/30 user@C# set fe-1/2/1 unit 0 family iso user@C# set fe-1/2/2 unit 0 family inet address 10.0.0.25/30 user@C# set fe-1/2/2 unit 0 family iso user@C# set lo0 unit 0 family inet address 192.168.0.3/32 user@C# set lo0 unit 0 family iso address 49.0002.0192.0168.0003.00
Konfigurieren Sie IBGP.
[edit protocols bgp group int] user@C# set type internal user@C# set local-address 192.168.0.3 user@C# set neighbor 192.168.0.1 user@C# set neighbor 192.168.0.2
Konfigurieren Sie die Edu-to-isis-Richtlinie, die die von Gerät E erlernten BGP-Routen mit Edu-Tags neu verteilt und eine Metrik von 63 anwendet.
[edit policy-options] user@C# set policy-statement Edu-to-isis term 1 from protocol bgp user@C# set policy-statement Edu-to-isis term 1 from community Edu user@C# set policy-statement Edu-to-isis term 1 then metric 63 user@C# set policy-statement Edu-to-isis term 1 then accept user@C# set community Edu members 2:5
Aktivieren Sie IS-IS auf den Schnittstellen, und wenden Sie die Edu-to-isis-Richtlinie an.
[edit protocols isis] user@C# set export Edu-to-isis user@C# set interface fe-1/2/0.0 level 1 disable user@C# set interface fe-1/2/1.0 level 1 disable user@C# set interface fe-1/2/2.0 level 1 disable user@C# set interface fe-1/2/2.0 level 2 passive user@C# set interface lo0.0
Konfigurieren Sie die Richtlinie send-isis-and-direct, die Routen über EBGP an Gerät E verteilt.
Ohne diese Richtlinie wäre Gerät E nicht mit den Netzwerken in AS 1 verbunden.
[edit policy-options policy-statement send-isis-and-direct term 1] user@C# set from protocol isis user@C# set from protocol direct user@C# set from route-filter 10.0.0.0/16 orlonger user@C# set from route-filter 192.168.0.0/16 orlonger user@C# set then accept
Konfigurieren Sie EBGP, und wenden Sie die Richtlinie send-isis-and-direct an.
[edit protocols bgp group external-peers] user@C# set type external user@C# set export send-isis-and-direct user@C# set peer-as 2 user@C# set neighbor 10.0.0.26
Konfigurieren Sie die Router-ID und die AS-Nummer (autonomes System).
[edit routing-options] user@C# set router-id 192.168.0.3 user@C# set autonomous-system 1
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 E
user@E# show interfaces
fe-1/2/0 {
unit 0 {
family inet {
address 10.0.0.26/30;
}
}
}
lo0 {
unit 0 {
family inet {
address 192.168.0.5/32 {
primary;
}
address 10.2.0.1/32;
address 10.3.0.1/32;
}
}
}
user@E# show protocols
bgp {
group external-peers {
type external;
export statics;
peer-as 1;
neighbor 10.0.0.25;
}
}
user@E# show policy-options
policy-statement statics {
from protocol static;
then {
community add Edu;
accept;
}
}
community Edu members 2:5;
user@E# show routing-options
static {
route 10.2.0.0/16 {
reject;
install;
}
route 10.3.0.0/16 {
reject;
install;
}
}
router-id 192.168.0.5;
autonomous-system 2;
Gerät C
user@C# show interfaces
fe-1/2/0 {
unit 0 {
family inet {
address 10.0.0.10/30;
}
family iso;
}
}
fe-1/2/1 {
unit 0 {
family inet {
address 10.0.0.13/30;
}
family iso;
}
}
fe-1/2/2 {
unit 0 {
family inet {
address 10.0.0.25/30;
}
family iso;
}
}
lo0 {
unit 0 {
family inet {
address 192.168.0.3/32;
}
family iso {
address 49.0002.0192.0168.0003.00;
}
}
}
user@C# show protocols
bgp {
group int {
type internal;
local-address 192.168.0.3;
neighbor 192.168.0.1;
neighbor 192.168.0.2;
}
group external-peers {
type external;
export send-isis-and-direct;
peer-as 2;
neighbor 10.0.0.26;
}
}
isis {
export Edu-to-isis;
interface fe-1/2/0.0 {
level 1 disable;
}
interface fe-1/2/1.0 {
level 1 disable;
}
interface fe-1/2/2.0 {
level 1 disable;
level 2 passive;
}
interface lo0.0;
}
user@C# show policy-options
policy-statement Edu-to-isis {
term 1 {
from {
protocol bgp;
community Edu;
}
then {
metric 63;
accept;
}
}
}
policy-statement send-isis-and-direct {
term 1 {
from {
protocol [ isis direct ];
route-filter 10.0.0.0/16 orlonger;
route-filter 192.168.0.0/16 orlonger;
}
then accept;
}
}
community Edu members 2:5;
user@C# show routing-options
router-id 192.168.0.3;
autonomous-system 1;
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.
Verifizieren des IS-IS-Nachbarn
Zweck
Stellen Sie sicher, dass die BGP-Routen von Gerät E über das IS-IS-Netzwerk in AS 1 kommuniziert werden.
Aktion
Geben Sie im Betriebsmodus den show route protocol isis
Befehl ein.
user@D> show route protocol isis inet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.4/30 *[IS-IS/18] 22:30:53, metric 30 > to 10.0.0.13 via fe-1/2/0.0 10.0.0.8/30 *[IS-IS/18] 22:30:53, metric 20 > to 10.0.0.13 via fe-1/2/0.0 10.0.0.24/30 *[IS-IS/18] 03:31:21, metric 20 > to 10.0.0.13 via fe-1/2/0.0 10.2.0.0/16 *[IS-IS/165] 02:36:31, metric 73 > to 10.0.0.13 via fe-1/2/0.0 10.3.0.0/16 *[IS-IS/165] 02:36:31, metric 73 > to 10.0.0.13 via fe-1/2/0.0 192.168.0.1/32 *[IS-IS/18] 03:40:28, metric 30 > to 10.0.0.13 via fe-1/2/0.0 192.168.0.2/32 *[IS-IS/18] 22:30:53, metric 20 > to 10.0.0.13 via fe-1/2/0.0 192.168.0.3/32 *[IS-IS/18] 22:30:53, metric 10 > to 10.0.0.13 via fe-1/2/0.0 iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
Bedeutung
Wie erwartet, befinden sich die Routen 10.2.0.0/16 und 10.3.0.0/16 in der Routing-Tabelle von Gerät D als externe IS-IS-Routen mit einer Metrik von 73. Wenn Gerät C der Metrik nicht 63 hinzugefügt hätte, hätte Gerät D eine Metrik von 10 für diese Routen.