配置 OSPF 路由策略
了解路由策略
对于某些路由平台供应商来说,路由流发生在各种协议之间。例如,如果要配置从 RIP 到 OSPF 的重新分发,RIP 进程会告知 OSPF 进程它具有可能要包含在内进行重新分发的路由。在 Junos OS 中,路由协议之间没有太多直接的交互。取而代之的是,存在所有协议安装其路由信息的中央聚集点。这些是主要的单播路由表 inet.0 和 inet6.0。
根据这些表,路由协议计算到每个目标的最佳路由,并将这些路由放在转转发表中。然后,这些路由用于将路由协议流量转发到目标,并且可以向邻居播发。
导入和导出路由
导入和导出这两个术语解释了路由如何在路由协议和路由表之间移动。
当路由引擎将路由协议的路由放入路由表时,它正在将路由 导入 到路由表中。
当路由引擎使用路由表中的活动路由发送协议播发时,它将从路由表 导出 路由。
注意:始终 从路由表的角度来描述在路由协议和路由表之间移动路由的过程。也就是说,路由从路由 协议导入 到路由表中,然后从路由表 导出 到路由协议。在使用路由策略时,请记住这一区别。
如 图 1 所示,您可以使用导入路由策略来控制将哪些路由放置在路由表中,并使用导出路由策略来控制哪些路由从路由表播发到邻接方。
通常,路由协议将其所有路由放在路由表中,并从路由表中播发一组有限的路由。处理路由协议与路由表之间路由信息的一般规则称为 路由策略框架。
路由策略框架由每个路由协议的默认规则组成,这些规则用于确定协议将哪些路由放在路由表中,并从路由表进行播发。每个路由协议的默认规则称为 默认路由策略。
您可以创建路由策略来抢占始终存在的默认策略。 路由策略 允许您修改路由策略框架以满足您的需求。您可以创建并实施自己的路由策略,以执行以下作:
控制路由协议在路由表中的位置。
控制路由协议从路由表播发哪些活动路由。 活动路由 是从路由表中的所有路由中选择以到达目标的路由。
在路由协议将路由置于路由表中或从路由表播发路由时作路由特征。
您可以纵路径特征来控制选择哪条路径作为到达目标的活动路径。活动路由放置在转转发表中,用于将流量转发到路由的目的地。通常,活动路由也会播发给路由器的邻接方。
活动和非活动路由
当路由表中存在目标的多个路由时,协议会选择活动路由,并将该路由放置在相应的路由表中。对于等价路由,Junos OS 会在相应的路由表中放置多个下一跃点。
当协议从路由表导出路由时,只会导出活动路由。这适用于默认和用户定义的导出策略指定的作。
评估要导出的路由时,路由引擎仅使用路由表中的活动路由。例如,如果路由表包含到同一目标的多个路由,并且其中一个路由具有更优的指标,则仅评估该路由。换言之,导出策略不会评估所有路由;它仅评估允许路由协议向邻接方播发的那些路由。
默认情况下,BGP 播发活动路由。但是,您可以将 BGP 配置为播发 非活动路由,这些路由指向与其他路由相同的目标,但指标不太可取。
显式配置的路由
显式配置的路由是已配置的路由。未显式配置直接路由。它们是由于在接口上配置了 IP 地址而创建的。显式配置的路由包括聚合路由、生成路由、本地路由和静态路由。(聚合路由是将具有通用地址的路由组提取为一个路由的路由。生成的路由是指在路由表中没有关于如何到达特定目标的信息时使用的路由。本地路由是分配给路由器接口的 IP 地址。静态路由是到达目标的不变路由。
策略框架软件将直接和显式配置的路由视为通过路由协议学习;因此,可以将其导入到路由表中。无法将路由从路由表导出到伪协议,因为此协议不是真正的路由协议。但是,聚合路由、直接路由、生成路由和静态路由可以从路由表导出到路由协议,而本地路由则不能。
动态数据库
在 Junos OS 9.5 及更高版本中,您可以在动态数据库中配置路由策略和特定路由策略对象,而动态数据库不受标准配置数据库所需的相同验证的约束。因此,您可以快速提交这些路由策略和策略对象,可以根据需要在标准配置中引用和应用这些策略和策略对象。BGP 是可以应用引用动态数据库中配置的策略的路由策略的唯一协议。在标准配置中配置并提交基于动态数据库的路由策略后,您可以通过修改动态数据库中的策略对象快速更改现有路由策略。由于 Junos OS 不会验证对动态数据库的配置更改,因此在使用此功能时,应先测试并验证所有配置更改,然后再提交。
另见
了解 OSPF 路由策略
每个路由策略都由一个策略名称标识。名称可以包含字母、数字和连字符 (-),最长可达 255 个字符。若要在名称中包含空格,请用双引号将整个名称括起来。每个路由策略名称在配置中必须是唯一的。创建并命名策略后,必须在激活之前应用该策略。
在 import 语句中,将列出用于过滤 OSPF 外部路由以免安装到 OSPF 邻接方的路由表中的路由策略的名称。您可以过滤路由,但不能过滤链路状态地址 (LSA) 泛洪。外部路由是 OSPF 自治系统 (AS) 外部的路由。导入策略不会影响 OSPF 数据库。这意味着导入策略对链路状态播发没有影响。OSPF 的默认导入策略是接受所有已学习的路由并将它们导入路由表。
在 export 语句中,列出将路由从路由表导出到 OSPF 时要评估的路由策略的名称。OSPF 的默认导出策略是拒绝除 LSA 类型 1 和类型 2 之外的所有内容。OSPF 实际上不会导出其内部学习的路由(运行协议的接口上直接连接的路由)。OSPF 使用链路状态通告 (LSA) 泛洪来通告本地路由和获知路由,并且 LSA 泛洪不受导出策略的影响。
默认情况下,如果路由设备有多个 OSPF 区域,则来自其他区域的获知路由会自动安装到路由表的区域 0 中。
要指定多个策略并创建策略链,请使用空格作为分隔符列出策略。如果指定了多个策略,则按指定策略的顺序评估这些策略。一旦执行接受或拒绝作,策略链评估就会结束。
本主题介绍以下信息:
路由策略条款
路由策略由一个或多个术语组成。术语是一种命名结构,可在其中定义匹配条件和作。您可以定义一个或多个术语。名称可以包含字母、数字和连字符 ( - ),最长可达 255 个字符。若要在名称中包含空格,请用双引号将整个名称括起来。
每个术语都包含一组匹配条件和一组作:
匹配条件是路由在应用作之前必须匹配的条件。如果路由符合所有条件,则对路由应用一个或多个作。
作指定是接受还是拒绝路由,控制如何评估一系列策略,以及作与路由关联的特征。
路由策略匹配条件
匹配条件定义路由必须匹配才能执行作的条件。您可以为每个术语定义一个或多个匹配条件。如果路由与特定术语的所有匹配条件匹配,则处理为该术语定义的作。
每个术语可以包含两个语句和 from to,用于定义匹配条件:
在
from语句中,定义传入路由必须匹配的条件。您可以指定一个或多个匹配条件。如果指定多个,则它们都必须与路由匹配才能发生匹配。该
from语句是可选的。如果省略和from语to句,则所有路由都将被视为匹配。注意:在导出策略中,从路由策略术语中省略
from语句可能会导致意外结果。在
to语句中,定义传出路由必须匹配的条件。您可以指定一个或多个匹配条件。如果指定多个,则它们都必须与路由匹配才能发生匹配。
术语中匹配条件的顺序并不重要,因为路由必须与术语中的所有匹配条件匹配才能执行作。
有关匹配条件的完整列表,请参阅在路由策略术语中配置匹配条件。
路由策略作
作定义当路由与特定术语的 from 和 to 语句中的所有匹配条件匹配时,路由设备对路由执行的作。如果术语没有 from 和 to 语句,则所有路由都将被视为匹配,并且作适用于所有路由。
每个术语可以具有以下一种或多种类型的作。作在语句下 then 配置。
流控制作,影响是接受还是拒绝路由,以及是否评估下一个术语或路由策略。
作路由特征的作。
跟踪作,记录路由匹配。
该 then 语句是可选的。如果省略它,将发生以下情况之一:
将评估路由策略中的下一个术语(如果存在)。
如果路由策略没有更多术语,则评估下一个路由策略(如果存在)。
如果没有更多术语或路由策略,
accept则执行默认策略指定的或reject作。
有关路由策略作的完整列表,请参阅在路由策略术语中配置作。
了解 OSPF 协议的备份选择策略
对 OSPF 无环路备用 (LFA) 路由的支持实质上增加了 OSPF 的 IP 快速重新路由功能。Junos OS 会为所有 OSPF 路由预先计算多个无环路备份路由。这些备份路由预安装在 数据包转发引擎 中,当特定路由的下一跃点主链路不再可用时,该执行本地修复并实施备用路径。LFA 的选择是通过选择任何匹配的 LFA 来随机完成的,以前进到给定的目的地。这并不能确保网络的最佳备份覆盖率。为了选择最佳的 LFA,Junos OS 允许您为每个目标(IPv4 和 IPv6)和一个主下一跃点接口配置网络范围的备份选择策略。这些策略根据管理员组、srlg、带宽、保护类型、指标和节点信息进行评估。
在备份最短路径优先 (SPF) 计算过程中,备份路径的每个节点和链路属性由 IGP 累积并与拓扑中的每个节点(路由器)相关联。最佳备份路径中的下一跃点将被选为路由表中的备份下一跃点。通常,备份评估策略规则分为以下几种类型:
修剪 — 为选择符合条件的备份路径而配置的规则。
排序 — 配置为在符合条件的备份路径中选择最佳路径的规则。
备份选择策略可以同时配置修剪规则和排序规则。在评估备份策略时,系统会为每个备份路径分配一个分数,这是一个整数值,表示评估条件的总权重。选择得分最高的备份路径。
要强制执行 LFA 选择,请为以下属性配置各种规则:
admin-group– 管理组(也称为链接着色或资源类)是手动分配的属性,用于描述链接的“颜色”,因此具有相同颜色的链接在概念上属于同一类。这些配置的管理组在协议 MPLS 下定义。您可以使用管理组通过排除、全部包含、包含任意或首选项来实现各种备份选择策略。
srlg— 共享风险链路组 (SRLG) 是一组共享公共资源的链路,如果公共资源发生故障,它会影响集中的所有链路。这些链路具有相同的故障风险,因此被视为属于同一个 SRLG。例如,共享公共光纤的链路被称为位于同一 SRLG 中,因为光纤故障可能会导致组中的所有链路发生故障。SRLG 由 IGP (OSPF) 域中唯一的 32 位数字表示。一个链路可能属于多个 SRLG。您可以定义备份选择以允许或拒绝主路径和备份路径之间的公共 SRLG。这种对公共 SRLG 的拒绝是基于在主下一跳和备份 SPF 中不存在具有公共 SRLG 的链路。
注意:只能为默认拓扑创建管理组和 SRLG。
bandwidth — 带宽指定主路径和备份路径之间的带宽约束。仅当备份下一跳接口的带宽大于或等于主下一跳的带宽时,才能使用备份下一跳链路。
protection-type— 保护类型可保护目标免受主节点节点故障或主链路链路链路故障的影响。您可以配置节点、链路或节点链路来保护目标。如果配置了链路节点,则节点保护 LFA 优先于链路保护 LFA。
node - 节点是每个节点的策略信息。在这里,节点可以是直接连接的路由器、远程路由器(如 RSVP 备份 LSP 尾端)或备份 SPF 路径中的任何其他路由器。节点通过 LSP 中节点播发的路由 ID 来识别。您可以列出节点,以便在备份路径中首选或排除它们。
metric— 指标决定如何优先使用 LFA。在备份选择路径中,根指标和 dest-metric 是两种类型的指标。root-metric 指示单跃点邻接方或远程路由器(如 RSVP 备份 LSP 尾端路由器)的指标。dest-metric 表示从单跳邻居或远程路由器(例如 RSVP 备份 LSP 尾端路由器)到最终目标的指标。指标评估按升序或降序进行。默认情况下,第一个优先级是目标评估最低的备份路径,然后是根指标最低的备份路径。
评估顺序允许您控制在备份路径中评估这些属性的顺序和条件。您可以显式配置评估顺序。只有配置的属性会影响备份路径的选择。LFA 的这些属性的默认评估顺序是 [ admin-group srlg bandwidth protection-type node metric ]。
OSPFv3 不支持 TE 属性,也不能用于 IPv6 前缀的备份选择策略评估。
另见
配置 OSPF 协议的备份选择策略
对 OSPF 无环路备用 (LFA) 路由的支持实质上增加了 OSPF 的 IP 快速重新路由功能。Junos OS 会为所有 OSPF 路由预先计算多个无环路备份路由。这些备份路由预安装在 数据包转发引擎 中,当特定路由的下一跃点主链路不再可用时,该执行本地修复并实施备用路径。LFA 的选择是通过选择任何匹配的 LFA 来随机完成的,以前进到给定的目的地。这并不能确保网络的最佳备份覆盖率。为了选择最佳的 LFA,Junos OS 允许您为每个目标(IPv4 和 IPv6)和一个主下一跃点接口配置网络范围的备份选择策略。这些策略根据管理员组、srlg、带宽、保护类型、指标和节点信息进行评估。
开始为 OSPF 协议配置备份选择策略之前:
配置路由器接口。请参阅 《Junos OS 网络管理路由设备管理指南》。
配置内部网关协议或静态路由。请参阅 适用于路由设备的 Junos OS 路由协议库。
要为 OSPF 协议配置备份选择策略,请执行以下作:
另见
独立于拓扑结构的无环路备用,具有用于 OSPF 的分段路由
了解用于 OSPF 的与拓扑无关的无环路替代分段路由
分段路由通过强加描述路径的标签堆栈,使路由器能够沿着网络中的特定路径发送数据包。分段路由标签堆栈描述的转发作不需要基于每条路径建立。因此,入口路由器可以使用分段路由标签堆栈实例化任意路径,并立即使用它,无需任何信号。
在分段路由中,每个节点播发传入标签和转发作之间的映射。特定的转发作称为分段,标识该分段的标签称为分段标识符 (SID)。TI-LFA 创建的备份路径使用以下类型的分段:
节点分段 — 节点分段沿最短路径将数据包转发至目标节点。将交换表示节点段(节点 SID)的标签,直到到达目标节点。
邻接分段 — 邻接分段通过通告邻接分段的节点上的特定接口转发数据包。表示邻接分段的标签(邻接 SID)由播发该分段的节点弹出。
路由器可以通过创建使用节点 SID 和邻接 SID 组合的标签堆栈来沿特定路径发送数据包。通常,节点 SID 用于表示与两个节点之间的最短路径相对应的路径部分。如果节点 SID 无法用于准确表示所需路径,则使用邻接 SID。
TI-LFA 与 OSPF 配合使用时,可提供保护,防止链路故障、节点故障、命运共享故障和共享风险链路组故障。在链路故障模式下,如果链路故障,目标将受到保护。在节点保护模式下,如果连接到主链路的邻接方发生故障,则目标将受到保护。为了确定保护节点的收敛后路径,我们假定离开邻接方的所有链路的成本将按可配置的量增加。
从 Junos OS 20.3R1 版开始,您可以在 TI-LFA 网络中为分段路由配置命运共享保护,以选择在与拓扑无关的无环路备用 (TI-LFA) 备份路径中不包含命运共享组的快速重新路由路径,以避免命运共享失败。借助命运共享保护,在每个公共出借权上配置一个命运共享组列表,每个命运共享组中的链路由各自的 IP 地址标识。PLR将成本与每个命运分担组相关联。命运共享后收敛路径的计算方法是:假设与失败链路处于同一命运共享组中的每个链路的成本增加了与该组关联的成本。
从 Junos OS 20.3R1 版开始,您可以在 TI-LFA 网络中为分段路由配置共享风险链路组 (SRLG) 保护,以选择在与拓扑无关的无环路备用 (TI-LFA) 备份路径中不包括 SRLG 链路的快速重新路由路径。SRLG 共享光纤,同时也存在链路断开的风险。当 SRLG 中的一个链路发生故障时,组中的其他链路也可能发生故障。因此,您需要避免与备份路径中的受保护链接具有相同风险的链接。配置 SRLG 保护可防止 TI-LFA 选择包含共享风险链路的备份路径。如果配置了 SRLG 保护,则 OSPFv2 将计算与后收敛路径对齐的快速重新路由路径,并排除属于受保护链路的 SRLG 的链路。与受保护链路来自同一 SRLG 的所有本地和远程链路都将从 TI-LFA 备份路径中排除。本地维修点 (PLR) 为使用不同传出接口的快速重新路由路径设置标签堆栈。目前,无法在 IPv6 网络和多拓扑网络中启用 SRLG 保护。
为了构建遵循收敛后路径的备份路径,TI-LFA 可以在标签堆栈中使用多个标签来定义备份路径。如果构建特定收敛后备份路径所需的标签数量超过一定数量,则在某些情况下,不安装该备份路径会很有用。您可以配置备份路径可以具有的最大标签数,以便进行安装。默认值为 3,范围为 2 到 5。
通常情况下,给定故障的收敛后路径实际上是一组等价路径。TI-LFA 尝试在故障后拓扑中使用多个等价路径来构建到给定目标的备用路径。根据拓扑结构的不同,TI-LFA 可能需要使用不同的标签堆栈来准确构建这些等价备份路径。默认情况下,TI-LFA 仅为给定目标安装一个备份路径。但是,您可以在 1 到 8 的范围内配置该值。
将独立于拓扑的无环路备用路由与分段路由搭配使用的优势
多年来,无环路备用 (LFA) 和远程 LFA (RLFA) 一直用于提供快速重新路由保护。借助 LFA,本地修复点 (PLR) 可确定发送到其直接邻接方之一的数据包是否到达目的地,而无需通过 PLR 返回。在典型的网络拓扑中,大约 40% 到 60% 的目标可以受 LFA 保护。远程 LFA 扩展了 LFA 的概念,允许 PLR 强加单个标签,将数据包通过隧道传输到修复隧道端点,数据包可以从该端点到达目的地,而无需通过 PLR 返回。与 LFA 相比,使用远程 LFA 可以保护更多目的地。但是,根据网络拓扑的不同,受远程 LFA 保护的目标百分比通常小于 100%。
独立于拓扑的 LFA (TI-LFA) 扩展了 LFA 和远程 LFA 的概念,允许 PLR 使用更深的标签堆栈来构建备份路径。此外,TI-LFA 还施加了一项约束,即在给定故障场景中,内部网关协议 (IGP) 收敛后,PLR 使用的备用路径应与数据包所采用的路径相同。此路径称为收敛后路径。
使用收敛后路径作为备份路径具有一些理想的特性。对于某些拓扑,网络运营商只需要确保网络有足够的容量在发生故障后沿融合后路径承载流量。在这些情况下,当备用路径处于活动状态时,网络运营商无需在故障发生后立即分配额外容量来处理流量模式,因为备用路径遵循融合后路径。
TI-LFA 与 OSPF 配合使用时,可提供链路故障和节点故障保护。
为 OSPF 配置与拓扑无关的无环路备用分段路由
在为 OSPF 配置 TI-LFA 之前,请确保配置 SPRING 或分段路由。
从 Junos OS 19.3R1 版开始,Junos 支持创建独立于 OSPF 拓扑的 TI-LFA 备份路径,当 PLR 和映射服务器都位于同一 OSPF 区域时,将从分段路由映射服务器通告中获知前缀 SID。
要使用 SPRING for OSPF 配置 TI-LFA,必须执行以下作:
示例:配置 OSPF 或 OSPF3 协议的备份选择策略
此示例说明如何为 OSPF 或 OSPF3 协议配置备份选择策略,以便选择网络中的无环路备用 (LFA)。
启用备份选择策略时,Junos OS 允许根据网络中链路和节点的策略规则和属性选择 LFA。这些属性是 admin-group、srlg、bandwidth、protection-type、metric 和 node。
要求
此示例使用以下硬件和软件组件:
八台路由器,可以是 M Series 多服务边缘路由器、MX 系列 5G 通用路由平台、PTX 系列数据包传输路由器和 T Series 核心路由器的组合
在所有设备上运行的 Junos OS 15.1 或更高版本
开始之前:
配置设备接口。
配置 OSPF。
概述
在 Junos OS 中,默认的无环路替代方案 (LFA) 选择算法或标准可被 LFA 策略覆盖。这些策略是为每个目标(IPv4 和 IPv6)和一个主下一跃点接口配置的。这些备份策略基于备份路径的管理员组、srlg、带宽、保护类型、指标和节点属性强制执行 LFA 选择。在备份最短路径优先 (SPF) 计算期间,IGP 会累积每个备份下一跃点存储的备份路径的每个属性(包括节点和链路)。对于 IGP 在内部创建的路由,系统会根据为每个目标(IPv4 和 IPv6)配置的策略和一个主下一跃点接口来评估每个备份路径的属性集。选择第一个或最佳备份路径,并将其安装为路由表中的备份下一跃点。要配置备份选择策略,请在[edit routing-options]层次结构级别包含backup-selection配置语句。命令show backup-selection显示为给定接口和目标配置的策略。可以根据特定的目标、前缀、接口或逻辑系统对显示进行过滤。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层 [edit] 级的 CLI 中,然后从配置模式进入 commit 。
R0
set interfaces ge-0/0/0 unit 0 family inet address 10.1.1.1/30 set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:10:1:1::1/64 set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/1/0 unit 0 family inet address 172.16.15.1/30 set interfaces ge-0/1/0 unit 0 family inet6 address 2001:db8:15:1:1::1/64 set interfaces ge-0/1/0 unit 0 family mpls set interfaces xe-0/2/0 unit 0 family inet address 172.16.20.1/30 set interfaces xe-0/2/0 unit 0 family inet6 address 2001:db8:20:1:1::1/64 set interfaces xe-0/2/0 unit 0 family mpls set interfaces ge-1/0/5 unit 0 family inet address 172.16.150.1/24 set interfaces ge-1/0/5 unit 0 family inet6 address 2001:db8:150:1:1::1/64 set interfaces ge-1/0/5 unit 0 family mpls set interfaces ge-1/1/1 unit 0 family inet address 172.16.30.1/30 set interfaces ge-1/1/1 unit 0 family inet6 address 2001:db8:30:1:1::1/64 set interfaces ge-1/1/1 unit 0 family mpls set interfaces xe-1/3/0 unit 0 family inet address 172.16.25.1/30 set interfaces xe-1/3/0 unit 0 family inet6 address 2001:db8:25:1:1::1/64 set interfaces xe-1/3/0 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.10.10.10/32 primary set interfaces lo0 unit 0 family inet6 address 2001:db8::10:10:10:10/128 primary set interfaces lo0 unit 0 family mpls set routing-options srlg srlg1 srlg-value 1001 set routing-options srlg srlg2 srlg-value 1002 set routing-options srlg srlg3 srlg-value 1003 set routing-options srlg srlg4 srlg-value 1004 set routing-options srlg srlg5 srlg-value 1005 set routing-options srlg srlg6 srlg-value 1006 set routing-options srlg srlg7 srlg-value 1007 set routing-options srlg srlg8 srlg-value 1008 set routing-options srlg srlg9 srlg-value 1009 set routing-options srlg srlg10 srlg-value 10010 set routing-options srlg srlg11 srlg-value 10011 set routing-options srlg srlg12 srlg-value 10012 set routing-options router-id 10.10.10.10 set protocols rsvp interface all set protocols mpls admin-groups c0 0 set protocols mpls admin-groups c1 1 set protocols mpls admin-groups c2 2 set protocols mpls admin-groups c3 3 set protocols mpls admin-groups c4 4 set protocols mpls admin-groups c5 5 set protocols mpls admin-groups c6 6 set protocols mpls admin-groups c7 7 set protocols mpls admin-groups c8 8 set protocols mpls admin-groups c9 9 set protocols mpls admin-groups c10 10 set protocols mpls admin-groups c11 11 set protocols mpls admin-groups c12 12 set protocols mpls admin-groups c13 13 set protocols mpls admin-groups c14 14 set protocols mpls admin-groups c15 15 set protocols mpls admin-groups c16 16 set protocols mpls admin-groups c17 17 set protocols mpls admin-groups c18 18 set protocols mpls admin-groups c19 19 set protocols mpls admin-groups c20 20 set protocols mpls admin-groups c21 21 set protocols mpls admin-groups c22 22 set protocols mpls admin-groups c23 23 set protocols mpls admin-groups c24 24 set protocols mpls admin-groups c25 25 set protocols mpls admin-groups c26 26 set protocols mpls admin-groups c27 27 set protocols mpls admin-groups c28 28 set protocols mpls admin-groups c29 29 set protocols mpls admin-groups c30 30 set protocols mpls admin-groups c31 31 set protocols mpls interface all set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 metric 10 set protocols ospf area 0.0.0.0 interface ge-0/1/0.0 metric 18 set protocols ospf area 0.0.0.0 interface xe-0/2/0.0 metric 51 set protocols ospf area 0.0.0.0 interface ge-1/1/1.0 metric 23 set protocols ospf area 0.0.0.0 interface xe-1/3/0.0 metric 52 set protocols ospf area 0.0.0.0 interface ge-1/0/5.0 set protocols ospf3 area 0.0.0.0 interface ge-0/0/0.0 metric 10 set protocols ospf3 area 0.0.0.0 interface ge-0/1/0.0 metric 18 set protocols ospf3 area 0.0.0.0 interface xe-0/2/0.0 metric 51 set protocols ospf3 area 0.0.0.0 interface ge-1/1/1.0 metric 23 set protocols ospf3 area 0.0.0.0 interface xe-1/3/0.0 metric 52 set protocols ospf3 area 0.0.0.0 interface ge-1/0/5.0
R1
set interfaces ge-0/0/0 unit 0 family inet address 10.1.1.2/30 set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:10:1:1::2/64 set interfaces ge-0/0/0 unit 0 family mpls set interfaces ge-0/0/5 unit 0 family inet address 172.16.35.1/30 set interfaces ge-0/0/5 unit 0 family inet6 address 2001:db8:35:1:1::1/64 set interfaces ge-0/0/5 unit 0 family mpls set interfaces xe-0/2/0 unit 0 family inet address 172.16.40.1/30 set interfaces xe-0/2/0 unit 0 family inet6 address 2001:db8:40:1:1::1/64 set interfaces xe-0/2/0 unit 0 family mpls set interfaces xe-0/3/0 unit 0 family inet address 172.16.45.1/30 set interfaces xe-0/3/0 unit 0 family inet6 address 2001:db8:45:1:1::1/64 set interfaces xe-0/3/0 unit 0 family mpls set interfaces lo0 unit 0 family inet address 172.16.1.1/32 primary set interfaces lo0 unit 0 family inet6 address 2001:db8::1:1:1:1/128 primary set interfaces lo0 unit 0 family mpls set routing-options srlg srlg1 srlg-value 1001 set routing-options srlg srlg2 srlg-value 1002 set routing-options srlg srlg3 srlg-value 1003 set routing-options srlg srlg4 srlg-value 1004 set routing-options srlg srlg5 srlg-value 1005 set routing-options srlg srlg6 srlg-value 1006 set routing-options srlg srlg7 srlg-value 1007 set routing-options srlg srlg8 srlg-value 1008 set routing-options srlg srlg9 srlg-value 1009 set routing-options srlg srlg10 srlg-value 10010 set routing-options srlg srlg11 srlg-value 10011 set routing-options srlg srlg12 srlg-value 10012 set routing-options router-id 172.16.1.1 set protocols rsvp interface all set protocols mpls admin-groups c0 0 set protocols mpls admin-groups c1 1 set protocols mpls admin-groups c2 2 set protocols mpls admin-groups c3 3 set protocols mpls admin-groups c4 4 set protocols mpls admin-groups c5 5 set protocols mpls admin-groups c6 6 set protocols mpls admin-groups c7 7 set protocols mpls admin-groups c8 8 set protocols mpls admin-groups c9 9 set protocols mpls admin-groups c10 10 set protocols mpls admin-groups c11 11 set protocols mpls admin-groups c12 12 set protocols mpls admin-groups c13 13 set protocols mpls admin-groups c14 14 set protocols mpls admin-groups c15 15 set protocols mpls admin-groups c16 16 set protocols mpls admin-groups c17 17 set protocols mpls admin-groups c18 18 set protocols mpls admin-groups c19 19 set protocols mpls admin-groups c20 20 set protocols mpls admin-groups c21 21 set protocols mpls admin-groups c22 22 set protocols mpls admin-groups c23 23 set protocols mpls admin-groups c24 24 set protocols mpls admin-groups c25 25 set protocols mpls admin-groups c26 26 set protocols mpls admin-groups c27 27 set protocols mpls admin-groups c28 28 set protocols mpls admin-groups c29 29 set protocols mpls admin-groups c30 30 set protocols mpls admin-groups c31 31 set protocols mpls interface all set protocols mpls interface ge-0/0/0.0 srlg srlg9 set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 metric 10 set protocols ospf area 0.0.0.0 interface ge-0/0/5.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/2/0.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/3/0.0 metric 10 set protocols ospf3 area 0.0.0.0 interface ge-0/0/0.0 metric 10 set protocols ospf3 area 0.0.0.0 interface ge-0/0/5.0 metric 10 set protocols ospf3 area 0.0.0.0 interface xe-0/2/0.0 metric 10 set protocols ospf3 area 0.0.0.0 interface xe-0/3/0.0 metric 10
R2
set interfaces ge-0/0/2 unit 0 family inet address 172.16.35.2/30 set interfaces ge-0/0/2 unit 0 family inet6 address 2001:db8:35:1:1::2/64 set interfaces ge-0/0/2 unit 0 family mpls set interfaces ge-0/1/0 unit 0 family inet address 172.16.50.1/30 set interfaces ge-0/1/0 unit 0 family inet6 address 2001:db8:50:1:1::1/64 set interfaces ge-0/1/0 unit 0 family mpls set interfaces xe-0/2/1 unit 0 family inet address 172.16.55.1/30 set interfaces xe-0/2/1 unit 0 family inet6 address 2001:db8:55:1:1::1/64 set interfaces xe-0/2/1 unit 0 family mpls set interfaces ge-1/0/2 unit 0 family inet address 172.16.60.1/30 set interfaces ge-1/0/2 unit 0 family inet6 address 2001:db8:60:1:1::1/64 set interfaces ge-1/0/2 unit 0 family mpls set interfaces ge-1/0/9 unit 0 family inet address 172.16.65.1/30 set interfaces ge-1/0/9 unit 0 family inet6 address 2001:db8:65:1:1::1/64 set interfaces ge-1/0/9 unit 0 family mpls set interfaces ge-1/1/5 unit 0 family inet address 172.16.70.1/30 set interfaces ge-1/1/5 unit 0 family inet6 address 2001:db8:70:1:1::1/64 set interfaces ge-1/1/5 unit 0 family mpls set interfaces lo0 unit 0 family inet address 172.16.2.2/32 primary set interfaces lo0 unit 0 family inet6 address 2001:db8::2:2:2:2/128 primary set interfaces lo0 unit 0 family mpls set routing-options srlg srlg1 srlg-value 1001 set routing-options srlg srlg2 srlg-value 1002 set routing-options srlg srlg3 srlg-value 1003 set routing-options srlg srlg4 srlg-value 1004 set routing-options srlg srlg5 srlg-value 1005 set routing-options srlg srlg6 srlg-value 1006 set routing-options srlg srlg7 srlg-value 1007 set routing-options srlg srlg8 srlg-value 1008 set routing-options srlg srlg9 srlg-value 1009 set routing-options srlg srlg10 srlg-value 10010 set routing-options srlg srlg11 srlg-value 10011 set routing-options srlg srlg12 srlg-value 10012 set routing-options router-id 172.16.2.2 set protocols rsvp interface all set protocols mpls admin-groups c0 0 set protocols mpls admin-groups c1 1 set protocols mpls admin-groups c2 2 set protocols mpls admin-groups c3 3 set protocols mpls admin-groups c4 4 set protocols mpls admin-groups c5 5 set protocols mpls admin-groups c6 6 set protocols mpls admin-groups c7 7 set protocols mpls admin-groups c8 8 set protocols mpls admin-groups c9 9 set protocols mpls admin-groups c10 10 set protocols mpls admin-groups c11 11 set protocols mpls admin-groups c12 12 set protocols mpls admin-groups c13 13 set protocols mpls admin-groups c14 14 set protocols mpls admin-groups c15 15 set protocols mpls admin-groups c16 16 set protocols mpls admin-groups c17 17 set protocols mpls admin-groups c18 18 set protocols mpls admin-groups c19 19 set protocols mpls admin-groups c20 20 set protocols mpls admin-groups c21 21 set protocols mpls admin-groups c22 22 set protocols mpls admin-groups c23 23 set protocols mpls admin-groups c24 24 set protocols mpls admin-groups c25 25 set protocols mpls admin-groups c26 26 set protocols mpls admin-groups c27 27 set protocols mpls admin-groups c28 28 set protocols mpls admin-groups c29 29 set protocols mpls admin-groups c30 30 set protocols mpls admin-groups c31 31 set protocols mpls interface all set protocols mpls interface ge-0/1/0.0 srlg srlg1 set protocols mpls interface ge-1/0/9.0 srlg srlg1 set protocols mpls interface ge-1/1/5.0 srlg srlg7 set protocols ospf area 0.0.0.0 interface ge-0/0/2.0 metric 10 set protocols ospf area 0.0.0.0 interface ge-0/1/0.0 link-protection set protocols ospf area 0.0.0.0 interface xe-0/2/1.0 metric 12 set protocols ospf area 0.0.0.0 interface ge-1/0/2.0 metric 10 set protocols ospf area 0.0.0.0 interface ge-1/0/9.0 metric 12 set protocols ospf area 0.0.0.0 interface ge-1/1/5.0 metric 13 set protocols ospf3 area 0.0.0.0 interface ge-0/0/2.0 metric 10 set protocols ospf3 area 0.0.0.0 interface ge-0/1/0.0 link-protection set protocols ospf3 area 0.0.0.0 interface xe-0/2/1.0 metric 12 set protocols ospf3 area 0.0.0.0 interface ge-1/0/2.0 metric 10 set protocols ospf3 area 0.0.0.0 interface ge-1/0/9.0 metric 12 set protocols ospf3 area 0.0.0.0 interface ge-1/1/5.0 metric 13
R3
set interfaces ge-0/0/5 unit 0 family inet address 172.16.50.2/30 set interfaces ge-0/0/5 unit 0 family inet6 address 2001:db8:50:1:1::2/64 set interfaces ge-0/0/5 unit 0 family mpls set interfaces xe-0/3/1 unit 0 family inet address 172.16.75.1/30 set interfaces xe-0/3/1 unit 0 family inet6 address 2001:db8:75:1:1::1/64 set interfaces xe-0/3/1 unit 0 family mpls set interfaces ge-1/0/0 unit 0 family inet address 172.16.80.1/30 set interfaces ge-1/0/0 unit 0 family inet6 address 2001:db8:80:1:1::1/64 set interfaces ge-1/0/0 unit 0 family mpls set interfaces ge-1/0/5 unit 0 family inet address 172.16.200.1/24 set interfaces ge-1/0/5 unit 0 family inet6 address 2001:db8:200:1:1::1/64 set interfaces ge-1/0/6 unit 0 family inet address 172.16.85.1/30 set interfaces ge-1/0/6 unit 0 family inet6 address 2001:db8:85:1:1::1/64 set interfaces ge-1/0/6 unit 0 family mpls set interfaces xe-1/3/0 unit 0 family inet address 172.16.90.1/30 set interfaces xe-1/3/0 unit 0 family inet6 address 2001:db8:90:1:1::1/64 set interfaces xe-1/3/0 unit 0 family mpls set interfaces lo0 unit 0 family inet address 172.16.3.3/32 primary set interfaces lo0 unit 0 family inet6 address 2001:db8::3:3:3:3/128 primary set interfaces lo0 unit 0 family mpls set routing-options srlg srlg1 srlg-value 1001 set routing-options srlg srlg2 srlg-value 1002 set routing-options srlg srlg3 srlg-value 1003 set routing-options srlg srlg4 srlg-value 1004 set routing-options srlg srlg5 srlg-value 1005 set routing-options srlg srlg6 srlg-value 1006 set routing-options srlg srlg7 srlg-value 1007 set routing-options srlg srlg8 srlg-value 1008 set routing-options srlg srlg9 srlg-value 1009 set routing-options srlg srlg10 srlg-value 10010 set routing-options srlg srlg11 srlg-value 10011 set routing-options srlg srlg12 srlg-value 10012 set routing-options router-id 172.16.3.3 set routing-options forwarding-table export ecmp set routing-options backup-selection destination 10.1.1.0/30 interface xe-1/3/0.0 admin-group include-all c2 set routing-options backup-selection destination 10.1.1.0/30 interface all admin-group exclude c3 set routing-options backup-selection destination 10.1.1.0/30 interface all srlg strict set routing-options backup-selection destination 10.1.1.0/30 interface all protection-type node set routing-options backup-selection destination 10.1.1.0/30 interface all bandwidth-greater-equal-primary set routing-options backup-selection destination 10.1.1.0/30 interface all neighbor preference 172.16.7.7 set routing-options backup-selection destination 10.1.1.0/30 interface all root-metric lowest set routing-options backup-selection destination 10.1.1.0/30 interface all metric-order root set routing-options backup-selection destination 172.16.30.0/30 interface all admin-group exclude c5 set routing-options backup-selection destination 172.16.30.0/30 interface all srlg strict set routing-options backup-selection destination 172.16.30.0/30 interface all protection-type node set routing-options backup-selection destination 172.16.30.0/30 interface all bandwidth-greater-equal-primary set routing-options backup-selection destination 172.16.30.0/30 interface all neighbor preference 172.16.7.7 set routing-options backup-selection destination 172.16.30.0/30 interface all root-metric lowest set routing-options backup-selection destination 172.16.30.0/30 interface all metric-order root set routing-options backup-selection destination 172.16.45.0/30 interface all admin-group exclude c5 set routing-options backup-selection destination 172.16.45.0/30 interface all srlg strict set routing-options backup-selection destination 172.16.45.0/30 interface all protection-type node set routing-options backup-selection destination 172.16.45.0/30 interface all bandwidth-greater-equal-primary set routing-options backup-selection destination 172.16.45.0/30 interface all neighbor preference 172.16.7.7 set routing-options backup-selection destination 172.16.45.0/30 interface all root-metric lowest set routing-options backup-selection destination 172.16.45.1/30 interface all metric-order root set protocols rsvp interface all set protocols mpls admin-groups c0 0 set protocols mpls admin-groups c1 1 set protocols mpls admin-groups c2 2 set protocols mpls admin-groups c3 3 set protocols mpls admin-groups c4 4 set protocols mpls admin-groups c5 5 set protocols mpls admin-groups c6 6 set protocols mpls admin-groups c7 7 set protocols mpls admin-groups c8 8 set protocols mpls admin-groups c9 9 set protocols mpls admin-groups c10 10 set protocols mpls admin-groups c11 11 set protocols mpls admin-groups c12 12 set protocols mpls admin-groups c13 13 set protocols mpls admin-groups c14 14 set protocols mpls admin-groups c15 15 set protocols mpls admin-groups c16 16 set protocols mpls admin-groups c17 17 set protocols mpls admin-groups c18 18 set protocols mpls admin-groups c19 19 set protocols mpls admin-groups c20 20 set protocols mpls admin-groups c21 21 set protocols mpls admin-groups c22 22 set protocols mpls admin-groups c23 23 set protocols mpls admin-groups c24 24 set protocols mpls admin-groups c25 25 set protocols mpls admin-groups c26 26 set protocols mpls admin-groups c27 27 set protocols mpls admin-groups c28 28 set protocols mpls admin-groups c29 29 set protocols mpls admin-groups c30 30 set protocols mpls admin-groups c31 31 set protocols mpls interface all set protocols mpls interface ge-0/0/5.0 admin-group c0 set protocols ospf area 0.0.0.0 interface ge-0/0/5.0 link-protection set protocols ospf area 0.0.0.0 interface ge-0/0/5.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/3/1.0 metric 21 set protocols ospf area 0.0.0.0 interface ge-1/0/0.0 metric 13 set protocols ospf area 0.0.0.0 interface ge-1/0/6.0 metric 15 set protocols ospf area 0.0.0.0 interface xe-1/3/0.0 link-protection set protocols ospf area 0.0.0.0 interface xe-1/3/0.0 metric 22 set protocols ospf3 area 0.0.0.0 interface ge-0/0/5.0 link-protection set protocols ospf3 area 0.0.0.0 interface ge-0/0/5.0 metric 10 set protocols ospf3 area 0.0.0.0 interface xe-0/3/1.0 metric 21 set protocols ospf3 area 0.0.0.0 interface ge-1/0/0.0 metric 13 set protocols ospf3 area 0.0.0.0 interface ge-1/0/6.0 metric 15 set protocols ospf3 area 0.0.0.0 interface xe-1/3/0.0 link-protection set protocols ospf3 area 0.0.0.0 interface xe-1/3/0.0 metric 22 set policy-options policy-statement ecmp term 1 then load-balance per-packet
R4
set routing-options srlg srlg1 srlg-value 1001 set routing-options srlg srlg2 srlg-value 1002 set routing-options srlg srlg3 srlg-value 1003 set routing-options srlg srlg4 srlg-value 1004 set routing-options srlg srlg5 srlg-value 1005 set routing-options srlg srlg6 srlg-value 1006 set routing-options srlg srlg7 srlg-value 1007 set routing-options srlg srlg8 srlg-value 1008 set routing-options srlg srlg9 srlg-value 1009 set routing-options srlg srlg10 srlg-value 10010 set routing-options srlg srlg11 srlg-value 10011 set routing-options srlg srlg12 srlg-value 10012 set routing-options router-id 172.16.4.4 set protocols rsvp interface all set protocols mpls admin-groups c0 0 set protocols mpls admin-groups c1 1 set protocols mpls admin-groups c2 2 set protocols mpls admin-groups c3 3 set protocols mpls admin-groups c4 4 set protocols mpls admin-groups c5 5 set protocols mpls admin-groups c6 6 set protocols mpls admin-groups c7 7 set protocols mpls admin-groups c8 8 set protocols mpls admin-groups c9 9 set protocols mpls admin-groups c10 10 set protocols mpls admin-groups c11 11 set protocols mpls admin-groups c12 12 set protocols mpls admin-groups c13 13 set protocols mpls admin-groups c14 14 set protocols mpls admin-groups c15 15 set protocols mpls admin-groups c16 16 set protocols mpls admin-groups c17 17 set protocols mpls admin-groups c18 18 set protocols mpls admin-groups c19 19 set protocols mpls admin-groups c20 20 set protocols mpls admin-groups c21 21 set protocols mpls admin-groups c22 22 set protocols mpls admin-groups c23 23 set protocols mpls admin-groups c24 24 set protocols mpls admin-groups c25 25 set protocols mpls admin-groups c26 26 set protocols mpls admin-groups c27 27 set protocols mpls admin-groups c28 28 set protocols mpls admin-groups c29 29 set protocols mpls admin-groups c30 30 set protocols mpls admin-groups c31 31 set protocols mpls interface all set protocols ospf area 0.0.0.0 interface ge-0/1/0.0 metric 18 set protocols ospf area 0.0.0.0 interface xe-0/2/0.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-1/3/0.0 metric 10 set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 metric 10 set protocols ospf area 0.0.0.0 interface ge-1/1/0.0 metric 10 set protocols ospf area 0.0.0.0 interface xe-0/3/1.0 metric 21 set protocols ospf3 area 0.0.0.0 interface ge-0/1/0.0 metric 18 set protocols ospf3 area 0.0.0.0 interface xe-0/2/0.0 metric 10 set protocols ospf3 area 0.0.0.0 interface xe-1/3/0.0 metric 10 set protocols ospf3 area 0.0.0.0 interface ge-0/0/0.0 metric 10 set protocols ospf3 area 0.0.0.0 interface ge-1/1/0.0 metric 10 set protocols ospf3 area 0.0.0.0 interface xe-0/3/1.0 metric 21
R5
set routing-options srlg srlg1 srlg-value 1001 set routing-options srlg srlg2 srlg-value 1002 set routing-options srlg srlg3 srlg-value 1003 set routing-options srlg srlg4 srlg-value 1004 set routing-options srlg srlg5 srlg-value 1005 set routing-options srlg srlg6 srlg-value 1006 set routing-options srlg srlg7 srlg-value 1007 set routing-options srlg srlg8 srlg-value 1008 set routing-options srlg srlg9 srlg-value 1009 set routing-options srlg srlg10 srlg-value 10010 set routing-options srlg srlg11 srlg-value 10011 set routing-options srlg srlg12 srlg-value 10012 set routing-options router-id 172.16.5.5 set protocols rsvp interface all set protocols mpls admin-groups c0 0 set protocols mpls admin-groups c1 1 set protocols mpls admin-groups c2 2 set protocols mpls admin-groups c3 3 set protocols mpls admin-groups c4 4 set protocols mpls admin-groups c5 5 set protocols mpls admin-groups c6 6 set protocols mpls admin-groups c7 7 set protocols mpls admin-groups c8 8 set protocols mpls admin-groups c9 9 set protocols mpls admin-groups c10 10 set protocols mpls admin-groups c11 11 set protocols mpls admin-groups c12 12 set protocols mpls admin-groups c13 13 set protocols mpls admin-groups c14 14 set protocols mpls admin-groups c15 15 set protocols mpls admin-groups c16 16 set protocols mpls admin-groups c17 17 set protocols mpls admin-groups c18 18 set protocols mpls admin-groups c19 19 set protocols mpls admin-groups c20 20 set protocols mpls admin-groups c21 21 set protocols mpls admin-groups c22 22 set protocols mpls admin-groups c23 23 set protocols mpls admin-groups c24 24 set protocols mpls admin-groups c25 25 set protocols mpls admin-groups c26 26 set protocols mpls admin-groups c27 27 set protocols mpls admin-groups c28 28 set protocols mpls admin-groups c29 29 set protocols mpls admin-groups c30 30 set protocols mpls admin-groups c31 31 set protocols mpls interface all set protocols ospf area 0.0.0.0 interface xe-0/2/0.0 metric 51 set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 metric 10 set protocols ospf area 0.0.0.0 interface ge-0/0/5.0 metric 13 set protocols ospf area 0.0.0.0 interface ge-0/1/0.0 metric 10 set protocols ospf3 area 0.0.0.0 interface xe-0/2/0.0 metric 51 set protocols ospf3 area 0.0.0.0 interface ge-0/0/1.0 metric 10 set protocols ospf3 area 0.0.0.0 interface ge-0/0/5.0 metric 13 set protocols ospf3 area 0.0.0.0 interface ge-0/1/0.0 metric 10
R6
set routing-options srlg srlg1 srlg-value 1001 set routing-options srlg srlg2 srlg-value 1002 set routing-options srlg srlg3 srlg-value 1003 set routing-options srlg srlg4 srlg-value 1004 set routing-options srlg srlg5 srlg-value 1005 set routing-options srlg srlg6 srlg-value 1006 set routing-options srlg srlg7 srlg-value 1007 set routing-options srlg srlg8 srlg-value 1008 set routing-options srlg srlg9 srlg-value 1009 set routing-options srlg srlg10 srlg-value 10010 set routing-options srlg srlg11 srlg-value 10011 set routing-options srlg srlg12 srlg-value 10012 set routing-options router-id 172.16.6.6 set protocols rsvp interface all set protocols mpls admin-groups c0 0 set protocols mpls admin-groups c1 1 set protocols mpls admin-groups c2 2 set protocols mpls admin-groups c3 3 set protocols mpls admin-groups c4 4 set protocols mpls admin-groups c5 5 set protocols mpls admin-groups c6 6 set protocols mpls admin-groups c7 7 set protocols mpls admin-groups c8 8 set protocols mpls admin-groups c9 9 set protocols mpls admin-groups c10 10 set protocols mpls admin-groups c11 11 set protocols mpls admin-groups c12 12 set protocols mpls admin-groups c13 13 set protocols mpls admin-groups c14 14 set protocols mpls admin-groups c15 15 set protocols mpls admin-groups c16 16 set protocols mpls admin-groups c17 17 set protocols mpls admin-groups c18 18 set protocols mpls admin-groups c19 19 set protocols mpls admin-groups c20 20 set protocols mpls admin-groups c21 21 set protocols mpls admin-groups c22 22 set protocols mpls admin-groups c23 23 set protocols mpls admin-groups c24 24 set protocols mpls admin-groups c25 25 set protocols mpls admin-groups c26 26 set protocols mpls admin-groups c27 27 set protocols mpls admin-groups c28 28 set protocols mpls admin-groups c29 29 set protocols mpls admin-groups c30 30 set protocols mpls admin-groups c31 31 set protocols mpls interface all set protocols ospf area 0.0.0.0 interface xe-0/3/0.0 metric 52 set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 metric 12 set protocols ospf area 0.0.0.0 interface ge-0/0/4.0 metric 15 set protocols ospf area 0.0.0.0 interface xe-0/2/0.0 metric 10 set protocols ospf3 area 0.0.0.0 interface xe-0/3/0.0 metric 52 set protocols ospf3 area 0.0.0.0 interface ge-0/0/0.0 metric 12 set protocols ospf3 area 0.0.0.0 interface ge-0/0/4.0 metric 15 set protocols ospf3 area 0.0.0.0 interface xe-0/2/0.0 metric 10
R7
set routing-options srlg srlg1 srlg-value 1001 set routing-options srlg srlg2 srlg-value 1002 set routing-options srlg srlg3 srlg-value 1003 set routing-options srlg srlg4 srlg-value 1004 set routing-options srlg srlg5 srlg-value 1005 set routing-options srlg srlg6 srlg-value 1006 set routing-options srlg srlg7 srlg-value 1007 set routing-options srlg srlg8 srlg-value 1008 set routing-options srlg srlg9 srlg-value 1009 set routing-options srlg srlg10 srlg-value 10010 set routing-options srlg srlg11 srlg-value 10011 set routing-options srlg srlg12 srlg-value 10012 set routing-options router-id 172.16.7.7 set protocols rsvp interface all set protocols mpls admin-groups c0 0 set protocols mpls admin-groups c1 1 set protocols mpls admin-groups c2 2 set protocols mpls admin-groups c3 3 set protocols mpls admin-groups c4 4 set protocols mpls admin-groups c5 5 set protocols mpls admin-groups c6 6 set protocols mpls admin-groups c7 7 set protocols mpls admin-groups c8 8 set protocols mpls admin-groups c9 9 set protocols mpls admin-groups c10 10 set protocols mpls admin-groups c11 11 set protocols mpls admin-groups c12 12 set protocols mpls admin-groups c13 13 set protocols mpls admin-groups c14 14 set protocols mpls admin-groups c15 15 set protocols mpls admin-groups c16 16 set protocols mpls admin-groups c17 17 set protocols mpls admin-groups c18 18 set protocols mpls admin-groups c19 19 set protocols mpls admin-groups c20 20 set protocols mpls admin-groups c21 21 set protocols mpls admin-groups c22 22 set protocols mpls admin-groups c23 23 set protocols mpls admin-groups c24 24 set protocols mpls admin-groups c25 26 set protocols mpls admin-groups c27 27 set protocols mpls admin-groups c28 28 set protocols mpls admin-groups c29 29 set protocols mpls admin-groups c30 30 set protocols mpls admin-groups c31 31 set protocols mpls interface all set protocols mpls interface xe-0/3/0.0 srlg srlg8 set protocols ospf area 0.0.0.0 interface ge-0/1/5.0 metric 23 set protocols ospf area 0.0.0.0 interface xe-0/3/0.0 metric 10 set protocols ospf area 0.0.0.0 interface ge-1/0/0.0 metric 13 set protocols ospf area 0.0.0.0 interface xe-1/3/0.0 metric 22 set protocols ospf area 0.0.0.0 interface xe-1/2/0.0 metric 10 set protocols ospf3 area 0.0.0.0 interface ge-0/1/5.0 metric 23 set protocols ospf3 area 0.0.0.0 interface xe-0/3/0.0 metric 10 set protocols ospf3 area 0.0.0.0 interface ge-1/0/0.0 metric 13 set protocols ospf3 area 0.0.0.0 interface xe-1/3/0.0 metric 22 set protocols ospf3 area 0.0.0.0 interface xe-1/2/0.0 metric 10
配置设备 R3
分步过程
下面的示例要求您在各个配置层级中进行导航。有关 CLI 导航的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 R3,请执行以下作:
配置接口。
[edit interfaces] user@R3# set ge-0/0/5 unit 0 family inet address 172.16.50.2/30 user@R3# set ge-0/0/5 unit 0 family inet6 address 2001:db8:50:1:1::2/64 user@R3# set ge-0/0/5 unit 0 family mpls user@R3# set xe-0/3/1 unit 0 family inet address 172.16.75.1/30 user@R3# set xe-0/3/1 unit 0 family inet6 address 2001:db8:75:1:1::1/64 user@R3# set xe-0/3/1 unit 0 family mpls user@R3# set ge-1/0/0 unit 0 family inet address 172.16.80.1/30 user@R3# set ge-1/0/0 unit 0 family inet6 address 2001:db8:80:1:1::1/64 user@R3# set ge-1/0/0 unit 0 family mpls user@R3# set ge-1/0/5 unit 0 family inet address 172.16.200.1/24 user@R3# set ge-1/0/5 unit 0 family inet6 address 2001:db8:200:1:1::1/64 user@R3# set ge-1/0/6 unit 0 family inet address 172.16.85.1/30 user@R3# set ge-1/0/6 unit 0 family inet6 address 2001:db8:85:1:1::1/64 user@R3# set ge-1/0/6 unit 0 family mpls user@R3# set xe-1/3/0 unit 0 family inet address 172.16.90.1/30 user@R3# set xe-1/3/0 unit 0 family inet6 address 2001:db8:90:1:1::1/64 user@R3# set xe-1/3/0 unit 0 family mpls user@R3# set lo0 unit 0 family inet address 172.16.3.3/32 primary user@R3# set lo0 unit 0 family inet6 address 2001:db8::3:3:3:3/128 primary user@R3# set lo0 unit 0 family mpls
配置 srlg 值。
[edit routing-options] user@R3# set srlg srlg1 srlg-value 1001 user@R3# set srlg srlg2 srlg-value 1002 user@R3# set srlg srlg3 srlg-value 1003 user@R3# set srlg srlg4 srlg-value 1004 user@R3# set srlg srlg5 srlg-value 1005 user@R3# set srlg srlg6 srlg-value 1006 user@R3# set srlg srlg7 srlg-value 1007 user@R3# set srlg srlg8 srlg-value 1008 user@R3# set srlg srlg9 srlg-value 1009 user@R3# set srlg srlg10 srlg-value 10010 user@R3# set srlg srlg11 srlg-value 10011 user@R3# set srlg srlg12 srlg-value 10012
配置路由器的 ID。
[edit routing-options] user@R3# set router-id 172.16.3.3
将路由策略应用于从路由表导出到转转发表的所有等价多路径。
[edit routing-options] user@R3# set forwarding-table export ecmp
配置备份选择策略的属性。
[edit routing-options backup-selection] user@R3# set destination 10.1.1.0/30 interface xe-1/3/0.0 admin-group include-all c2 user@R3# set destination 10.1.1.0/30 interface all admin-group exclude c3 user@R3# set destination 10.1.1.0/30 interface all srlg strict user@R3# set destination 10.1.1.0/30 interface all protection-type node user@R3# set destination 10.1.1.0/30 interface all bandwidth-greater-equal-primary user@R3# set destination 10.1.1.0/30 interface all neighbor preference 172.16.7.7 user@R3# set destination 10.1.1.0/30 interface all root-metric lowest user@R3# set destination 10.1.1.0/30 interface all metric-order root user@R3# set destination 172.16.30.0/30 interface all admin-group exclude c5 user@R3# set destination 172.16.30.0/30 interface all srlg strict user@R3# set destination 172.16.30.0/30 interface all protection-type node user@R3# set destination 172.16.30.0/30 interface all bandwidth-greater-equal-primary user@R3# set destination 172.16.30.0/30 interface all neighbor preference 172.16.7.7 user@R3# set destination 172.16.30.0/30 interface all root-metric lowest user@R3# set destination 172.16.30.0/30 interface all metric-order root user@R3# set destination 192.168.45.0/30 interface all admin-group exclude c5 user@R3# set destination 192.168.45.0/30 interface all srlg strict user@R3# set destination 192.168.45.0/30 interface all protection-type node user@R3# set destination 192.168.45.0/30 interface all bandwidth-greater-equal-primary user@R3# set destination 192.168.45.0/30 interface all neighbor preference 172.16.7.7 user@R3# set destination 192.168.45.0/30 interface all root-metric lowest user@R3# set destination 192.168.45.0/30 interface all metric-order root
在所有接口上启用 RSVP。
[edit protocols] user@R3# set rsvp interface all
配置管理组。
[edit protocols mpls] user@R3# set admin-groups c0 0 user@R3# set admin-groups c1 1 user@R3# set admin-groups c2 2 user@R3# set admin-groups c3 3 user@R3# set admin-groups c4 4 user@R3# set admin-groups c5 5 user@R3# set admin-groups c6 6 user@R3# set admin-groups c7 7 user@R3# set admin-groups c8 8 user@R3# set admin-groups c9 9 user@R3# set admin-groups c10 10 user@R3# set admin-groups c11 11 user@R3# set admin-groups c12 12 user@R3# set admin-groups c13 13 user@R3# set admin-groups c14 14 user@R3# set admin-groups c15 15 user@R3# set admin-groups c16 16 user@R3# set admin-groups c17 17 user@R3# set admin-groups c18 18 user@R3# set admin-groups c19 19 user@R3# set admin-groups c20 20 user@R3# set admin-groups c21 21 user@R3# set admin-groups c22 22 user@R3# set admin-groups c23 23 user@R3# set admin-groups c24 24 user@R3# set admin-groups c25 25 user@R3# set admin-groups c26 26 user@R3# set admin-groups c27 27 user@R3# set admin-groups c28 28 user@R3# set admin-groups c29 29 user@R3# set admin-groups c30 30 user@R3# set admin-groups c31 31
在所有接口上启用 MPLS,并为某个接口配置管理组。
[edit protocols mpls] user@R3# set interface all user@R3# set interface ge-0/0/5.0 admin-group c0
启用链路保护,并在 OSPF 区域的所有接口上配置指标值。
[edit protocols ospf] user@R3# set area 0.0.0.0 interface ge-0/0/5.0 link-protection user@R3# set area 0.0.0.0 interface ge-0/0/5.0 metric 10 user@R3# set area 0.0.0.0 interface xe-0/3/1.0 metric 21 user@R3# set area 0.0.0.0 interface ge-1/0/0.0 metric 13 user@R3# set area 0.0.0.0 interface ge-1/0/6.0 metric 15 user@R3# set area 0.0.0.0 interface xe-1/3/0.0 link-protection user@R3# set area 0.0.0.0 interface xe-1/3/0.0 metric 22
启用链路保护并在 OSPF3 区域的所有接口上配置指标值。
[edit protocols ospf3] user@R3# set area 0.0.0.0 interface ge-0/0/5.0 link-protection user@R3# set area 0.0.0.0 interface ge-0/0/5.0 metric 10 user@R3# set area 0.0.0.0 interface xe-0/3/1.0 metric 21 user@R3# set area 0.0.0.0 interface ge-1/0/0.0 metric 13 user@R3# set area 0.0.0.0 interface ge-1/0/6.0 metric 15 user@R3# set area 0.0.0.0 interface xe-1/3/0.0 link-protection user@R3# set area 0.0.0.0 interface xe-1/3/0.0 metric 22
配置路由策略。
[edit policy-options] user@R3# set policy-statement ecmp term 1 then load-balance per-packet
结果
在配置模式下,输入show interfaces、show protocolsshow policy-options、和show routing-options命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@R3# show interfaces
ge-0/0/5 {
unit 0 {
family inet {
address 192.168.50.2/30;
}
family inet6 {
address 2001:db8:50:1:1::2/64;
}
family mpls;
}
}
xe-0/3/1 {
unit 0 {
family inet {
address 192.168.75.1/30;
}
family inet6 {
address 2001:db8:75:1:1::1/64;
}
family mpls;
}
}
ge-1/0/0 {
unit 0 {
family inet {
address 192.168.80.1/30;
}
family inet6 {
address 2001:db8:80:1:1::1/64;
}
family mpls;
}
}
ge-1/0/5 {
unit 0 {
family inet {
address 172.16.200.1/24;
}
family inet6 {
address 2001:db8:200:1:1::1/64;
}
}
}
ge-1/0/6 {
unit 0 {
family inet {
address 192.168.85.1/30;
}
family inet6 {
address 2001:db8:85:1:1::1/64;
}
family mpls;
}
}
xe-1/3/0 {
unit 0 {
family inet {
address 192.168.90.1/30;
}
family inet6 {
address 2001:db8:90:1:1::1/64;
}
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 172.16.3.3/32 {
primary;
}
}
family inet6 {
address 2001:db8:3:3:3:3/128 {
primary;
}
}
family mpls;
}
}
user@R3# show protocols
rsvp {
interface all;
}
mpls {
admin-groups {
c0 0;
c1 1;
c2 2;
c3 3;
c4 4;
c5 5;
c6 6;
c7 7;
c8 8;
c9 9;
c10 10;
c11 11;
c12 12;
c13 13;
c14 14;
c15 15;
c16 16;
c17 17;
c18 18;
c19 19;
c20 20;
c21 21;
c22 22;
c23 23;
c24 24;
c25 25;
c26 26;
c27 27;
c28 28;
c29 29;
c30 30;
c31 31;
}
interface all;
interface ge-0/0/5.0 {
admin-group c0;
}
}
ospf {
area 0.0.0.0 {
interface ge-0/0/5.0 {
link-protection;
metric 10;
}
interface xe-0/3/1.0 {
metric 21;
}
interface ge-1/0/0.0 {
metric 13;
}
interface ge-1/0/6.0 {
metric 15;
}
interface xe-1/3/0.0 {
link-protection;
metric 22;
}
}
}
ospf3 {
area 0.0.0.0 {
interface ge-0/0/5.0 {
link-protection;
metric 10;
}
interface xe-0/3/1.0 {
metric 21;
}
interface ge-1/0/0.0 {
metric 13;
}
interface ge-1/0/6.0 {
metric 15;
}
interface xe-1/3/0.0 {
link-protection;
metric 22;
}
}
}
user@R3# show routing-options
srlg {
srlg1 srlg-value 1001;
srlg2 srlg-value 1002;
srlg3 srlg-value 1003;
srlg4 srlg-value 1004;
srlg5 srlg-value 1005;
srlg6 srlg-value 1006;
srlg7 srlg-value 1007;
srlg8 srlg-value 1008;
srlg9 srlg-value 1009;
srlg10 srlg-value 10010;
srlg11 srlg-value 10011;
srlg12 srlg-value 10012;
}
router-id 172.16.3.3;
forwarding-table {
export ecmp;
}
backup-selection {
destination 10.1.1.0/30 {
interface xe-1/3/0.0 {
admin-group {
include-all c2;
}
}
interface all {
admin-group {
exclude c3;
}
srlg strict;
protection-type node;
bandwidth-greater-equal-primary;
node {
preference 172.16.7.7;
}
root-metric lowest;
metric-order root;
}
}
destination 172.16.30.0/30 {
interface all {
admin-group {
exclude c5;
}
srlg strict;
protection-type node;
bandwidth-greater-equal-primary;
node {
preference 172.16.7.7;
}
root-metric lowest;
metric-order root;
}
}
destination 192.168.45.0/30 {
interface all {
admin-group {
exclude c5;
}
srlg strict;
protection-type node;
bandwidth-greater-equal-primary;
node {
preference 172.16.7.7;
}
root-metric lowest;
metric-order root;
}
}
}
如果完成设备配置,请从配置模式输入 commit 。
验证
确认配置工作正常。
验证路由
目的
验证是否学习了预期的路由。
行动
在作模式下,运行 show route 路由表的命令。
user@R3> show route
inet.0: 48 destinations, 48 routes (48 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
172.16.3.3/32 *[Direct/0] 02:22:27
> via lo0.0
10.4.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.5.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.6.128.0/17 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.9.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.10.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.13.4.0/23 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.13.10.0/23 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.82.0.0/15 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.84.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.85.12.0/22 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.92.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.92.16.0/20 *[Direct/0] 02:22:57
> via fxp0.0
10.92.24.195/32 *[Local/0] 02:22:57
Local via fxp0.0
10.94.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.99.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.102.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.150.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.155.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.157.64.0/19 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.160.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.204.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.205.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.206.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.207.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.209.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.212.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.213.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.214.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.215.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.216.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.218.13.0/24 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.218.14.0/24 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.218.16.0/20 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.218.32.0/20 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
10.227.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
172.16.50.0/30 *[Direct/0] 02:19:55
> via ge-0/0/5.0
172.16.50.2/32 *[Local/0] 02:19:58
Local via ge-0/0/5.0
172.16.75.0/30 *[Direct/0] 02:19:55
> via xe-0/3/1.0
172.16.75.1/32 *[Local/0] 02:19:57
Local via xe-0/3/1.0
172.16.24.195/32 *[Direct/0] 02:22:57
> via lo0.0
172.16.0.0/12 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
192.168.0.0/16 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
192.168.102.0/23 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
192.168.136.0/24 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
192.168.136.192/32 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
192.168.137.0/24 *[Static/5] 02:22:57
> to 10.92.31.254 via fxp0.0
192.168.233.5/32 *[OSPF/10] 00:16:55, metric 1
MultiRecv
iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
47.0005.80ff.f800.0000.0108.0001.1280.9202.4195/152
*[Direct/0] 02:22:57
> via lo0.0
mpls.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0 *[MPLS/0] 00:16:55, metric 1
Receive
1 *[MPLS/0] 00:16:55, metric 1
Receive
2 *[MPLS/0] 00:16:55, metric 1
Receive
13 *[MPLS/0] 00:16:55, metric 1
Receive
inet6.0: 10 destinations, 11 routes (10 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
2001:db8:50:1:1::/64 *[Direct/0] 02:19:44
> via ge-0/0/5.0
2001:db8:50:1:1::2/128 *[Local/0] 02:19:58
Local via ge-0/0/5.0
2001:db8:75:1:1::/64 *[Direct/0] 02:19:44
> via xe-0/3/1.0
2001:db8:75:1:1::1/128 *[Local/0] 02:19:57
Local via xe-0/3/1.0
2001:db8::3:3:3:3/128 *[Direct/0] 02:22:27
> via lo0.0
2001:db8::128:92:24:195/128
*[Direct/0] 02:22:57
> via lo0.0
fe80::/64 *[Direct/0] 02:19:44
> via ge-0/0/5.0
[Direct/0] 02:19:43
> via xe-0/3/1.0
fe80::205:86ff:fe00:ed05/128
*[Local/0] 02:19:58
Local via ge-0/0/5.0
fe80::205:86ff:fe00:ed3d/128
*[Local/0] 02:19:57
Local via xe-0/3/1.0
fe80::5668:a50f:fcc1:3ca2/128
*[Direct/0] 02:22:57
> via lo0.0
意义
输出显示所有设备 R3 路由。
验证 OSPF 路由
目的
验证 OSPF 的路由表。
行动
在作模式下,为设备 R3 运行 show ospf route detail 命令。
user@R3> show ospf route detail
Topology default Route Table:
Prefix Path Route NH Metric NextHop Nexthop
Type Type Type Interface Address/LSP
172.16.50.0/30 Intra Network IP 10 ge-0/0/5.0
area 0.0.0.0, origin 172.16.3.3, priority low
172.16.75.0/30 Intra Network IP 21 xe-0/3/1.0
area 0.0.0.0, origin 172.16.3.3, priority low
意义
输出显示 OSPF 路由器的路由表。
验证 OSPF3 路由
目的
验证 OSPF3 的路由表。
行动
在作模式下,为设备 R3 运行 show ospf3 route detail 命令。
user@R3> show ospf3 route detail
Prefix Path Route NH Metric
Type Type Type
2001:db8:50:1:1::/64 Intra Network IP 10
NH-interface ge-0/0/5.0
Area 0.0.0.0, Origin 172.16.3.3, Priority low
2001:db8:75:1:1::/64 Intra Network IP 21
NH-interface xe-0/3/1.0
Area 0.0.0.0, Origin 172.16.3.3, Priority low
意义
输出显示 OSPF3 路由器的路由表。
验证设备 R3 的备份选择策略
目的
验证设备 R3 的备份选择策略。
行动
在作模式下,为设备 R3 运行 show backup-selection 命令。
user@R3> show backup-selection
Prefix: 10.1.1.0/30
Interface: all
Admin-group exclude: c3
Neighbor preference: 172.16.7.7
Protection Type: Node, Downstream Paths Only: Disabled, SRLG: Strict, B/w >= Primary: Enabled, Root-metric: lowest, Dest-metric: lowest
Metric Evaluation Order: Root-metric, Dest-metric
Policy Evaluation Order: Admin-group, SRLG, Bandwidth, Protection, node, Metric
Interface: xe-1/3/0.0
Admin-group include-all: c2
Protection Type: Link, Downstream Paths Only: Disabled, SRLG: Loose, B/w >= Primary: Disabled, Root-metric: lowest, Dest-metric: lowest
Metric Evaluation Order: Dest-metric, Root-metric
Policy Evaluation Order: Admin-group, SRLG, Bandwidth, Protection, node, Metric Prefix: 172.16.30.0/30
Interface: all
Admin-group exclude: c5
Neighbor preference: 172.16.7.7
Protection Type: Node, Downstream Paths Only: Disabled, SRLG: Strict, B/w >= Primary: Enabled, Root-metric: lowest, Dest-metric: lowest
Metric Evaluation Order: Root-metric, Dest-metric
Policy Evaluation Order: Admin-group, SRLG, Bandwidth, Protection, node, Metric
Prefix: 172.16.45.0/30
Interface: all
Admin-group exclude: c5
Neighbor preference: 172.16.7.7
Protection Type: Node, Downstream Paths Only: Disabled, SRLG: Strict, B/w >= Primary: Enabled, Root-metric: lowest, Dest-metric: lowest
Metric Evaluation Order: Root-metric, Dest-metric
Policy Evaluation Order: Admin-group, SRLG, Bandwidth, Protection, node, Metric
意义
输出显示每个主下一跃点接口每个前缀的配置策略。
示例:将 OSPF 路由注入 BGP 路由表
此示例说明如何创建将 OSPF 路由注入 BGP 路由表的策略。
要求
开始之前:
配置网络接口。
配置外部对等会话。请参阅 示例:配置外部 BGP 点对点对等会话。
配置对等方之间的内部网关协议 (IGP) 会话。
概述
在此示例中,您将创建一个名为 injectpolicy1 的路由策略和一个名为 injectterm1的路由术语。该策略会将 OSPF 路由注入 BGP 路由表。
拓扑学
配置
配置路由策略
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到 [edit] 层次结构级别的 CLI 中,然后从配置模式进入 commit 。
set policy-options policy-statement injectpolicy1 term injectterm1 from protocol ospf set policy-options policy-statement injectpolicy1 term injectterm1 from area 0.0.0.1 set policy-options policy-statement injectpolicy1 term injectterm1 then accept set protocols bgp export injectpolicy1
分步过程
下面的示例要求您在各个配置层级中进行导航。有关 CLI 导航的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要将 OSPF 路由注入 BGP 路由表,请执行以下作:
创建策略期限。
[edit policy-options policy-statement injectpolicy1] user@host# set term injectterm1
将 OSPF 指定为匹配条件。
[edit policy-options policy-statement injectpolicy1 term injectterm1] user@host# set from protocol ospf
将来自 OSPF 区域的路由指定为匹配条件。
[edit policy-options policy-statement injectpolicy1 term injectterm1] user@host# set from area 0.0.0.1
指定如果先前条件匹配,则接受路由。
[edit policy-options policy-statement injectpolicy1 term injectterm1] user@host# set then accept
将路由策略应用于 BGP。
[edit] user@host# set protocols bgp export injectpolicy1
结果
通过在配置模式下输入 show policy-options 和 show protocols bgp 命令来确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@host# show policy-options
policy-statement injectpolicy1 {
term injectterm1 {
from {
protocol ospf;
area 0.0.0.1;
}
then accept;
}
}
user@host# show protocols bgp export injectpolicy1;
如果完成设备配置,请从配置模式输入 commit 。
配置路由策略的跟踪
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到 [edit] 层次结构级别的 CLI 中,然后从配置模式进入 commit 。
set policy-options policy-statement injectpolicy1 term injectterm1 then trace set routing-options traceoptions file ospf-bgp-policy-log set routing-options traceoptions file size 5m set routing-options traceoptions file files 5 set routing-options traceoptions flag policy
分步过程
下面的示例要求您在各个配置层级中进行导航。有关 CLI 导航的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
在策略中包括跟踪作。
[edit policy-options policy-statement injectpolicy1 term injectterm1] user@host# then trace
配置输出的跟踪文件。
[edit routing-options traceoptions] user@host# set file ospf-bgp-policy-log user@host# set file size 5m user@host# set file files 5 user@host# set flag policy
结果
通过在配置模式下输入 show policy-options 和 show routing-options 命令来确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@host# show policy-options
policy-statement injectpolicy1 {
term injectterm1 {
then {
trace;
}
}
}
user@host# show routing-options
traceoptions {
file ospf-bgp-policy-log size 5m files 5;
flag policy;
}
如果完成设备配置,请从配置模式输入 commit 。
示例:将静态路由重新分发到 OSPF 中
此示例说明如何创建将静态路由重新分配给 OSPF 的策略。
要求
开始之前:
配置设备接口。请参阅 安全设备接口用户指南。
概述
在此示例中,您将创建一个名为 exportstatic1 的路由策略和一个名为 exportstatic1 的路由术语。该策略将静态路由注入到 OSPF 中。此示例包含以下设置:
policy-statement- 定义路由策略。指定策略的名称并进一步定义策略的元素。策略名称必须是唯一的,可以包含字母、数字和连字符 ( - ),长度不超过 255 个字符。term- 定义路由策略的匹配条件和适用作。术语名称可以包含字母、数字和连字符 ( - ),长度不超过 255 个字符。您可以指定术语的名称,并通过包含from语句来定义传入路由必须匹配的条件,以及如果路由通过包含then语句来匹配条件时要执行的作。在此示例中,您将指定静态协议匹配条件和接受作。export- 应用您创建的导出策略,以便在将路由从路由表导出到 OSPF 时进行评估。
拓扑学
配置
CLI 快速配置
要快速创建将静态路由注入 OSPF 的策略,请复制以下命令并将其粘贴到 CLI 中。
[edit] set policy-options policy-statement exportstatic1 term exportstatic1 from protocol static set policy-options policy-statement exportstatic1 term exportstatic1 then accept set protocols ospf export exportstatic1
程序
分步过程
下面的示例要求您在各个配置层级中进行导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的修改 Junos OS 配置。
要将静态路由注入 OSPF:
创建路由策略。
[edit] user@host# edit policy-options policy-statement exportstatic1
创建策略期限。
[edit policy-options policy-statement exportstatic1] user@host# set term exportstatic1
将 static 指定为匹配条件。
[edit policy-options policy-statement exportstatic1 term exportstatic1] user@host# set from protocol static
指定如果与上一个条件匹配,则接受路由。
[edit policy-options policy-statement exportstatic1 term exportstatic1] user@host# set then accept
将路由策略应用于 OSPF。
注意:对于 OSPFv3,请在
[edit protocols]层次结构级别包含ospf3语句。[edit] user@host# set protocols ospf export exportstatic1
如果完成设备配置,请提交配置。
[edit] user@host# commit
结果
输入 show policy-options 和 show protocols ospf 命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@host# show policy-options
policy-statement exportstatic1 {
term exportstatic1 {
from protocol static;
then accept;
}
}
user@host# show protocols ospf export exportstatic1;
要确认您的 OSPFv3 配置,请输入和 show policy-options 命令 show protocols ospf3 。
验证
确认配置工作正常。
示例:配置OSPF导入策略
此示例说明如何创建 OSPF 导入策略。OSPF 导入策略仅适用于外部路由。外部路由是 OSPF 自治系统 (AS) 外部的路由。
要求
开始之前:
为 OSPF 网络中的设备配置路由器标识符。请参阅 示例:配置 OSPF 路由器标识符。
控制 OSPF 指定的路由器选择。请参阅 示例:控制 OSPF 指定路由器选择。
配置单区域 OSPF 网络。请参阅 示例:配置单区域 OSPF 网络 。
概述
外部路由由 AS 边界路由器学习。如果将 AS 边界路由器配置为将路由重新分发到 OSPF 中,则可以在整个 OSPF 域中通告外部路由。AS 边界路由器可以从 OSPF 以外的路由协议获知外部路由,或者外部路由可能是您在 AS 边界路由器上配置的静态路由。
对于 OSPFv3,链路状态通告 (LSA) 称为区域间前缀 LSA,其执行的功能与网络汇总 LSA 为 OSPFv2 执行的功能相同。区域边界路由器 (ABR) 为必须播发到某个区域的每个 IPv6 前缀发起一个区域间前缀 LSA。
OSPF 导入策略允许您阻止将外部路由添加到 OSPF 邻接方的路由表中。导入策略不会影响 OSPF 数据库。这意味着导入策略对链路状态播发没有影响。仅在 OSPF 中的外部路由上进行过滤。过滤不会考虑区域内和区域间路由。默认作是在路由与策略不匹配时接受路由。
此示例包含以下 OSPF 策略设置:
policy-statement- 定义路由策略。指定策略的名称并进一步定义策略的元素。策略名称必须是唯一的,可以包含字母、数字和连字符 ( - ),长度不超过 255 个字符。export- 应用您创建的导出策略,以便在网络汇总 LSA 泛洪到某个区域时进行评估。在此示例中,导出策略名为 export_static。import- 应用您创建的导入策略,以防止外部路由添加到路由表中。在此示例中,导入策略名为 filter_routes。
在此示例中配置的设备表示以下功能:
R1 - 设备 R1 位于区域 0.0.0.0 中,与设备 R2 直接连接。R1 配置了 OSPF 导出策略。导出策略将静态路由从 R1 的路由表重新分配到 R1 的 OSPF 数据库中。由于静态路由位于 R1 的 OSPF 数据库中,因此路由会在 LSA 中播发至 R1 的 OSPF 邻接方。R1 的 OSPF 邻接方是设备 R2。
R2 — 设备 R2 位于区域 0.0.0.0 中,与设备 R1 直接连接。R2 配置了 OSPF 导入策略,用于匹配到 10.0.16.0/30 网络的静态路由,并防止静态路由安装在 R2 的路由表中。R2 的 OSPF 邻接方是设备 R1。
配置
CLI 快速配置
要快速配置 OSPF 导入策略,请将其粘贴到文本文件中,删除所有换行符,更改详细信息以匹配您的网络配置,将命令复制并粘贴到 [edit] 层次结构级别的 CLI 中,然后从配置模式进入 commit 。
设备 R1 上的配置:
[edit] set interfaces so-0/2/0 unit 0 family inet address 10.0.2.1/30 set protocols ospf export export_static set protocols ospf area 0.0.0.0 interface so-0/2/0 set policy-options policy-statement export_static from protocol static set policy-options policy-statement export_static then accept
设备 R2 上的配置:
[edit] set interfaces so-0/2/0 unit 0 family inet address 10.0.2.2/30 set protocols ospf import filter_routes set protocols ospf area 0.0.0.0 interface so-0/2/0 set policy-options policy-statement filter_routes from route-filter 10.0.16.0/30 exact set policy-options policy-statement filter_routes then reject
程序
分步过程
下面的示例要求您在各个配置层级中进行导航。有关导航 CLI 的信息,请参阅CLI 用户指南中的修改 Junos OS 配置。
要配置 OSPF 导入策略,请执行以下作:
配置接口。
[edit] user@R1# set interfaces so-0/2/0 unit 0 family inet address 10.0.2.1/30
[edit] user@R2# set interfaces so-0/2/0 unit 0 family inet address 10.0.2.2/30
在接口上启用 OSPF。
注意:对于 OSPFv3,请在
[edit protocols]层次结构级别包含ospf3语句。[edit] user@R1# set protocols ospf area 0.0.0.0 interface so-0/2/0
[edit] user@R2# set protocols ospf area 0.0.0.0 interface so-0/2/0
在 R1 上,将静态路由重新分发到 OSPF 中。
[edit] user@R1# set protocols ospf export export_static user@R1# set policy-options policy-statement export_static from protocol static user@R1# set policy-options policy-statement export_static then accept
在 R2 上,配置 OSPF 导入策略。
[edit] user@R2# set protocols ospf import filter_routes user@R2# set policy-options policy-statement filter_routes from route-filter 10.0.16.0/30 exact user@R2# set policy-options policy-statement filter_routes then reject
如果完成设备配置,请提交配置。
[edit] user@host# commit
结果
通过在相应设备上输入show interfacesshow policy-optionsshow protocols ospf、和命令来确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
R1 的输出:
user@R1# show interfaces
so-0/2/0 {
unit 0 {
family inet {
address 10.0.2.1/30;
}
}
}
user@R1# show policy-options
policy-statement export_static {
from protocol static;
then accept;
}
user@R1# show protocols ospf
export export_static;
area 0.0.0.0 {
interface so-0/2/0.0;
}
R2 的输出:
user@R2# show interfaces
so-0/2/0 {
unit 0 {
family inet {
address 10.0.2.2/30;
}
}
}
user@R2# show policy-options
policy-statement filter_routes {
from {
route-filter 10.0.16.0/30 exact;
}
then reject;
}
user@R2# show protocols ospf
import filter_routes;
area 0.0.0.0 {
interface so-0/2/0.0;
}
要确认您的 OSPFv3 配置,请在相应设备上输入show interfacesshow policy-options、、show routing-optionsshow protocols ospf3和命令。
示例:配置路由过滤器策略,为通过 OSPF 获知的前缀指定优先级
此示例说明如何创建 OSPF 导入策略,该策略优先考虑通过 OSPF 获知的特定前缀。
要求
开始之前:
配置设备接口。请参阅 安全设备接口用户指南。
为 OSPF 网络中的设备配置路由器标识符。请参阅 示例:配置 OSPF 路由器标识符。
控制 OSPF 指定路由器选择 请参阅 示例:控制 OSPF 指定路由器选择
配置单区域 OSPF 网络。请参阅 示例:配置单区域 OSPF 网络 。
配置多区域 OSPF 网络。请参阅 示例:配置多区域 OSPF 网络。
概述
在具有大量 OSPF 路由的网络中,控制路由的更新顺序以响应网络拓扑更改会很有用。在 Junos OS 9.3 及更高版本中,您可以为 OSPF 导入策略中包含的前缀指定高、中或低优先级。如果 OSPF 拓扑发生更改,将首先更新路由表中的高优先级前缀,然后更新中等优先级前缀,然后更新低优先级前缀。
OSPF 导入策略只能用于设置优先级或过滤 OSPF 外部路由。如果应用的 OSPF 导入策略导致对非外部路由执行 reject 终止作,则 reject 该作将被忽略,并且路由仍会被接受。默认情况下,此类路由现在安装在路由表中,优先级为低。此行为可确保 OSPF 域内的路由一致性,从而防止流量黑洞,即静默丢弃的流量。
通常,未明确分配优先级的 OSPF 路由被视为优先级介质,但以下情况除外:
汇总丢弃路由的默认优先级为低。
未添加到路由表的本地路由的优先级为低。
被导入策略拒绝并因此未添加到路由表的外部路由的优先级为低。
适用于 OSPF 路由的任何可用匹配标准都可用于确定优先级。OSPF 最常用的两个匹配标准是 route-filter 和 tag 语句。
在此示例中,路由设备位于区域 0.0.0.0 中,具有接口 fe-0/1/0 并 fe-1/1/0 连接到相邻设备。您可以配置名为 ospf-import 的导入路由策略,为通过 OSPF 获知的前缀指定优先级。与这些前缀关联的路由将按前缀指定优先级的顺序安装在路由表中。首先安装匹配 192.0.2.0/24 orlonger 的路由,因为它们的优先级为 high。接下来将安装路由匹配 198.51.100.0/24 orlonger ,因为它们的优先级为 medium。最后安装匹配的路由 203.0.113.0/24 orlonger ,因为它们的优先级为 low。然后,将导入策略应用于 OSPF。
当安装新路由或现有路由发生更改时,优先级值生效。
拓扑学
配置
CLI 快速配置
要快速配置 OSPF 导入策略,使其优先考虑通过 OSPF 获知的特定前缀,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改任何必要的详细信息以匹配您的网络配置,将命令复制并粘贴到 [编辑] 层次结构级别的 CLI 中,然后从配置模式进入 commit 。
[edit] set interfaces fe-0/1/0 unit 0 family inet address 192.168.8.4/30 set interfaces fe-0/1/0 unit 0 family inet address 192.168.8.5/30 set policy-options policy-statement ospf-import term t1 from route-filter 203.0.113.0/24 orlonger set policy-options policy-statement ospf-import term t1 then priority low set policy-options policy-statement ospf-import term t1 then accept set policy-options policy-statement ospf-import term t2 from route-filter 198.51.100.0/24 orlonger set policy-options policy-statement ospf-import term t2 then priority medium set policy-options policy-statement ospf-import term t2 then accept set policy-options policy-statement ospf-import term t3 from route-filter 192.0.2.0/24 orlonger set policy-options policy-statement ospf-import term t3 then priority high set policy-options policy-statement ospf-import term t3 then accept set protocols ospf import ospf-import set protocols ospf area 0.0.0.0 interface fe-0/1/0 set protocols ospf area 0.0.0.0 interface fe-1/1/0
程序
分步过程
下面的示例要求您在各个配置层级中进行导航。有关导航 CLI 的信息,请参阅CLI 用户指南中的修改 Junos OS 配置。
要配置优先考虑特定前缀的 OSPF 导入策略,请执行以下作:
配置接口。
[edit] user@host# set interfaces fe-0/1/0 unit 0 family inet address 192.168.8.4/30 user@host# set interfaces fe-0/2/0 unit 0 family inet address 192.168.8.5/30
在接口上启用 OSPF。
注意:对于 OSPFv3,请在
[edit protocols]层次结构级别包含ospf3语句。[edit] user@host# set protocols ospf area 0.0.0.0 interface fe-0/1/0 user@host# set protocols ospf area 0.0.0.0 interface fe-0/2/0
配置策略以指定通过 OSPF 获知的前缀的优先级。
[edit ] user@host# set policy-options policy-statement ospf-import term t1 from route-filter 203.0.113.0/24 orlonger user@host# set policy-options policy-statement ospf-import term t1 then priority low user@host# set policy-options policy-statement ospf-import term t1 then accept user@host# set policy-options policy-statement ospf-import term t2 from route-filter 198.51.100.0/24 orlonger user@host# set policy-options policy-statement ospf-import term t2 then priority medium user@host# set policy-options policy-statement ospf-import term t2 then accept user@host# set policy-options policy-statement ospf-import term t3 from route-filter 192.0.2.0/24 orlonger user@host# set policy-options policy-statement ospf-import term t3 then priority high user@host# set policy-options policy-statement ospf-import term t3 then accept
将策略应用于 OSPF。
[edit] user@host# set protocols ospf import ospf-import
如果完成设备配置,请提交配置。
[edit] user@host# commit
结果
输入show interfacesshow policy-optionsshow protocols ospf、和命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@host# show interfaces
fe-0/1/0 {
unit 0 {
family inet {
address 192.168.8.4/30;
}
}
}
fe-0/2/0 {
unit 0 {
family inet {
address 192.168.8.5/30;
}
}
}
user@host# show protocols ospf
import ospf-import;
area 0.0.0.0 {
interface fe-0/1/0.0;
interface fe-0/2/0.0;
}
user@host# show policy-options
policy-statement ospf-import {
term t1 {
from {
route-filter 203.0.113.0/24 orlonger;
}
then {
priority low;
accept;
}
}
term t2 {
from {
route-filter 198.51.100.0/24 orlonger;
}
then {
priority medium;
accept;
}
}
term t3 {
from {
route-filter 192.0.2.0/24 orlonger;
}
then {
priority high;
accept;
}
}
}
user@host# show protocols ospf
import ospf-import;
area 0.0.0.0 {
interface fe-0/1/0.0;
interface fe-0/2/0.0;
}
要确认您的 OSPFv3 配置,show policy-options请输入show interfaces、和show protocols ospf3命令。
网络摘要的导入和导出策略概述
默认情况下,OSPF 使用网络汇总链路状态通告 (LSA) 跨区域边界传输路由信息。每个区域边界路由器 (ABR) 将网络汇总 LSA 泛洪到同一区域内的其他路由设备。ABR 还控制从该区域出发的哪些路由用于生成进入其他区域的网络汇总 LSA。每个 ABR 都为它们所连接的每个区域维护一个单独的拓扑数据库。在 Junos OS 9.1 及更高版本中,您可以为 OSPFv2 和 OSPFv3 配置导出和导入策略,以便控制网络汇总 LSA(包含有关区域间 OSPF 前缀的信息)的分发和生成方式。对于 OSPFv3,LSA 称为区域间前缀 LSA,其执行的功能与网络汇总 LSA 对 OSPFv2 执行的功能相同。ABR 为必须播发到某个区域的每个 IPv6 前缀发出一个区域间前缀 LSA。
导出策略允许您指定将哪些汇总 LSA 泛洪到某个区域。通过导入策略,您可以控制从某个区域学习的哪些路由用于生成到其他区域的汇总 LSA。您可以在 [edit policy-options policy-statement policy-name] 层级定义路由策略。与所有 OSPF 导出策略一样,网络摘要 LSA 导出策略的默认值是拒绝所有内容。同样,与所有 OSPF 导入策略一样,网络摘要 LSA 导入策略的默认值是接受所有 OSPF 路由。
示例:配置网络摘要的 OSPF 导出策略
此示例说明如何创建 OSPF 导出策略,以控制 ABR 泛洪到 OSPF 区域的网络摘要(类型 3)LSA。
要求
开始之前:
为 OSPF 网络中的设备配置路由器标识符。请参阅 示例:配置 OSPF 路由器标识符。
控制 OSPF 指定的路由器选择。请参阅 示例:控制 OSPF 指定路由器选择
概述
OSPF 使用网络汇总 LSA 跨区域边界传输路由信息。根据您的网络环境,您可能希望进一步过滤 OSPF 区域之间的网络汇总 LSA。例如,如果创建 OSPF 区域来定义管理边界,则可能不希望在这些区域之间播发内部路由信息。为了进一步改善对多个 OSPF 区域之间的路由分布的控制,可以在 ABR 上为要过滤网络汇总 LSA 播发的区域配置网络汇总策略。
对于 OSPFv3,LSA 称为区域间前缀 LSA,其执行的功能与网络汇总 LSA 对 OSPFv2 执行的功能相同。ABR 为必须播发到某个区域的每个 IPv6 前缀发出一个区域间前缀 LSA。在本主题中,术语网络摘要策略和网络摘要策略用于描述 OSPFv2 和 OSPFv3 功能。
以下准则适用于导出网络摘要策略:
在配置这些策略之前,您应该彻底了解您的网络。不正确的网络汇总策略配置可能会导致意外结果,如路由欠佳或流量丢弃。
我们建议您为这些类型的策略使用 路由过滤器 策略匹配条件。
对于这些类型的策略,建议使用
accept和reject路由策略术语。
图 3 显示了包含三个 OSPF 区域的示例拓扑。R4 为区域 4 中的路由生成网络摘要,并将其从区域 4 发送到区域 0。R3 为区域 3 中的路由生成网络摘要,并将其从区域 3 发送到区域 0。
的示例拓扑
在此示例中,您使用名为 export-policy 的导出网络摘要策略为 R4,该策略仅允许与 10.0.4.4 前缀匹配的路由从区域 3 到区域 4。导出策略控制 R4 涌入区域 4 的网络汇总 LSA。这将导致只有允许的跨区域路由进入区域 4,而所有其他区域间路由都将从 OSPF 数据库和区域 4 中设备的路由表中清除。您首先定义策略,然后通过包含 network-summary-export OSPFv2 的语句或 inter-area-prefix-export OSPFv3 的语句将其应用于 ABR。
这些设备的作方式如下:
R1 — 设备 R1 是区域 3 中的内部路由器。接口
fe-0/1/0的 IP 地址为 10.0.4.13/30,并连接到 R3。接口fe-0/0/1的 IP 地址为 10.0.4.5/30,并连接到 R2。R2 — 设备 R2 是区域 3 中的内部路由器。接口
fe-0/0/1的 IP 地址为 10.0.4.6/30,并连接到 R1。接口fe-1/0/0的 IP 地址为 10.0.4.1,并连接到 R3。R3 - 设备 R3 参与区域 3 和区域 0。R3 是区域 3 和区域 0 之间的 ABR,在区域之间传递网络汇总 LSA。接口
fe-1/0/0的 IP 地址为 10.0.4.2/30,并连接到 R2。接口fe-1/1/0的 IP 地址为 10.0.4.14/30,并连接到 R1。接口fe-0/0/1的 IP 地址为 10.0.2.1/30,并连接到 R4。R4 - 设备 R4 参与区域 0 和区域 4。R4 是区域 0 和区域 4 之间的 ABR,在区域之间传递网络汇总 LSA。接口
fe-0/0/1的 IP 地址为 10.0.2.4/30,连接到 R3。接口fe-1/1/0的 IP 地址为 10.0.8.6/30,连接到 R5。接口fe-1/0/0的 IP 地址为 10.0.8.9/30,连接到 R6。R5 — 设备 R5 是区域 4 中的内部路由器。接口
fe-1/1/0的 IP 地址为 10.0.8.5/30,并连接到 R4。R6 — 设备 R6 是区域 4 中的内部路由器。接口
fe-1/0/0的 IP 地址为 10.0.8.10/30,并连接到 R4。
配置
CLI 快速配置
要为网络摘要快速配置 OSPF 导出策略,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改任何必要的详细信息以匹配您的网络配置,将命令复制并粘贴到 [edit] 层次结构级别的 CLI 中,然后从配置模式进入 commit 。
设备 R1 上的配置:
[edit] set interfaces fe-0/1/0 unit 0 family inet address 10.0.4.13/30 set interfaces fe-0/0/1 unit 0 family inet address 10.0.4.5/30 set protocols ospf area 0.0.0.3 interface fe-0/1/0 set protocols ospf area 0.0.0.3 interface fe-0/0/1
设备 R2 上的配置:
[edit] set interfaces fe-0/1/0 unit 0 family inet address 10.0.4.6/30 set interfaces fe-1/0/0 unit 0 family inet address 10.0.4.1/30 set protocols ospf area 0.0.0.3 interface fe-0/1/0 set protocols ospf area 0.0.0.3 interface fe-1/0/0
设备 R3 上的配置:
[edit] set interfaces fe-1/0/0 unit 0 family inet address 10.0.4.2/30 set interfaces fe-1/1/0 unit 0 family inet address 10.0.4.14/30 set interfaces fe-0/0/1 unit 0 family inet address 10.0.2.1/30 set protocols ospf area 0.0.0.3 interface fe-1/0/0 set protocols ospf area 0.0.0.3 interface fe-1/1/0 set protocols ospf area 0.0.0.0 interface fe-0/0/1
设备 R4 上的配置:
[edit] set interfaces fe-0/0/1 unit 0 family inet address 10.0.2.1/30 set interfaces fe-1/1/0 unit 0 family inet address 10.0.8.6/30 set interfaces fe-1/0/0 unit 0 family inet address 10.0.8.9/30 set policy-options policy-statement export-policy term term1 from route-filter 10.0.4.4/30 prefix-length-range /30-/30 set policy-options policy-statement export-policy term term1 then accept set protocols ospf area 0.0.0.0 interface fe-0/0/1 set protocols ospf area 0.0.0.4 interface fe-0/1/0 set protocols ospf area 0.0.0.4 interface fe-1/0/0 set protocols ospf area 0.0.0.4 network-summary-export export-policy
设备 R5 上的配置:
[edit] set interfaces fe-1/1/0 unit 0 family inet address 10.0.8.5/30 set protocols ospf area 0.0.0.4 interface fe-0/1/0
设备 R6 上的配置:
[edit] set interfaces fe-1/0/0 unit 0 family inet address 10.0.8.10/30 set protocols ospf area 0.0.0.4 interface fe-1/0/0
程序
分步过程
下面的示例要求您在各个配置层级中进行导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的修改 Junos OS 配置。
要为网络摘要配置 OSPF 导出策略,请执行以下作:
配置接口。
注意:对于 OSPFv3,请使用 IPv6 地址。
[edit] user@R1# set interfaces fe-0/1/0 unit 0 family inet address 10.0.4.13/30 user@R1# set interfaces fe-0/0/1 unit 0 family inet address 10.0.4.5/30
[edit] user@R2# set interfaces fe-0/1/0 unit 0 family inet address 10.0.4.6/30 user@R2# set interfaces fe-1/0/0 unit 0 family inet address 10.0.4.1/30
[edit] user@R3# set interfaces fe-1/0/0 unit 0 family inet address 10.0.4.2/30 user@R3# set interfaces fe-1/1/0 unit 0 family inet address 10.0.4.14/30 user@R3#set interfaces fe-0/0/1 unit 0 family inet address 10.0.2.1/30
[edit] user@R4# set interfaces fe-0/0/1 unit 0 family inet address 10.0.2.1/30 user@R4# set interfaces fe-1/1/0 unit 0 family inet address 10.0.8.6/30 user@R4# set interfaces fe-1/0/0 unit 0 family inet address 10.0.8.9/30
[edit] user@R5# set interfaces fe-1/1/0 unit 0 family inet address 10.0.8.5/30
[edit] user@R6# set interfaces fe-1/0/0 unit 0 family inet address 10.0.8.10/30
在接口上启用 OSPF。
注意:对于 OSPFv3,请在
[edit protocols]层次结构级别包含ospf3语句。[edit] user@R1# set protocols ospf area 0.0.0.3 interface fe-0/1/0 user@R1# set protocols ospf area 0.0.0.3 interface fe-0/0/1
[edit] user@R2# set protocols ospf area 0.0.0.3 interface fe-0/1/0 user@R2# set protocols ospf area 0.0.0.3 interface fe-1/0/0
[edit] user@R3# set protocols ospf area 0.0.0.3 interface fe-1/0/0 user@R3# set protocols ospf area 0.0.0.3 interface fe-1/1/0 user@R3# set protocols ospf area 0.0.0.0 interface fe-0/0/1
[edit] user@R4# set protocols ospf area 0.0.0.0 interface fe-0/0/1 user@R4# set protocols ospf area 0.0.0.4 interface fe-1/1/0 user@R4# set protocols ospf area 0.0.0.4 interface fe-1/0/0
[edit] user@R5# set protocols ospf area 0.0.0.4 interface fe-1/1/0
[edit] user@R6# set protocols ospf area 0.0.0.4 interface fe-1/0/0
在 R4 上,配置导出网络摘要策略。
[edit ] user@R4# set policy-options policy-statement export-policy term term1 from route-filter 10.0.4.4/30 prefix-length-range /30-/30 user@R4# set policy-options policy-statement export-policy term term1 then accept
在 R4 上,将导出网络摘要策略应用于 OSPF。
注意:对于 OSPFv3,请在
[edit protocols ospf3 area area-id]层次结构级别包含inter-area-prefix-export语句。[edit] user@R4# set protocols ospf area 0.0.0.4 network-summary-export export-policy
如果完成设备配置,请提交配置。
[edit] user@host# commit
结果
通过在相应设备上输入show interfacesshow policy-optionsshow protocols ospf、和命令来确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
R1 的输出:
user@R1# show interfaces
fe-0/0/1 {
unit 0 {
family inet {
address 10.0.4.5/30;
}
}
}
fe-1/1/0 {
unit 0 {
family inet {
address 10.0.4.13/30;
}
}
}
user@R1# show protocols ospf
area 0.0.0.3 {
interface fe-0/1/0.0;
interface fe-0/0/1.0;
}
R2 的输出:
user@R2# show interfaces
fe-0/1/0 {
unit 0 {
family inet {
address 10.0.4.6/30;
}
}
}
fe-1/0/0 {
unit 0 {
family inet {
address 10.0.4.3/30;
}
}
}
user@R2# show protocols ospf
area 0.0.0.3 {
interface fe-0/1/0.0;
interface fe-1/0/0.0;
}
R3 的输出:
user@R3# show interfaces
fe-0/0/1 {
unit 0 {
family inet {
address 10.0.2.3/30;
}
}
}
fe-1/0/0 {
unit 0 {
family inet {
address 10.0.4.2/30;
}
}
}
fe-1/1/0 {
unit 0 {
family inet {
address 10.0.4.14/30;
}
}
}
user@R3# show protocols ospf
area 0.0.0.0 {
interface fe-0/0/1.0;
}
area 0.0.0.3 {
interface fe-1/0/0.0;
interface fe-1/1/0.0;
}
R4 的输出:
user@R4# show interfaces
fe-0/0/1 {
unit 0 {
family inet {
address 10.0.2.4/30;
}
}
}
fe-1/0/0 {
unit 0 {
family inet {
address 10.0.8.6/30;
}
}
}
fe-1/1/0 {
unit 0 {
family inet {
address 10.0.8.3/30;
}
}
}
user@R4# show protocols ospf
area 0.0.0.0 {
interface fe-0/0/1.0;
}
area 0.0.0.4 {
network-summary-export export-policy;
interface fe-1/0/0.0;
interface fe-1/1/0.0;
}
user@R4# show policy-options
policy-statement export-policy {
term term1 {
from {
route-filter 10.0.4.4/30 prefix-length-range /30-/30;
}
then accept;
}
}
R5 的输出:
user@R5# show interfaces
fe-1/1/0 {
unit 0 {
family inet {
address 10.0.8.5/30;
}
}
}
user@R5# show protocols ospf
area 0.0.0.4 {
interface fe-1/1/0.0;
}
R6 的输出:
user@R6# show interfaces
fe-1/0/0 {
unit 0 {
family inet {
address 10.0.8.7/30;
}
}
}
user@R6# show protocols ospf
area 0.0.0.4 {
interface fe-1/0/0.0;
}
要确认您的 OSPFv3 配置,请在相应设备上输入show interfacesshow policy-options、 和show protocols ospf3命令。
验证
确认配置工作正常。
验证 OSPF 数据库
目的
验证区域 4 中设备的 OSPF 数据库是否包含我们在 ABR R4 上允许的区域间路由。其他未指定的区域间路由应过期或不再存在于 OSPF 数据库中。
行动
在作模式下, show ospf database netsummary area 0.0.0.4 输入适用于 OSPFv2 的命令,然后 show ospf3 database inter-area-prefix area 0.0.0.4 输入适用于 OSPFv3 的命令。
示例:配置网络摘要的 OSPF 导入策略
此示例说明如何创建 OSPF 导入策略,以控制 ABR 从 OSPF 区域播发的网络摘要(类型 3)LSA。
要求
开始之前:
为 OSPF 网络中的设备配置路由器标识符。请参阅 示例:配置 OSPF 路由器标识符。
控制 OSPF 指定的路由器选择。请参阅 示例:控制 OSPF 指定路由器选择。
概述
OSPF 使用网络汇总 LSA 跨区域边界传输路由信息。根据您的网络环境,您可能希望进一步过滤 OSPF 区域之间的网络汇总 LSA。例如,如果创建 OSPF 区域来定义管理边界,则可能不希望在这些区域之间播发内部路由信息。为了进一步改善对多个 OSPF 区域之间的路由分布的控制,可以在 ABR 上为要过滤网络汇总 LSA 播发的区域配置网络汇总策略。
对于 OSPFv3,LSA 称为区域间前缀 LSA,其执行的功能与网络汇总 LSA 对 OSPFv2 执行的功能相同。ABR 为必须播发到某个区域的每个 IPv6 前缀发出一个区域间前缀 LSA。在本主题中,术语网络摘要策略和网络摘要策略用于描述 OSPFv2 和 OSPFv3 功能。
以下准则适用于导入网络摘要策略:
在配置这些策略之前,您应该彻底了解您的网络。不正确的网络汇总策略配置可能会导致意外结果,如路由欠佳或流量丢弃。
我们建议您为这些类型的策略使用
route-filter策略匹配条件。对于这些类型的策略,建议使用
accept和reject路由策略术语。
图 4 显示了包含三个 OSPF 区域的示例拓扑。R4 为区域 4 中的路由生成网络摘要,并将其从区域 4 发送到区域 0。R3 为区域 3 中的路由生成网络摘要,并将其从区域 3 发送到区域 0。
的示例拓扑
在此示例中,您为R3配置名为import-policy的导入网络摘要策略,以便R3仅生成路由10.0.4.12/30的网络摘要。导入策略控制路由,从而控制 R3 在区域 3 之外播发的路由和网络摘要,因此应用此策略意味着 R3 仅播发区域 3 之外的路由 10.0.4.12/30。这会导致从区域 0 和区域 4 的 OSPF 数据库以及区域 0 和区域 4 中的设备路由表中清除来自其他区域间路由的现有网络摘要。您首先定义策略,然后通过包含 network-summary-import OSPFv2 的语句或 inter-area-prefix-import OSPFv3 的语句将其应用于 ABR。
这些设备的作方式如下:
R1 — 设备 R1 是区域 3 中的内部路由器。接口
ge-0/1/0的 IP 地址为 10.0.4.13/30,并连接到 R3。接口ge-0/0/1的 IP 地址为 10.0.4.5/30,并连接到 R2。R2 — 设备 R2 是区域 3 中的内部路由器。接口
ge-0/0/1的 IP 地址为 10.0.4.6/30,并连接到 R1。接口ge-1/0/0的 IP 地址为 10.0.4.1/30,并连接到 R3。R3 - 设备 R3 参与区域 3 和区域 0。R3 是区域 3 和区域 0 之间的 ABR,在区域之间传递网络汇总 LSA。接口
ge-1/0/0的 IP 地址为 10.0.4.2/30,并连接到 R2。接口ge-1/1/0的 IP 地址为 10.0.4.14/30,并连接到 R1。接口ge-0/0/1的 IP 地址为 10.0.2.1/30,并连接到 R4。R4 - 设备 R4 参与区域 0 和区域 4。R4 是区域 0 和区域 4 之间的 ABR,在区域之间传递网络汇总 LSA。接口
ge-0/0/1的 IP 地址为 10.0.2.1/30,并连接到 R3。接口ge-1/1/0的 IP 地址为 10.0.8.6/30,连接到 R5。接口ge-1/0/0的 IP 地址为 10.0.8.9/30,连接到 R6。R5 — 设备 R5 是区域 4 中的内部路由器。接口
ge-1/1/0的 IP 地址为 10.0.8.5/30,并连接到 R4。R6 — 设备 R6 是区域 4 中的内部路由器。接口
ge-1/0/0的 IP 地址为 10.0.8.10/30,并连接到 R4。
配置
程序
CLI 快速配置
要为网络摘要快速配置 OSPF 导入策略,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改任何必要的详细信息以匹配您的网络配置,将命令复制并粘贴到 [edit] 层次结构级别的 CLI 中,然后从配置模式进入 commit 。
设备 R1 上的配置:
[edit] set interfaces ge-0/1/0 unit 0 family inet address 10.0.4.13/30 set interfaces ge-0/0/1 unit 0 family inet address 10.0.4.5/30 set protocols ospf area 0.0.0.3 interface ge-0/1/0 set protocols ospf area 0.0.0.3 interface ge-0/0/1
设备 R2 上的配置:
[edit] set interfaces ge-0/1/0 unit 0 family inet address 10.0.4.6/30 set interfaces ge-1/0/0 unit 0 family inet address 10.0.4.1/30 set protocols ospf area 0.0.0.3 interface ge-0/1/0 set protocols ospf area 0.0.0.3 interface ge-1/0/0
设备 R3 上的配置:
[edit] set interfaces ge-1/0/0 unit 0 family inet address 10.0.4.2/30 set interfaces ge-1/1/0 unit 0 family inet address 10.0.4.14/30 set interfaces ge-0/0/1 unit 0 family inet address 10.0.2.1/30 set policy-options policy-statement import-policy term term1 from route-filter 10.0.4.12/30 prefix-length-range /30-/30 set policy-options policy-statement import-policy term term1 then accept set policy-options policy-statement import-policy term term2 then reject set protocols ospf area 0.0.0.3 interface ge-1/0/0 set protocols ospf area 0.0.0.3 interface ge-1/1/0 set protocols ospf area 0.0.0.0 interface ge-0/0/1 set protocols ospf area 0.0.0.3 network-summary-import import-policy
设备 R4 上的配置:
[edit] set interfaces ge-0/0/1 unit 0 family inet address 10.0.2.1/30 set interfaces ge-1/1/0 unit 0 family inet address 10.0.8.6/30 set interfaces ge-1/0/0 unit 0 family inet address 10.0.8.9/30 set protocols ospf area 0.0.0.0 interface ge-0/0/1 set protocols ospf area 0.0.0.4 interface ge-1/1/0 set protocols ospf area 0.0.0.4 interface ge-1/0/0
设备 R5 上的配置:
[edit] set interfaces ge-1/1/0 unit 0 family inet address 10.0.8.5/30 set protocols ospf area 0.0.0.4 interface ge-1/1/0
设备 R6 上的配置:
[edit] set interfaces ge-1/0/0 unit 0 family inet address 10.0.8.10/30 set protocols ospf area 0.0.0.4 interface ge-1/0/0
分步过程
下面的示例要求您在各个配置层级中进行导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的修改 Junos OS 配置。
要为网络摘要配置 OSPF 导入策略,请执行以下作:
配置接口。
注意:对于 OSPFv3,请使用 IPv6 地址。
[edit] user@R1# set interfaces ge-0/1/0 unit 0 family inet address 10.0.4.13/30 user@R1# set interfaces ge-0/0/1 unit 0 family inet address 10.0.4.5/30
[edit] user@R2# set interfaces ge-0/1/0 unit 0 family inet address 10.0.4.6/30 user@R2# set interfaces ge-1/0/0 unit 0 family inet address 10.0.4.1/30
[edit] user@R3# set interfaces ge-1/0/0 unit 0 family inet address 10.0.4.2/30 user@R3# set interfaces ge-1/1/0 unit 0 family inet address 10.0.4.14/30 user@R3#set interfaces ge-0/0/1 unit 0 family inet address 10.0.2.1/30
[edit] user@R4# set interfaces ge-0/0/1 unit 0 family inet address 10.0.2.1/30 user@R4# set interfaces ge-1/1/0 unit 0 family inet address 10.0.8.6/30 user@R4# set interfaces ge-1/0/0 unit 0 family inet address 10.0.8.9/30
[edit] user@R5# set interfaces ge-1/1/0 unit 0 family inet address 10.0.8.5/30
[edit] user@R6# set interfaces ge-1/0/0 unit 0 family inet address 10.0.8.10/30
在接口上启用 OSPF。
注意:对于 OSPFv3,请在
[edit protocols]层次结构级别包含ospf3语句。[edit] user@R1# set protocols ospf area 0.0.0.3 interface ge-0/1/0 user@R1# set protocols ospf area 0.0.0.3 interface ge-0/0/1
[edit] user@R2# set protocols ospf area 0.0.0.3 interface ge-0/1/0 user@R2# set protocols ospf area 0.0.0.3 interface ge-1/0/0
[edit] user@R3# set protocols ospf area 0.0.0.3 interface ge-1/0/0 user@R3# set protocols ospf area 0.0.0.3 interface ge-1/1/0 user@R3# set protocols ospf area 0.0.0.0 interface ge-0/0/1
[edit] user@R4# set protocols ospf area 0.0.0.0 interface ge-0/0/1 user@R4# set protocols ospf area 0.0.0.4 interface ge-1/1/0 user@R4# set protocols ospf area 0.0.0.4 interface ge-1/0/0
[edit] user@R5# set protocols ospf area 0.0.0.4 interface ge-1/1/0
[edit] user@R6# set protocols ospf area 0.0.0.4 interface ge-1/0/0
在 R3 上,配置导入网络摘要策略。
[edit ] user@R3# set policy-options policy-statement import-policy term term1 from route-filter 10.0.4.12/30 prefix-length-range /30-/30 user@R3# set policy-options policy-statement import-policy term term1 then accept
在 R3 上,将导入网络摘要策略应用于 OSPF。
注意:对于 OSPFv3,请在
[edit protocols ospf3 area area-id]层次结构级别包含inter-area-prefix-export语句。[edit] user@R3# set protocols ospf area 0.0.0.3 network-summary-import import-policy
如果完成设备配置,请提交配置。
[edit] user@host# commit
结果
通过在相应设备上输入show interfacesshow policy-optionsshow protocols ospf、和命令来确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
R1 的输出:
user@R1# show interfacesge-0/0/1 {
unit 0 {
family inet {
address 10.0.4.5/30;
}
}
}
ge-0/1/0 {
unit 0 {
family inet {
address 10.0.4.13/30;
}
}
}
user@R1# show protocols ospf
area 0.0.0.3 {
interface ge-0/1/0.0;
interface ge-0/0/1.0;
}
R2 的输出:
user@R2# show interfaces
ge-0/1/0 {
unit 0 {
family inet {
address 10.0.4.6/30;
}
}
}
ge-1/0/0 {
unit 0 {
family inet {
address 10.0.4.1/30;
}
}
}
user@R2# show protocols ospf
area 0.0.0.3 {
interface ge-0/1/0.0;
interface ge-1/0/0.0;
}
R3 的输出:
user@R3# show interfaces
ge-0/0/1 {
unit 0 {
family inet {
address 10.0.2.1/30;
}
}
}
ge-1/0/0 {
unit 0 {
family inet {
address 10.0.4.2/30;
}
}
}
ge-1/1/0 {
unit 0 {
family inet {
address 10.0.4.14/30;
}
}
}
user@R3# show protocols ospf
area 0.0.0.0 {
interface ge-0/0/1.0;
}
area 0.0.0.3 {
network-summary-import import policy;
interface ge-1/0/0.0;
interface ge-1/1/0.0;
}
user@R3# show policy-options
policy-statement import-policy {
term term1 {
from {
route-filter 10.0.4.12/30 prefix-length-range /30-/30;
}
then accept;
}
term term2 {
then reject;
}
}
R4 的输出:
user@R4# show interfaces
ge-0/0/1 {
unit 0 {
family inet {
address 10.0.2.1/30;
}
}
}
ge-1/0/0 {
unit 0 {
family inet {
address 10.0.8.9/30;
}
}
}
ge-1/1/0 {
unit 0 {
family inet {
address 10.0.8.6/30;
}
}
}
user@R4# show protocols ospf
area 0.0.0.0 {
interface ge-0/0/1.0;
}
area 0.0.0.4 {
interface ge-0/1/0.0;
interface ge-1/0/0.0;
}
R5 的输出:
user@R5# show interfaces
ge-1/1/0 {
unit 0 {
family inet {
address 10.0.8.5/30;
}
}
}
user@R5# show protocols ospf
area 0.0.0.4 {
interface ge-1/1/0.0;
}
R6 的输出:
user@R6# show interfaces
ge-1/0/0 {
unit 0 {
family inet {
address 10.0.8.10/30;
}
}
}
user@R6# show protocols ospf
area 0.0.0.4 {
interface ge-1/0/0.0;
}
要确认您的 OSPFv3 配置,请在相应设备上输入show interfacesshow policy-options、 和show protocols ospf3命令。
验证
确认配置工作正常。
验证 OSPF 数据库
目的
验证区域 4 中设备的 OSPF 数据库是否包含我们从 R3 播发的区域间路由。来自区域 3 的任何其他路由都不应播发到区域 4,因此这些条目应过时或不再存在于 OSPF 数据库中。
行动
在作模式下, show ospf database netsummary area 0.0.0.4 输入适用于 OSPFv2 的命令,然后 show ospf3 database inter-area-prefix area 0.0.0.4 输入适用于 OSPFv3 的命令。
示例:将 OSPF 路由重新分发到 IS-IS 中
此示例说明如何将 OSPF 路由重新分配到 IS-IS 网络中。
要求
配置此示例之前,不需要除设备初始化之外的特殊配置。
概述
导出策略可应用于 IS-IS,以便于路由重新分配。
Junos OS 不支持对 IS-IS 等链路状态路由协议应用导入策略,因为此类策略会导致链路状态数据库 (LSDB) 条目不一致,进而导致路由不稳定。
在此示例中,OSPF 路由 192.168.0/24 到 192.168.3/24 从设备 R2 重新分配给 IS-IS 区域 49.0002。
此外,还配置了策略以确保设备 R1 可以到达 10.0.0.44/30 网络上的目标,并且设备 R3 可以到达 10.0.0.36/30 网络上的目标。这实现了端到端的可达性。
图 5 显示了此示例中使用的拓扑。
CLI 快速配置 显示了 图 5 中所有设备的配置。 #d177e65__d177e235 部分介绍了设备 R2 上的步骤。 #d177e65__d177e364 描述了设备 R3 上的步骤。
拓扑学
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层 [edit] 级的 CLI 中。
设备 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
设备 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
设备 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
分步过程
要配置设备 R2,请执行以下作:
配置网络接口。
[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
在面向设备 R1 和环路接口的接口上配置 IS-IS。
[edit protocols isis] user@R2# set interface fe-1/2/1.0 user@R2# set interface lo0.0
配置使设备 R1 能够访问 10.0.0.44/30 网络的策略。
[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
应用使设备 R1 能够访问 10.0.0.44/30 网络的策略。
[edit protocols isis] user@R2# set export send-direct-to-isis-neighbors
在接口上配置 OSPF。
[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
配置 OSPF 路由重新分发策略。
[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
将 OSPF 路由重新分发策略应用于 IS-IS 实例。
[edit protocols isis] user@R2# set export ospf-isis
配置使设备 R3 能够访问 10.0.0.36/30 网络的策略。
[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
应用使设备 R3 能够访问 10.0.0.36/30 网络的策略。
[edit protocols ospf] user@R2# set export send-direct-to-ospf-neighbors
分步过程
下面的示例要求您在各个配置层级中进行导航。有关 CLI 导航的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置多级 IS-IS:
配置网络接口。
环路接口上配置了多个地址,以模拟多个路由目标。
[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
配置到环路接口地址的静态路由。
这些是重新分配给 IS-IS 的路由。
[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
在接口上配置 OSPF。
[edit protocols ospf area 0.0.0.1] user@R3# set interface fe-1/2/0.0 user@R3# set interface lo0.0 passive
配置 OSPF 策略以导出静态路由。
[edit policy-options policy-statement ospf term 1] user@R3# set from protocol static user@R3# set then accept
应用 OSPF 导出策略。
[edit protocols ospf] user@R3# set export ospf
结果
在配置模式下,输入show interfaces、show protocolsshow policy-options、和show routing-options命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
设备 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;
}
设备 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;
}
如果完成设备配置,请从配置模式输入 commit 。
验证
确认配置工作正常。
验证 OSPF 路由通告
目的
确保预期路由由 OSPF 播发。
行动
在设备 R2 上的作模式下,输入 show route protocol ospf 命令。
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)
意义
192.168/16路由由OSPF公布。
验证路由重新分配
目的
确保将预期的路由从 OSPF 重新分发到 IS-IS 中。
行动
在设备 R1 上的作模式下,输入 show route protocol isis 命令。
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)
意义
192.168/16 路由重新分配给 IS-IS。
验证连接性
目的
检查设备 R1 是否可以到达设备 R3 上的目标。
行动
在作模式下,输入 ping 命令。
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
意义
这些结果确认设备 R1 可以到达 OSPF 网络中的目标。
变更历史表
是否支持某项功能取决于您使用的平台和版本。使用 功能浏览器 查看您使用的平台是否支持某项功能。
