如何配置多个独立的 IGP IS-IS 和 OSPFv2 实例
了解如何在路由器上配置和运行多个 IGP 实例。
配置 IS-IS 的多个 IGP 实例
了解在路由器上运行 IS-IS 的多个内部网关协议 (IGP) 实例的优势并大致说明。
多实例 IS-IS 的优势
- 您可以使用 IS-IS 的多个 IGP 实例在单个路由器上的独立 IS-IS 域之间重新分配路由。
- 您可以跨独立的 IGP 域构建灵活的 IS-IS 层次结构。
- 允许解耦多个 IS-IS 泛洪域,从而实现更具可扩展性的 IS-IS 部署。
图 1 说明了在路由器上配置多个 IS-IS IGP 实例的几个好处。例如,路由器 F 涉及两个独立的 IS-IS 实例。路由器 F 将 IS-IS 聚合网络 1 和 IS-IS 核心网络视为两个独立的 IGP 域,同时在这些域之间重新分配路由。网络运营商可以利用这种灵活性来构建 IS-IS 域的层次结构。
图 1 还说明了如何使用 IS-IS 的多个 IGP 实例将城域网分成独立的 IS-IS 泛洪域。在此示例中,路由器 D 和 E 加入了 IS-IS 城域网 a、IS-IS 城域网 b 和 IS-IS 城域网 c 网络以及 IS-IS 聚合网络 1。路由器 D 和 E 不会在不同的 IS-IS 域中使用 IS-IS 播发泛洪。相反,它们会在不同的 IS-IS 域之间重新分配特定路由,从而实现更具可扩展性的城域网部署。
多实例 IS-IS 概述
您可以在路由器上同时配置和运行多个独立的 IS-IS IGP 实例。这些实例与默认路由实例相关联,并在默认路由表中安装路由。每个 IS-IS 实例还可以使用标准 Junos OS 路由策略配置导出其他 IS-IS 实例在路由表中安装的路由。默认情况下,不同 IS-IS 实例安装的路由具有相同的路由优先级。
Junos OS 不支持在 IS-IS 的多个 IGP 实例中配置相同的逻辑接口。
在大多数部署方案中,路由器上只有一个 IS-IS 实例会安装给定前缀的路由。因此,无需为多个 IS-IS 实例配置不同的路由首选项。但是,对于多个 IS-IS 实例在路由表中安装同一前缀的路由的某些部署场景,您可以为其他 IS-IS 实例安装的路由设置不同的路由首选项。这样,路由表就可以选择具有最佳路由首选项的路由,并将这些路由安装到转发表中。
您可以将多 IS-IS 实例功能用于分层部署和并行部署。在分层部署的情况下,参与不同 IGP 实例的路由器组之间存在明确定义的边界。在并行部署中,不同的 IGP 实例(通常不超过两个或三个)跨越整个路由器组。您还可以进行混合部署,分层部署中的某些域并行运行 IGP 实例。
您可以通过在 [edit protocols] 层次结构级别包含配置语句来isis-instance配置多个独立的 IS-IS IGP 实例。您在 [edit protocols isis-instance igp-instance-name] 层级使用的配置语句与在 [edit protocols isis] 层级可用的配置语句相同。
isis-instance[] 层级不edit routing-instances routing-instance-name protocols支持配置语句。
您可以通过在 [edit protocols] 层次结构级别包含 configuration 语句来ospf-instance配置多个独立的 OSPFv2 IGP 实例。您在 [edit protocols ospf-instance igp-instance-name] 层级使用的配置语句与在 [edit protocols ospf] 层级可用的配置语句相同。
ospf-instance[] 层级不edit routing-instances routing-instance-name protocols支持配置语句。
您可以在路由器上配置和运行多个具有分段路由 (SR) 功能的 OSPFv2 内部网关协议 (IGP) 实例。您可以创建两个或多个 OSPF 实例,并在每个实例上应用 SR-MPLS。OSPF 的多个实例可以播发不同的前缀段标识符(前缀 SID)。其他实例可以使用这些 SID 来做出路由决策。
多实例 OSPF 与 SR 相结合,可增强网络灵活性、可扩展性和对流量工程的控制,尤其是在大型复杂网络中。
示例:在城域泛洪域中配置独立的 IS-IS 实例
使用此示例了解如何配置运行 IS-IS 的多个 IGP 实例的独立城域泛洪域。
概述
此示例说明如何在城域泛洪域中配置和运行多个独立的 IGP IS-IS 实例。
拓扑结构
图 2 显示了城域泛洪域(城域网 A 和城域网 b)运行独立 IS-IS 的 IGP 实例的示例。在拓扑中,路由器 R3 和 R4 属于城域 IS-IS 域(IS-IS 城域网 a 和 IS-IS 城域网 b)和 IS-IS 核心网域。路由器 R3 和 R4 不会使用 IS-IS 播发泛洪到不同的 IS-IS 域。相反,它们会在不同的 IS-IS 域之间重新分配特定路由,从而实现更具可扩展性的城域网部署。
要求
此示例使用以下硬件和软件组件:
- MX 系列路由器
- 在所有设备上运行 Junos OS 21.1R1 或更高版本
您必须将网络服务模式配置为增强型 IP。增强型 IP 配置可确保路由器使用增强型模式功能。
[edit] user@CE1#set chassis network-services enhanced-ip
配置语 enhanced-ip 句并提交配置后,将显示以下警告消息,提示您重新启动路由器:
'chassis' WARNING: Chassis configuration for network services has been changed. A system reboot is mandatory. Please reboot the system NOW. Continuing without a reboot might result in unexpected system behavior. commit complete
重新启动将启动路由器上的 FPC。
配置
要在路由器上配置和运行多个 IS-IS 的 IGP 实例,请执行以下任务:
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,移除所有换行符,更改任何必要的详细信息以匹配您的网络配置,然后将命令复制粘贴到 [edit] 层级的 CLI 中。
设备 R1
set interfaces ge-0/0/1 description R1-to-R4 set interfaces ge-0/0/1 unit 0 family inet address 192.168.1.1/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/2 description R1-to-R3 set interfaces ge-0/0/2 unit 0 family inet address 192.168.2.1/24 set interfaces ge-0/0/2 unit 0 family iso set interfaces lo0 unit 0 family inet address 192.168.100.1/32 set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0001.00 set protocols isis interface ge-0/0/1.0 level 2 metric 100 set protocols isis interface ge-0/0/1.0 level 1 disable set protocols isis interface ge-0/0/1.0 point-to-point set protocols isis interface ge-0/0/2.0 level 1 disable set protocols isis interface ge-0/0/2.0 level 2 metric 100 set protocols isis interface ge-0/0/2.0 point-to-point set protocols isis interface lo0.0 passive set routing-options router-id 192.168.100.1
设备 R2
set interfaces ge-0/0/1 description R2-to-R3 set interfaces ge-0/0/1 unit 0 family inet address 192.168.3.1/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/2 description R2-to-R4 set interfaces ge-0/0/2 unit 0 family inet address 192.168.4.1/24 set interfaces ge-0/0/2 unit 0 family iso set interfaces lo0 unit 0 family inet address 192.168.100.2/32 set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0002.00 set protocols isis interface ge-0/0/1.0 level 1 disable set protocols isis interface ge-0/0/1.0 level 2 metric 100 set protocols isis interface ge-0/0/1.0 point-to-point set protocols isis interface ge-0/0/2.0 level 1 disable set protocols isis interface ge-0/0/2.0 level 2 metric 100 set protocols isis interface ge-0/0/2.0 point-to-point set protocols isis interface lo0.0 passive set routing-options router-id 192.168.100.2
设备 R3
set interfaces ge-0/0/1 description R3-to-R2 set interfaces ge-0/0/1 unit 0 family inet address 192.168.3.2/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/2 description R3-to-R1 set interfaces ge-0/0/2 unit 0 family inet address 192.168.2.2/24 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/3 description R3-to-R5 set interfaces ge-0/0/3 unit 0 family inet address 192.168.6.1/24 set interfaces ge-0/0/3 unit 0 family iso set interfaces ge-0/0/4 description R3-to-R4 set interfaces ge-0/0/4 vlan-tagging set interfaces ge-0/0/4 unit 0 vlan-id 10 set interfaces ge-0/0/4 unit 0 family inet address 192.168.5.1/24 set interfaces ge-0/0/4 unit 0 family iso set interfaces ge-0/0/4 unit 1 vlan-id 11 set interfaces ge-0/0/4 unit 1 family inet address 192.168.9.1/24 set interfaces ge-0/0/4 unit 1 family iso set interfaces ge-0/0/4 unit 2 vlan-id 12 set interfaces ge-0/0/4 unit 2 family inet address 192.168.10.1/24 set interfaces ge-0/0/4 unit 2 family iso set interfaces lo0 unit 0 family inet address 192.168.100.3/32 set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0003.00 set policy-options policy-statement export-direct-loopback from protocol direct set policy-options policy-statement export-direct-loopback from route-filter 192.168.100.3/32 exact set policy-options policy-statement export-direct-loopback then accept set policy-options policy-statement export-isis from protocol isis set policy-options policy-statement export-isis from level 2 set policy-options policy-statement export-isis from route-filter 192.168.100.0/24 longer set policy-options policy-statement export-isis then accept set policy-options policy-statement export-isis-metro-a from igp-instance metro-a set policy-options policy-statement export-isis-metro-a from protocol isis set policy-options policy-statement export-isis-metro-a from level 2 set policy-options policy-statement export-isis-metro-a from route-filter 192.168.100.0/24 longer set policy-options policy-statement export-isis-metro-a then accept set policy-options policy-statement export-isis-metro-b from igp-instance metro-b set policy-options policy-statement export-isis-metro-b from protocol isis set policy-options policy-statement export-isis-metro-b from level 2 set policy-options policy-statement export-isis-metro-b from route-filter 192.168.100.0/24 longer set policy-options policy-statement export-isis-metro-b then accept set protocols isis interface ge-0/0/3.0 level 1 disable set protocols isis interface ge-0/0/3.0 level 2 metric 100 set protocols isis interface ge-0/0/3.0 point-to-point set protocols isis interface ge-0/0/4.0 level 1 disable set protocols isis interface ge-0/0/4.0 level 2 metric 100 set protocols isis interface ge-0/0/4.0 point-to-point set protocols isis interface lo0.0 passive set protocols isis export export-isis-metro-a set protocols isis export export-isis-metro-b set protocols isis-instance metro-b interface ge-0/0/1.0 level 1 disable set protocols isis-instance metro-b interface ge-0/0/1.0 level 2 metric 100 set protocols isis-instance metro-b interface ge-0/0/1.0 point-to-point set protocols isis-instance metro-b interface ge-0/0/4.2 level 1 disable set protocols isis-instance metro-b interface ge-0/0/4.2 level 2 metric 100 set protocols isis-instance metro-b interface ge-0/0/4.2 point-to-point set protocols isis-instance metro-b export export-isis set protocols isis-instance metro-b export export-direct-loopback set protocols isis-instance metro-b export export-isis-metro-a set protocols isis-instance metro-a interface ge-0/0/2.0 level 1 disable set protocols isis-instance metro-a interface ge-0/0/2.0 level 2 metric 100 set protocols isis-instance metro-a interface ge-0/0/2.0 point-to-point set protocols isis-instance metro-a interface ge-0/0/4.1 level 1 disable set protocols isis-instance metro-a interface ge-0/0/4.1 level 2 metric 100 set protocols isis-instance metro-a interface ge-0/0/4.1 point-to-point set protocols isis-instance metro-a export export-isis set protocols isis-instance metro-a export export-direct-loopback set protocols isis-instance metro-a export export-isis-metro-b set routing-options router-id 192.168.100.3
设备 R4
set interfaces ge-0/0/1 description R4-to-R1 set interfaces ge-0/0/1 unit 0 family inet address 192.168.1.2/24 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/2 description R4-to-R2 set interfaces ge-0/0/2 unit 0 family inet address 192.168.4.2/24 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/3 description R4-to-R6 set interfaces ge-0/0/3 unit 0 family inet address 192.168.7.1/24 set interfaces ge-0/0/3 unit 0 family iso set interfaces ge-0/0/4 description R4-to-R3 set interfaces ge-0/0/4 vlan-tagging set interfaces ge-0/0/4 unit 0 vlan-id 10 set interfaces ge-0/0/4 unit 0 family inet address 192.168.5.2/24 set interfaces ge-0/0/4 unit 0 family iso set interfaces ge-0/0/4 unit 1 vlan-id 11 set interfaces ge-0/0/4 unit 1 family inet address 192.168.9.2/24 set interfaces ge-0/0/4 unit 1 family iso set interfaces ge-0/0/4 unit 2 vlan-id 12 set interfaces ge-0/0/4 unit 2 family inet address 192.168.10.2/24 set interfaces ge-0/0/4 unit 2 family iso set interfaces lo0 unit 0 family inet address 192.168.100.4/32 set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0004.00 set policy-options policy-statement export-direct-loopback from protocol direct set policy-options policy-statement export-direct-loopback from route-filter 192.168.100.4/32 exact set policy-options policy-statement export-direct-loopback then accept set policy-options policy-statement export-isis from protocol isis set policy-options policy-statement export-isis from level 2 set policy-options policy-statement export-isis from route-filter 192.168.100.0/24 longer set policy-options policy-statement export-isis then accept set policy-options policy-statement export-isis-metro-a from igp-instance metro-a set policy-options policy-statement export-isis-metro-a from protocol isis set policy-options policy-statement export-isis-metro-a from level 2 set policy-options policy-statement export-isis-metro-a from route-filter 192.168.100.0/24 longer set policy-options policy-statement export-isis-metro-a then accept set policy-options policy-statement export-isis-metro-b from igp-instance metro-b set policy-options policy-statement export-isis-metro-b from protocol isis set policy-options policy-statement export-isis-metro-b from level 2 set policy-options policy-statement export-isis-metro-b from route-filter 192.168.100.0/24 longer set policy-options policy-statement export-isis-metro-b then accept set protocols isis interface ge-0/0/3.0 level 1 disable set protocols isis interface ge-0/0/3.0 level 2 metric 100 set protocols isis interface ge-0/0/3.0 point-to-point set protocols isis interface ge-0/0/4.0 level 1 disable set protocols isis interface ge-0/0/4.0 level 2 metric 100 set protocols isis interface ge-0/0/4.0 point-to-point set protocols isis interface lo0.0 passive set protocols isis export export-isis-metro-a set protocols isis export export-isis-metro-b set protocols isis-instance metro-a interface ge-0/0/1.0 level 1 disable set protocols isis-instance metro-a interface ge-0/0/1.0 level 2 metric 100 set protocols isis-instance metro-a interface ge-0/0/1.0 point-to-point set protocols isis-instance metro-a interface ge-0/0/4.1 level 1 disable set protocols isis-instance metro-a interface ge-0/0/4.1 level 2 metric 100 set protocols isis-instance metro-a interface ge-0/0/4.1 point-to-point set protocols isis-instance metro-a export export-isis set protocols isis-instance metro-a export export-direct-loopback set protocols isis-instance metro-a export export-isis-metro-b set protocols isis-instance metro-b interface ge-0/0/2.0 level 1 disable set protocols isis-instance metro-b interface ge-0/0/2.0 level 2 metric 100 set protocols isis-instance metro-b interface ge-0/0/2.0 point-to-point set protocols isis-instance metro-b interface ge-0/0/4.2 level 1 disable set protocols isis-instance metro-b interface ge-0/0/4.2 level 2 metric 100 set protocols isis-instance metro-b interface ge-0/0/4.2 point-to-point set protocols isis-instance metro-b export export-isis set protocols isis-instance metro-b export export-direct-loopback set protocols isis-instance metro-b export export-isis-metro-a set routing-options router-id 192.168.100.4
设备 R5
set interfaces ge-0/0/2 description R5-to-R6 set interfaces ge-0/0/2 unit 0 family inet address 192.168.8.1/24 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/3 description R5-to-R3 set interfaces ge-0/0/3 unit 0 family inet address 192.168.6.2/24 set interfaces ge-0/0/3 unit 0 family iso set interfaces lo0 unit 0 family inet address 192.168.100.5/32 set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0005.00 set protocols isis interface ge-0/0/2.0 level 1 disable set protocols isis interface ge-0/0/2.0 level 2 metric 100 set protocols isis interface ge-0/0/2.0 point-to-point set protocols isis interface ge-0/0/3.0 level 1 disable set protocols isis interface ge-0/0/3.0 level 2 metric 100 set protocols isis interface ge-0/0/3.0 point-to-point set protocols isis interface lo0.0 passive set routing-options router-id 192.168.100.5
设备 R6
set interfaces ge-0/0/2 description R6-to-R5 set interfaces ge-0/0/2 unit 0 family inet address 192.168.8.2/24 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/3 description R6-to-R4 set interfaces ge-0/0/3 unit 0 family inet address 192.168.7.2/24 set interfaces ge-0/0/3 unit 0 family iso set interfaces lo0 unit 0 family inet address 192.168.100.6/32 set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0006.00 set protocols isis interface ge-0/0/2.0 level 1 disable set protocols isis interface ge-0/0/2.0 level 2 metric 100 set protocols isis interface ge-0/0/2.0 point-to-point set protocols isis interface ge-0/0/3.0 level 1 disable set protocols isis interface ge-0/0/3.0 level 2 metric 100 set protocols isis interface ge-0/0/3.0 point-to-point set protocols isis interface lo0.0 passive set routing-options router-id 192.168.100.6
配置 R1
分步程序
下面的示例要求您在各个配置层级中进行导航。有关导航 CLI 的信息,请参阅 《CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
您还可以使用此示例中的步骤配置 R2、R5 和 R6 路由器。请参阅 CLI 快速配置 和 图 2 ,了解这些路由器上使用的接口 ID、IP 地址和环路地址。
要配置 R1:
-
配置接口以启用 IP (
inet) 和 ISO 家族支持。user@R1# set interfaces ge-0/0/1 description R1-to-R4 user@R1# set interfaces ge-0/0/1 unit 0 family inet address 192.168.1.1/24 user@R1# set interfaces ge-0/0/1 unit 0 family iso user@R1# set interfaces ge-0/0/2 description R1-to-R3 user@R1# set interfaces ge-0/0/2 unit 0 family inet address 192.168.2.1/24 user@R1# set interfaces ge-0/0/2 unit 0 family iso
-
创建环路接口并配置 IP 地址和 NET 地址。
user@R1# set interfaces lo0 unit 0 family inet address 192.168.100.1/32 user@R1# set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0001.00
-
配置路由选项以识别域中的路由器。
user@R1# set routing-options router-id 192.168.100.1
-
在接口上启用 IS-IS。
user@R1# set protocols isis interface ge-0/0/1.0 level 2 metric 100 user@R1# set protocols isis interface ge-0/0/1.0 level 1 disable user@R1# set protocols isis interface ge-0/0/1.0 point-to-point user@R1# set protocols isis interface ge-0/0/2.0 level 1 disable user@R1# set protocols isis interface ge-0/0/2.0 level 2 metric 100 user@R1# set protocols isis interface ge-0/0/2.0 point-to-point user@R1# set protocols isis interface lo0.0 passive
结果
在配置模式下,输入 show interfaces、 show routing-options和 show protocols 命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
interfaces {
ge-0/0/1 {
description R1-to-R4;
unit 0 {
family inet {
address 192.168.1.1/24;
}
family iso;
}
}
ge-0/0/2 {
description R1-to-R3;
unit 0 {
family inet {
address 192.168.2.1/24;
}
family iso;
}
}
lo0 {
unit 0 {
family inet {
address 192.168.100.1/32;
}
family iso {
address 49.0002.0192.0168.0001.00;
}
}
}
}
protocols {
isis {
interface ge-0/0/1.0 {
level 2 metric 100;
level 1 disable;
point-to-point;
}
interface ge-0/0/2.0 {
level 1 disable;
level 2 metric 100;
point-to-point;
}
interface lo0.0 {
passive;
}
}
}
routing-options {
router-id 192.168.100.1;
}
配置 R3
分步程序
下面的示例要求您在各个配置层级中进行导航。有关导航 CLI 的信息,请参阅 《CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
您还可以使用此示例中的步骤配置 R4 路由器。请参阅 CLI 快速配置 和 图 2 ,了解路由器上使用的接口 ID、IP 地址和环路地址。
要配置 R3:
-
配置连接到 R1、R2 和 R5 的接口,以启用 IP 和 ISO 家族支持。
user@R3# set interfaces ge-0/0/1 description R3-to-R2 user@R3# set interfaces ge-0/0/1 unit 0 family inet address 192.168.3.2/24 user@R3# set interfaces ge-0/0/1 unit 0 family iso user@R3# set interfaces ge-0/0/2 description R3-to-R1 user@R3# set interfaces ge-0/0/2 unit 0 family inet address 192.168.2.2/24 user@R3# set interfaces ge-0/0/2 unit 0 family iso user@R3# set interfaces ge-0/0/3 description R3-to-R5 user@R3# set interfaces ge-0/0/3 unit 0 family inet address 192.168.6.1/24 user@R3# set interfaces ge-0/0/3 unit 0 family iso
-
配置连接 R3 和 R4 的三个子接口(逻辑接口)(一个 IS-IS 标准实例和两个 IS-IS 城域实例(IS-IS 城域网 a 和 IS-IS 城域网-b))。
注意:标准 IS-IS 实例是指在 [
edit protocols isis] 层级配置的 IS-IS IGP 实例。user@R3# set interfaces ge-0/0/4 description R3-to-R4 user@R3# set interfaces ge-0/0/4 vlan-tagging user@R3# set interfaces ge-0/0/4 unit 0 vlan-id 10 user@R3# set interfaces ge-0/0/4 unit 0 family inet address 192.168.5.1/24 user@R3# set interfaces ge-0/0/4 unit 0 family iso user@R3# set interfaces ge-0/0/4 unit 1 vlan-id 11 user@R3# set interfaces ge-0/0/4 unit 1 family inet address 192.168.9.1/24 user@R3# set interfaces ge-0/0/4 unit 1 family iso user@R3# set interfaces ge-0/0/4 unit 2 vlan-id 12 user@R3# set interfaces ge-0/0/4 unit 2 family inet address 192.168.10.1/24 user@R3# set interfaces ge-0/0/4 unit 2 family iso
-
创建环路接口并配置 IP 地址和 NET 地址。
user@R3# set interfaces lo0 unit 0 family inet address 192.168.100.3/32 user@R3# set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0003.00
-
配置策略以重新分配IS-IS城域实例(IS-IS城域网 A 和 IS-IS城域网 B)IS-IS和标准实例(核心网络)路由器的环路地址,以便路由可以根据需要跨IS-IS域分布。
-
配置策略以分发 R3 的环路地址。
user@R3# set policy-options policy-statement export-direct-loopback from protocol direct user@R3# set policy-options policy-statement export-direct-loopback from route-filter 192.168.100.3/32 exact user@R3# set policy-options policy-statement export-direct-loopback then accept
-
配置策略以分发 R5 和 R6 路由器(标准 IS-IS 实例)的环路地址。
user@R3# set policy-options policy-statement export-isis from protocol isis user@R3# set policy-options policy-statement export-isis from level 2 user@R3# set policy-options policy-statement export-isis from route-filter 192.168.100.0/24 longer user@R3# set policy-options policy-statement export-isis then accept
-
配置策略以分发 R1(IS-IS 城域网实例)的环路地址。
user@R3# set policy-options policy-statement export-isis-metro-a from igp-instance metro-a user@R3# set policy-options policy-statement export-isis-metro-a from protocol isis user@R3# set policy-options policy-statement export-isis-metro-a from level 2 user@R3# set policy-options policy-statement export-isis-metro-a from route-filter 192.168.100.0/24 longer user@R3# set policy-options policy-statement export-isis-metro-a then accept
-
配置策略以分发 R2(IS-IS 城域网 b 实例)的环路地址。
user@R3# set policy-options policy-statement export-isis-metro-b from igp-instance metro-b user@R3# set policy-options policy-statement export-isis-metro-b from protocol isis user@R3# set policy-options policy-statement export-isis-metro-b from level 2 user@R3# set policy-options policy-statement export-isis-metro-b from route-filter 192.168.100.0/24 longer user@R3# set policy-options policy-statement export-isis-metro-b then accept
-
-
在标准实例接口(将 R3 连接到 R5)和子接口(将 R3 连接到 R4)上启用 IS-IS。
user@R3# set protocols isis interface ge-0/0/3.0 level 1 disable user@R3# set protocols isis interface ge-0/0/3.0 level 2 metric 100 user@R3# set protocols isis interface ge-0/0/3.0 point-to-point user@R3# set protocols isis interface ge-0/0/4.0 level 1 disable user@R3# set protocols isis interface ge-0/0/4.0 level 2 metric 100 user@R3# set protocols isis interface ge-0/0/4.0 point-to-point user@R3# set protocols isis interface lo0.0 passive
-
配置 IS-IS 以将环路地址从 IS-IS 城域网 a 和 IS-IS 城域网 b 实例导出到 IS-IS 标准实例。此配置将分发特定路由,而不是泛洪整个城域。
user@R3# set protocols isis export export-isis-metro-a user@R3# set protocols isis export export-isis-metro-b
-
在 IS-IS 城域网 b 实例接口(将 R3 连接到 R2)和子接口(R3 到 R4)上启用 IS-IS。
user@R3# set protocols isis-instance metro-b interface ge-0/0/1.0 level 1 disable user@R3# set protocols isis-instance metro-b interface ge-0/0/1.0 level 2 metric 100 user@R3# set protocols isis-instance metro-b interface ge-0/0/1.0 point-to-point user@R3# set protocols isis-instance metro-b interface ge-0/0/4.2 level 1 disable user@R3# set protocols isis-instance metro-b interface ge-0/0/4.2 level 2 metric 100 user@R3# set protocols isis-instance metro-b interface ge-0/0/4.2 point-to-point
-
配置 IS-IS 以将 IS-IS 城域网 a 和标准 IS-IS 实例的环路地址导出到 IS-IS 城域网 b 实例。此配置分配特定路由,而不是泛洪整个标准 IS-IS 实例和城域网域实例。
user@R3# set protocols isis-instance metro-b export export-isis user@R3# set protocols isis-instance metro-b export export-direct-loopback user@R3# set protocols isis-instance metro-b export export-isis-metro-a
-
在 IS-IS 城域网实例接口(将 R3 连接到 R1)和子接口(R3 到 R4)上启用 IS-IS。
user@R3# set protocols isis-instance metro-a interface ge-0/0/2.0 level 1 disable user@R3# set protocols isis-instance metro-a interface ge-0/0/2.0 level 2 metric 100 user@R3# set protocols isis-instance metro-a interface ge-0/0/2.0 point-to-point user@R3# set protocols isis-instance metro-a interface ge-0/0/4.1 level 1 disable user@R3# set protocols isis-instance metro-a interface ge-0/0/4.1 level 2 metric 100 user@R3# set protocols isis-instance metro-a interface ge-0/0/4.1 point-to-point
-
配置 IS-IS 以将 IS-IS 城域网 b 和标准 IS-IS 实例的环路地址导出到 IS-IS 城域网 a 实例。此配置分配特定路由,而不是泛洪整个标准 IS-IS 实例和城域 B 域实例。
user@R3# set protocols isis-instance metro-a export export-isis user@R3# set protocols isis-instance metro-a export export-direct-loopback user@R3# set protocols isis-instance metro-a export export-isis-metro-b
-
配置路由选项以识别域中的路由器。
user@R3# set routing-options router-id 192.168.100.3
结果
在配置模式下,输入 show interfaces、 show routing-options和 show protocols 命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
interfaces {
ge-0/0/1 {
description R3-to-R2;
unit 0 {
family inet {
address 192.168.3.2/24;
}
family iso;
}
}
ge-0/0/2 {
description R3-to-R1;
unit 0 {
family inet {
address 192.168.2.2/24;
}
family iso;
}
}
ge-0/0/3 {
description R3-to-R5;
unit 0 {
family inet {
address 192.168.6.1/24;
}
family iso;
}
}
ge-0/0/4 {
description R3-to-R4;
vlan-tagging;
unit 0 {
vlan-id 10;
family inet {
address 192.168.5.1/24;
}
family iso;
}
unit 1 {
vlan-id 11;
family inet {
address 192.168.9.1/24;
}
family iso;
}
unit 2 {
vlan-id 12;
family inet {
address 192.168.10.1/24;
}
family iso;
}
}
lo0 {
unit 0 {
family inet {
address 192.168.100.3/32;
}
family iso {
address 49.0002.0192.0168.0003.00;
}
}
}
}
policy-options {
policy-statement export-direct-loopback {
from {
protocol direct;
route-filter 192.168.100.3/32 exact;
}
then accept;
}
policy-statement export-isis {
from {
protocol isis;
level 2;
route-filter 192.168.100.0/24 longer;
}
then accept;
}
policy-statement export-isis-metro-a {
from {
igp-instance metro-a;
protocol isis;
level 2;
route-filter 192.168.100.0/24 longer;
}
then accept;
}
policy-statement export-isis-metro-b {
from {
igp-instance metro-b;
protocol isis;
level 2;
route-filter 192.168.100.0/24 longer;
}
then accept;
}
}
protocols {
isis {
interface ge-0/0/3.0 {
level 1 disable;
level 2 metric 100;
point-to-point;
}
interface ge-0/0/4.0 {
level 1 disable;
level 2 metric 100;
point-to-point;
}
interface lo0.0 {
passive;
}
export [ export-isis-metro-a export-isis-metro-b ];
}
isis-instance metro-b {
interface ge-0/0/1.0 {
level 1 disable;
level 2 metric 100;
point-to-point;
}
interface ge-0/0/4.2 {
level 1 disable;
level 2 metric 100;
point-to-point;
}
export [ export-isis export-direct-loopback export-isis-metro-a ];
}
isis-instance metro-a {
interface ge-0/0/2.0 {
level 1 disable;
level 2 metric 100;
point-to-point;
}
interface ge-0/0/4.1 {
level 1 disable;
level 2 metric 100;
point-to-point;
}
export [ export-isis export-direct-loopback export-isis-metro-b ];
}
}
routing-options {
router-id 192.168.100.3;
}
验证
要验证配置是否工作正常,请执行以下任务:
验证 IS-IS 通告
目的
验证包含有关 PDU 数据包的数据的 IS-IS 链路状态数据库 (LSDB) 中的 IS-IS 通告条目。
行动
在操作模式下,运行命令 show isis database level 2 。
在 R3 上
user@R3>show isis database level 2 IS-IS level 2 link-state database: LSP ID Sequence Checksum Lifetime Attributes R6.00-00 0x75d 0x1ff7 1181 L1 L2 R5.00-00 0x75b 0xffdc 741 L1 L2 R4.00-00 0x780 0x4e1 552 L1 L2 R3.00-00 0x7f0 0x8643 496 L1 L2 4 LSPs
user@R3>show isis database level 2 igp-instance metro-a IS-IS level 2 link-state database: LSP ID Sequence Checksum Lifetime Attributes R1.00-00 0x136 0x46e5 1046 L1 L2 R4.00-00 0x781 0xf65e 768 L1 L2 R3.00-00 0x7f2 0x871b 764 L1 L2 3 LSPs
user@R3>show isis database level 2 igp-instance metro-b IS-IS level 2 link-state database: LSP ID Sequence Checksum Lifetime Attributes R2.00-00 0x13a 0x7997 1013 L1 L2 R4.00-00 0x781 0x86ba 771 L1 L2 R3.00-00 0x7f2 0x1288 510 L1 L2 3 LSPs
在 R1 上
user@R1>show isis database level 2 IS-IS level 2 link-state database: LSP ID Sequence Checksum Lifetime Attributes R1.00-00 0x136 0x46e5 851 L1 L2 R4.00-00 0x781 0xf65e 571 L1 L2 R3.00-00 0x7f2 0x871b 565 L1 L2 3 LSPs
意义
R3 上的此输出表明,R3 看到来自 R4、R5 和 R6 的 IS-IS 播发,这是标准 IS-IS 实例。R3 还会看到来自 R1(IS-IS 城域网 a)、R2(IS-IS 城域网 b)和 R4(IS-IS 城域网 a 和 IS-IS 城域网 b)的 IS-IS 通告。因此,您可以看到 R3 是一个通用路由器,可在 IS-IS 城域网 a 实例、IS-IS 城域网 b 实例和标准 IS-IS 实例(核心网络)之间重新分配 IS-IS 路由。
R1 上的输出表明,R1 仅看到来自 R3 和 R4 的 IS-IS 播发。R1 看不到来自 R2 的任何 IS-IS 播发。因此,您会看到 IS-IS 城域网 a 和 IS-IS 城域网 b 是单独的 IS-IS 泛洪域。您可以使用此属性构建更具可扩展性的网络。
验证路由表
目的
验证路由表中的路由条目。
行动
在操作模式下,运行命令 show route table inet.0 route-destination address extensive 。
在 R3 上
user@R3>show route table inet.0 192.168.100.1 extensive
inet.0: 28 destinations, 28 routes (28 active, 0 holddown, 0 hidden)
192.168.100.1/32 (1 entry, 1 announced)
TSI:
KRT in-kernel 192.168.100.1/32 -> {192.168.2.1}
IS-IS level 1, LSP fragment 0
IS-IS level 2, LSP fragment 0
IS-IS level 1, LSP fragment 0
IS-IS level 2, LSP fragment 0
*IS-IS Preference: 18
Level: 2
Next hop type: Router, Next hop index: 601
Address: 0xc5b21cc
Next-hop reference count: 2
Next hop: 192.168.2.1 via ge-0/0/2.0, selected
Session Id: 0x140
State: <Active Int>
Age: 2d 18:10:36 Metric: 63
Validation State: unverified
ORR Generation-ID: 0
Task: IS-IS-metro-a
Announcement bits (3): 0-KRT 2-IS-IS 10-IS-IS-metro-b
AS path: I
Thread: junos-main
user@R3>show route table inet.0 192.168.100.2 extensive
inet.0: 28 destinations, 28 routes (28 active, 0 holddown, 0 hidden)
192.168.100.2/32 (1 entry, 1 announced)
TSI:
KRT in-kernel 192.168.100.2/32 -> {192.168.3.1}
IS-IS level 1, LSP fragment 0
IS-IS level 2, LSP fragment 0
IS-IS level 1, LSP fragment 0
IS-IS level 2, LSP fragment 0
*IS-IS Preference: 18
Level: 2
Next hop type: Router, Next hop index: 602
Address: 0xc5b2234
Next-hop reference count: 2
Next hop: 192.168.3.1 via ge-0/0/1.0, selected
Session Id: 0x141
State: <Active Int>
Age: 2d 18:18:48 Metric: 63
Validation State: unverified
ORR Generation-ID: 0
Task: IS-IS-metro-b
Announcement bits (3): 0-KRT 2-IS-IS 4-IS-IS-metro-a
AS path: I
Thread: junos-main
意义
输出说明 R1 的环路地址 (192.168.100.1) 映射到 IS-IS 城域网 a 实例 (IS-IS-metro-a),R2 的环路地址 (192.168.100.2) 映射到 R3 中配置的 IS-IS 城域网 b 实例 (IS-IS-metro-b)。
验证 IS-IS 路由表中的路由
目的
验证 IS-IS 路由表中的路由。
行动
在操作模式下,运行命令 show isis route 。
在 R3 上
user@R3>show isis route
IS-IS routing table Current version: L1: 1885 L2: 1956
IPv4/IPv6 Routes
----------------
Prefix L Version Metric Type Interface NH Via Backup Score
192.168.7.0/24 2 1956 126 int ge-0/0/4.0 IPV4 R4
192.168.8.0/24 2 1956 126 int ge-0/0/3.0 IPV4 R5
192.168.100.4/32 2 1956 63 int ge-0/0/4.0 IPV4 R4
192.168.100.5/32 2 1956 63 int ge-0/0/3.0 IPV4 R5
192.168.100.6/32 2 1956 126 int ge-0/0/3.0 IPV4 R5
ge-0/0/4.0 IPV4 R4
user@R3>show isis route igp-instance metro-a
IS-IS routing table Current version: L1: 1889 L2: 1961
IPv4/IPv6 Routes
----------------
Prefix L Version Metric Type Interface NH Via Backup Score
192.168.1.0/24 2 1961 126 int ge-0/0/4.1 IPV4 R4
ge-0/0/2.0 IPV4 R1
192.168.100.1/32 2 1961 63 int ge-0/0/2.0 IPV4 R1
user@R3>show isis route igp-instance metro-b
IS-IS routing table Current version: L1: 1892 L2: 1949
IPv4/IPv6 Routes
----------------
Prefix L Version Metric Type Interface NH Via Backup Score
192.168.4.0/24 2 1949 126 int ge-0/0/4.2 IPV4 R4
ge-0/0/1.0 IPV4 R2
192.168.100.2/32 2 1949 63 int ge-0/0/1.0 IPV4 R2
在 R1 上
user@R1>show isis route
IS-IS routing table Current version: L1: 313 L2: 392
IPv4/IPv6 Routes
----------------
Prefix L Version Metric Type Interface NH Via Backup Score
192.168.9.0/24 2 392 126 int ge-0/0/2.0 IPV4 R3
ge-0/0/1.0 IPV4 R4
192.168.100.2/32 2 392 126 int ge-0/0/2.0 IPV4 R3
ge-0/0/1.0 IPV4 R4
192.168.100.3/32 2 392 73 int ge-0/0/2.0 IPV4 R3
192.168.100.4/32 2 392 73 int ge-0/0/1.0 IPV4 R4
192.168.100.5/32 2 392 126 int ge-0/0/2.0 IPV4 R3
ge-0/0/1.0 IPV4 R4
192.168.100.6/32 2 392 126 int ge-0/0/2.0 IPV4 R3
ge-0/0/1.0 IPV4 R4
意义
R3 上的输出显示了 R1、R2、R4、R5 和 R6 的环路地址和 IS-IS 实例映射信息。
R1上的输出显示R2、R3、R4、R5和R6的环路地址。
验证 IS-IS 接口
目的
验证有关支持 IS-IS 的接口的状态信息。
行动
在操作模式下,运行命令 show isis interface 。
在 R3 上
user@R3>show isis interface IS-IS interface database: Interface L CirID Level 1 DR Level 2 DR L1/L2 Metric ge-0/0/3.0 2 0x1 Disabled Point to Point 10/100 ge-0/0/4.0 2 0x1 Disabled Point to Point 10/100 lo0.0 3 0x1 Passive Passive 0/0
user@R3>show isis interface igp-instance metro-a IS-IS interface database: Interface L CirID Level 1 DR Level 2 DR L1/L2 Metric ge-0/0/2.0 2 0x1 Disabled Point to Point 10/100 ge-0/0/4.1 2 0x1 Disabled Point to Point 10/100
user@R3>show isis interface igp-instance metro-b IS-IS interface database: Interface L CirID Level 1 DR Level 2 DR L1/L2 Metric ge-0/0/1.0 2 0x1 Disabled Point to Point 10/100 ge-0/0/4.2 2 0x1 Disabled Point to Point 10/100
在 R1 上
user@R1>show isis interface IS-IS interface database: Interface L CirID Level 1 DR Level 2 DR L1/L2 Metric ge-0/0/1.0 2 0x1 Disabled Point to Point 10/100 ge-0/0/2.0 2 0x1 Disabled Point to Point 10/100 lo0.0 3 0x1 Passive Passive 0/0
意义
输出显示映射到不同 IS-IS 实例的接口。
示例:使用分段路由配置多个独立的 OSPFv2 实例
使用此示例可使用分段路由配置 OSPFv2 的多个 IGP 实例。
我们的内容测试团队已验证并更新了此示例。
| 阅读时间 |
30 分钟 |
| 配置时间 |
20 分钟 |
先决条件示例
| 硬件要求 |
三台 MX 系列路由器。 |
| 软件要求 |
所有设备上运行 Junos OS 24.4R1 或更高版本。 |
开始之前
| 优势 |
使用分段路由配置多个独立的 OSPFv2 实例可增强网络灵活性、可扩展性和对流量工程的控制,尤其是在大型复杂网络中。 |
| 了解更多 |
功能概述
| 使用的技术 |
|
| 主要验证任务 |
|
拓扑概述
此配置示例描述三个设备 R1、R2 和 R3。设备 R1 和设备 R2 之间以及设备 R2 和设备 R3 之间配置了两个子接口。每台设备运行多个启用了分段路由的 OSPF 实例。我们配置 SR-MPLS 来提供通过网络的路径控制。在设备的两个子接口上的每个子接口上都运行着名为 OSPF 的实例 metro-edge 。
| 主机名 |
角色 |
功能 |
|---|---|---|
| R1、R2 和 R3 |
设备的子接口上配置了多实例 OSPF,并启用了分段路由。 |
设备参与 OSPF 多实例,通告路由,并使用前缀 SID 将流量转发至其他设备。 |
拓扑图示
R2 配置步骤
有关 R2 上的完整示例配置,请参阅: 附录 1:在所有设备上设置命令
本节重点介绍为此示例配置 R2 设备所需的主要配置任务。
-
在设备接口的逻辑单元上配置主机名、
enhanced-ip模式、IPv4 地址等基本设备设置。使用 IP 地址配置环路接口并启用 MPLS。
配置路由器 ID 和自治系统 (AS) 编号,以便在属于同一 AS 的一组路由设备内传播路由信息 AS。
启用 VLAN 标记,并使用不同的 VLAN ID 配置两个接口的逻辑单元。
在每个逻辑单元上启用 MPLS。配置可应用于每个接口逻辑单元上的传出数据包的最大 MPLS 标签数。
定义用于对数据包进行负载均衡的策略,并应用每个数据包的策略来实现流量的负载平衡。
配置一个策略语句,该语句根据确切前缀匹配路由,并为匹配的路由分配分段标识符。
在层次结构级别配置
edit protocol mplsMPLS 流量工程、分段路由全局块 (SRGB) 标签范围,以确保标签在各个分段路由域中更具可预测性,以及 MPLS 标签范围,以便从配置的 SRGB 标签为链路分配标签。[edit] set system host-name R2 set chassis network-services enhanced-ip set interfaces ge-0/0/0 unit 1 family inet address 10.0.0.2/24 set interfaces ge-0/0/0 unit 2 family inet address 10.0.0.12/24 set interfaces ge-0/0/1 unit 1 family inet address 10.2.2.1/24 set interfaces ge-0/0/1 unit 2 family inet address 10.2.2.11/24
[edit] set interfaces lo0 unit 0 family inet address 10.1.255.2/32 set interfaces lo0 unit 0 family mpls
[edit] set routing-options router-id 10.1.255.2 set routing-options autonomous-system 100
[edit] set interfaces ge-0/0/0 vlan-tagging set interfaces ge-0/0/0 unit 1 vlan-id 1 set interfaces ge-0/0/0 unit 2 vlan-id 2 set interfaces ge-0/0/1 vlan-tagging set interfaces ge-0/0/1 unit 1 vlan-id 1 set interfaces ge-0/0/1 unit 2 vlan-id 2
[edit] set interfaces ge-0/0/0 unit 1 family mpls maximum-labels 5 set interfaces ge-0/0/0 unit 2 family mpls maximum-labels 5 set interfaces ge-0/0/1 unit 1 family mpls maximum-labels 5 set interfaces ge-0/0/1 unit 2 family mpls maximum-labels 5
[edit] set policy-options policy-statement pplb then load-balance per-packet set policy-options policy-statement pplb then accept set routing-options forwarding-table export pplb
[edit] set policy-options policy-statement prefix-sid term 1 from route-filter 10.1.255.2/32 exact set policy-options policy-statement prefix-sid term 1 then prefix-segment index 1001 set policy-options policy-statement prefix-sid term 1 then accept
[edit] set protocols mpls traffic-engineering set protocols mpls label-range srgb-label-range 800000 879999 set protocols mpls label-range static-label-range 60001 100000 set protocols mpls interface all set protocols mpls interface fxp0.0 disable
在子接口上配置 (
ospf-instancemetro-edge从 R2 连接到 R1 和从 R2 连接到 R3)。[edit] set protocols ospf-instance metro-edge area 0.0.0.0 interface all
启用 OSPF
metro-edge实例以使用带有前缀 sid 的分段路由。[edit] set protocols ospf-instance metro-edge source-packet-routing prefix-segment prefix-sid
- 配置节点分段的 IPv4 索引值。
[edit] set protocols ospf-instance metro-edge source-packet-routing node-segment ipv4-index 1
将 OSPF
metro-edge实例的环路地址配置为被动地址并禁用管理接口 (fxp0.0)。[edit] set protocols ospf-instance metro-edge area 0.0.0.0 interface lo0.0 passive set protocols ospf-instance metro-edge area 0.0.0.0 interface fxp0.0 disable
验证
| 命令 | 验证任务 |
|---|---|
| 显示路由协议 OSPF 表 inet.0 扩展 |
|
| 显示 ospf spring sid-database igp 实例 igp-instance | 验证 OSPF 实例的 OSPF 分段路由数据库。 |
| 显示 OSPF 邻接方 IGP 实例 igp-instance | 验证特定 OSPF 实例的邻接方。 |
| 显示 OSPF 数据库 IGP 实例 igp-instance | 验证与 IGP 实例关联的 OSPF 链路状态数据库 (LSDB) 中的 OSPF 播发条目。 |
| 显示 OSPF 接口 IGP 实例 igp-instance | 验证映射到 IGP 实例的接口。 |
| 显示 OSPF 路由 IGP 实例 igp-instance | 验证 R1 和 R3 的路由和 OSPF 实例映射信息。 |
验证路由表
目的
验证路由表中的路由条目
行动
在操作模式下,运行命令 show route table inet.0 route-destination address extensive 。
user@R2>show route protocol ospf table inet.0 10.1.255.1 extensive
inet.0: 19 destinations, 21 routes (19 active, 0 holddown, 0 hidden)
10.1.255.1/32 (1 entry, 1 announced)
TSI:
KRT in-kernel 10.1.255.1/32 -> {list:10.0.0.1, 10.0.0.11}
*OSPF Preference: 10/10
Next hop type: Router, Next hop index: 0
Address: 0x8b32234
Next-hop reference count: 2, Next-hop session id: 0
Kernel Table Id: 0
Next hop: 10.0.0.1 via ge-0/0/0.1, selected
Session Id: 0
Next hop: 10.0.0.11 via ge-0/0/0.2
Session Id: 0
State: <Active Int>
Local AS: 100
Age: 1w4d 16:01:19 Metric: 1
Validation State: unverified
Area: 0.0.0.0
Task: OSPF-metro-edge
Announcement bits (1): 0-KRT
AS path: I
Thread: junos-main
user@R2>show route protocol ospf table inet.0 10.1.255.3 extensive
inet.0: 19 destinations, 21 routes (19 active, 0 holddown, 0 hidden)
10.1.255.3/32 (1 entry, 1 announced)
TSI:
KRT in-kernel 10.1.255.3/32 -> {list:10.2.2.2, 10.2.2.12}
*OSPF Preference: 10/10
Next hop type: Router, Next hop index: 0
Address: 0x8b316f4
Next-hop reference count: 2, Next-hop session id: 0
Kernel Table Id: 0
Next hop: 10.2.2.2 via ge-0/0/1.1, selected
Session Id: 0
Next hop: 10.2.2.12 via ge-0/0/1.2
Session Id: 0
State: <Active Int>
Local AS: 100
Age: 1w4d 16:13:55 Metric: 1
Validation State: unverified
Area: 0.0.0.0
Task: OSPF-metro-edge
Announcement bits (1): 0-KRT
AS path: I
Thread: junos-main
意义
输出说明 R1 的环路地址 (10.1.255.1) 和 R3 的环路地址 (10.1.255.2) 映射到 R2 中配置的 OSPF igp 实例 城域网边缘 。
验证 OSPF 通告
目的
验证与 IGP 实例关联的 OSPF 链路状态数据库 (LSDB) 中的 OSPF 播发条目。
行动
在操作模式下,运行 show ospf database igp-instance igp-instance 命令。
user@R2>show ospf database igp-instance metro-edge OSPF database, Area 0.0.0.0 Type ID Adv Rtr Seq Age Opt Cksum Len Router 10.1.255.1 10.1.255.1 0x80000013 1110 0x22 0xe6e9 72 Router *10.1.255.2 10.1.255.2 0x80000015 1084 0x22 0x7be2 96 Router 10.1.255.3 10.1.255.3 0x80000013 1585 0x22 0x491 72 Network *10.0.0.2 10.1.255.2 0x80000010 2959 0x22 0x6791 32 Network *10.0.0.12 10.1.255.2 0x80000010 2209 0x22 0x3eb 32 Network 10.2.2.2 10.1.255.3 0x80000010 2085 0x22 0x4ba6 32 Network 10.2.2.12 10.1.255.3 0x80000010 1085 0x22 0xe601 32 OpaqArea 7.0.0.1 10.1.255.1 0x80000012 193 0x22 0x8c0 44 OpaqArea*7.0.0.1 10.1.255.2 0x80000012 511 0x22 0x2a9b 44 OpaqArea 7.0.0.1 10.1.255.3 0x80000012 585 0x22 0x4c76 44 OpaqArea 8.0.0.1 10.1.255.1 0x80000010 2610 0x22 0x4683 48 OpaqArea*8.0.0.1 10.1.255.2 0x80000010 2584 0x22 0xac01 52 OpaqArea 8.0.0.1 10.1.255.3 0x80000010 2584 0x22 0x7d06 52 OpaqArea 8.0.0.2 10.1.255.1 0x80000010 1860 0x22 0x4f55 48 OpaqArea*8.0.0.2 10.1.255.2 0x80000011 334 0x22 0xf393 52 OpaqArea 8.0.0.2 10.1.255.3 0x80000011 84 0x22 0xc498 52 OpaqArea*8.0.0.3 10.1.255.2 0x80000010 1834 0x22 0x445a 48 OpaqArea*8.0.0.4 10.1.255.2 0x80000010 1459 0x22 0x4d2c 48
意义
验证 OSPF 路由表中的路由
目的
验证 OSPF 路由表中的路由
行动
在操作模式下,运行 show ospf route 命令。
user@R2>show ospf route igp-instance metro-edge
Topology default Route Table:
Prefix Path Route NH Metric NextHop Nexthop
Type Type Type Interface Address/LSP
10.1.255.1 Intra Router IP 1 ge-0/0/0.1 10.0.0.1
ge-0/0/0.2 10.0.0.11
10.1.255.3 Intra Router IP 1 ge-0/0/1.1 10.2.2.2
ge-0/0/1.2 10.2.2.12
10.0.0.0/24 Intra Network IP 1 ge-0/0/0.1
ge-0/0/0.2
10.1.255.1/32 Intra Network IP 1 ge-0/0/0.1 10.0.0.1
ge-0/0/0.2 10.0.0.11
10.1.255.2/32 Intra Network IP 0 lo0.0
10.1.255.3/32 Intra Network IP 1 ge-0/0/1.1 10.2.2.2
ge-0/0/1.2 10.2.2.12
10.2.2.0/24 Intra Network IP 1 ge-0/0/1.1
ge-0/0/1.2
299840 Intra Network Mpls 0 ge-0/0/0.2 10.0.0.11
299840 (S=0) Intra Network Mpls 0 ge-0/0/0.2 10.0.0.11
299856 Intra Network Mpls 0 ge-0/0/0.1 10.0.0.1
299856 (S=0) Intra Network Mpls 0 ge-0/0/0.1 10.0.0.1
299904 Intra Network Mpls 0 ge-0/0/1.2 10.2.2.12
299904 (S=0) Intra Network Mpls 0 ge-0/0/1.2 10.2.2.12
299920 Intra Network Mpls 0 ge-0/0/1.1 10.2.2.2
299920 (S=0) Intra Network Mpls 0 ge-0/0/1.1 10.2.2.2
意义
R2 上的输出显示 R1 和 R3 的环路地址和 OSPF 实例映射信息。
验证 OSPF 分段路由数据库
目的
验证 OSPF 实例城域网边缘的 OSPF 分段路由数据库。
行动
在操作模式下,运行 show ospf spring sid-database igp-instance igp-instance 命令。
user@R2>show ospf spring sid-database igp-instance metro-edge OSPF database, Area 0.0.0.0 SID Prefix Advertised-by Route-type 1000 10.1.255.1/32 10.1.255.1 Intra-Area 1001 10.1.255.2/32 10.1.255.2 Intra-Area 1002 10.1.255.3/32 10.1.255.3 Intra-Area
意义
输出说明了 OSPF(城域-边缘)播发前缀 SID 的多个实例。
验证 OSPF 接口
目的
验证有关已启用 OSPF 实例的接口的状态信息。
行动
在操作模式下,运行 show ospf interface igp-instance igp-instance 命令。
user@R2>show ospf interface igp-instance metro-edge Interface State Area DR ID BDR ID Nbrs ge-0/0/0.1 DR 0.0.0.0 10.1.255.2 10.1.255.1 1 ge-0/0/0.2 DR 0.0.0.0 10.1.255.2 10.1.255.1 1 ge-0/0/1.1 DR 0.0.0.0 10.1.255.2 10.1.255.3 1 ge-0/0/1.2 DR 0.0.0.0 10.1.255.2 10.1.255.3 1 lo0.0 DRother 0.0.0.0 0.0.0.0 0.0.0.0 0 lo0.0 DRother 0.0.0.0 0.0.0.0 0.0.0.0 0
意义
输出显示映射到 OSPF 实例(城域网边缘)的 R2 子接口。
验证 OSPF 邻接方
目的
验证配置链路之间的邻接关系。
行动
在操作模式下,运行 show ospf neighbor igp-instance igp-instance 命令。
user@R2>show ospf neighbor igp-instance metro-edge Address Interface State ID Pri Dead 10.0.0.1 ge-0/0/0.1 Full 10.1.255.1 128 35 10.0.0.11 ge-0/0/0.2 Full 10.1.255.1 128 39 10.2.2.2 ge-0/0/1.1 Full 10.1.255.3 128 33 10.2.2.12 ge-0/0/1.2 Full 10.1.255.3 128 36
意义
设备 R2 已与设备 R1 和设备 R3 建立邻接关系,如 State 输出字段 Full所示。
附录 1:在所有设备上设置命令
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,移除所有换行符,更改任何必要的详细信息以匹配您的网络配置,然后将命令复制粘贴到 [edit] 层级的 CLI 中。
R1
set system host-name R1 set interfaces ge-0/0/0 unit 1 family inet address 10.0.0.1/24 set interfaces ge-0/0/0 unit 2 family inet address 10.0.0.11/24 set interfaces ge-0/0/0 unit 2 enable set interfaces ge-0/0/0 vlan-tagging set interfaces ge-0/0/0 unit 1 vlan-id 1 set interfaces ge-0/0/0 unit 2 vlan-id 2 set interfaces ge-0/0/0 unit 1 family mpls maximum-labels 5 set interfaces ge-0/0/0 unit 2 family mpls maximum-labels 5 set interfaces lo0 unit 0 family inet address 10.1.255.1/32 set interfaces lo0 unit 0 family mpls set policy-options policy-statement pplb then load-balance per-packet set policy-options policy-statement pplb then accept set policy-options policy-statement prefix-sid term 1 from route-filter 10.1.255.1/32 exact set policy-options policy-statement prefix-sid term 1 then prefix-segment index 1000 set policy-options policy-statement prefix-sid term 1 then accept set routing-options router-id 10.1.255.1 set routing-options autonomous-system 100 set routing-options forwarding-table export pplb set protocols mpls traffic-engineering set protocols mpls label-range srgb-label-range 800000 879999 set protocols mpls label-range static-label-range 60001 100000 set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf-instance metro-edge source-packet-routing prefix-segment prefix-sid set protocols ospf-instance metro-edge source-packet-routing node-segment ipv4-index 0 set protocols ospf-instance metro-edge area 0.0.0.0 interface all set protocols ospf-instance metro-edge area 0.0.0.0 interface lo0.0 passive set protocols ospf-instance metro-edge area 0.0.0.0 interface fxp0.0 disable
R2
set system host-name R2 set interfaces ge-0/0/0 unit 1 family inet address 10.0.0.2/24 set interfaces ge-0/0/0 unit 2 family inet address 10.0.0.12/24 set interfaces ge-0/0/1 unit 1 family inet address 10.2.2.1/24 set interfaces ge-0/0/1 unit 2 family inet address 10.2.2.11/24 set interfaces ge-0/0/0 vlan-tagging set interfaces ge-0/0/0 unit 1 vlan-id 1 set interfaces ge-0/0/0 unit 2 vlan-id 2 set interfaces ge-0/0/1 vlan-tagging set interfaces ge-0/0/1 unit 1 vlan-id 1 set interfaces ge-0/0/1 unit 2 vlan-id 2 set interfaces ge-0/0/0 unit 1 family mpls maximum-labels 5 set interfaces ge-0/0/0 unit 2 family mpls maximum-labels 5 set interfaces ge-0/0/1 unit 1 family mpls maximum-labels 5 set interfaces ge-0/0/1 unit 2 family mpls maximum-labels 5 set interfaces lo0 unit 0 family inet address 10.1.255.2/32 set interfaces lo0 unit 0 family mpls set policy-options policy-statement pplb then load-balance per-packet set policy-options policy-statement pplb then accept set policy-options policy-statement prefix-sid term 1 from route-filter 10.1.255.2/32 exact set policy-options policy-statement prefix-sid term 1 then prefix-segment index 1001 set policy-options policy-statement prefix-sid term 1 then accept set routing-options router-id 10.1.255.2 set routing-options autonomous-system 100 set routing-options forwarding-table export pplb set protocols mpls traffic-engineering set protocols mpls label-range srgb-label-range 800000 879999 set protocols mpls label-range static-label-range 60001 100000 set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf-instance metro-edge source-packet-routing prefix-segment prefix-sid set protocols ospf-instance metro-edge source-packet-routing node-segment ipv4-index 1 set protocols ospf-instance metro-edge area 0.0.0.0 interface all set protocols ospf-instance metro-edge area 0.0.0.0 interface lo0.0 passive set protocols ospf-instance metro-edge area 0.0.0.0 interface fxp0.0 disable
R3
set system host-name R3 set interfaces ge-0/0/0 unit 1 family inet address 10.2.2.2/24 set interfaces ge-0/0/0 unit 2 family inet address 10.2.2.12/24 set interfaces ge-0/0/0 vlan-tagging set interfaces ge-0/0/0 unit 1 vlan-id 1 set interfaces ge-0/0/0 unit 2 vlan-id 2 set interfaces ge-0/0/0 unit 1 family mpls maximum-labels 5 set interfaces ge-0/0/0 unit 2 family mpls maximum-labels 5 set interfaces lo0 unit 0 family inet address 10.1.255.3/32 set interfaces lo0 unit 0 family mpls set policy-options policy-statement pplb then load-balance per-packet set policy-options policy-statement pplb then accept set policy-options policy-statement prefix-sid term 1 from route-filter 10.1.255.3/32 exact set policy-options policy-statement prefix-sid term 1 then prefix-segment index 1002 set policy-options policy-statement prefix-sid term 1 then accept set routing-options router-id 10.1.255.3 set routing-options autonomous-system 100 set routing-options forwarding-table export pplb set protocols mpls traffic-engineering set protocols mpls label-range srgb-label-range 800000 879999 set protocols mpls label-range static-label-range 60001 100000 set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf-instance metro-edge source-packet-routing prefix-segment prefix-sid set protocols ospf-instance metro-edge source-packet-routing node-segment ipv4-index 2 set protocols ospf-instance metro-edge area 0.0.0.0 interface lo0.0 passive set protocols ospf-instance metro-edge area 0.0.0.0 interface all set protocols ospf-instance metro-edge area 0.0.0.0 interface fxp0.0 disable
变更历史表
是否支持某项功能取决于您使用的平台和版本。使用 功能资源管理器 确定您的平台是否支持某个功能。