本页内容
配置 OSPF 区域
了解 OSPF 区域
在 OSPF 中,单个自治系统 (AS) 可以划分为更小的组,称为 区域。这减少了网络上发送的链路状态通告 (LSA) 和其他 OSPF 开销流量的数量,并减小了每个路由器必须维护的拓扑数据库的大小。参与 OSPF 路由的路由设备会根据其在网络中的位置执行一项或多项功能。
本主题介绍以下 OSPF 区域类型和路由设备功能:
地区
一个 区域 是 AS 内的一组网络和主机,这些网络和主机经过管理分组在一起。建议将一个区域配置为连续 IP 子网网络的集合。完全位于一个区域内的路由设备称为 内部路由器。内部路由器上的所有接口均直接连接到区域内的网络。
一个区域的拓扑对 AS 的其余部分是隐藏的,因此显著减少了 AS 中的路由流量。此外,区域内的路由仅由区域的拓扑决定,从而为区域提供一些保护,以抵御不良路由数据。
一个区域内的所有路由设备都有相同的拓扑数据库。
区域边界路由器
属于多个区域的路由设备,并将一个或多个 OSPF 区域连接到主干区域,则称为 区域边界路由器 (ABR)。至少有一个接口位于主干内部,而另一个接口位于另一个区域。ABER 还为其连接的每个区域维护单独的拓扑数据库。
骨干区域
OSPF 主干区域 由区域 ID 0.0.0.0.0 中的所有网络、其连接的路由设备以及所有 ABER 组成。主干网本身没有任何 ABR。主干网在区域之间分配路由信息。主干网只是另一个领域,因此区域术语和规则适用:直接连接到主干网络的路由设备是主干网络上的一个内部路由器,主干网络拓扑对 AS 中的其他区域隐藏。
组成主干网的路由设备必须物理连续。如果不是,则必须配置 虚拟链路 以创建主干连接的外观。您可以在任意两个 ABER 之间创建虚拟链路,这些 ABER 与公共非骨干区域有一个接口。OSPF 将两个通过虚拟链路连接的路由设备视为连接到未编号的点对点网络。
AS 边界路由器
与非 OSPF 网络中路由设备交换路由信息的路由设备称为 AS 边界路由器。它们在整个 OSPF AS 中播发外部学习的路由。根据 AS 边界路由器在网络中的位置,它可以是 ABR、主干路由器或内部路由器(剩余区域除外)。剩余区域的内部路由器不能是 AS 边界路由器,因为剩余区域不能包含任何 5 类 LSA。
AS 边界路由器所在区域内的路由设备知道该 AS 边界路由器的路径。区域之外的任何路由设备仅知道与 AS 边界路由器所在区域的最近 ABR 的路径。
中枢路由器
主干路由器 是具有一个或多个接口连接到 OSPF 主干区域(区域 ID 0.0.0.0)的路由设备。
内部路由器
仅连接到一个 OSPF 区域的路由设备称为 内部路由器。内部路由器上的所有接口均直接连接到单个区域内的网络。
剩余区域
剩余区域 是 AS 外部播发未泛洪的区域。当大部分拓扑数据库由 AS 外部播发组成时,您可能希望创建剩余区域。这样做可以减小拓扑数据库的大小,从而减少剩余区域内部路由器上所需的内存量。
剩余区域内的路由设备依靠区域 ABR 发起的默认路由才能到达外部 AS 目标。必须先在 default-metric
ABR 上配置选项,然后才能播发默认路由。配置后,ABR 会播发一个默认路由,以取代剩余区域内未播发的外部路由,以便剩余区域中的路由设备可以到达区域以外的目标。
以下限制适用于剩余区域:您不能通过剩余区域创建虚拟链路,剩余区域不能包含 AS 边界路由器,主干区域不能是剩余区域,也不能将区域同时配置为剩余区域和非剩余区域。
不太那么 Stubby 区域
OSPF 剩余区域没有外部路由,因此无法从另一个协议重新分配到剩余区域。 非剩余区域 (NSSA) 允许在该区域内淹没外部路由。然后,这些路由被泄漏到其他地区。但是,来自其他地区的外部路由仍然不会进入 NSSA。
以下限制适用于 NSSA:您不能将区域同时配置为剩余区域和 NSSA。
中转区域
传输区域 用于将流量从一个相邻区域传递到主干网(或者,如果主干距离一个区域超过两个跃点),则将流量传递到另一个区域。流量既不发源地也不发往中转区域。
OSPF 区域类型和接受的 LSA
下表提供了有关 OSPF 区域类型和接受的 LSA 的详细信息:
OSPF 指定路由器概述
由于链路状态通告 (LSA) 在网络中泛洪,因此具有许多 OSPF 邻接的大型 LAN 可能会产生大量控制数据包流量。为了缓解潜在的流量问题,OSPF 在所有多接入网络(广播和非广播多路访问 [NBMA] 网络类型)上使用指定路由器。路由设备不将其 LSA 发送至指定的路由器,而不是将其 LSA 广播给所有 OSPF 邻接方。每个多接入网络都有一个指定的路由器,可执行两个主要功能:
代表网络发起网络链路通告。
与网络上的所有路由设备建立邻接,从而参与链路状态数据库同步。
在 LAN 中,当 OSPF 网络首次建立时,将选择指定路由器。当第一个 OSPF 链路处于活动状态时,具有最高路由器标识符(由 路由器 ID 配置值(通常是路由设备的 IP 地址或环路地址)的路由设备将选为指定路由器。具有第二高路由器标识符的路由设备将选择备份指定路由器。如果指定路由器出现故障或断开连接,则备份指定路由器将承担其角色,并在 OSPF 网络中的所有路由器之间进行新的备份指定路由器选择。
OSPF 将路由器标识符用于两个主要目的:选择指定的路由器(除非您手动指定优先级值),以及识别数据包始发源的路由设备。在指定路由器选择时,首先评估路由器优先级,优先级最高的路由设备为选定指定路由器。如果路由器的优先级相同,则具有最高路由器标识符的路由设备(通常是路由设备的 IP 地址)被选为指定路由器。如果未配置路由器标识符,将使用要联机的第一个接口的 IP 地址。这通常是环路接口。否则,将使用第一个带有 IP 地址的硬件接口。
每个逻辑 IP 网络或子网上的至少一台路由设备必须有资格成为 OSPFv2 的指定路由器。每个逻辑链路上的至少一台路由设备必须有资格成为 OSPFv3 的指定路由器。
默认情况下,路由设备的优先级为 128。优先级为 0 表示路由设备不符合成为指定路由器的资格。优先级 1 表示路由设备成为指定路由器的机会最小。优先级为 255 表示路由设备始终是指定的路由器。
示例:配置 OSPF 路由器标识符
此示例说明如何配置 OSPF 路由器标识符。
要求
开始之前:
识别将参与 OSPF 的路由设备上的接口。您必须在传输 OSPF 流量的网络中的所有接口上启用 OSPF。
配置设备接口。请参阅 安全设备接口用户指南
概述
OSPF 使用路由器标识符来标识数据包始发的路由设备。Junos OS 会根据以下规则选择路由器标识符:
默认情况下,Junos OS 选择接口配置的最低物理 IP 地址作为路由器标识符。
如果配置了环路接口,则环路接口的 IP 地址将成为路由器标识符。
如果配置了多个环路接口,则最低环路地址将成为路由器标识符。
如果使用层级下的
[edit routing-options]
语句显式配置router-id address
路由器标识符,则上面的三条规则将被忽略。
1. 此处介绍的路由器标识符行为即使在层级和[edit logical-systems logical-system-name routing-instances routing-instance-name routing-options]
层级下[edit routing-instances routing-instance-name routing-options]
配置时也能保持良好。
2. 如果在网络中修改路由器标识符,则先前路由器标识符播发的链路状态播发 (LSA) 将保留在 OSPF 数据库中,直到 LSA 重新传输间隔超时。因此,强烈建议在层级下 [edit routing-options]
显式配置路由器标识符,以避免环路接口上的接口地址发生变化时出现不可预测的行为。
在此示例中,通过将 OSPF 路由器标识符的路由器 ID 值设置为设备的 IP 地址(即 192.0.2.24),来配置 OSPF 路由器标识符。
配置
CLI 快速配置
要快速配置 OSPF 路由器标识符,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到 [edit] 层次结构级别的 CLI 中,然后从配置模式进入 commit
。
[edit] set routing-options router-id 192.0.2.24
程序
逐步过程
要配置 OSPF 路由器标识符:
输入配置值,配置
[router-id]
OSPF 路由器标识符。[edit] user@host# set routing-options router-id 192.0.2.24
完成设备配置后,提交配置。
[edit] user@host# commit
结果
输入命令以确认 show routing-options router-id
您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@host# show routing-options router-id router-id 192.0.2.24;
验证
配置路由器 ID 并在路由设备上激活 OSPF 后,多个 OSPF 操作模式命令会引用路由器 ID,您可以使用这些命令来监控 OSPF 协议并对其进行故障排除。路由器 ID 字段在输出中明确标记。
示例:控制 OSPF 指定路由器选择
此示例说明如何控制 OSPF 指定的路由器选择。
要求
开始之前:
配置设备接口。请参阅 安全设备的接口用户指南。
配置 OSPF 网络中设备的路由器标识符。请参阅 示例:配置 OSPF 路由器标识符。
概述
此示例说明如何控制 OSPF 指定的路由器选择。在此示例中,您将 OSPF 接口设置为 ge-/0/0/1 ,并将设备优先级设置为 200。优先级值越高,路由设备成为指定路由器的可能性就越高。
默认情况下,路由设备的优先级为 128。优先级为 0 表示路由设备不符合成为指定路由器的资格。优先级 1 表示路由设备成为指定路由器的机会最小。
配置
CLI 快速配置
要快速配置 OSPF 指定路由器选择,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到 [edit] 层次结构级别的 CLI 中,然后从配置模式进入 commit
。
[edit] set protocols ospf area 0.0.0.3 interface ge-0/0/1 priority 200
程序
逐步过程
要控制 OSPF 指定的路由器选择:
配置 OSPF 接口并指定设备优先级。
注意:要指定 OSPFv3 接口,请在
ospf3
层次结构级别包含语句[edit protocols]
。[edit] user@host# set protocols ospf area 0.0.0.3 interface ge-0/0/1 priority 200
完成设备配置后,提交配置。
[edit] user@host# commit
结果
输入命令以确认 show protocols ospf
您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@host# show protocols ospf area 0.0.0.3 { interface ge-0/0/1.0 { priority 200; } }
要确认 OSPFv3 配置,请输入 show protocols ospf3
命令。
了解 OSPF 区域和主干区域
自治系统 (AS) 中的 OSPF 网络在行政上分为多个区域。AS 中的每个区域都像独立网络一样运行,并具有唯一的 32 位区域 ID,其功能类似于网络地址。在一个区域内,拓扑数据库仅包含有关区域的信息,链路状态通告 (LSA) 只会泛洪到区域内的节点,并且仅在区域内计算路由。一个区域的拓扑对 AS 的其余部分是隐藏的,因此显著减少了 AS 中的路由流量。子网被划分为其他区域,这些区域连接起来构成整个主网络。完全位于一个区域内的路由设备称为内部路由器。内部路由器上的所有接口均直接连接到区域内的网络。
AS 的中心区域称为主干区域,具有特殊功能,始终分配区域 ID 0.0.0.0。(在简单的单区域网络中,这也是区域的 ID。)区域 ID 是唯一数字标识符,采用十进制点符号,但它们不是 IP 地址。区域标识在 AS 中只需要唯一。AS 中的所有其他网络或区域都必须通过在多个区域中具有接口的路由设备直接连接到主干区域。这些连接路由设备称为边界区域路由器 (ABR)。 图 1 显示了由两个 ABR 连接的三个区域的 OSPF 拓扑。
由于所有区域都与主干区域相邻,因此 OSPF 路由器会通过主干区域发送所有不发往各自区域的流量。然后,主干区域中的 ABR 负责将流量通过适当的 ABR 传输到目标区域。ABR 汇总了每个区域的链路状态记录,并将目标地址汇总通告给邻近区域。播发包含每个目标所在的区域的 ID,以便将数据包路由到相应的 ABR。例如,在 图 1 所示的 OSPF 区域,从路由器 A 发送到路由器 C 的数据包将通过 ABR B 自动路由。
Junos OS 支持主动主干检测。实施主动主干网检测以验证 ABER 是否已连接到主干网。如果与中枢区域的连接丢失,则不会播发路由设备的默认指标,从而通过与骨干网建立有效连接的另一个 ABR 有效地重新路由流量。主动主干检测支持通过没有活动主干连接的 ABR 进行传输。ABR 会向其他路由设备播发,即使与主干网的连接中断,也将其作为 ABR,以便邻接方可以将它用于区域间路由。
OSPF 限制要求所有区域直接连接到主干区域,以便正确路由数据包。默认情况下,所有数据包都会首先路由到主干区域。然后,发往主干区域以外的区域的数据包被路由到相应的 ABR,然后路由到目标区域内的远程主机。
在具有多个区域的大型网络中,所有区域和骨干区域之间的直接连接在物理上困难或不可能,您可以配置虚拟链路来连接不连续区域。虚拟链路使用包含两个或多个 ABER 的传输区域,将网络流量从一个相邻区域传递到另一个区域。例如, 图 2 显示了通过连接到两个区域的区域在非连续区域与主干区域之间的虚拟链路。
在 图 2 所示的拓扑中,在区域 0.0.0.3 和通过 0.0.0.2 的主干区域之间建立虚拟链路。所有发往其他地区的出站流量都会通过区域 0.0.0.2 路由到主干区域,然后路由到相应的 ABR。发往区域 0.0.0.3 的所有入站流量都会路由到主干区域,然后通过区域 0.0.0.2 路由。
示例:配置单区域 OSPF 网络
此示例说明如何配置单区域 OSPF 网络。
要求
开始之前:
配置设备接口。请参阅 安全设备的接口用户指南。
配置 OSPF 网络中设备的路由器标识符。请参阅 示例:配置 OSPF 路由器标识符。
概述
要激活网络上的 OSPF,必须在传输 OSPF 流量的网络中的所有接口上启用 OSPF 协议。要启用 OSPF,必须在 OSPF 区域内的设备上配置一个或多个接口。配置接口后,OSPF LSA 将传输到所有支持 OSPF 的接口上,并且整个网络共享网络拓扑。
在自治系统 (AS) 中,骨干区域始终分配区域 ID 0.0.0.0(在简单的单区域网络中,这也是区域的 ID)。区域 ID 是唯一数字标识符,采用十进制点符号。区域标识在 AS 中只需要唯一。AS 中的所有其他网络或区域必须通过区域边界路由器在多个区域拥有接口直接连接到骨干区域。如果您的网络包含多个区域,还必须创建一个主干区域。在此示例中,您将创建主干区域,并根据需要向 OSPF 区域添加 ge-0/0/0/0 等接口。
要在设备上使用 OSPF,必须至少配置一个 OSPF 区域,如图 3 所示。
拓扑
配置
CLI 快速配置
要快速配置单区域 OSPF 网络,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到 [edit] 层次结构级别的 CLI 中,然后从配置模式进入 commit
。
[edit] set protocols ospf area 0.0.0.0 interface ge-0/0/0
程序
逐步过程
要配置单区域 OSPF 网络:
通过指定区域 ID 和关联接口来配置单区域 OSPF 网络。
注意:对于单区域 OSPFv3 网络,请将语句
ospf3
[edit protocols]
包含在层次结构级别。[edit] user@host# set protocols ospf area 0.0.0.0 interface ge-0/0/0
完成设备配置后,提交配置。
[edit] user@host# commit
结果
输入命令以确认 show protocols ospf
您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@host# show protocols ospf area 0.0.0.0 { interface ge-0/0/0.0; }
要确认 OSPFv3 配置,请输入 show protocols ospf3
命令。
示例:配置多区域 OSPF 网络
此示例说明如何配置多区域 OSPF 网络。要减少 OSPF 自治系统 (AS) 中设备的流量和拓扑维护,可以将支持 OSPF 的路由设备分组为多个区域。
要求
开始之前:
配置设备接口。请参阅 安全设备的接口用户指南。
配置 OSPF 网络中设备的路由器标识符。请参阅 示例:配置 OSPF 路由器标识符。
控制 OSPF 指定的路由器选择。请参阅 示例:控制 OSPF 指定路由器选择
配置单区域 OSPF 网络。请参阅 示例:配置单区域 OSPF 网络。
概述
要激活网络上的 OSPF,必须在传输 OSPF 流量的网络中的所有接口上启用 OSPF 协议。要启用 OSPF,必须在 OSPF 区域内的设备上配置一个或多个接口。配置接口后,OSPF LSA 将传输到所有支持 OSPF 的接口上,并且整个网络共享网络拓扑。
每个 OSPF 区域都包含配置相同区域编号的路由设备。在 图 4 中,路由器 B 位于 AS 的主干区域。中枢区域始终分配区域 ID 0.0.0.0。(AS 中所有区域标识都必须是唯一的。)AS 中的所有其他网络或区域都必须通过位于多个区域中具有接口的路由器直接连接到主干区域。在此示例中,这些区域边界路由器分别是 A、C、D 和 E。创建一个附加区域(区域 2)并为其分配唯一区域 ID 0.0.0.2,然后将接口 ge-0/0/0 添加到 OSPF 区域。
为了减少 OSPF AS 中设备的流量和拓扑维护,您可以将它们分组为多个区域,如图 4 所示。在此示例中,您创建骨干区域,创建一个附加区域(区域 2),并为其分配唯一区域 ID 0.0.0.2,并将设备 B 配置为区域边界路由器,其中接口 ge-0/0/0/0 参与 OSPF 区域 0,接口 ge-0/0/2 参与 OSPF 区域 2。
拓扑
配置
程序
CLI 快速配置
要快速配置多区域 OSPF 网络,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到 [edit] 层次结构级别的 CLI 中,然后从配置模式进入 commit
。
设备 A
[edit] set protocols ospf area 0.0.0.0 interface ge-0/0/0 set protocols ospf area 0.0.0.0 interface ge-0/0/1
设备 C
[edit] set protocols ospf area 0.0.0.0 interface ge-0/0/0
设备 B
[edit] set protocols ospf area 0.0.0.0 interface ge-0/0/0 set protocols ospf area 0.0.0.2 interface ge-0/0/2
设备 D
[edit] set protocols ospf area 0.0.0.2 interface ge-0/0/0 set protocols ospf area 0.0.0.2 interface ge-0/0/2
设备 E
[edit] set protocols ospf area 0.0.0.2 interface ge-0/0/2
逐步过程
要配置多区域 OSPF 网络:
配置主干区域。
注意:对于 OSPFv3 网络,请将语句
ospf3
[edit protocols]
包含在层次结构级别。[edit] user@A# set protocols ospf area 0.0.0.0 interface ge-0/0/0 user@A# set protocols ospf area 0.0.0.0 interface ge-0/0/1
[edit] user@C# set protocols ospf area 0.0.0.0 interface ge-0/0/0
[edit] user@B# set protocols ospf area 0.0.0.0 interface ge-0/0/0
为 OSPF 网络配置一个附加区域。
注意:对于多区域 OSPFv3 网络,请将语句
ospf3
[edit protocols]
包含在层次结构级别。[edit] user@host# set protocols ospf area 0.0.0.2 interface ge-0/0/0 user@D# set protocols ospf area 0.0.0.2 interface ge-0/0/2
[edit] user@E# set protocols ospf area 0.0.0.2 interface ge-0/0/2
完成设备配置后,提交配置。
[edit] user@host# commit
结果
输入命令以确认 show protocols ospf
您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@host# show protocols ospf area 0.0.0.0 { interface ge-0/0/0.0; interface ge-0/0/1.0; }
user@C# show protocols ospf area 0.0.0.0 { interface ge-0/0/0.0; }
user@B# show protocols ospf area 0.0.0.0 { interface ge-0/0/0.0; } area 0.0.0.2 { interface ge-0/0/2.0; }
user@D# show protocols ospf area 0.0.0.2 { interface ge-0/0/0.0; interface ge-0/0/2.0; }
user@E# show protocols ospf area 0.0.0.2 { interface ge-0/0/2.0; }
要确认 OSPFv3 配置,请输入 show protocols ospf3
命令。
了解 OSPF 的多区域邻接性
默认情况下,单个接口只能属于一个 OSPF 区域。但是,在某些情况下,您可能需要将接口配置为属于多个区域。这样做可以使相应的链路被视为多个区域中的区域内链路,并比其他成本较高的区域内路径更可取。例如,您可以将一个接口配置为属于多个区域,在两个区域边界路由器 (ABER) 之间有一个高速主干链路,以便创建属于不同区域的多区域邻接。
在 Junos OS 9.2 及更高版本中,您可以将 一个逻辑接口 配置为属于多个 OSPFv2 区域。Junos OS 9.4 版中引入了对 OSPFv3 的支持。如 RFC 5185 OSPF 多区域邻接中定义,ABER 在同一逻辑接口上建立属于不同区域的多个邻接。连接到链路的路由器将每个多区域邻接通告为配置区域内的点到点未编号链路。对于每个区域,其中一个逻辑接口被视为主接口,为该区域配置的其余接口则被指定为辅助接口。
任何未配置为某个区域的辅助接口的逻辑接口都被视为该区域的主接口。一个逻辑接口只能配置为一个区域的主接口。对于您配置接口的任何其他区域,必须将其配置为辅助接口。
示例:为 OSPF 配置多区域邻接
此示例说明如何为 OSPF 配置多区域邻接。
要求
开始之前,规划您的多区域 OSPF 网络。请参阅 示例:配置多区域 OSPF 网络。
概述
默认情况下,单个接口只能属于一个 OSPF 区域。您可以将单个接口配置为属于多个 OSPF 区域。这样做可以使相应的链路被视为多个区域中的区域内链路,并比其他成本较高的区域内路径更可取。配置辅助接口时,请考虑以下事项:
对于 OSPFv2,您无法将点到多点和非广播多点访问 (NBMA) 网络接口配置为辅助接口,因为辅助接口被视为点到点无编号链路。
LAN 接口支持辅助接口(主接口可以是 LAN 接口,但任何辅助接口均被视为通过 LAN 的点对点未编号链路)。在这种情况下,必须确保 LAN 上只有两个路由设备,或者 LAN 上只有两个为特定 OSPF 区域配置的辅助接口的路由设备。
由于辅助接口的目的是通过 OSPF 区域播发拓扑路径,因此不能将包含一个或多个辅助接口的辅助接口或主接口配置为被动接口。被动接口播发其地址,但不运行 OSPF 协议(未形成邻接且不会生成 hello 数据包)。
任何未配置为某个区域的辅助接口的逻辑接口都被视为该区域的主接口。一个逻辑接口只能配置为一个区域的主接口。对于您配置接口的任何其他区域,必须将其配置为辅助接口。
您不能使用
secondary
语句配置interface all
语句。您不能按辅助接口的 IP 地址来配置。
在此示例中,您将一个接口配置为位于两个区域,从而创建一个多区域邻接,并在两个 ABR R 之间提供链路:ABR R1 和 ABR R2。在每个 ABR 上,区域 0.0.0.1 包含主接口,是 ABR 之间的主链路,区域 0.0.0.2 包含辅助逻辑接口,您可以通过包括 secondary
语句进行配置。您可以在 ABR R1 上配置接口 so-0/0/0,在 ABR R2 上配置接口 so-1/0/0。
配置
CLI 快速配置
要为 OSPF 区域快速配置辅助逻辑接口,请将以下命令复制粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到 [edit] 层次结构级别的 CLI 中,然后从配置模式进入 commit
。
ABR R1 上的配置:
[edit] set interfaces so-0/0/0 unit 0 family inet address 192.0.2.45/24 set routing-options router-id 10.255.0.1 set protocols ospf area 0.0.0.1 interface so-0/0/0 set protocols ospf area 0.0.0.2 interface so-0/0/0 secondary
ABR R2 上的配置:
[edit] set interfaces so-1/0/0 unit 0 family inet address 192.0.2.37/24 set routing-options router-id 10.255.0.2 set protocols ospf area 0.0.0.1 interface so-1/0/0 set protocols ospf area 0.0.0.2 interface so-1/0/0 secondary
程序
逐步过程
要配置辅助逻辑接口,
配置设备接口。
注意:对于 OSPFv3,在每个接口上指定 inet6 地址家族并包括 IPv6 地址。
[edit] user@R1# set interfaces so-0/0/0 unit 0 family inet address 192.0.2.45/24
[edit] user@R2# set interfaces so-1/0/0 unit 0 family inet address 192.0.2.37/24
配置路由器标识符。
[edit] user@R1# set routing-options router-id 10.255.0.1
[edit] user@R2# set routing-options router-id 10.255.0.2
在每个 ABR 上,为 OSPF 区域配置主接口。
注意:对于 OSPFv3,在
ospf3
层次结构级别包括语句[edit protocols]
。[edit] user@R1# set protocols ospf area 0.0.0.1 interface so-0/0/0
[edit ] user@R2# set protocols ospf area 0.0.0.1 interface so-1/0/0
在每个 ABR 上,为 OSPF 区域配置辅助接口。
[edit ] user@R1# set protocols ospf area 0.0.0.2 so-0/0/0 secondary
[edit ] user@R2# set protocols ospf area 0.0.0.2 so-1/0/0 secondary
完成设备配置后,提交配置。
[edit protocols ospf area 0.0.0.1 ] user@host# commit
结果
输入 show interfaces
、 show routing-options
和命令, show protocols ospf
以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
ABR R1 上的配置:
user@R1# show interfaces so-0/0/0 { unit 0 { family inet { address 192.0.2.45/24; } } }
user@R1# show routing-options router-id 10.255.0.1;
user@R1# show protocols ospf area 0.0.0.1 { interface so-0/0/0.0; } area 0.0.0.2 { interface so-0/0/0.0 { secondary; } }
ABR R2 上的配置:
user@R2# show interfaces so-0/0/0 { unit 0 { family inet { address 192.0.2.37/24; } } }
user@R2# show routing-options router-id 10.255.0.2;
user@R2# show protocols ospf area 0.0.0.1 { interface so-1/0/0.0; } area 0.0.0.2 { interface so-1/0/0.0 { secondary; } }
验证
确认配置工作正常。
验证辅助接口
目的
验证已配置区域是否显示了辅助接口。如果接口配置为辅助接口,则显示辅助字段。输出还可能显示多个区域列出的同一接口。
行动
在操作模式下,输入 show ospf interface detail
OSPFv2 的命令,然后为 OSPFv3 输入 show ospf3 interface detail
命令。
验证 Area(区域)中的接口
目的
验证为指定区域配置的接口。
行动
在操作模式下,输入 show ospf interface area area-id
OSPFv2 的命令,然后输入 show ospf3 interface area area-id
OSPFv3 的命令。
了解 OSPFv3 的多区域邻接
一个区域是 OSPFv3 域中的一组网络和主机,以管理方式组合在一起。默认情况下,单个接口只能属于一个 OSPFv3 区域。但是,在某些情况下,您可能需要将接口配置为属于多个区域,以避免次优路由。这样做可以使相应的链路被视为多个区域中的区域内链路,并且优于成本较高的区域内链路。
在 Junos OS 9.2 及更高版本中,您可以将一个接口配置为属于多个 OSPFv2 区域。Junos OS 9.4 版中引入了对 OSPFv3 的支持。如 RFC 5185 OSPF 多区域邻接中定义,ABER 在同一 逻辑接口上建立属于不同区域的多个邻接。连接到链路的路由器将每个多区域邻接通告为配置区域内的点到点未编号链路。
一个接口被认为主要在一个领域。在另一个区域配置同一接口时,它被视为在另一个区域。您可以通过在层次结构级别包含 secondary
语句 [edit protocols ospf3 area area-number interface interface-name]
来指定次要区域。
示例:为 OSPFv3 配置多区域邻接
此示例说明如何为 OSPFv3 配置多区域邻接。
要求
配置此示例之前,不需要除设备初始化之外的特殊配置。
概述
OSPFv3 区域内路径优于区域间路径。在此示例中,设备 R1 和设备 R2 是区域边界路由器 (ABER),两者均位于区域 0 和区域 1 中。设备 R1 和 R2 之间的链路在第 0 区域,是一条高速链路。区域 1 中的链路速度较低。
如果您希望通过高速链路在设备 R1 和设备 R2 之间转发区域 1 的某些流量,则实现这一目标的一种方法是将高速链路作为多区域邻接,以便该链路同时属于区域 0 和区域 1。
如果设备 R1 和设备 R2 之间的高速链路仅保留在区域 1 中,设备 R1 始终通过低速链路通过区域 1 将流量路由到设备 R4 和设备 R5。设备 R1 还使用通过设备 R3 的区域 1 路径到达设备 R2 下游的区域 1 目标。
显然,此方案导致路由效果欠佳。
如果不将设备 R1 和设备 R2 之间的链路移动到区域 1,则 OSPF 虚拟链路无法用于解决此问题。如果物理链路属于网络的骨干拓扑结构,您可能不想这样做。
RFC 5185 中描述的 OSPF /OSPFv3 协议扩展允许设备 R1 和设备 R2 之间的链路属于主干区域和区域 1,从而解决了这个问题。
要创建多区域邻接,请将一个接口配置为位于两个区域,设备 R1 上配置了 ge-1/2/0(在区域 0 和区域 1 中配置的设备 R2 上)中配置了 ge-1/2/0。在设备 R1 和设备 R2 上,区域 0 都包含主接口,并且是设备之间的主链路。区域 1 包含辅助逻辑接口,您可以通过包含 secondary
语句进行配置。
CLI 快速配置 显示了 图 6 中所有设备的配置。 第 #d19e111__d19e436 节介绍了设备 R1 和设备 R2 上的步骤。
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层级的 [edit]
CLI 中。
设备 R1
set interfaces ge-1/2/0 unit 0 family inet6 address 2001:db8:9009:1::1/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:2::2/64 set interfaces lo0 unit 0 family inet address 10.1.1.1/32 set interfaces lo0 unit 0 family inet6 address 2001:db8:9009::1/128 set protocols ospf3 area 0.0.0.0 interface ge-1/2/0.0 set protocols ospf3 area 0.0.0.0 interface lo0.0 passive set protocols ospf3 area 0.0.0.1 interface fe-1/2/1.0 set protocols ospf3 area 0.0.0.1 interface ge-1/2/0.0 secondary
设备 R2
set interfaces ge-1/2/0 unit 0 family inet6 address 2001:db8:9009:1::1/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:4::1/64 set interfaces fe-1/2/2 unit 0 family inet6 address 2001:db8:9009:6::1/64 set interfaces lo0 unit 0 family inet address 10.2.2.2/32 set interfaces lo0 unit 0 family inet6 address 2001:db9:9001::2/128 set protocols ospf3 area 0.0.0.0 interface ge-1/2/0.0 set protocols ospf3 area 0.0.0.0 interface lo0.0 passive set protocols ospf3 area 0.0.0.1 interface fe-1/2/2.0 set protocols ospf3 area 0.0.0.1 interface fe-1/2/1.0 set protocols ospf3 area 0.0.0.1 interface ge-1/2/0.0 secondary
设备 R3
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:2::1/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:3::1/64 set interfaces lo0 unit 0 family inet address 10.3.3.3/32 set interfaces lo0 unit 0 family inet6 address 2001:db8:9009::3/128 set protocols ospf3 area 0.0.0.1 interface fe-1/2/0.0 set protocols ospf3 area 0.0.0.1 interface lo0.0 passive set protocols ospf3 area 0.0.0.1 interface fe-1/2/1.0
设备 R4
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:3::2/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:4::1/64 set interfaces fe-1/2/2 unit 0 family inet6 address 2001:db8:9009:5::1/64 set interfaces lo0 unit 0 family inet address 10.4.4.4/32 set interfaces lo0 unit 0 family inet6 address 2001:db8:9009::4/128 set protocols ospf3 area 0.0.0.1 interface fe-1/2/0.0 set protocols ospf3 area 0.0.0.1 interface fe-1/2/1.0 set protocols ospf3 area 0.0.0.1 interface lo0.0 passive set protocols ospf3 area 0.0.0.1 interface fe-1/2/2.0
设备 R5
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:5::2/64 set interfaces lo0 unit 0 family inet address 10.5.5.5/32 set interfaces lo0 unit 0 family inet6 address 2001:db8:9009::5/128 set protocols ospf3 area 0.0.0.1 interface lo0.0 passive set protocols ospf3 area 0.0.0.1 interface fe-1/2/0.0
设备 R6
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:6::2/64 set interfaces lo0 unit 0 family inet address 10.6.6.6/32 set interfaces lo0 unit 0 family inet6 address 2001:db8:9009::6/128 set protocols ospf3 area 0.0.0.1 interface lo0.0 passive set protocols ospf3 area 0.0.0.1 interface fe-1/2/0.0
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 R1:
-
配置接口。
[edit interfaces] user@R1# set ge-1/2/0 unit 0 family inet6 address 2001:db8:9009:1::1/64 user@R1# set fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:2::2/64 user@R1# set lo0 unit 0 family inet address 10.1.1.1/32 user@R1# set lo0 unit 0 family inet6 address 2001:db8:9009::1/128
-
在区域 0 的接口上启用 OSPFv3。
[edit protocols ospf3 area 0.0.0.0] user@R1# set interface ge-1/2/0.0 user@R1# set interface lo0.0 passive
-
在区域 1 的接口上启用 OSPFv3。
[edit protocols ospf3 area 0.0.0.1] user@R1# set interface fe-1/2/1.0 user@R1# set interface ge-1/2/0.0 secondary
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 R2:
-
配置接口。
[edit interfaces] user@R2# set ge-1/2/0 unit 0 family inet6 address 2001:db8:9009:1::2/64 user@R2# set fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:4::2/64 user@R2# set fe-1/2/2 unit 0 family inet6 address 2001:db8:9009:6::2/64 user@R2# set lo0 unit 0 family inet address 10.2.2.2/32 user@R2# set lo0 unit 0 family inet6 address 2001:db8:9009::2/128
-
在区域 0 的接口上启用 OSPFv3。
[edit protocols ospf3 area 0.0.0.0] user@R2# set interface ge-1/2/0.0 user@R2# set interface lo0.0 passive
-
在区域 1 的接口上启用 OSPFv3。
[edit protocols ospf3 area 0.0.0.1] user@R2# set interface fe-1/2/2.0 user@R2# set interface fe-1/2/1.0 user@R2# set interface ge-1/2/0.0 secondary
结果
在配置模式下,输入和 show protocols
命令以确认show interfaces
您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
设备 R1
user@R1# show interfaces
ge-1/2/0 {
unit 0 {
family inet6 {
address 2001:db8:9009:1::1/64/64;
}
}
}
fe-1/2/1 {
unit 0 {
family inet6 {
address 2001:db8:9009:2::2/64;
}
}
}
lo0 {
unit 0 {
family inet {
address 10.1.1.1/32;
}
family inet6 {
address 2001:db8:9009::1/128;
}
}
}
user@R1# show protocols
ospf3 {
area 0.0.0.0 {
interface ge-1/2/0.0;
interface lo0.0 {
passive;
}
}
area 0.0.0.1 {
interface fe-1/2/1.0;
interface ge-1/2/0.0 {
secondary;
}
}
}
设备 R2
user@R2# show interfaces
ge-1/2/0 {
unit 0 {
family inet6 {
address 2001:db8:9009:1::2/64;
}
}
}
fe-1/2/1 {
unit 0 {
family inet6 {
address 2001:db8:9009:4::1/64;
}
}
}
fe-1/2/2 {
unit 0 {
family inet6 {
address 2001:db8:9009:6::2/64;
}
}
}
lo0 {
unit 0 {
family inet {
address 10.2.2.2/32;
}
family inet6 {
address 2001:db8:9009::2/128;
}
}
}
user@R2# show protocols
ospf3 {
area 0.0.0.0 {
interface ge-1/2/0.0;
interface lo0.0 {
passive;
}
}
area 0.0.0.1 {
interface fe-1/2/2.0;
interface fe-1/2/1.0;
interface ge-1/2/0.0 {
secondary;
}
}
}
完成设备配置后,请从配置模式进入 commit
。
验证
确认配置工作正常。
验证流量
目的
验证流量是否使用设备 R1 和设备 R2 之间的高速链路到达区域 1 中的目标。
行动
在设备 R1 上的操作模式下,使用 traceroute
命令检查流向设备 R5 和设备 R6 的流量。
user@R1> traceroute 2001:db8:9009::6 traceroute6 to 2001:db8:9009::6 (2001:db8:9009::6 ) from 2001:db8:9009:1::1 , 64 hops max, 12 byte packets 1 2001:db8:9009:1::2 (2001:db8:9009:1::2 ) 1.361 ms 1.166 ms 1.117 ms 2 2001:db8:9009::6 (2001:db8:9009::6 ) 1.578 ms 1.484 ms 1.488 ms
user@R1> traceroute 2001:db8:9009::5 traceroute6 to 2001:db8:9009::5 (2001:db8:9009::5) from 2001:db8:9009:1::1, 64 hops max, 12 byte packets 1 2001:db8:9009:1::2 (2001:db8:9009:1::2) 1.312 ms 1.472 ms 1.132 ms 2 2001:db8:9009:4::1 (2001:db8:9009:4::1) 1.137 ms 1.174 ms 1.126 ms 3 2001:db8:9009::5 (5::5) 1.591 ms 1.445 ms 1.441 ms
意义
traceroute 输出显示流量使用设备 R1 和设备 R2 之间的 9009:1:: 链路。
验证移除多区域邻接时流量是否发生变化
目的
在未配置多区域邻接的情况下验证结果。
行动
-
停用 R1 和 R2 上区域 1 中的主干链路接口。
user@R1# deactivate protocols ospf3 area 0.0.0.1 interface ge-1/2/0.0 user@R1# commit user@R2# deactivate protocols ospf3 area 0.0.0.1 interface ge-1/2/0.0 user@R2# commit
-
在设备 R1 上的操作模式下,使用
traceroute
命令检查流向设备 R5 和设备 R6 的流量。user@R1> traceroute 2001:db8:9009::6 traceroute6 to 2001:db8:9009::6 (2001:db8:9009::6) from 2001:db8:9009:2::2, 64 hops max, 12 byte packets 1 2001:db8:9009:2::1 (2001:db8:9009:2::1) 1.314 ms 8.523 ms 8.310 ms 2 2001:db8:9009:3::2 (2001:db8:9009:3::2) 1.166 ms 1.162 ms 1.172 ms 3 2001:db8:9009:4::1 (2001:db8:9009:4::1) 1.386 ms 1.182 ms 1.138 ms 4 2001:db8:9009::6 (2001:db8:9009::6) 1.605 ms 1.469 ms 1.438 ms
user@R1> traceroute 2001:db8:9009::5 traceroute6 to 2001:db8:9009::5 (2001:db8:9009::5) from 2001:db8:9009:2::2, 64 hops max, 12 byte packets 1 2001:db8:9009:2::1 (2001:db8:9009:2::1) 1.365 ms 1.174 ms 1.133 ms 2 2001:db8:9009:3::2 (2001:db8:9009:2::1) 1.157 ms 1.198 ms 1.138 ms 3 2001:db8:9009:5::5 (2001:db8:9009:5::5) 1.584 ms 1.461 ms 1.443 ms
意义
没有多区域邻接,输出显示次优路由,路径通过区域 1 的低速链路。
了解 OSPF 剩余区域、完全剩余区域和“非剩余”区域
图 7 显示了一个自治系统 (AS),通过它播发许多外部路由。如果外部路由在拓扑数据库中占很大一部分,则可以在网络之外没有链路的区域抑制播发。通过这样做,您可以减少节点用于维护拓扑数据库并释放其用于其他用途的内存量。
要控制进入某个区域的外部路由的播发,OSPF 使用剩余区域。通过将区域边界路由器 (ABR) 接口指定为剩余接口,即可抑制通过 ABR 进行外部路由通告。相反,ABR 会播发默认路由(通过自身),以取代外部路由,并生成网络摘要(类型 3)链路状态通告 (LSA)。发往外部路由的数据包会自动发送至 ABR,ABR 用作出站流量的网关,并相应地路由该流量。
您必须显式配置 ABR,以便在连接到剩余或非存根区域 (NSSA) 时生成默认路由。要在区域中注入具有指定指标值的默认路由,必须配置 default-metric
选项并指定指标值。
例如, 图 7 中的区域 0.0.0.3 未直接连接到外部网络。所有出站流量都会通过 ABR 路由到主干网,然后路由到目标地址。通过将区域 0.0.0.3 指定为剩余区域,您可以将路由条目限制为区域内部的那些路由,从而降低该区域的拓扑数据库的大小。
仅允许区域内部路由并限制 Type 3 LSA 进入剩余区域的剩余区域通常称为完全剩余区域。通过将 ABR 配置为仅播发并允许默认路由进入该区域,可以将 0.0.0.3 区域转换为完全剩余区域。前往其他地区的外部路由和目的地将不再汇总或完全剩余区域。
如果配置错误,则可能会遇到网络连接问题。在配置完全剩余区域之前,您应该具备 OSPF 的高级知识并了解您的网络环境。
与 图 7 中的 0.0.0.3 区域类似,0.0.0.4 区域没有外部连接。但是,区域 0.0.0.4 有静态客户路由,这些路由不是内部 OSPF 路由。您可以通过将区域指定为 NSSA,将外部路由通告限制到此区域,并播发静态客户路由。在 NSSA 中,AS 边界路由器会生成 NSSA 外部(类型 7)LSA,并泛洪到 NSSA,其中包含这些 LSA。7 类 LSA 允许 NSSA 支持存在 AS 边界路由器及其相应的外部路由信息。ABR 会将 7 类 LSA 转换为 AS 外部(5 类)LSA,并将其泄漏到其他区域,但来自其他区域的外部路由不会在 NSSA 内播发。
示例:配置 OSPF 剩余区域和完全剩余区域
此示例说明如何配置 OSPF 剩余区域和完全剩余区域,以控制向某个区域播发外部路由。
要求
开始之前:
配置设备接口。请参阅 安全设备的接口用户指南。
配置 OSPF 网络中设备的路由器标识符。请参阅 示例:配置 OSPF 路由器标识符。
控制 OSPF 指定的路由器选择。请参阅 示例:控制 OSPF 指定路由器选择
配置多区域 OSPF 网络。请参阅 示例:配置多区域 OSPF 网络。
概述
主干区域( 图 8 中的 0)具有特殊功能,始终分配区域 ID 0.0.0.0。区域 ID 是唯一数字标识符,采用十进制点符号。区域 ID 仅在自治系统 (AS) 中是唯一的。AS 中的所有其他网络或区域(如 3、7 和 9)必须直接连接到在多个区域拥有接口的按区域边界路由器 (ABER) 的主干区域。
剩余区域是 OSPF 不会在 AS 外部链路状态播发(5 类 LSA)中泛洪的区域。如果大部分拓扑数据库由 AS 外部播发组成,并且希望将剩余区域内部路由器上的拓扑数据库的大小降至最低,则可能会创建剩余区域。
以下限制适用于剩余区域:
您不能通过剩余区域创建虚拟链路。
剩余区域不能包含 AS 边界路由器。
您不能将主干网配置为剩余区域。
您不能将一个区域同时配置为剩余区域和非剩余区域 (NSSA)。
在此示例中,您将第 7 区中的每台路由设备(区域 ID 0.0.0.7)配置为剩余路由器,并在 ABR 上配置一些附加设置:
stub
- 指定此区域成为剩余区域,而不是 5 类 LSA 泛洪。您必须在第 7 区域的所有路由设备上包括该stub
语句,因为此区域没有外部连接。default-metric
- 配置 ABR 以在剩余区域生成带有指定指标的默认路由。此默认路由支持从剩余区域向外部目标转发数据包。您仅在 ABR 上配置此选项。当连接到存根时,ABR 不会自动生成默认路由。您必须显式配置此选项才能生成默认路由。no-summaries
-(可选)通过将剩余区域转换为完全剩余区域,可防止 ABR 将摘要路由广告到剩余区域。如果与default-metric
语句组合配置,则完全剩余区域仅允许向区域内部路由,并将默认路由播发到该区域。前往其他地区的外部路由和目的地将不再汇总或完全剩余区域。只有 ABR 需要此附加配置,因为它是完全剩余区域内唯一创建 Type 3 LSA 的路由设备,用于从区域外部接收和发送流量。
在 Junos OS 8.5 及更高版本中,以下内容适用:
未配置为运行 OSPF 的路由器标识符接口将不再在 OSPF LSA 中播发为剩余网络。
如果环路接口配置的前缀长度不是 32,OSPF 将播发前缀长度为 32 的本地路由作为剩余链路。OSPF 还会播发具有配置的掩码长度的直接路由,如早期版本中那样。
拓扑
配置
CLI 快速配置
要快速配置 OSPF 剩余区域,请复制以下命令并将其粘贴到 CLI 中。您必须配置属于剩余区域的所有路由设备。
[edit] set protocols ospf area 07 stub
要快速配置 ABR 以将默认路由注入区域,请将以下命令复制并粘贴到 CLI 中。您仅在 ABR 上应用此配置。
[edit] set protocols ospf area 07 stub default-metric 10
(可选)要快速配置 ABR 以限制所有摘要播发并仅允许内部路由和默认路由播发进入此区域,请复制以下命令并将其粘贴到 CLI 中。您仅在 ABR 上应用此配置。
[edit] set protocols ospf area 0.0.0.7 stub no-summaries
程序
逐步过程
要配置 OSPF 剩余区域:
在该地区的所有路由设备上,配置 OSPF 剩余区域。
注意:要指定 OSPFv3 剩余区域,请在
ospf3
层次结构级别包含语句[edit protocols]
。[edit] user@host# set protocols ospf area 0.0.0.7 stub
在 ABR 上,向区域注入默认路由。
[edit] user@host# set protocols ospf area 0.0.0.7 stub default-metric 10
(可选)在 ABR 上,限制汇总 LSA 进入区域。这一步会将剩余区域转换为完全剩余区域。
[edit] user@host# set protocols ospf area 0.0.0.7 stub no-summaries
完成设备配置后,提交配置。
[edit] user@host# commit
结果
输入命令以确认 show protocols ospf
您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
所有路由设备上的配置:
user@host# show protocols ospf area 0.0.0.7 { stub; }
ABR 上的配置(输出还包括可选设置):
user@host# show protocols ospf area 0.0.0.7 { stub default-metric 10 no-summaries; }
要确认 OSPFv3 配置,请输入 show protocols ospf3
命令。
验证
确认配置工作正常。
验证 Area(区域)中的接口
目的
验证 OSPF 接口是否已针对相应区域配置。确认输出是否将存根作为 OSPF 区域类型。
行动
在操作模式下,输入 show ospf interface detail
OSPFv2 的命令,然后为 OSPFv3 输入 show ospf3 interface detail
命令。
示例:配置 OSPF 非剩余区域
此示例说明如何配置 OSPF 非剩余区域 (NSSA), 以控制将外部路由播发到一个区域。
要求
开始之前:
配置设备接口。请参阅 安全设备的接口用户指南。
配置 OSPF 网络中设备的路由器标识符。请参阅 示例:配置 OSPF 路由器标识符。
控制 OSPF 指定的路由器选择。请参阅 示例:控制 OSPF 指定路由器选择
配置多区域 OSPF 网络。请参阅 示例:配置多区域 OSPF 网络。
概述
骨干区域( 图 9 中的 0)具有特殊功能,始终分配区域 ID 0.0.0.0。区域 ID 是唯一数字标识符,采用十进制点符号。区域标识在 AS 中只需要唯一。AS 中的所有其他网络或区域(如 3、7 和 9)必须由在多个区域拥有接口的 ABER 直接连接到主干区域。
OSPF 剩余区域没有外部路由,因此无法将路由从另一个协议重新分配到剩余区域。OSPF NSSA 允许外部路由在区域内泛洪。
此外,在将 Type 7 LSA 导出到 NSSA 是不必要的情况。当 AS 边界路由器也是附加了 NSSA 的 ABR 时,默认情况下,7 类 LSA 会导出到 NSSA 中。如果 ABR 连接到多个 NSSA,则默认情况下,单独的 Type 7 LSA 将导出到每个 NSSA 中。在路由重新分配期间,此路由设备会同时生成 5 类 LSA 和 7 类 LSA。您可以禁用将 7 类 LSA 导出到 NSSA。
以下限制适用于 NSSA:您不能将区域同时配置为剩余区域和 NSSA。
您可以使用以下设置配置区域 9(区域 ID 0.0.0.9)中的每台路由设备:
nssa
- 指定 OSPF NSSA。您必须在第 9 区域的所有路由设备上包括该nssa
语句,因为此区域只有与静态路由的外部连接。
您还可以使用以下附加设置在第 9 区配置 ABR:
no-summaries
- 阻止 ABR 将摘要路由广告到 NSSA 中。如果与default-metric
语句组合配置,则 NSSA 仅允许区域内部路由,并将默认路由播发到区域中。到其他地区的外部路由和目的地不再汇总或允许进入 NSSA。只有 ABR 需要此附加配置,因为它是 NSSA 中唯一创建 Type 3 LSA 的路由设备,用于从区域外部接收和发送流量。default-lsa
- 配置 ABR 以在 NSSA 中生成默认路由。在此示例中,您将配置以下内容:default-metric
- 指定 ABR 在 NSSA 中生成带有指定指标的默认路由。此默认路由支持从 NSSA 转发到外部目标的数据包。您仅在 ABR 上配置此选项。当连接到 NSSA 时,ABR 不会自动生成默认路由。您必须为 ABR 显式配置此选项才能生成默认路由。metric-type
—(可选)为默认 LSA 指定外部指标类型,可以是类型 1,也可以是类型 2。当 OSPF 从外部 AS 导出路由信息时,它会在路由中包含成本或外部指标。这两个指标之间的区别在于 OSPF 如何计算路由成本。第 1 类外部指标等同于链路状态指标,其中成本等于内部成本加外部成本的总和。第 2 类外部指标仅使用 AS 边界路由器分配的外部成本。默认情况下,OSPF 使用 Type 2 外部指标。type-7
-(可选)如果no-summaries
配置了语句,则将类型 7 的默认 LSA 泛洪到 NSSA 中。默认情况下,配置语句no-summaries
后,将 3 类 LSA 注入到 Junos OS 5.0 及更高版本的 NSSA 中。要支持向后兼容早期 Junos OS 版本,请包含语句type-7
。
第二个示例还显示了禁用将 7 类 LSA 导出到 NSSA 所需的可选配置,在路由设备上包括 no-nssa-abr
执行 ABR 和 AS 边界路由器功能的语句。
拓扑
配置
配置路由设备以加入“非剩余”区域
CLI 快速配置
要快速配置 OSPF NSSA,请复制以下命令并将其粘贴到 CLI 中。您必须配置属于 NSSA 的所有路由设备。
[edit] set protocols ospf area 0.0.0.9 nssa
要快速配置参与 OSPF NSSA 的 ABR,请将以下命令复制并粘贴到 CLI 中。
[edit] set protocols ospf area 0.0.0.9 nssa default-lsa default-metric 10 set protocols ospf area 0.0.0.9 nssa default-lsa metric-type 1 set protocols ospf area 0.0.0.9 nssa default-lsa type-7 set protocols ospf area 0.0.0.9 nssa no-summaries
逐步过程
要配置 OSPF NSSA:
在该地区的所有路由设备上,配置 OSPF NSSA。
注意:要指定 OSPFv3 NSSA 区域,请在
ospf3
层次结构级别包含语句[edit protocols]
。[edit] user@host# set protocols ospf area 0.0.0.9 nssa
在 ABR 上,进入 OSPF 配置模式,并指定已创建的 NSSA 区域 0.0.0.9。
[edit ] user@host# edit protocols ospf area 0.0.0.9 nssa
在 ABR 上,向区域注入默认路由。
[edit protocols ospf area 0.0.0.9 nssa] user@host# set default-lsa default-metric 10
(可选)在 ABR 上,为默认路由指定外部指标类型。
[edit protocols ospf area 0.0.0.9 nssa] user@host# set default-lsa metric-type 1
(可选)在 ABR 上,指定 Type 7 LSA 的泛洪。
[edit protocols ospf area 0.0.0.9 nssa] user@host# set default-lsa type-7
在 ABR 上,限制汇总 LSA 进入区域。
[edit protocols ospf area 0.0.0.9 nssa] user@host# set no-summaries
完成设备配置后,提交配置。
[edit protocols ospf area 0.0.0.9 nssa] user@host# commit
结果
输入命令以确认 show protocols ospf
您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
该地区所有路由设备上的配置:
user@host# show protocols ospf area 0.0.0.9 { nssa; }
ABR 上的配置。输出还包括可选 metric-type
和 type-7
语句。
user@host# show protocols ospf area 0.0.0.9 { nssa { default-lsa { default-metric 10; metric-type 1; type-7; } no-summaries; } }
要确认 OSPFv3 配置,请输入 show protocols ospf3
命令。
禁用将 7 类链路状态广告导出到“非剩余”区域
CLI 快速配置
要快速禁用将 Type 7 LSA 导出到 NSSA 中,请将以下命令复制粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到 [edit] 层次结构级别的 CLI 中,然后从配置模式进入 commit
。您可以在 AS 边界路由器上配置此设置,该路由器也是附加了 NSSA 区域的 ABR。
[edit] set protocols ospf no-nssa-abr
逐步过程
如果有 AS 边界路由器也是附加了 NSSA 区域的 ABR,则可以配置此设置。
禁用将 Type 7 LSA 导出到 NSSA。
注意:要指定 OSPFv3,请在
ospf3
层次结构级别包含语句[edit protocols]
。[edit] user@host# set protocols ospf no-nssa-abr
完成设备配置后,提交配置。
[edit] user@host# commit
结果
输入命令以确认 show protocols ospf
您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@host# show protocols ospf no-nssa-abr;
要确认 OSPFv3 配置,请输入 show protocols ospf3
命令。
验证
确认配置工作正常。
验证 Area(区域)中的接口
目的
验证 OSPF 接口是否已针对相应区域配置。确认输出包含作为 OSPF 区域的类型的存根 NSSA。
行动
在操作模式下,输入 show ospf interface detail
OSPFv2 的命令,然后为 OSPFv3 输入 show ospf3 interface detail
命令。
验证 OSPF 区域的类型
目的
验证 OSPF 区域是否为剩余区域。确认输出将“存根”类型显示为“存根”。
行动
在操作模式下,输入 show ospf overview
OSPFv2 的命令,然后为 OSPFv3 输入 show ospf3 overview
命令。
了解 OSPFv3 剩余区域和完全剩余区域
适用于 IPv6 网络的 Junos OS OSPFv3 配置与 OSPFv2 配置相同。您可使用命令而非命令来set ospf3
配置协议,并使用show ospf3
命令而非show ospf
命令检查 OSPF set ospf
状态。此外,请务必在运行 OSPFv3 的接口上设置 IPv6 地址。
剩余区域是 OSPF 不会在 AS 外部链路状态播发(5 类 LSA)中泛洪的区域。如果大部分拓扑数据库由 AS 外部播发组成,并且希望将剩余区域内部路由器上的拓扑数据库的大小降至最低,则可能会创建剩余区域。
以下限制适用于剩余区域:
您不能通过剩余区域创建虚拟链路。
剩余区域不能包含 AS 边界路由器。
您不能将主干网配置为剩余区域。
您不能将一个区域同时配置为剩余区域和非剩余区域 (NSSA)。
示例:配置 OSPFv3 存根和完全剩余区域
此示例说明如何配置 OSPFv3 剩余区域和完全剩余区域,以控制将外部路由播发到一个区域。
要求
配置此示例之前,不需要除设备初始化之外的特殊配置。
概述
图 10 显示了此示例中使用的拓扑。
在此示例中,您将第 7 区中的每台路由设备(区域 ID 0.0.0.7)配置为剩余路由器,并在 ABR 上配置一些附加设置:
-
stub
- 指定此区域成为剩余区域,而不是 5 类 LSA 泛洪。您必须在第 7 区域的所有路由设备上包括该stub
语句,因为此区域没有外部连接。 -
default-metric
- 配置 ABR 以在剩余区域生成带有指定指标的默认路由。此默认路由支持从剩余区域向外部目标转发数据包。您仅在 ABR 上配置此选项。当连接到存根时,ABR 不会自动生成默认路由。您必须显式配置此选项才能生成默认路由。 -
no-summaries
-(可选)通过将剩余区域转换为完全剩余区域,可防止 ABR 将摘要路由广告到剩余区域。如果与default-metric
语句组合配置,则完全剩余区域仅允许向区域内部路由,并将默认路由播发到该区域。前往其他地区的外部路由和目的地将不再汇总或完全剩余区域。只有 ABR 需要此附加配置,因为它是完全剩余区域内唯一创建 Type 3 LSA 的路由设备,用于从区域外部接收和发送流量。
在 Junos OS 8.5 及更高版本中,以下内容适用:
-
未配置为运行 OSPF 的路由器标识符接口将不再在 OSPF LSA 中播发为剩余网络。
-
如果环路接口配置的前缀长度不是 32,OSPF 将播发前缀长度为 32 的本地路由作为剩余链路。OSPF 还会播发具有配置的掩码长度的直接路由,如早期版本中那样。
CLI 快速配置 显示了 图 10 中所有设备的配置。部分 #d24e145__d24e512 介绍了设备 2、设备 6、设备 7 和设备 8 上的步骤。
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层级的 [edit]
CLI 中。
设备 1
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:1::1/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:2::1/64 set interfaces fe-1/2/2 unit 0 family inet6 address 2001:db8:9009:3::1/64 set interfaces lo0 unit 0 family inet address 10.1.1.1/32 set protocols ospf3 area 0.0.0.0 interface fe-1/2/0.0 set protocols ospf3 area 0.0.0.0 interface fe-1/2/1.0 set protocols ospf3 area 0.0.0.0 interface fe-1/2/2.0 set protocols ospf3 area 0.0.0.0 interface lo0.0 passive
设备 2
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:2::2/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:4::1/64 set interfaces lo0 unit 0 family inet address 10.2.2.2/32 set protocols ospf3 area 0.0.0.0 interface fe-1/2/0.0 set protocols ospf3 area 0.0.0.0 interface lo0.0 passive set protocols ospf3 area 0.0.0.7 stub default-metric 10 set protocols ospf3 area 0.0.0.7 stub no-summaries set protocols ospf3 area 0.0.0.7 interface fe-1/2/1.0
设备 3
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:3::2/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:5::1/64 set interfaces lo0 unit 0 family inet address 10.3.3.3/32 set protocols ospf3 area 0.0.0.0 interface fe-1/2/0.0 set protocols ospf3 area 0.0.0.0 interface lo0.0 passive set protocols ospf3 area 0.0.0.9 interface fe-1/2/1.0
设备 4
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:1::2/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:6::1/64 set interfaces lo0 unit 0 family inet address 10.4.4.4/32 set protocols ospf3 area 0.0.0.0 interface fe-1/2/0.0 set protocols ospf3 area 0.0.0.0 interface lo0.0 passive set protocols ospf3 area 0.0.0.3 interface fe-1/2/1.0
设备 5
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:6::2/64 set interfaces lo0 unit 0 family inet address 10.5.5.5/32 set protocols ospf3 area 0.0.0.3 interface fe-1/2/0.0 set protocols ospf3 area 0.0.0.3 interface lo0.0 passive
设备 6
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:4::2/64 set interfaces lo0 unit 0 family inet address 10.6.6.6/32 set protocols ospf3 area 0.0.0.7 stub set protocols ospf3 area 0.0.0.7 interface fe-1/2/0.0 set protocols ospf3 area 0.0.0.7 interface lo0.0 passive
设备 7
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:5::2/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:7::1/64 set interfaces lo0 unit 0 family inet address 10.7.7.7/32 set protocols ospf3 export static-to-ospf set protocols ospf3 area 0.0.0.9 interface fe-1/2/0.0 set protocols ospf3 area 0.0.0.9 interface lo0.0 passive set policy-options policy-statement static-to-ospf term 1 from protocol static set policy-options policy-statement static-to-ospf term 1 then accept set routing-options rib inet6.0 static route 2001:db8:1010::1/128 next-hop 2001:db8:9009:7::2 set routing-options rib inet6.0 static route 2001:db8:2020::1/128 next-hop 2001:db8:9009:7::2
设备 8
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:7::2/64 set interfaces lo0 unit 0 family inet address 10.8.8.8/32 set interfaces lo0 unit 0 family inet6 address 2001:db8:1010::1/128 set interfaces lo0 unit 0 family inet6 address 2001:db8:2020::1/128
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 2:
-
配置接口。
[edit interfaces] user@2# set fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:2::2/64 user@2# set fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:4::1/64 user@2# set lo0 unit 0 family inet address 10.2.2.2/32
-
在区域 0 的接口上启用 OSPFv3。
[edit protocols ospf3 area 0.0.0.0] user@2# set interface fe-1/2/0.0 user@2# set interface lo0.0 passive
-
在第 7 区中的接口上启用 OSPFv3。
[edit protocols ospf3 area 0.0.0.7] user@2# set interface fe-1/2/1.0
-
将区域 7 指定为 OSPFv3 剩余区域。
该地区
stub
所有路由设备上都需要该语句。[edit protocols ospf3 area 0.0.0.7] user@2# set stub
-
在 ABR 上,向区域注入默认路由。
[edit protocols ospf3 area 0.0.0.7] user@2# set stub default-metric 10
-
(可选)在 ABR 上,限制汇总 LSA 进入区域。
这一步会将剩余区域转换为完全剩余区域。
[edit protocols ospf3 area 0.0.0.7] user@2# set stub no-summaries
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 6:
-
配置接口。
[edit interfaces] user@6# set fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:4::2/64 user@6# set lo0 unit 0 family inet address 10.6.6.6/32
-
在第 7 区中的接口上启用 OSPFv3。
[edit protocols ospf3 area 0.0.0.7] user@6# set interface fe-1/2/0.0 user@6# set interface lo0.0 passive
-
将区域 7 指定为 OSPFv3 剩余区域。
该地区
stub
所有路由设备上都需要该语句。[edit protocols ospf3 area 0.0.0.7] user@6# set stub
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 7:
-
配置接口。
[edit interfaces] user@7# set fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:5::2/64 user@7# set fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:7::1/64 user@7# set lo0 unit 0 family inet address 10.7.7.7/32
-
在区域 9 的接口上启用 OSPFv3。
[edit protocols ospf3 area 0.0.0.9] user@7# set interface fe-1/2/0.0 user@7# set interface lo0.0 passive
-
配置支持与客户路由连接的静态路由。
[edit routing-options rib inet6.0 static] user@7# set route 1010::1/128 next-hop 2001:db8:9009:7::2 user@7# set route 2020::1/128 next-hop 2001:db8:9009:7::2
-
配置路由策略以重新分配静态路由。
[edit policy-options policy-statement static-to-ospf term 1] user@7# set from protocol static user@7# set then accept
-
将路由策略应用于 OSPFv3 实例。
[edit protocols ospf3] user@7# set export static-to-ospf
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 8:
-
配置接口。
[edit interfaces] user@8# set fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:7::2/64 user@8# set lo0 unit 0 family inet address 10.8.8.8/32
-
配置两个环路接口地址以模拟客户路由。
[edit interfaces lo0 unit 0 family inet6] user@8# set address 2001:db8:1010::1/128 user@8# set address 2001:db8:2020::1/128
结果
在配置模式下,输入 show interfaces
、 show protocols
、 show policy-options
和 show routing-options
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
设备 2
user@2# show interfaces
fe-1/2/0 {
unit 0 {
family inet6 {
address 2001:db8:9009:2::2/64;
}
}
}
fe-1/2/1 {
unit 0 {
family inet6 {
address 2001:db8:9009:4::1/64;
}
}
}
lo0 {
unit 0 {
family inet {
address 10.2.2.2/32;
}
}
}
user@2# show protocols
ospf3 {
area 0.0.0.0 {
interface fe-1/2/0.0;
interface lo0.0 {
passive;
}
}
area 0.0.0.7 {
stub default-metric 10 no-summaries;
interface fe-1/2/1.0;
}
}
设备 6
user@6# show interfaces
fe-1/2/0 {
unit 0 {
family inet6 {
address 2001:db8:9009:4::2/64;
}
}
}
lo0 {
unit 0 {
family inet {
address 10.6.6.6/32;
}
}
}
user@6# show protocols
ospf3 {
area 0.0.0.7 {
stub;
interface fe-1/2/0.0;
interface lo0.0 {
passive;
}
}
}
设备 7
user@7# show interfaces
fe-1/2/0 {
unit 0 {
family inet6 {
address 2001:db8:9009:5::2/64;
}
}
}
fe-1/2/1 {
unit 0 {
family inet6 {
address 2001:db8:9009:7::1/64;
}
}
}
lo0 {
unit 0 {
family inet {
address 10.7.7.7/32;
}
}
}
user@7# show protocols
ospf3 {
export static-to-ospf;
area 0.0.0.9 {
interface fe-1/2/0.0;
interface lo0.0 {
passive;
}
}
}
user@7# show policy-options
policy-statement static-to-ospf {
term 1 {
from protocol static;
then accept;
}
}
user@7# show routing-options
rib inet6.0 {
static {
route 2001:db8:1010::1/128 next-hop 2001:db8:9009:7::2;
route 2001:db8:2020::1/128 next-hop 2001:db8:9009:7::2;
}
}
设备 8
user@8# show interfaces
fe-1/2/0 {
unit 0 {
family inet6 {
address 2001:db8:9009:7::2/64;
}
}
}
lo0 {
unit 0 {
family inet {
address 10.8.8.8/32;
}
family inet6 {
address 2001:db8:1010::1/128;
address 2001:db8:2020::1/128;
}
}
}
完成设备配置后,请从配置模式进入 commit
。
验证
确认配置工作正常。
验证 OSPFv3 区域的类型
目的
验证 OSPFv3 区域是否为剩余区域。确认输出是否将存根显示为存根类型。
行动
在设备 2 和设备 6 的操作模式下,输入 show ospf3 overview
命令。
user@2> show ospf3 overview Instance: master Router ID: 10.2.2.2 Route table index: 51 Area border router LSA refresh time: 50 minutes Area: 0.0.0.0 Stub type: Not Stub Area border routers: 2, AS boundary routers: 0 Neighbors Up (in full state): 1 Area: 0.0.0.7 Stub type: Stub, Stub cost: 10 Area border routers: 0, AS boundary routers: 0 Neighbors Up (in full state): 1 Topology: default (ID 0) Prefix export count: 0 Full SPF runs: 24 SPF delay: 0.200000 sec, SPF holddown: 5 sec, SPF rapid runs: 3 Backup SPF: Not Needed
user@6> show ospf3 overview Instance: master Router ID: 10.6.6.6 Route table index: 46 LSA refresh time: 50 minutes Area: 0.0.0.7 Stub type: Stub Area border routers: 1, AS boundary routers: 0 Neighbors Up (in full state): 1 Topology: default (ID 0) Prefix export count: 0 Full SPF runs: 17 SPF delay: 0.200000 sec, SPF holddown: 5 sec, SPF rapid runs: 3 Backup SPF: Not Needed
意义
在设备 2 上,区域 0 的剩余类型为 Not Stub
。区域 7 的剩余部分类型为 Stub
。剩余项默认指标为 10。
在设备 6 上,区域 7 的剩余类型为 Stub
。
验证 OSPFv3 剩余区域中的路由
目的
请确保路由表中存在预期的路由。
行动
在设备 6 和设备 2 的操作模式下,输入 show route
命令。
user@6> show route inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.6.6.6/32 *[Direct/0] 1d 01:57:12 > via lo0.0 inet6.0: 6 destinations, 7 routes (6 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both ::/0 *[OSPF3/10] 00:10:52, metric 11 > via fe-1/2/0.0 2001:db8:9009:4::/64 *[Direct/0] 1d 01:56:31 > via fe-1/2/0.0 [OSPF3/10] 1d 01:56:31, metric 1 > via fe-1/2/0.0 2001:db8:9009:4::2/128 *[Local/0] 1d 01:56:53 Local via fe-1/2/0.0 fe80::/64 *[Direct/0] 1d 01:56:31 > via fe-1/2/0.0 fe80::2a0:a514:0:a4c/128 *[Local/0] 1d 01:56:53 Local via fe-1/2/0.0 ff02::5/128 *[OSPF3/10] 1d 01:58:22, metric 1 MultiRecv
user@2> show route inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.2.2.2/32 *[Direct/0] 1d 02:16:13 > via lo0.0 inet6.0: 14 destinations, 17 routes (14 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 2001:db8:1010::1/128 *[OSPF3/150] 00:30:15, metric 0, tag 0 > via fe-1/2/0.0 2001:db8:2020::1/128 *[OSPF3/150] 00:30:15, metric 0, tag 0 > via fe-1/2/0.0 2001:db8:9009:1::/64 *[OSPF3/10] 1d 02:15:54, metric 2 > via fe-1/2/0.0 2001:db8:9009:2::/64 *[Direct/0] 1d 02:15:54 > via fe-1/2/0.0 [OSPF3/10] 1d 02:15:54, metric 1 > via fe-1/2/0.0 2001:db8:9009:2::2/128 *[Local/0] 1d 02:15:54 Local via fe-1/2/0.0 2001:db8:9009:3::/64 *[OSPF3/10] 1d 02:15:54, metric 2 > via fe-1/2/0.0 2001:db8:9009:4::/64 *[Direct/0] 1d 02:15:54 > via fe-1/2/1.0 [OSPF3/10] 05:38:05, metric 1 > via fe-1/2/1.0 2001:db8:9009:4::1/128 *[Local/0] 1d 02:15:54 Local via fe-1/2/1.0 2001:db8:9009:5::/64 *[OSPF3/10] 1d 02:15:54, metric 3 > via fe-1/2/0.0 2001:db8:9009:6::/64 *[OSPF3/10] 1d 01:33:10, metric 3 > via fe-1/2/0.0 fe80::/64 *[Direct/0] 1d 02:15:54 > via fe-1/2/0.0 [Direct/0] 1d 02:15:54 > via fe-1/2/1.0 fe80::2a0:a514:0:64c/128 *[Local/0] 1d 02:15:54 Local via fe-1/2/0.0 fe80::2a0:a514:0:94c/128 *[Local/0] 1d 02:15:54 Local via fe-1/2/1.0 ff02::5/128 *[OSPF3/10] 1d 02:17:45, metric 1 MultiRecv
意义
在设备 6 上,由于 default-metric
ABR 设备 2 上的语句,已学习默认路由。否则,设备 6 的路由表中的唯一 OSPFv3 路由是网络地址 2001:db8:9009:4:/64 和所有 SPF 链路状态路由器(也称为 AllSPFRouter)的 OSPFv3 组播地址 ff02:5/128。
在设备 2 上,已学习所有 OSPFv3 路由,包括外部客户路由 2001:db8:1010::1/128 和 2001:db8:2020::1/128。
了解 OSPFv3 不那么剩余区域
与 OSPF 剩余区域类似,OSPFv3 剩余区域没有外部路由,因此您无法将路由从另一个协议重新分配到剩余区域。非剩余区域 (NSSA) 允许外部路由在区域内泛洪。NSSA 中的路由器不会从区域边界路由器 (ABER) 接收外部链路状态公告 (LSA),但允许发送用于重新分配的外部路由信息。它们使用 7 型 LSA 将这些外部路由告知 ABR,然后 ABR 将其转换为 5 类外部 LSA,并像 OSPF 网络的其他部分一样正常发生泛洪。
示例:配置 OSPFv3 非 So-Stubby 区域
此示例说明如何配置 OSPFv3 非剩余区域 (NSSA), 以控制进入该区域的外部路由的播发。
要求
配置此示例之前,不需要除设备初始化之外的特殊配置。
概述
在此示例中,设备 7 将静态客户 1 路由重新分配到 OSPFv3 中。设备 7 位于区域 9,配置为 NSSA。设备 3 是连接到 NSSA 的 ABR。NSSA 是一种剩余区域,可以导入自治系统外部路由并将其发送到其他地区,但仍无法接收来自其他区域的 AS 外部路由。由于区域 9 被定义为 NSSA,设备 7 使用类型 7 LSA 通知 ABR(设备 3)有关这些外部路由的信息。然后,设备 3 将第 7 类路由转换为 5 类外部 LSA,并按正常方式将其泛洪至 OSPF 网络的其他部分。
在区域 3 中,设备 5 将静态客户 2 路由重新分配到 OSPFv3 中。这些路由是在设备 3 上学习的,但不会在设备 7 或 10 上学习。设备 3 将默认静态路由注入区域 9,以便设备 7 和 10 仍然可以到达客户 2 路由。
您可以使用以下设置配置区域 9(区域 ID 0.0.0.9)中的每台路由设备:
-
nssa
- 指定 OSPFv3 NSSA。您必须在第 9 区域的所有路由设备上包括该nssa
语句。
您还可以使用以下附加设置在第 9 区配置 ABR:
-
no-summaries
- 阻止 ABR 将摘要路由广告到 NSSA 中。如果与default-metric
语句组合配置,则 NSSA 仅允许区域内部路由,并将默认路由播发到区域中。到其他地区的外部路由和目的地不再汇总或允许进入 NSSA。只有 ABR 需要此附加配置,因为它是 NSSA 中唯一创建 Type 3 汇总 LSA 的路由设备,用于从区域外部接收和发送流量。 -
default-lsa
- 配置 ABR 以在 NSSA 中生成默认路由。在此示例中,您将配置以下内容:-
default-metric
- 指定 ABR 在 NSSA 中生成带有指定指标的默认路由。此默认路由支持从 NSSA 转发到外部目标的数据包。您仅在 ABR 上配置此选项。当连接到 NSSA 时,ABR 不会自动生成默认路由。您必须为 ABR 显式配置此选项才能生成默认路由。 -
metric-type
—(可选)为默认 LSA 指定外部指标类型,可以是类型 1,也可以是类型 2。当 OSPFv3 从外部 AS 导出路由信息时,路由中包含成本或外部指标。这两个指标之间的区别在于 OSPFv3 如何计算路由成本。第 1 类外部指标等同于链路状态指标,其中成本等于内部成本加外部成本的总和。第 2 类外部指标仅使用 AS 边界路由器分配的外部成本。默认情况下,OSPFv3 使用 Type 2 外部指标。 -
type-7
-(可选)如果no-summaries
配置了语句,则将类型 7 的默认 LSA 泛洪到 NSSA 中。默认情况下,配置语句no-summaries
后,将 3 类 LSA 注入到 Junos OS 5.0 及更高版本的 NSSA 中。要支持向后兼容早期 Junos OS 版本,请包含语句type-7
。
-
CLI 快速配置 显示了 图 11 中所有设备的配置。 第 #d26e168__d26e580 节介绍了设备 3、设备 7 和设备 9 上的步骤。
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层级的 [edit]
CLI 中。
设备 1
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:1::1/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:3::1/64 set interfaces lo0 unit 0 family inet address 10.1.1.1/32 set protocols ospf3 area 0.0.0.0 interface fe-1/2/0.0 set protocols ospf3 area 0.0.0.0 interface fe-1/2/0.5 set protocols ospf3 area 0.0.0.0 interface fe-1/2/1.0 set protocols ospf3 area 0.0.0.0 interface lo0.0 passive
设备 3
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:3::2/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:5::1/64 set interfaces lo0 unit 0 family inet address 10.3.3.3/32 set protocols ospf3 area 0.0.0.0 interface fe-1/2/0.0 set protocols ospf3 area 0.0.0.0 interface lo0.0 passive set protocols ospf3 area 0.0.0.9 nssa default-lsa default-metric 10 set protocols ospf3 area 0.0.0.9 nssa default-lsa metric-type 1 set protocols ospf3 area 0.0.0.9 nssa default-lsa type-7 set protocols ospf3 area 0.0.0.9 nssa no-summaries set protocols ospf3 area 0.0.0.9 interface fe-1/2/1.0
设备 4
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:1::2/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:6::1/64 set interfaces lo0 unit 0 family inet address 10.4.4.4/32 set protocols ospf3 area 0.0.0.0 interface fe-1/2/0.0 set protocols ospf3 area 0.0.0.0 interface lo0.0 passive set protocols ospf3 area 0.0.0.3 interface fe-1/2/1.0
设备 5
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:6::2/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:7::1/64 set interfaces lo0 unit 0 family inet address 10.5.5.5/32 set protocols ospf3 export static-to-ospf set protocols ospf3 area 0.0.0.3 interface fe-1/2/0.0 set protocols ospf3 area 0.0.0.3 interface lo0.0 passive set policy-options policy-statement static-to-ospf term 1 from protocol static set policy-options policy-statement static-to-ospf term 1 then accept set routing-options rib inet6.0 static route 2001:db8:1010::1/128 next-hop 2001:db8:9009:7::2 set routing-options rib inet6.0 static route 2001:db8:2020::1/128 next-hop 2001:db8:9009:7::2
设备 7
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:8::1/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:9::1/64 set interfaces lo0 unit 0 family inet address 10.7.7.7/32 set protocols ospf3 export static2-to-ospf set protocols ospf3 area 0.0.0.9 nssa set protocols ospf3 area 0.0.0.9 interface fe-1/2/1.0 set protocols ospf3 area 0.0.0.9 interface lo0.0 passive set policy-options policy-statement static2-to-ospf term 1 from protocol static set policy-options policy-statement static2-to-ospf term 1 then accept set routing-options rib inet6.0 static route 2001:db8:3030::1/128 next-hop 2001:db8:9009:8::2 set routing-options rib inet6.0 static route 2001:db8:4040::1/128 next-hop 2001:db8:9009:8::2
设备 8
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:7::2/64 set interfaces lo0 unit 0 family inet address 10.8.8.8/32 set interfaces lo0 unit 0 family inet6 address 2001:db8:1010::1/128 set interfaces lo0 unit 0 family inet6 address 2001:db8:2020::1/128
设备 9
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:8::2/64 set interfaces lo0 unit 0 family inet address 10.9.9.9/32 set interfaces lo0 unit 0 family inet6 address 2001:db8:3030::1/128 set interfaces lo0 unit 0 family inet6 address 2001:db8:4040::1/128
设备 10
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:5::2/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:9::2/64 set interfaces lo0 unit 0 family inet address 10.10.10.10/32 set protocols ospf3 area 0.0.0.9 nssa set protocols ospf3 area 0.0.0.9 interface fe-1/2/0.0 set protocols ospf3 area 0.0.0.9 interface fe-1/2/1.0 set protocols ospf3 area 0.0.0.9 interface lo0.0 passive
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 3:
-
配置接口。
[edit interfaces] user@3# set fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:3::2/64 user@3# set fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:5::1/64 user@3# set lo0 unit 0 family inet address 10.3.3.3/32
-
在区域 0 的接口上启用 OSPFv3。
[edit protocols ospf3 area 0.0.0.0] user@3# set interface fe-1/2/0.0 user@3# set interface lo0.0 passive
-
在区域 9 的接口上启用 OSPFv3。
[edit protocols ospf3 area 0.0.0.9] user@3# set interface fe-1/2/1.0
-
配置 OSPFv3 NSSA。
该地区
nssa
所有路由设备上都需要该语句。[edit protocols ospf3 area 0.0.0.9] user@3# set nssa
-
在 ABR 上,向区域注入默认路由。
[edit protocols ospf3 area 0.0.0.9] user@3# set default-lsa default-metric 10
-
(可选)在 ABR 上,为默认路由指定外部指标类型。
[edit protocols ospf3 area 0.0.0.9] user@3# set nssa default-lsa metric-type 1
-
(可选)在 ABR 上,指定 Type 7 LSA 的泛洪。
[edit protocols ospf3 area 0.0.0.9] user@3# set nssa default-lsa type-7
-
在 ABR 上,限制汇总 LSA 进入区域。
[edit protocols ospf3 area 0.0.0.9] user@3# set nssa no-summaries
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 5:
-
配置接口。
[edit interfaces] user@5# set fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:6::2/64 user@5# set fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:7::1/64 user@5# set lo0 unit 0 family inet address 10.5.5.5/32
-
在位于第 3 区域的接口上启用 OSPFv3。
[edit protocols ospf3 area 0.0.0.3] user@5# set interface fe-1/2/0.0 user@5# set interface lo0.0 passive
-
配置支持与客户路由连接的静态路由。
[edit routing-options rib inet6.0 static] user@5# set route 1010::1/128 next-hop 2001:db8:9009:7::2 user@5# set route 2020::1/128 next-hop 2001:db8:9009:7::2
-
配置路由策略以重新分配静态路由。
[edit policy-options policy-statement static-to-ospf term 1] user@5# set from protocol static user@5# set then accept
-
将路由策略应用于 OSPFv3 实例。
[edit protocols ospf3] user@5# set export static-to-ospf
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 7:
-
配置接口。
[edit interfaces] user@7# set fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:5::2/64 user@7# set fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:7::1/64 user@7# set lo0 unit 0 family inet address 10.7.7.7/32
-
在区域 9 的接口上启用 OSPFv3。
[edit protocols ospf3 area 0.0.0.9] user@7# set interface fe-1/2/0.0 user@7# set interface lo0.0 passive
-
配置 OSPFv3 NSSA。
该地区
nssa
所有路由设备上都需要该语句。[edit protocols ospf3 area 0.0.0.9] user@7# set nssa
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 8:
-
配置接口。
[edit interfaces] user@8# set fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:7::2/64 user@8# set lo0 unit 0 family inet address 10.8.8.8/32
-
配置两个环路接口地址以模拟客户路由。
[edit interfaces lo0 unit 0 family inet6] user@8# set address 2001:db8:1010::1/128 user@8# set address 2001:db8:2020::1/128
结果
在配置模式下,输入 show interfaces
、 show protocols
、 show policy-options
和 show routing-options
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
设备 3
user@3# show interfaces
fe-1/2/0 {
unit 0 {
family inet6 {
address 2001:db8:9009:3::2/64;
}
}
}
fe-1/2/1 {
unit 0 {
family inet6 {
address 2001:db8:9009:5::1/64;
}
}
}
lo0 {
unit 0 {
family inet {
address 10.3.3.3/32;
}
}
}
}
user@3# show protocols
ospf3 {
area 0.0.0.0 {
interface fe-1/2/0.0;
interface lo0.0 {
passive;
}
}
area 0.0.0.9 {
nssa {
default-lsa {
default-metric 10;
metric-type 1;
type-7;
}
no-summaries;
}
interface fe-1/2/1.0;
}
}
设备 5
user@5# show interfaces
fe-1/2/0 {
unit 0 {
family inet6 {
address 2001:db8:9009:6::2/64;
}
}
}
fe-1/2/1 {
unit 0 {
family inet6 {
address 2001:db8:9009:7::1/64;
}
}
}
lo0 {
unit 0 {
family inet {
address 10.5.5.5/32;
}
}
}
user@5# show protocols
ospf3 {
export static-to-ospf;
area 0.0.0.3 {
interface fe-1/2/0.0;
interface lo0.0 {
passive;
}
}
}
user@5# show policy-options
policy-statement static-to-ospf {
term 1 {
from protocol static;
then accept;
}
}
user@5# show routing-options
rib inet6.0 {
static {
route 2001:db8:1010::1/128 next-hop 2001:db8:9009:7::2;
route 2001:db8:2020::1/128 next-hop 2001:db8:9009:7::2;
}
}
设备 7
user@7# show interfaces
fe-1/2/0 {
unit 0{
family inet6 {
address 2001:db8:9009:5::2/64;
}
}
}
lo0 {
unit 0 {
family inet {
address 10.7.7.7/32;
}
}
}
user@7# show protocols
ospf3 {
area 0.0.0.9 {
nssa;
interface fe-1/2/0.0;
interface lo0.0 {
passive;
}
}
}
设备 8
user@8# show interfaces
fe-1/2/0 {
unit 0 {
family inet6 {
address 2001:db8:9009:7::2/64;
}
}
}
lo0 {
unit 0 {
family inet {
address 10.8.8.8/32;
}
family inet6 {
address 2001:db8:1010::1/128;
address 2001:db8:2020::1/128;
}
}
}
完成设备配置后,请从配置模式进入 commit
。
验证
确认配置工作正常。
验证 OSPFv3 区域的类型
目的
验证 OSPFv3 区域是否为 NSSA 区域。确认输出是否显示为 Stub NSSA
存根类型。
行动
在设备 3、设备 7 和设备 10 的操作模式下,输入 show ospf3 overview
命令。
user@3> show ospf3 overview Instance: master Router ID: 10.3.3.3 Route table index: 36 Area border router, AS boundary router, NSSA router LSA refresh time: 50 minutes Area: 0.0.0.0 Stub type: Not Stub Area border routers: 2, AS boundary routers: 0 Neighbors Up (in full state): 1 Area: 0.0.0.9 Stub type: Stub NSSA, Stub cost: 10 Area border routers: 0, AS boundary routers: 1 Neighbors Up (in full state): 1 Topology: default (ID 0) Prefix export count: 0 Full SPF runs: 22 SPF delay: 0.200000 sec, SPF holddown: 5 sec, SPF rapid runs: 3 Backup SPF: Not Needed
user@7> show ospf3 overview Instance: master Router ID: 10.7.7.7 Route table index: 44 AS boundary router, NSSA router LSA refresh time: 50 minutes Area: 0.0.0.9 Stub type: Stub NSSA Area border routers: 1, AS boundary routers: 1 Neighbors Up (in full state): 1 Topology: default (ID 0) Prefix export count: 2 Full SPF runs: 11 SPF delay: 0.200000 sec, SPF holddown: 5 sec, SPF rapid runs: 3 Backup SPF: Not Needed
user@10> show ospf3 overview Instance: master Router ID: 10.10.10.10 Route table index: 55 NSSA router LSA refresh time: 50 minutes Area: 0.0.0.9 Stub type: Stub NSSA Area border routers: 1, AS boundary routers: 2 Neighbors Up (in full state): 2 Topology: default (ID 0) Prefix export count: 0 Full SPF runs: 6 SPF delay: 0.200000 sec, SPF holddown: 5 sec, SPF rapid runs: 3 Backup SPF: Not Needed
意义
在设备 3 上,区域 0 的剩余类型为 Not Stub
。区域 9 的剩余部分类型为 Stub NSSA
。剩余项默认指标为 10。
在设备 7 和设备 10 上,区域 9 的剩余类型为 Stub NSSA
。
验证 OSPFv3 剩余区域中的路由
目的
请确保路由表中存在预期的路由。
行动
在设备 7 和设备 3 的操作模式下,输入 show route
命令。
user@7> show route inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.7.7.7/32 *[Direct/0] 3d 03:00:23 > via lo0.0 inet6.0: 12 destinations, 14 routes (12 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both ::/0 *[OSPF3/150] 01:01:31, metric 12, tag 0 > via fe-1/2/1.0 2001:db8:3030::1/128 *[Static/5] 01:01:43 > to 9009:8::2 via fe-1/2/0.0 2001:db8:4040::1/128 *[Static/5] 01:01:43 > to 9009:8::2 via fe-1/2/0.0 2001:db8:9009:5::/64 *[OSPF3/10] 01:01:33, metric 2 > via fe-1/2/1.0 2001:db8:9009:8::/64 *[Direct/0] 01:01:43 > via fe-1/2/0.0 2001:db8:9009:8::1/128 *[Local/0] 01:02:01 Local via fe-1/2/0.0 2001:db8:9009:9::/64 *[Direct/0] 01:01:45 > via fe-1/2/1.0 [OSPF3/10] 01:01:44, metric 1 > via fe-1/2/1.0 2001:db8:9009:9::1/128 *[Local/0] 01:02:01 Local via fe-1/2/1.0 fe80::/64 *[Direct/0] 01:01:45 > via fe-1/2/1.0 [Direct/0] 01:01:43 > via fe-1/2/0.0 fe80::2a0:a514:0:f4c/128 *[Local/0] 01:02:01 Local via fe-1/2/0.0 fe80::2a0:a514:0:114c/128 *[Local/0] 01:02:01 Local via fe-1/2/1.0 ff02::5/128 *[OSPF3/10] 3d 03:01:25, metric 1 MultiRecv
user@10> show route inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.10.10.10/32 *[Direct/0] 01:01:59 > via lo0.0 inet6.0: 11 destinations, 14 routes (11 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both ::/0 *[OSPF3/150] 01:01:35, metric 11, tag 0 > via fe-1/2/0.0 2001:db8:3030::1/128 *[OSPF3/150] 01:01:35, metric 0, tag 0 > via fe-1/2/1.0 2001:db8:4040::1/128 *[OSPF3/150] 01:01:35, metric 0, tag 0 > via fe-1/2/1.0 2001:db8:9009:5::/64 *[Direct/0] 01:01:50 > via fe-1/2/0.0 [OSPF3/10] 01:01:50, metric 1 > via fe-1/2/0.0 2001:db8:9009:5::2/128 *[Local/0] 01:01:50 Local via fe-1/2/0.0 2001:db8:9009:9::/64 *[Direct/0] 01:01:50 > via fe-1/2/1.0 [OSPF3/10] 01:01:40, metric 1 > via fe-1/2/1.0 2001:db8:9009:9::2/128 *[Local/0] 01:01:50 Local via fe-1/2/1.0 fe80::/64 *[Direct/0] 01:01:50 > via fe-1/2/0.0 [Direct/0] 01:01:50 > via fe-1/2/1.0 fe80::2a0:a514:0:c4c/128 *[Local/0] 01:01:50 Local via fe-1/2/0.0 fe80::2a0:a514:0:124c/128 *[Local/0] 01:01:50 Local via fe-1/2/1.0 ff02::5/128 *[OSPF3/10] 01:02:16, metric 1 MultiRecv
user@3> show route inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.3.3.3/32 *[Direct/0] 3d 03:03:10 > via lo0.0 inet6.0: 15 destinations, 18 routes (15 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 2001:db8:1010::1/128 *[OSPF3/150] 01:04:21, metric 0, tag 0 > via fe-1/2/0.0 2001:db8:2020::1/128 *[OSPF3/150] 01:04:21, metric 0, tag 0 > via fe-1/2/0.0 2001:db8:3030::1/128 *[OSPF3/150] 01:03:57, metric 0, tag 0 > via fe-1/2/1.0 2001:db8:4040::1/128 *[OSPF3/150] 01:03:57, metric 0, tag 0 > via fe-1/2/1.0 2001:db8:9009:1::/64 *[OSPF3/10] 3d 03:02:06, metric 2 > via fe-1/2/0.0 2001:db8:9009:3::/64 *[Direct/0] 3d 03:02:55 > via fe-1/2/0.0 [OSPF3/10] 3d 03:02:54, metric 1 > via fe-1/2/0.0 2001:db8:9009:3::2/128 *[Local/0] 3d 03:02:55 Local via fe-1/2/0.02001:db8:9009:5::/64 *[Direct/0] 01:04:09 > via fe-1/2/1.0 [OSPF3/10] 01:04:09, metric 1 > via fe-1/2/1.0 2001:db8:9009:5::1/128 *[Local/0] 3d 03:02:54 Local via fe-1/2/1.0 2001:db8:9009:6::/64 *[OSPF3/10] 3d 02:19:14, metric 3 > via fe-1/2/0.0 2001:db8:9009:9::/64 *[OSPF3/10] 01:04:02, metric 2 > via fe-1/2/1.0 fe80::/64 *[Direct/0] 3d 03:02:55 > via fe-1/2/0.0 [Direct/0] 01:04:09 > via fe-1/2/1.0 fe80::2a0:a514:0:84c/128 *[Local/0] 3d 03:02:55 Local via fe-1/2/0.0 fe80::2a0:a514:0:b4c/128 *[Local/0] 3d 03:02:54 Local via fe-1/2/1.0 ff02::5/128 *[OSPF3/10] 3d 03:03:50, metric 1 MultiRecv
意义
在设备 7 上,由于 default-metric
ABR 设备 3 上的语句,已学习默认路由。否则,设备 7 的路由表中的唯一 OSPFv3 路由是区域 9 的本地路由和所有 SPF 链路状态路由器(也称为 AllSPF 路由器)的 OSPFv3 组播地址 ff02::5/128。
设备 10 具有由设备 3 注入的默认路由,以及由设备 7 注入的 OSPF 外部路由。
设备 7 和设备 10 都没有由设备 5 注入到 OSPFv3 中的外部客户路由。
在设备 3 上,已学习所有 OSPFv3 路由,包括外部客户路由 2001:db8:1010::1/128 和 2001:db8:2020::1/128。
验证 LSA 类型
目的
验证区域内的 LSA 类型。
行动
在设备 7 的操作模式下,输入 show ospf3 database nssa detail
命令。
user@7> show ospf3 database nssa detail Area 0.0.0.9 Type ID Adv Rtr Seq Age Cksum Len NSSA 0.0.0.1 10.3.3.3 0x8000002a 1462 0xf406 28 Prefix ::/0 Prefix-options 0x0, Metric 10, Type 1, NSSA *0.0.0.1 10.7.7.7 0x80000003 1625 0x88df 60 Prefix 2001:db8:3030::1/128 Prefix-options 0x8, Metric 0, Type 2, Fwd addr 2001:db8:9009:9::1, NSSA *0.0.0.2 10.7.7.7 0x80000003 1025 0xef57 60 Prefix 2001:db8:4040::1/128 Prefix-options 0x8, Metric 0, Type 2, Fwd addr 2001:db8:9009:9::1,
意义
在设备 7 上,NSSA LSA 是从设备 3 学习的第 1 类外部默认路由,也是到客户 1 网络的第 2 类外部静态路由。
了解“非存根”区域过滤
您可能需要将 7 类 LSA 导出到非剩余区域 (NSSA)。当自治系统边界路由器 (ASBR) 也是附加了 NSSA 的区域边界路由器 (ABR),则默认情况下,Type 7 LSA 会导出到 NSSA 中。
此外,当 ASBR(也称为 ABR)连接到多个 NSSA 时,默认情况下,单独的 Type 7 LSA 会导出到每个 NSSA 中。在路由重新分配期间,此路由设备会同时生成 5 类 LSA 和 7 类 LSA。因此,为避免同一路由被重新分配两次(从 5 类 LSA 和 7 类 LSA),可以通过在路由设备上包括 no-nssa-abr
语句来禁用将 7 类 LSA 导出到 NSSA。
示例:使用过滤配置 OSPFv3 非存根区域
此示例说明当无需将外部路由作为 7 类链路状态播发 (LSA) 注入 NSSA 时,如何配置 OSPFv3 非剩余区域 (NSSA)。
要求
配置此示例之前,不需要除设备初始化之外的特殊配置。
概述
当自治系统边界路由器 (ASBR) 也是 NSSA 区域边界路由器 (ABR) 时,路由设备将生成 Type 5 和 Type 7 LSA。您可以使用语句阻止路由器为 NSSA 创建 7 类 LSA no-nssa-abr
。
在此示例中,设备 5 和设备 3 位于客户网络中。设备 4 和设备 2 均将客户路由注入 OSPFv3。区域 1 是 NSSA。由于设备 4 既是 NSSA ABR,又是 ASBR,它会同时生成 7 类和 5 类 LSA,并将 7 类 LSA 注入到区域 1 中,将 5 型 LSA 注入到区域 0 中。要阻止将类型 7 LSA 注入到区域 1 中, no-nssa-abr
设备 4 配置中包含的语句。
CLI 快速配置 显示了 图 12 中所有设备的配置。第 #d28e95__d28e440 节介绍了设备 4 上的步骤。
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层级的 [edit]
CLI 中。
设备 1
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:6::2/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:5::1/64 set interfaces lo0 unit 0 family inet address 0.1.1.1/32 set protocols ospf3 area 0.0.0.1 nssa set protocols ospf3 area 0.0.0.1 interface fe-1/2/0.0 set protocols ospf3 area 0.0.0.1 interface fe-1/2/1.0 set protocols ospf3 area 0.0.0.1 interface lo0.0 passive
设备 2
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:5::2/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:4::1/64 set interfaces lo0 unit 0 family inet address 10.2.2.2/32 set protocols ospf3 export static2-to-ospf set protocols ospf3 area 0.0.0.1 nssa set protocols ospf3 area 0.0.0.1 interface fe-1/2/0.0 set protocols ospf3 area 0.0.0.1 interface lo0.0 passive set policy-options policy-statement static2-to-ospf term 1 from protocol static set policy-options policy-statement static2-to-ospf term 1 then accept set routing-options rib inet6.0 static route 3030::1/128 next-hop 2001:db8:9009:4::2 set routing-options rib inet6.0 static route 4040::1/128 next-hop 2001:db8:9009:4::2
设备 3
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:4::2/64 set interfaces lo0 unit 0 family inet address 10.3.3.3/32 set interfaces lo0 unit 0 family inet6 address 2001:db8:3030::1/128 set interfaces lo0 unit 0 family inet6 address 2001:db8:4040::1/128 set routing-options rib inet6.0 static route ::/0 next-hop 2001:db8:9009:4::1
设备 4
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:1::2/64 set interfaces fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:6::1/64 set interfaces fe-1/2/2 unit 0 family inet6 address 2001:db8:9009:3::1/64 set interfaces lo0 unit 0 family inet address 10.4.4.4/32 set protocols ospf3 export static-to-ospf set protocols ospf3 no-nssa-abr set protocols ospf3 area 0.0.0.0 interface fe-1/2/2.0 set protocols ospf3 area 0.0.0.0 interface lo0.0 passive set protocols ospf3 area 0.0.0.1 nssa default-lsa default-metric 10 set protocols ospf3 area 0.0.0.1 nssa default-lsa metric-type 1 set protocols ospf3 area 0.0.0.1 nssa default-lsa type-7 set protocols ospf3 area 0.0.0.1 nssa no-summaries set protocols ospf3 area 0.0.0.1 interface fe-1/2/1.0 set policy-options policy-statement static-to-ospf term 1 from protocol static set policy-options policy-statement static-to-ospf term 1 then accept set routing-options rib inet6.0 static route 2001:db8:1010::1/128 next-hop 2001:db8:9009:1::1 set routing-options rib inet6.0 static route 2001:db8:2020::1/128 next-hop 2001:db8:9009:1::1
设备 5
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:1::1/64 set interfaces lo0 unit 0 family inet address 10.5.5.5/32 set interfaces lo0 unit 0 family inet6 address 2001:db8:1010::1/128 set interfaces lo0 unit 0 family inet6 address 2001:db8:2020::1/128 set routing-options rib inet6.0 static route ::/0 next-hop 2001:db8:9009:1::2
设备 6
set interfaces fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:3::2/64 set interfaces lo0 unit 0 family inet address 10.6.6.6/32 set protocols ospf3 area 0.0.0.0 interface fe-1/2/0.0 set protocols ospf3 area 0.0.0.0 interface lo0.0 passive
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的“在配置模式下使用 CLI 编辑器”。
要配置设备 4:
-
配置接口。
[edit interfaces] user@4# set fe-1/2/0 unit 0 family inet6 address 2001:db8:9009:1::2/64 user@4# set fe-1/2/1 unit 0 family inet6 address 2001:db8:9009:6::1/64 user@4# set fe-1/2/2 unit 0 family inet6 address 2001:db8:9009:3::1/64 user@4# set lo0 unit 0 family inet address 10.4.4.4/32
-
在区域 0 的接口上启用 OSPFv3。
[edit protocols ospf3 area 0.0.0.0] user@4# set interface fe-1/2/2.0 user@4# set interface lo0.0 passive
-
在区域 1 的接口上启用 OSPFv3。
[edit protocols ospf3 area 0.0.0.1] user@4# set interface fe-1/2/1.0
-
配置 OSPFv3 NSSA。
该地区
nssa
所有路由设备上都需要该语句。[edit protocols ospf3 area 0.0.0.1] user@4# set nssa
-
在 ABR 上,向区域注入默认路由。
[edit protocols ospf3 area 0.0.0.1] user@4# set nssa default-lsa default-metric 10
-
(可选)在 ABR 上,为默认路由指定外部指标类型。
[edit protocols ospf3 area 0.0.0.1] user@4# set nssa default-lsa metric-type 1
-
(可选)在 ABR 上,指定 Type 7 LSA 的泛洪。
[edit protocols ospf3 area 0.0.0.1] user@4# set nssa default-lsa type-7
-
在 ABR 上,限制汇总 LSA 进入区域。
[edit protocols ospf3 area 0.0.0.1] user@4# set nssa no-summaries
-
禁用将 Type 7 LSA 导出到 NSSA。
如果 AS 边界路由器也是附加了 NSSA 区域的 ABR,则此设置会很有用。
[edit protocols ospf3] user@4# set no-nssa-abr
-
配置到客户网络的静态路由。
[edit routing-options rib inet6.0 static] user@4# set route 2001:db8:1010::1/128 next-hop 2001:db8:9009:1::1 user@4# set route 2001:db8:2020::1/128 next-hop 2001:db8:9009:1::1
-
配置策略,将静态路由注入 OSPFv3。
[edit policy-options policy-statement static-to-ospf term 1] user@4# set from protocol static user@4# set then accept
-
将策略应用于 OSPFv3。
[edit protocols ospf3] user@4# set export static-to-ospf
结果
在配置模式下,输入 show interfaces
、 show protocols
、 show policy-options
和 show routing-options
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
设备 4
user@4# show interfaces
fe-1/2/0 {
unit 0 {
family inet6 {
address 2001:db8:9009:1::2/64;
}
}
unit 0 {
family inet6 {
address 2001:db8:9009:6::1/64;
}
}
unit 0 {
family inet6 {
address 2001:db8:9009:3::1/64;
}
}
}
lo0 {
unit 0 {
family inet {
address 10.4.4.4/32;
}
}
}
user@4# show protocols
ospf3 {
export static-to-ospf;
no-nssa-abr;
area 0.0.0.0 {
interface fe-1/2/2.0;
interface lo0.0 {
passive;
}
}
area 0.0.0.1 {
nssa {
default-lsa {
default-metric 10;
metric-type 1;
type-7;
}
no-summaries;
}
interface fe-1/2/1.0;
}
}
user@4# show policy-options
policy-statement static-to-ospf {
term 1 {
from protocol static;
then accept;
}
}
user@4# show routing-options
rib inet6.0 {
static {
route 2001:db8:1010::1/128 next-hop 2001:db8:9009:1::1;
route 2001:db8:2020::1/128 next-hop 2001:db8:9009:1::1;
}
}
完成设备配置后,请从配置模式进入 commit
。
验证
确认配置工作正常。
验证 OSPFv3 剩余区域中的路由
目的
请确保路由表中存在预期的路由。
行动
在设备 1 和设备 6 的操作模式下,输入 show route
命令。
user@1> show route inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 0.1.1.1/32 *[Direct/0] 03:25:44 > via lo0.0 inet6.0: 11 destinations, 14 routes (11 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both ::/0 *[OSPF3/150] 01:52:58, metric 11, tag 0 > via fe-1/2/0.0 2001:db8:3030::1/128 *[OSPF3/150] 02:44:02, metric 0, tag 0 > via fe-1/2/1.0 2001:db8:4040::1/128 *[OSPF3/150] 02:44:02, metric 0, tag 0 > via fe-1/2/1.0 2001:db8:9009:5::/64 *[Direct/0] 03:25:34 > via fe-1/2/1.0 [OSPF3/10] 03:25:24, metric 1 > via fe-1/2/1.0 2001:db8:9009:5::1/128 *[Local/0] 03:25:34 Local via fe-1/2/1.0 2001:db8:9009:6::/64 *[Direct/0] 03:25:34 > via fe-1/2/0.0 [OSPF3/10] 03:25:34, metric 1 > via fe-1/2/0.0 2001:db8:9009:6::2/128 *[Local/0] 03:25:34 Local via fe-1/2/0.0 fe80::/64 *[Direct/0] 03:25:34 > via fe-1/2/0.0 [Direct/0] 03:25:34 > via fe-1/2/1.0 fe80::2a0:a514:0:44c/128 *[Local/0] 03:25:34 Local via fe-1/2/0.0 fe80::2a0:a514:0:74c/128 *[Local/0] 03:25:34 Local via fe-1/2/1.0 ff02::5/128 *[OSPF3/10] 03:27:00, metric 1 MultiRecv
user@6> show route inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.6.6.6/32 *[Direct/0] 03:26:57 > via lo0.0 inet6.0: 11 destinations, 12 routes (11 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 2001:db8:1010::1/128 *[OSPF3/150] 03:16:59, metric 0, tag 0 > via fe-1/2/0.0 2001:db8:2020::1/128 *[OSPF3/150] 03:16:59, metric 0, tag 0 > via fe-1/2/0.0 2001:db8:3030::1/128 *[OSPF3/150] 02:44:34, metric 0, tag 0 > via fe-1/2/0.0 2001:db8:4040::1/128 *[OSPF3/150] 02:44:34, metric 0, tag 0 > via fe-1/2/0.0 2001:db8:9009:3::/64 *[Direct/0] 03:26:29 > via fe-1/2/0.0 [OSPF3/10] 03:26:29, metric 1 > via fe-1/2/0.0 2001:db8:9009:3::2/128 *[Local/0] 03:26:29 Local via fe-1/2/0.0 2001:db8:9009:5::/64 *[OSPF3/10] 02:44:34, metric 3 > via fe-1/2/0.0 2001:db8:9009:6::/64 *[OSPF3/10] 03:16:59, metric 2 > via fe-1/2/0.0 fe80::/64 *[Direct/0] 03:26:29 > via fe-1/2/0.0 fe80::2a0:a514:0:64c/128 *[Local/0] 03:26:29 Local via fe-1/2/0.0 ff02::5/128 *[OSPF3/10] 03:27:37, metric 1 MultiRecv
意义
在设备 1 上,由于 default-metric
ABR(设备 4)上的语句,已学习默认路由 (:/0)。客户已从设备 2 学习路由 2001:db8:3030::1 和 2001:db8:4040::1。2001:db8:1010::1 和 2001:db8:2020::1 路由已被抑制。不需要它们,因为可以使用默认路由来代替。
在第 0 区域的设备 6 上,已学习所有客户路由。
验证 LSA 类型
目的
验证区域内的 LSA 类型。
行动
在设备 1 的操作模式下,输入 show ospf3 database nssa detail
命令。
user@4> show ospf3 database nssa detail Area 0.0.0.1 Type ID Adv Rtr Seq Age Cksum Len NSSA 0.0.0.1 10.2.2.2 0x80000004 2063 0xceaf 60 Prefix 3030::1/128 Prefix-options 0x8, Metric 0, Type 2, Fwd addr 2001:db8:9009:5::2, NSSA 0.0.0.2 10.2.2.2 0x80000004 1463 0x3627 60 Prefix 4040::1/128 Prefix-options 0x8, Metric 0, Type 2, Fwd addr 2001:db8:9009:5::2, NSSA *0.0.0.1 10.4.4.4 0x80000003 35 0x25f8 28 Prefix ::/0 Prefix-options 0x0, Metric 10, Type 1,
意义
设备 4 不会为客户路由 2001:db8:1010:1/128 和 2001:db8:2020::1/128 发送 7 类 (NSSA) LSA。如果要删除或停用 no-nssa-abr
语句,然后重新运行 show ospf3 database nssa detail
命令,您将看到设备 4 正在为 2001:db8:1010::1/128 和 2001:db8:2020::1/128 发送 7 类 LSA。
了解非连续区域的 OSPF 虚拟链路
OSPF 要求自治系统 (AS) 中的所有区域都必须物理连接到主干区域(区域 0)。在具有多个区域的大型网络中,所有区域和骨干区域之间的直接连接在物理上困难或不可能,您可以配置虚拟链路来连接不连续区域。虚拟链路使用包含两个或多个区域边界路由器 (ABER) 的传输区域,将网络流量从一个相邻区域传递到另一个区域。传输区域必须具有完整的路由信息,并且不能是剩余区域。例如, 图 13 显示了通过连接到两个区域的不连续区域与主干区域之间的虚拟链路。
在 图 13 所示的拓扑中,在区域 0.0.0.3 和通过 0.0.0.2 的主干区域之间建立了虚拟链路。虚拟链路传输区域 0.0.0.2。所有发往其他地区的出站流量都会通过区域 0.0.0.2 路由到主干区域,然后路由到相应的 ABR。发往区域 0.0.0.3 的所有入站流量都会路由到主干区域,然后通过区域 0.0.0.2 路由。
示例:配置 OSPF 虚拟链路以连接非连续区域
此示例说明如何配置 OSPF 虚拟链路以连接不连续区域。
要求
开始之前:
配置设备接口。请参阅 路由设备的 Junos OS 网络接口库。
配置单区域 OSPF 网络。请参阅 示例:配置单区域 OSPF 网络。
配置多区域 OSPF 网络。请参阅 示例:配置多区域 OSPF 网络。
概述
如果主干网络上的任何路由设备未物理连接到主干网,则必须在该路由设备与主干网之间建立虚拟连接,以连接不连续区域。
要配置通过某个区域的 OSPF 虚拟链路,请在虚拟链路两端指定路由设备的路由器 ID(IP 地址)。这些路由设备必须是区域边界路由器 (ABR),其中一个是物理连接到主干网的。您不能通过剩余区域配置虚拟链路。您还必须指定虚拟链路通过的传输区域编号(也称为传输区域)。将这些设置应用于作为虚拟链路一部分的 ABER 上的主干区域(由 0.0.0.0 区域定义)。
在此示例中,设备 R1 和设备 R2 是虚拟链路两端的路由设备,设备 R1 以物理方式连接到主干网,如图 14 所示。您可以配置以下虚拟链路设置:
邻接方 ID — 指定虚拟链路另一端的路由设备的 IP 地址。在此示例中,设备 R1 的路由器 ID 为 192.0.2.5,设备 R2 的路由器 ID 为 192.0.2.3。
传输区域 — 指定虚拟链路通过的区域标识符。在此示例中,区域 0.0.0.3 未连接到主干网,因此在区域 0.0.0.3 和通过 0.0.0.2 的骨干区域之间配置虚拟链路会话。区域 0.0.0.2 是中转区域。
拓扑
配置
CLI 快速配置
要在本地路由设备(设备 R1)上快速配置 OSPF 虚拟链路,请将以下命令复制粘贴到 CLI 中。
注意:您必须配置属于虚拟链路的这两个路由设备,并为每个路由设备上指定适用的邻接方 ID。
[edit] set routing-options router-id 192.0.2.5 set protocols ospf area 0.0.0.0 virtual-link neighbor-id 192.0.2.3 transit-area 0.0.0.2
要快速配置远程路由设备(设备 R2)上的 OSPF 虚拟链路,请将以下命令复制粘贴到 CLI 中。
[edit] set routing-options router-id 192.0.2.3 set protocols ospf area 0.0.0.0 virtual-link neighbor-id 192.0.2.5 transit-area 0.0.0.2
程序
逐步过程
要配置本地路由设备(设备 R1)上的 OSPF 虚拟链路,
配置路由器 ID。
[edit] user@R1# set routing-options router-id 192.0.2.5
进入 OSPF 配置模式并指定 OSPF 区域 0.0.0.0。
注意:对于 OSPFv3 虚拟链路,请将语句
ospf3
[edit protocols]
包含在层次结构级别。[edit] user@R1# edit protocols ospf area 0.0.0.0
配置 OSPF 虚拟链路并指定传输区域 0.0.0.2。 此路由设备必须是物理连接到主干的 ABR。
[edit protocols ospf area 0.0.0.0] user@R1# set virtual-link neighbor-id 192.0.2.3 transit-area 0.0.0.2
完成设备配置后,提交配置。
[edit protocols ospf area 0.0.0.0] user@R1# commit
逐步过程
要配置远程 ABR 上的 OSPF 虚拟链路(设备 R2,链路另一端的路由设备):
配置路由器 ID。
[edit] user@R2# set routing-options router-id 192.0.2.3
进入 OSPF 配置模式并指定 OSPF 区域 0.0.0.0。
注意:对于 OSPFv3 虚拟链路,请将语句
ospf3
[edit protocols]
包含在层次结构级别。[edit] user@R2# edit protocols ospf area 0.0.0.0
在远程 ABR 上配置 OSPF 虚拟链路,并指定传输区域 0.0.0.2。 此路由设备未物理连接到主干网。
[edit protocols ospf area 0.0.0.0] user@R2# set virtual-link neighbor-id 192.0.2.5 transit-area 0.0.0.2
完成设备配置后,提交配置。
[edit protocols ospf area 0.0.0.0] user@R2# commit
结果
输入 show routing 选项 和命令, show protocols ospf
以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
本地路由设备(设备 R1)上的配置:
user@R1#: show routing-options
router-id 192.0.2.5;
user@R1# show protocols ospf area 0.0.0.0 { virtual-link neighbor-id 192.0.2.3 transit-area 0.0.0.2; }
远程 ABR(设备 R2)上的配置:
user@R2#: show routing-options
router-id 192.0.2.3;
user@R2# show protocols ospf area 0.0.0.0 { virtual-link neighbor-id 192.0.2.5 transit-area 0.0.0.2; }
要确认 OSPFv3 配置,请输入 show protocols ospf3
命令。
验证
确认配置工作正常。
验证链路状态数据库中的条目
目的
验证 OSPFv2 或 OSPFv3 链路状态数据库中的条目是否显示。OSPFv2 输出中的路由器字段显示 LSA 信息,包括链路类型。如果配置为虚拟链路,则类型为虚拟。对于每个路由器链路,OSPFv3 输出中的 Type 字段将显示接口类型。如果配置为虚拟链路,则类型为虚拟。
行动
在操作模式下,输入 show ospf database detail
OSPFv2 的命令,然后为 OSPFv3 输入 show ospf3 database detail
命令。
示例:配置 OSPFv3 虚拟链路
此示例说明如何配置 OSPF 版本 3 (OSPFv3) 与主干区域(区域 0)没有直接邻接的部分区域。当一个区域缺少与区域 0 的邻接时,需要一个虚拟链路来通过非主干区域连接到主干网。配置虚拟链路的区域(称为传输区域)必须具有完整的路由信息。中继区域不能是剩余区域。
要求
配置此示例之前,不需要除设备初始化之外的特殊配置。
概述
图 15 显示了此示例中使用的拓扑。
设备 0、设备 1、设备 2 和设备 3 连接到 OSPFv3 主干区域 0。设备 2、设备 3 和设备 4 跨区域 1 相互连接。区域 2 位于设备 4 和设备 5 之间。由于设备 5 与 Area 0 没有直接邻接,因此需要设备 3 和设备 4 之间的区域 1 之间有一个虚拟链路。同样,由于设备 0 和设备 1 有两个独立的区域 0 主干网部分,您需要在设备 2 和设备 3 之间跨区域 1 配置第二个虚拟链路。
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层级的 [edit]
CLI 中。
设备 0
set logical-systems 0 interfaces so-0/3/2 unit 0 family inet6 address 9009:1::1/64 set logical-systems 0 interfaces lo0 unit 0 family inet address 192.168.0.1/32 set logical-systems 0 interfaces lo0 unit 0 family inet6 address feee::10:255:71:4/128 set logical-systems 0 protocols ospf3 area 0.0.0.0 interface so-0/3/2.0 set logical-systems 0 protocols ospf3 area 0.0.0.0 interface lo0.0 passive set logical-systems 0 routing-options router-id 192.168.0.1
设备 1
set logical-systems 1 interfaces at-2/0/0 atm-options vpi 0 set logical-systems 1 interfaces at-2/0/0 unit 0 family inet6 address 9009:2::1/64 set logical-systems 1 interfaces at-2/0/0 unit 0 vci 0.77 set logical-systems 1 interfaces lo0 unit 0 family inet address 192.168.1.1/32 set logical-systems 1 interfaces lo0 unit 0 family inet6 address feee::10:255:71:1/128 set logical-systems 1 protocols ospf3 area 0.0.0.0 interface at-2/0/0.0 set logical-systems 1 protocols ospf3 area 0.0.0.0 interface lo0.0 passive set logical-systems 1 routing-options router-id 192.168.1.1
设备 2
set logical-systems 2 interfaces so-0/2/0 unit 0 family inet6 address 9009:3::1/64 set logical-systems 2 interfaces fe-1/1/0 unit 0 family inet6 address 9009:4::1/64 set logical-systems 2 interfaces at-0/3/1 atm-options vpi 0 maximum-vcs 1200 set logical-systems 2 interfaces at-0/3/1 unit 0 family inet6 address 9009:2::2/64 set logical-systems 2 interfaces at-0/3/1 unit 0 vci 0.77 set logical-systems 2 interfaces lo0 unit 0 family inet address 192.168.2.1/32 set logical-systems 2 interfaces lo0 unit 0 family inet6 address feee::10:255:71:11/128 set logical-systems 2 protocols ospf3 area 0.0.0.0 virtual-link neighbor-id 192.168.3.1 transit-area 0.0.0.1 set logical-systems 2 protocols ospf3 area 0.0.0.0 interface at-0/3/1.0 set logical-systems 2 protocols ospf3 area 0.0.0.1 interface fe-1/1/0.0 set logical-systems 2 protocols ospf3 area 0.0.0.1 interface so-0/2/0.0 set logical-systems 2 protocols ospf3 area 0.0.0.1 interface lo0.0 passive set logical-systems 2 routing-options router-id 192.168.2.1
设备 3
set logical-systems 3 interfaces so-0/3/2 unit 0 family inet6 address 9009:1::2/64 set logical-systems 3 interfaces t1-0/2/1 unit 0 family inet6 address 9009:5::1/64 set logical-systems 3 interfaces so-0/3/0 unit 0 family inet6 address 9009:3::2/64 set logical-systems 3 interfaces lo0 unit 0 family inet address 192.168.3.1/32 set logical-systems 3 interfaces lo0 unit 0 family inet6 address feee::10:255:71:3/128 set logical-systems 3 protocols ospf3 area 0.0.0.1 interface so-0/3/0.0 set logical-systems 3 protocols ospf3 area 0.0.0.1 interface t1-0/2/1.0 set logical-systems 3 protocols ospf3 area 0.0.0.1 interface lo0.0 passive set logical-systems 3 protocols ospf3 area 0.0.0.0 virtual-link neighbor-id 192.168.2.1 transit-area 0.0.0.1 set logical-systems 3 protocols ospf3 area 0.0.0.0 virtual-link neighbor-id 192.168.4.1 transit-area 0.0.0.1 set logical-systems 3 protocols ospf3 area 0.0.0.0 interface so-0/3/2.0 set logical-systems 3 routing-options router-id 192.168.3.1
设备 4
set logical-systems 4 interfaces t1-0/2/1 unit 0 family inet6 address 9009:5::2/64 set logical-systems 4 interfaces fe-0/0/0 unit 0 family inet6 address 9009:6::1/64 set logical-systems 4 interfaces fe-1/1/0 unit 0 family inet6 address 9009:4::2/64 set logical-systems 4 interfaces lo0 unit 0 family inet address 192.168.4.1/32 set logical-systems 4 interfaces lo0 unit 0 family inet6 address feee::10:255:71:5/128 set logical-systems 4 protocols ospf3 area 0.0.0.1 interface fe-1/1/0.0 set logical-systems 4 protocols ospf3 area 0.0.0.1 interface t1-0/2/1.0 set logical-systems 4 protocols ospf3 area 0.0.0.1 interface lo0.0 passive set logical-systems 4 protocols ospf3 area 0.0.0.2 interface fe-0/0/0.0 set logical-systems 4 protocols ospf3 area 0.0.0.0 virtual-link neighbor-id 192.168.3.1 transit-area 0.0.0.1 set logical-systems 4 routing-options router-id 192.168.4.1
设备 5
set logical-systems 5 interfaces fe-0/0/0 unit 0 family inet6 address 9009:6::2/64 set logical-systems 5 interfaces lo0 unit 0 family inet address 192.168.5.1/32 set logical-systems 5 interfaces lo0 unit 0 family inet6 address feee::10:255:71:6/128 set logical-systems 5 protocols ospf3 area 0.0.0.2 interface fe-0/0/0.0 set logical-systems 5 protocols ospf3 area 0.0.0.2 interface lo0.0 passive set logical-systems 5 routing-options router-id 192.168.5.1
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 0:
配置接口。
[edit interfaces] user@0# set so-0/3/2 unit 0 family inet6 address 9009:1::1/64 user@0# set lo0 unit 0 family inet address 192.168.0.1/32 user@0# set lo0 unit 0 family inet6 address feee::10:255:71:4/128
将这些接口添加到 OSPFv3 进程的第 0 区域。
[edit protocols ospf3 area 0.0.0.0] user@0# set interface so-0/3/2.0 user@0# set interface lo0.0 passive
配置路由器 ID。
[edit routing-options] user@0# set router-id 192.168.0.1
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 1:
配置接口。
[edit interfaces] user@1# set at-2/0/0 atm-options vpi 0 user@1# set at-2/0/0 unit 0 family inet6 address 9009:2::1/64 user@1# set at-2/0/0 unit 0 vci 0.77 user@1# set lo0 unit 0 family inet address 192.168.1.1/32 user@1# set lo0 unit 0 family inet6 address feee::10:255:71:1/128
将这些接口添加到 OSPFv3 进程的第 0 区域。
[edit protocols ospf3 area 0.0.0.0] user@1# set interface at-2/0/0.0 user@1# set interface lo0.0 passive
配置路由器 ID。
[edit routing-options] user@1# set router-id 192.168.1.1
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 2:
配置接口。
[edit interfaces] user@2# set so-0/2/0 unit 0 family inet6 address 9009:3::1/64 user@2# set fe-1/1/0 unit 0 family inet6 address 9009:4::1/64 user@2# set at-0/3/1 atm-options vpi 0 maximum-vcs 1200 user@2# set at-0/3/1 unit 0 family inet6 address 9009:2::2/64 user@2# set at-0/3/1 unit 0 vci 0.77 user@2# set lo0 unit 0 family inet address 192.168.2.1/32 user@2# set lo0 unit 0 family inet6 address feee::10:255:71:11/128
将连接到设备 1、设备 3 和设备 4 的接口添加到 OSPFv3 进程中。
[edit protocols ospf3 area 0.0.0.0] user@2# set interface at-0/3/1.0 [edit protocols ospf3 area 0.0.0.1] user@2# set interface fe-1/1/0.0 user@2# set interface so-0/2/0.0 user@2# set interface lo0.0 passive
配置到设备 3 到区域 1 的虚拟链路,以便设备 1 可以访问设备 0 上 OSPF 骨干的不连续部分。
[edit protocols ospf3 area 0.0.0.0] user@2# set virtual-link neighbor-id 192.168.3.1 transit-area 0.0.0.1
配置路由器 ID。
[edit routing-options] user@2# set router-id 192.168.2.1
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 3:
配置接口。
[edit interfaces] user@3# set so-0/3/2 unit 0 family inet6 address 9009:1::2/64 user@3# set t1-0/2/1 unit 0 family inet6 address 9009:5::1/64 user@3# set so-0/3/0 unit 0 family inet6 address 9009:3::2/64 user@3# set lo0 unit 0 family inet address 192.168.3.1/32 user@3# set lo0 unit 0 family inet6 address feee::10:255:71:3/128
对于设备 3 上的 OSPFv3 进程,将连接到设备 2 和设备 4 的接口配置为区域 1,将连接到设备 0 的接口配置为区域 0。
[edit protocols ospf3 area 0.0.0.1] user@3# set interface so-0/3/0.0 user@3# set interface t1-0/2/1.0 user@3# set interface lo0.0 passive [edit protocols ospf3 area 0.0.0.0] user@3# set interface so-0/3/2.0
通过 Area 1 配置两个虚拟链路—一个连接到设备 2,另一个连接到设备 4。
虚拟链路允许设备 5 访问 OSPF 主干网,并连接位于设备 0 和设备 1 的 Area 0 的不连续部分。
[edit protocols ospf3 area 0.0.0.0] user@3# set virtual-link neighbor-id 192.168.2.1 transit-area 0.0.0.1 user@3# set virtual-link neighbor-id 192.168.4.1 transit-area 0.0.0.1
配置路由器 ID。
[edit routing-options] user@3# set router-id 192.168.3.1
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 4:
配置接口。
[edit interfaces] user@4# set t1-0/2/1 unit 0 family inet6 address 9009:5::2/64 user@4# set fe-0/0/0 unit 0 family inet6 address 9009:6::1/64 user@4# set fe-1/1/0 unit 0 family inet6 address 9009:4::2/64 user@4# set lo0 unit 0 family inet address 192.168.4.1/32 user@4# set lo0 unit 0 family inet6 address feee::10:255:71:5/128
在设备 4 上,将连接的接口添加到 OSPFv3 进程中。
[edit protocols ospf3 area 0.0.0.1] user@4# set interface fe-1/1/0.0 user@4# set interface t1-0/2/1.0 user@4# set interface lo0.0 passive [edit protocols ospf3 area 0.0.0.2] user@4# set interface fe-0/0/0.0
配置到设备 3 到区域 1 的虚拟链路,以便设备 5 可以访问 OSPF 主干网。
[edit protocols ospf3 area 0.0.0.0] user@4# set virtual-link neighbor-id 192.168.3.1 transit-area 0.0.0.1
配置路由器 ID。
[edit routing-options] user@4# set router-id 192.168.4.1
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 5:
配置接口。
[edit interfaces] user@5# set fe-0/0/0 unit 0 family inet6 address 9009:6::2/64 user@5# set lo0 unit 0 family inet address 192.168.5.1/32 user@5# set lo0 unit 0 family inet6 address feee::10:255:71:6/128
将接口添加到 OSPFv3 进程中。
[edit protocols ospf3 area 0.0.0.2] user@5# set interface fe-0/0/0.0 user@5# set interface lo0.0 passive
配置路由器 ID。
[edit routing-options] user@5# set router-id 192.168.5.1
结果
在配置模式下,输入 、 show protocols
和show routing-options
命令,show interfaces
以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
设备 0
user@0#show interfaces
so-0/3/2 { unit 0 { family inet6 { address 9009:1::1/64; } } } lo0 { unit 0 { family inet { address 192.168.0.1/32; } family inet6 { address feee::10:255:71:4/128; } } } user@0#show protocols
ospf3 { area 0.0.0.0 { interface so-0/3/2.0; interface lo0.0 { passive; } } } user@0#show routing-options
router-id 192.168.0.1;
设备 1
user@1#show interfaces
at-2/0/0 { atm-options { vpi 0; } unit 0 { family inet6 { address 9009:2::1/64; } } } lo0 { unit 0 { family inet { address 192.168.1.1/32; } family inet6 { address feee::10:255:71:1/128; } } } user@1#show protocols
ospf3 { area 0.0.0.0 { interface at-2/0/0.0; interface lo0.0 { passive; } } } user@1#show routing-options
router-id 192.168.1.1;
设备 2
user@2#show interfaces
so-0/2/0 { unit 0 { family inet6 { address 9009:3::1/64; } } } fe-1/1/0 { unit 0 { family inet6 { address 9009:4::1/64; } } } at-0/3/1 { atm-options { vpi 0 { maximum-vcs 1200; } } unit 0 { vci 0.77; family inet6 { address 9009:2::2/64; } } } lo0 { unit 0 { family inet { address 192.168.2.1/32; } family inet6 { address feee::10:255:71:11/128; } } } user@2#show protocols
ospf3 { area 0.0.0.0 { virtual-link neighbor-id 192.168.3.1 transit-area 0.0.0.1; interface at-0/3/1.0; } area 0.0.0.1 { interface fe-1/1/0.0; interface so-0/2/0.0; interface lo0.0 { passive; } } } user@2#show routing-options
router-id 192.168.2.1;
设备 3
user@3#show interfaces
so-0/3/2 { unit 0 { family inet6 { address 9009:1::2/64; } } } t1-0/2/1 { unit 0 { family inet6 { address 9009:5::1/64; } } } so-0/3/0 { unit 0 { family inet6 { address 9009:3::2/64; } } } lo0 { unit 0 { family inet { address 192.168.3.1/32; } family inet6 { address feee::10:255:71:3/128; } } } user@3#show protocols
ospf3 { area 0.0.0.1 { interface so-0/3/0.0; interface t1-0/2/1.0; interface lo0.0 { passive; } } area 0.0.0.0 { virtual-link neighbor-id 192.168.2.1 transit-area 0.0.0.1; virtual-link neighbor-id 192.168.4.1 transit-area 0.0.0.1; interface so-0/3/2.0; } } user@3#show routing-options
router-id 192.168.3.1;
设备 4
user@4#show interfaces
t1-0/2/1 { unit 0 { family inet6 { address 9009:5::2/64; } } } fe-0/0/0 { unit 0 { family inet6 { address 9009:6::1/64; } } } fe-1/1/0 { unit 0 { family inet6 { address 9009:4::2/64; } } } lo0 { unit 0 { family inet { address 192.168.4.1/32; } family inet6 { address feee::10:255:71:5/128; } } } user@4#show protocols
ospf3 { area 0.0.0.1 { interface fe-1/1/0.0; interface t1-0/2/1.0; interface lo0.0 { passive; } } area 0.0.0.2 { interface fe-0/0/0.0; } area 0.0.0.0 { virtual-link neighbor-id 192.168.3.1 transit-area 0.0.0.1; } } user@4#show routing-options
router-id 192.168.4.1;
设备 5
user@5#show interfaces
fe-0/0/0 { unit 0 { family inet6 { address 9009:6::2/64; } } } lo0 { unit 0 { family inet { address 192.168.5.1/32; } family inet6 { address feee::10:255:71:6/128; } } } user@5#show protocols
ospf3 { area 0.0.0.2 { interface fe-0/0/0.0; interface lo0.0 { passive; } } } user@5#show routing-options
router-id 192.168.5.1;
完成设备配置后,请从配置模式进入 commit
。
验证
确认配置工作正常。
要验证适用于 IPv6 的 OSPFv3 是否正确运行,请使用以下命令:
show ospf3 interface
show ospf3 neighbor
show ospf3 database
show ospf3 route
show interfaces terse
(查看分配给 lo0 接口的 IPv6 链路本地地址)注意:要查看前缀信息,您必须将 泛型 选项与命令一起
show ospf3 database
使用。
设备 0 状态
目的
验证设备 0 是否已学习预期的路由并建立预期的邻接邻。
在 show ospf3 database
示例输出中,星标表示“最佳”路由。这些路由是安装在路由表中的路由。
行动
user@0> show ospf3 database Area 0.0.0.0 Type ID Adv Rtr Seq Age Cksum Len Router *0.0.0.0 192.168.0.1 0x8000008f 1858 0x6e21 40 Router 0.0.0.0 192.168.1.1 0x8000008f 1861 0x523d 40 Router 0.0.0.0 192.168.2.1 0x80000090 1918 0x9e62 56 Router 0.0.0.0 192.168.3.1 0x80000092 2104 0x46d 72 Router 0.0.0.0 192.168.4.1 0x8000008f 2012 0x7016 40 InterArPfx 0.0.0.1 192.168.2.1 0x80000093 231 0xfc5c 36 InterArPfx 0.0.0.2 192.168.2.1 0x80000093 43 0x156 36 InterArPfx 0.0.0.3 192.168.2.1 0x80000092 1731 0x31a4 44 InterArPfx 0.0.0.4 192.168.2.1 0x8000008f 2668 0xc51f 44 InterArPfx 0.0.0.5 192.168.2.1 0x80000091 2856 0xfa59 36 InterArPfx 0.0.0.6 192.168.2.1 0x80000090 2481 0xe3fb 44 InterArPfx 0.0.0.1 192.168.3.1 0x80000093 417 0xf562 36 InterArPfx 0.0.0.2 192.168.3.1 0x80000093 2854 0x84d 36 InterArPfx 0.0.0.3 192.168.3.1 0x80000092 1729 0xbc26 44 InterArPfx 0.0.0.4 192.168.3.1 0x8000008f 2667 0x2ca9 44 InterArPfx 0.0.0.5 192.168.3.1 0x80000091 229 0xe56e 36 InterArPfx 0.0.0.6 192.168.3.1 0x8000008f 2292 0xde01 44 InterArPfx 0.0.0.2 192.168.4.1 0x80000092 794 0xf461 36 InterArPfx 0.0.0.3 192.168.4.1 0x80000092 606 0xf85b 36 InterArPfx 0.0.0.4 192.168.4.1 0x80000091 419 0xfe54 36 InterArPfx 0.0.0.5 192.168.4.1 0x80000090 1825 0xd906 44 InterArPfx 0.0.0.6 192.168.4.1 0x8000008f 2669 0xf1eb 44 InterArPfx 0.0.0.7 192.168.4.1 0x80000091 981 0xbc95 36 InterArPfx 0.0.0.8 192.168.4.1 0x8000008f 2481 0x8f4f 44 InterArPfx 0.0.0.9 192.168.4.1 0x80000090 2294 0xf0dd 44 InterArPfx 0.0.0.10 192.168.4.1 0x8000008f 231 0xac5a 44 IntraArPfx *0.0.0.1 192.168.0.1 0x80000094 2858 0xbf9f 64 IntraArPfx 0.0.0.1 192.168.1.1 0x80000095 2861 0x87d6 64 IntraArPfx 0.0.0.1 192.168.2.1 0x80000096 793 0xc7bd 64 IntraArPfx 0.0.0.1 192.168.3.1 0x80000097 1167 0x93f0 64 interface so-0/3/2.0 Area 0.0.0.0 Type ID Adv Rtr Seq Age Cksum Len Link *0.0.0.2 192.168.0.1 0x80000091 858 0xc0c7 56 Link 0.0.0.8 192.168.3.1 0x80000091 1354 0x84f9 56 user@0> show ospf3 interface Interface State Area DR ID BDR ID Nbrs lo0.0 DRother 0.0.0.0 0.0.0.0 0.0.0.0 0 so-0/3/2.0 PtToPt 0.0.0.0 0.0.0.0 0.0.0.0 1 user@0> show ospf3 neighbor ID Interface State Pri Dead 192.168.3.1 so-0/3/2.0 Full 128 33 Neighbor-address fe80::2a0:a514:0:24c user@0> show ospf3 route Prefix Path Route NH Metric Type Type Type 192.168.1.1 Intra Router IP 3 NH-interface so-0/3/2.0 192.168.2.1 Intra Area BR IP 2 NH-interface so-0/3/2.0 192.168.3.1 Intra Area BR IP 1 NH-interface so-0/3/2.0 192.168.4.1 Intra Area BR IP 2 NH-interface so-0/3/2.0 9009:1::/64 Intra Network IP 1 NH-interface so-0/3/2.0 9009:1::2/128 Intra Network IP 1 NH-interface so-0/3/2.0 9009:2::/64 Intra Network IP 3 NH-interface so-0/3/2.0 9009:2::2/128 Intra Network IP 2 NH-interface so-0/3/2.0 9009:3::/64 Inter Network IP 2 NH-interface so-0/3/2.0 9009:4::/64 Inter Network IP 3 NH-interface so-0/3/2.0 9009:5::/64 Inter Network IP 2 NH-interface so-0/3/2.0 9009:6::/64 Inter Network IP 3 NH-interface so-0/3/2.0 9009:6::1/128 Inter Network IP 2 NH-interface so-0/3/2.0 feee::10:255:71:1/128 Intra Network IP 3 NH-interface so-0/3/2.0 feee::10:255:71:3/128 Inter Network IP 1 NH-interface so-0/3/2.0 feee::10:255:71:4/128 Intra Network IP 0 NH-interface lo0.0 feee::10:255:71:5/128 Inter Network IP 2 NH-interface so-0/3/2.0 feee::10:255:71:6/128 Inter Network IP 3 NH-interface so-0/3/2.0 feee::10:255:71:11/128 Inter Network IP 2 NH-interface so-0/3/2.0 user@0> show interfaces terse Interface Admin Link Proto Local Remote lt-1/2/0 so-0/3/2.0 up up inet6 9009:1::1/64 fe80::2a0:a514:0:14c/64 lo0 lo0.0 up up inet 192.168.0.1 --> 0/0 inet6 fe80::2a0:a50f:fc56:14c feee::10:255:71:4 ...
设备 1 状态
目的
验证设备 1 是否已学习预期的路由并建立预期的邻接邻。
行动
user@1> show ospf3 interface Interface State Area DR ID BDR ID Nbrs lo0.0 DRother 0.0.0.0 0.0.0.0 0.0.0.0 0 at-2/0/0.0 PtToPt 0.0.0.0 0.0.0.0 0.0.0.0 1 user@1> show ospf3 neighbor ID Interface State Pri Dead 192.168.2.1 at-2/0/0.0 Full 128 37 Neighbor-address fe80::2a0:a514:0:c4c user@1> show ospf3 database Area 0.0.0.0 Type ID Adv Rtr Seq Age Cksum Len Router 0.0.0.0 192.168.0.1 0x8000008f 2334 0x6e21 40 Router *0.0.0.0 192.168.1.1 0x8000008f 2331 0x523d 40 Router 0.0.0.0 192.168.2.1 0x80000090 2390 0x9e62 56 Router 0.0.0.0 192.168.3.1 0x80000092 2578 0x46d 72 Router 0.0.0.0 192.168.4.1 0x8000008f 2486 0x7016 40 InterArPfx 0.0.0.1 192.168.2.1 0x80000093 703 0xfc5c 36 InterArPfx 0.0.0.2 192.168.2.1 0x80000093 515 0x156 36 InterArPfx 0.0.0.3 192.168.2.1 0x80000092 2203 0x31a4 44 InterArPfx 0.0.0.4 192.168.2.1 0x80000090 140 0xc320 44 InterArPfx 0.0.0.5 192.168.2.1 0x80000092 328 0xf85a 36 InterArPfx 0.0.0.6 192.168.2.1 0x80000090 2953 0xe3fb 44 InterArPfx 0.0.0.1 192.168.3.1 0x80000093 891 0xf562 36 InterArPfx 0.0.0.2 192.168.3.1 0x80000094 328 0x64e 36 InterArPfx 0.0.0.3 192.168.3.1 0x80000092 2203 0xbc26 44 InterArPfx 0.0.0.4 192.168.3.1 0x80000090 141 0x2aaa 44 InterArPfx 0.0.0.5 192.168.3.1 0x80000091 703 0xe56e 36 InterArPfx 0.0.0.6 192.168.3.1 0x8000008f 2766 0xde01 44 InterArPfx 0.0.0.2 192.168.4.1 0x80000092 1268 0xf461 36 InterArPfx 0.0.0.3 192.168.4.1 0x80000092 1080 0xf85b 36 InterArPfx 0.0.0.4 192.168.4.1 0x80000091 893 0xfe54 36 InterArPfx 0.0.0.5 192.168.4.1 0x80000090 2299 0xd906 44 InterArPfx 0.0.0.6 192.168.4.1 0x80000090 143 0xefec 44 InterArPfx 0.0.0.7 192.168.4.1 0x80000091 1455 0xbc95 36 InterArPfx 0.0.0.8 192.168.4.1 0x8000008f 2955 0x8f4f 44 InterArPfx 0.0.0.9 192.168.4.1 0x80000090 2768 0xf0dd 44 InterArPfx 0.0.0.10 192.168.4.1 0x8000008f 705 0xac5a 44 IntraArPfx 0.0.0.1 192.168.0.1 0x80000095 334 0xbda0 64 IntraArPfx *0.0.0.1 192.168.1.1 0x80000096 331 0x85d7 64 IntraArPfx 0.0.0.1 192.168.2.1 0x80000096 1265 0xc7bd 64 IntraArPfx 0.0.0.1 192.168.3.1 0x80000097 1641 0x93f0 64 interface at-2/0/0.0 Area 0.0.0.0 Type ID Adv Rtr Seq Age Cksum Len Link *0.0.0.2 192.168.1.1 0x80000091 1331 0xaecd 56 Link 0.0.0.8 192.168.2.1 0x80000091 1453 0x80f3 56 user@1> show ospf3 route Prefix Path Route NH Metric Type Type Type 192.168.0.1 Intra Router IP 3 NH-interface at-2/0/0.0 192.168.2.1 Intra Area BR IP 1 NH-interface at-2/0/0.0 192.168.3.1 Intra Area BR IP 2 NH-interface at-2/0/0.0 192.168.4.1 Intra Area BR IP 3 NH-interface at-2/0/0.0 9009:1::/64 Intra Network IP 3 NH-interface at-2/0/0.0 9009:1::2/128 Intra Network IP 2 NH-interface at-2/0/0.0 9009:2::/64 Intra Network IP 1 NH-interface at-2/0/0.0 9009:2::2/128 Intra Network IP 1 NH-interface at-2/0/0.0 9009:3::/64 Inter Network IP 2 NH-interface at-2/0/0.0 9009:4::/64 Inter Network IP 2 NH-interface at-2/0/0.0 9009:5::/64 Inter Network IP 3 NH-interface at-2/0/0.0 9009:6::/64 Inter Network IP 4 NH-interface at-2/0/0.0 9009:6::1/128 Inter Network IP 3 NH-interface at-2/0/0.0 feee::10:255:71:1/128 Intra Network IP 0 NH-interface lo0.0 feee::10:255:71:3/128 Inter Network IP 2 NH-interface at-2/0/0.0 feee::10:255:71:4/128 Intra Network IP 3 NH-interface at-2/0/0.0 feee::10:255:71:5/128 Inter Network IP 2 NH-interface at-2/0/0.0 feee::10:255:71:6/128 Inter Network IP 4 NH-interface at-2/0/0.0 feee::10:255:71:11/128 Inter Network IP 1 NH-interface at-2/0/0.0 user@1> show interfaces terse Interface Admin Link Proto Local Remote lt-1/2/0 at-2/0/0.0 up up inet6 9009:2::1/64 fe80::2a0:a514:0:b4c/64 lo0 lo0.0 up up inet 192.168.1.1 --> 0/0 inet6 fe80::2a0:a50f:fc56:14c feee::10:255:71:1 ...
设备 2 状态
目的
验证设备 2 是否已学习预期的路由并建立预期的邻接邻。
行动
user@2> show ospf3 interface Interface State Area DR ID BDR ID Nbrs at-0/3/1.0 PtToPt 0.0.0.0 0.0.0.0 0.0.0.0 1 vl-192.168.3.1 PtToPt 0.0.0.0 0.0.0.0 0.0.0.0 1 lo0.0 DRother 0.0.0.1 0.0.0.0 0.0.0.0 0 so-0/2/0.0 PtToPt 0.0.0.1 0.0.0.0 0.0.0.0 1 fe-1/1/0.0 PtToPt 0.0.0.1 0.0.0.0 0.0.0.0 1 user@2> show ospf3 neighbor ID Interface State Pri Dead 192.168.1.1 at-0/3/1.0 Full 128 32 Neighbor-address fe80::2a0:a514:0:b4c 192.168.3.1 vl-192.168.3.1 Full 0 35 Neighbor-address 9009:3::2 192.168.3.1 so-0/2/0.0 Full 128 38 Neighbor-address fe80::2a0:a514:0:74c 192.168.4.1 fe-1/1/0.0 Full 128 30 Neighbor-address fe80::2a0:a514:0:a4c user@2> show ospf3 database Area 0.0.0.0 Type ID Adv Rtr Seq Age Cksum Len Router 0.0.0.0 192.168.0.1 0x8000008f 2771 0x6e21 40 Router 0.0.0.0 192.168.1.1 0x8000008f 2770 0x523d 40 Router *0.0.0.0 192.168.2.1 0x80000090 2827 0x9e62 56 Router 0.0.0.0 192.168.3.1 0x80000093 15 0x26e 72 Router 0.0.0.0 192.168.4.1 0x8000008f 2923 0x7016 40 InterArPfx *0.0.0.1 192.168.2.1 0x80000093 1140 0xfc5c 36 InterArPfx *0.0.0.2 192.168.2.1 0x80000093 952 0x156 36 InterArPfx *0.0.0.3 192.168.2.1 0x80000092 2640 0x31a4 44 InterArPfx *0.0.0.4 192.168.2.1 0x80000090 577 0xc320 44 InterArPfx *0.0.0.5 192.168.2.1 0x80000092 765 0xf85a 36 InterArPfx *0.0.0.6 192.168.2.1 0x80000091 390 0xe1fc 44 InterArPfx 0.0.0.1 192.168.3.1 0x80000093 1328 0xf562 36 InterArPfx 0.0.0.2 192.168.3.1 0x80000094 765 0x64e 36 InterArPfx 0.0.0.3 192.168.3.1 0x80000092 2640 0xbc26 44 InterArPfx 0.0.0.4 192.168.3.1 0x80000090 578 0x2aaa 44 InterArPfx 0.0.0.5 192.168.3.1 0x80000091 1140 0xe56e 36 InterArPfx 0.0.0.6 192.168.3.1 0x80000090 203 0xdc02 44 InterArPfx 0.0.0.2 192.168.4.1 0x80000092 1705 0xf461 36 InterArPfx 0.0.0.3 192.168.4.1 0x80000092 1517 0xf85b 36 InterArPfx 0.0.0.4 192.168.4.1 0x80000091 1330 0xfe54 36 InterArPfx 0.0.0.5 192.168.4.1 0x80000090 2736 0xd906 44 InterArPfx 0.0.0.6 192.168.4.1 0x80000090 580 0xefec 44 InterArPfx 0.0.0.7 192.168.4.1 0x80000091 1892 0xbc95 36 InterArPfx 0.0.0.8 192.168.4.1 0x80000090 392 0x8d50 44 InterArPfx 0.0.0.9 192.168.4.1 0x80000091 205 0xeede 44 InterArPfx 0.0.0.10 192.168.4.1 0x8000008f 1142 0xac5a 44 IntraArPfx 0.0.0.1 192.168.0.1 0x80000095 771 0xbda0 64 IntraArPfx 0.0.0.1 192.168.1.1 0x80000096 770 0x85d7 64 IntraArPfx *0.0.0.1 192.168.2.1 0x80000096 1702 0xc7bd 64 IntraArPfx 0.0.0.1 192.168.3.1 0x80000097 2078 0x93f0 64 Area 0.0.0.1 Type ID Adv Rtr Seq Age Cksum Len Router *0.0.0.0 192.168.2.1 0x80000093 15 0x8f62 56 Router 0.0.0.0 192.168.3.1 0x80000093 2828 0x39b7 56 Router 0.0.0.0 192.168.4.1 0x80000092 16 0x8768 56 InterArPfx *0.0.0.1 192.168.2.1 0x80000094 1515 0xec6c 36 InterArPfx *0.0.0.3 192.168.2.1 0x80000090 202 0x994d 44 InterArPfx *0.0.0.4 192.168.2.1 0x8000008f 1327 0xd839 44 InterArPfx 0.0.0.1 192.168.3.1 0x80000094 1703 0xd781 36 InterArPfx 0.0.0.3 192.168.3.1 0x80000090 390 0xe002 44 InterArPfx 0.0.0.4 192.168.3.1 0x8000008f 1515 0xc34e 44 InterArPfx 0.0.0.1 192.168.4.1 0x80000093 1422 0x193b 36 InterArPfx 0.0.0.3 192.168.4.1 0x80000090 672 0xed1 44 InterArPfx 0.0.0.4 192.168.4.1 0x8000008f 1235 0xe824 44 IntraArPfx *0.0.0.1 192.168.2.1 0x80000097 2265 0x6bf1 76 IntraArPfx 0.0.0.1 192.168.3.1 0x80000099 953 0xadb8 76 IntraArPfx 0.0.0.1 192.168.4.1 0x80000098 2079 0x3c26 76 interface at-0/3/1.0 Area 0.0.0.0 Type ID Adv Rtr Seq Age Cksum Len Link 0.0.0.2 192.168.1.1 0x80000091 1770 0xaecd 56 Link *0.0.0.8 192.168.2.1 0x80000091 1890 0x80f3 56 interface so-0/2/0.0 Area 0.0.0.1 Type ID Adv Rtr Seq Age Cksum Len Link *0.0.0.6 192.168.2.1 0x80000092 2452 0x6018 56 Link 0.0.0.7 192.168.3.1 0x80000092 2453 0x3a3d 56 interface fe-1/1/0.0 Area 0.0.0.1 Type ID Adv Rtr Seq Age Cksum Len Link *0.0.0.7 192.168.2.1 0x80000092 2077 0x8de7 56 Link 0.0.0.8 192.168.4.1 0x80000091 2172 0x8ce5 56 user@2> show ospf3 route Prefix Path Route NH Metric Type Type Type 192.168.0.1 Intra Router IP 2 NH-interface (null), NH-addr feee::10:255:71:3 192.168.1.1 Intra Router IP 1 NH-interface at-0/3/1.0 192.168.3.1 Intra Area BR IP 1 NH-interface so-0/2/0.0 192.168.4.1 Intra Area BR IP 1 NH-interface fe-1/1/0.0 9009:1::/64 Intra Network IP 2 NH-interface so-0/2/0.0 9009:1::2/128 Intra Network IP 1 NH-interface so-0/2/0.0 9009:2::/64 Intra Network IP 1 NH-interface at-0/3/1.0 9009:2::2/128 Intra Network IP 0 NH-interface at-0/3/1.0 9009:3::/64 Intra Network IP 1 NH-interface so-0/2/0.0 9009:4::/64 Intra Network IP 1 NH-interface fe-1/1/0.0 9009:5::/64 Intra Network IP 2 NH-interface so-0/2/0.0 NH-interface fe-1/1/0.0 9009:6::/64 Inter Network IP 2 NH-interface fe-1/1/0.0 9009:6::1/128 Inter Network IP 1 NH-interface fe-1/1/0.0 feee::10:255:71:1/128 Intra Network IP 1 NH-interface at-0/3/1.0 feee::10:255:71:3/128 Intra Network IP 1 NH-interface so-0/2/0.0 feee::10:255:71:4/128 Intra Network IP 2 NH-interface so-0/2/0.0 feee::10:255:71:5/128 Intra Network IP 1 NH-interface fe-1/1/0.0 feee::10:255:71:6/128 Inter Network IP 2 NH-interface fe-1/1/0.0 feee::10:255:71:11/128 Intra Network IP 0 NH-interface lo0.0 user@2> show interfaces terse Interface Admin Link Proto Local Remote lt-1/2/0 so-0/2/0.0 up up inet6 9009:3::1/64 fe80::2a0:a514:0:84c/64 fe-1/1/0.0 up up inet6 9009:4::1/64 fe80::2a0:a514:0:94c/64 at-0/3/1.0 up up inet6 9009:2::2/64 fe80::2a0:a514:0:c4c/64 lo0 lo0.0 up up inet 192.168.2.1 --> 0/0 inet6 fe80::2a0:a50f:fc56:14c feee::10:255:71:11 ...
设备 3 状态
目的
验证设备 3 是否已了解预期的路由并建立预期的邻接邻。
行动
user@3> show ospf3 interface Interface State Area DR ID BDR ID Nbrs so-0/3/2.0 PtToPt 0.0.0.0 0.0.0.0 0.0.0.0 1 vl-192.168.2.1 PtToPt 0.0.0.0 0.0.0.0 0.0.0.0 1 vl-192.168.4.1 PtToPt 0.0.0.0 0.0.0.0 0.0.0.0 1 lo0.0 DRother 0.0.0.1 0.0.0.0 0.0.0.0 0 t1-0/2/1.0 PtToPt 0.0.0.1 0.0.0.0 0.0.0.0 1 so-0/3/0.0 PtToPt 0.0.0.1 0.0.0.0 0.0.0.0 1 user@3> show ospf3 neighbor ID Interface State Pri Dead 192.168.0.1 so-0/3/2.0 Full 128 31 Neighbor-address fe80::2a0:a514:0:14c 192.168.2.1 vl-192.168.2.1 Full 0 33 Neighbor-address 9009:3::1 192.168.4.1 vl-192.168.4.1 Full 0 38 Neighbor-address 9009:5::2 192.168.4.1 t1-0/2/1.0 Full 128 35 Neighbor-address fe80::2a0:a514:0:44c 192.168.2.1 so-0/3/0.0 Full 128 37 Neighbor-address fe80::2a0:a514:0:84c user@3> show ospf3 database Area 0.0.0.0 Type ID Adv Rtr Seq Age Cksum Len Router 0.0.0.0 192.168.0.1 0x80000090 11 0x6c22 40 Router 0.0.0.0 192.168.1.1 0x80000090 12 0x503e 40 Router 0.0.0.0 192.168.2.1 0x80000091 69 0x9c63 56 Router *0.0.0.0 192.168.3.1 0x80000093 255 0x26e 72 Router 0.0.0.0 192.168.4.1 0x80000090 163 0x6e17 40 InterArPfx 0.0.0.1 192.168.2.1 0x80000093 1382 0xfc5c 36 InterArPfx 0.0.0.2 192.168.2.1 0x80000093 1194 0x156 36 InterArPfx 0.0.0.3 192.168.2.1 0x80000092 2882 0x31a4 44 InterArPfx 0.0.0.4 192.168.2.1 0x80000090 819 0xc320 44 InterArPfx 0.0.0.5 192.168.2.1 0x80000092 1007 0xf85a 36 InterArPfx 0.0.0.6 192.168.2.1 0x80000091 632 0xe1fc 44 InterArPfx *0.0.0.1 192.168.3.1 0x80000093 1568 0xf562 36 InterArPfx *0.0.0.2 192.168.3.1 0x80000094 1005 0x64e 36 InterArPfx *0.0.0.3 192.168.3.1 0x80000092 2880 0xbc26 44 InterArPfx *0.0.0.4 192.168.3.1 0x80000090 818 0x2aaa 44 InterArPfx *0.0.0.5 192.168.3.1 0x80000091 1380 0xe56e 36 InterArPfx *0.0.0.6 192.168.3.1 0x80000090 443 0xdc02 44 InterArPfx 0.0.0.2 192.168.4.1 0x80000092 1945 0xf461 36 InterArPfx 0.0.0.3 192.168.4.1 0x80000092 1757 0xf85b 36 InterArPfx 0.0.0.4 192.168.4.1 0x80000091 1570 0xfe54 36 InterArPfx 0.0.0.5 192.168.4.1 0x80000090 2976 0xd906 44 InterArPfx 0.0.0.6 192.168.4.1 0x80000090 820 0xefec 44 InterArPfx 0.0.0.7 192.168.4.1 0x80000091 2132 0xbc95 36 InterArPfx 0.0.0.8 192.168.4.1 0x80000090 632 0x8d50 44 InterArPfx 0.0.0.9 192.168.4.1 0x80000091 445 0xeede 44 InterArPfx 0.0.0.10 192.168.4.1 0x8000008f 1382 0xac5a 44 IntraArPfx 0.0.0.1 192.168.0.1 0x80000095 1011 0xbda0 64 IntraArPfx 0.0.0.1 192.168.1.1 0x80000096 1012 0x85d7 64 IntraArPfx 0.0.0.1 192.168.2.1 0x80000096 1944 0xc7bd 64 IntraArPfx *0.0.0.1 192.168.3.1 0x80000097 2318 0x93f0 64 Area 0.0.0.1 Type ID Adv Rtr Seq Age Cksum Len Router 0.0.0.0 192.168.2.1 0x80000093 257 0x8f62 56 Router *0.0.0.0 192.168.3.1 0x80000094 68 0x37b8 56 Router 0.0.0.0 192.168.4.1 0x80000092 257 0x8768 56 InterArPfx 0.0.0.1 192.168.2.1 0x80000094 1757 0xec6c 36 InterArPfx 0.0.0.3 192.168.2.1 0x80000090 444 0x994d 44 InterArPfx 0.0.0.4 192.168.2.1 0x8000008f 1569 0xd839 44 InterArPfx *0.0.0.1 192.168.3.1 0x80000094 1943 0xd781 36 InterArPfx *0.0.0.3 192.168.3.1 0x80000090 630 0xe002 44 InterArPfx *0.0.0.4 192.168.3.1 0x8000008f 1755 0xc34e 44 InterArPfx 0.0.0.1 192.168.4.1 0x80000093 1663 0x193b 36 InterArPfx 0.0.0.3 192.168.4.1 0x80000090 913 0xed1 44 InterArPfx 0.0.0.4 192.168.4.1 0x8000008f 1476 0xe824 44 IntraArPfx 0.0.0.1 192.168.2.1 0x80000097 2507 0x6bf1 76 IntraArPfx *0.0.0.1 192.168.3.1 0x80000099 1193 0xadb8 76 IntraArPfx 0.0.0.1 192.168.4.1 0x80000098 2320 0x3c26 76 interface so-0/3/2.0 Area 0.0.0.0 Type ID Adv Rtr Seq Age Cksum Len Link 0.0.0.2 192.168.0.1 0x80000091 2011 0xc0c7 56 Link *0.0.0.8 192.168.3.1 0x80000091 2505 0x84f9 56 interface t1-0/2/1.0 Area 0.0.0.1 Type ID Adv Rtr Seq Age Cksum Len Link *0.0.0.9 192.168.3.1 0x80000092 2130 0x1661 56 Link 0.0.0.7 192.168.4.1 0x80000092 2507 0x383f 56 interface so-0/3/0.0 Area 0.0.0.1 Type ID Adv Rtr Seq Age Cksum Len Link 0.0.0.6 192.168.2.1 0x80000092 2694 0x6018 56 Link *0.0.0.7 192.168.3.1 0x80000092 2693 0x3a3d 56 user@3> show ospf3 route Prefix Path Route NH Metric Type Type Type 192.168.0.1 Intra Router IP 1 NH-interface so-0/3/2.0 192.168.1.1 Intra Router IP 2 NH-interface (null), NH-addr feee::10:255:71:11 192.168.2.1 Intra Area BR IP 1 NH-interface so-0/3/0.0 192.168.4.1 Intra Area BR IP 1 NH-interface t1-0/2/1.0 9009:1::/64 Intra Network IP 1 NH-interface so-0/3/2.0 9009:1::2/128 Intra Network IP 0 NH-interface so-0/3/2.0 9009:2::/64 Intra Network IP 2 NH-interface so-0/3/0.0 9009:2::2/128 Intra Network IP 1 NH-interface so-0/3/0.0 9009:3::/64 Intra Network IP 1 NH-interface so-0/3/0.0 9009:4::/64 Intra Network IP 2 NH-interface so-0/3/0.0 NH-interface t1-0/2/1.0 9009:5::/64 Intra Network IP 1 NH-interface t1-0/2/1.0 9009:6::/64 Inter Network IP 2 NH-interface t1-0/2/1.0 9009:6::1/128 Inter Network IP 1 NH-interface t1-0/2/1.0 feee::10:255:71:1/128 Intra Network IP 2 NH-interface so-0/3/0.0 feee::10:255:71:3/128 Intra Network IP 0 NH-interface lo0.0 feee::10:255:71:4/128 Intra Network IP 1 NH-interface so-0/3/2.0 feee::10:255:71:5/128 Intra Network IP 1 NH-interface t1-0/2/1.0 feee::10:255:71:6/128 Inter Network IP 2 NH-interface t1-0/2/1.0 feee::10:255:71:11/128 Intra Network IP 1 NH-interface so-0/3/0.0 user@3> show interfaces terse Interface Admin Link Proto Local Remote lt-1/2/0 so-0/3/2.0 up up inet6 9009:1::2/64 fe80::2a0:a514:0:24c/64 t1-0/2/1.0 up up inet6 9009:5::1/64 fe80::2a0:a514:0:34c/64 so-0/3/0.0 up up inet6 9009:3::2/64 fe80::2a0:a514:0:74c/64 lo0 lo0.0 up up inet 192.168.3.1 --> 0/0 inet6 fe80::2a0:a50f:fc56:14c feee::10:255:71:3 ...
设备 4 状态
目的
验证设备 4 是否已学习预期的路由并建立预期的邻接邻。
行动
user@4> show ospf3 interface Interface State Area DR ID BDR ID Nbrs lo0.0 DRother 0.0.0.1 0.0.0.0 0.0.0.0 0 fe-1/1/0.0 PtToPt 0.0.0.1 0.0.0.0 0.0.0.0 1 t1-0/2/1.0 PtToPt 0.0.0.1 0.0.0.0 0.0.0.0 1 fe-0/0/0.0 PtToPt 0.0.0.2 0.0.0.0 0.0.0.0 1 vl-192.168.3.1 PtToPt 0.0.0.0 0.0.0.0 0.0.0.0 1 user@4> show ospf3 neighbor ID Interface State Pri Dead 192.168.2.1 fe-1/1/0.0 Full 128 35 Neighbor-address fe80::2a0:a514:0:94c 192.168.3.1 t1-0/2/1.0 Full 128 34 Neighbor-address fe80::2a0:a514:0:34c 192.168.5.1 fe-0/0/0.0 Full 128 39 Neighbor-address fe80::2a0:a514:0:64c 192.168.3.1 vl-192.168.3.1 Full 0 33 Neighbor-address 9009:5::1 user@4> show ospf3 database Area 0.0.0.0 Type ID Adv Rtr Seq Age Cksum Len Router 0.0.0.0 192.168.0.1 0x80000090 270 0x6c22 40 Router 0.0.0.0 192.168.1.1 0x80000090 271 0x503e 40 Router 0.0.0.0 192.168.2.1 0x80000091 328 0x9c63 56 Router 0.0.0.0 192.168.3.1 0x80000093 514 0x26e 72 Router *0.0.0.0 192.168.4.1 0x80000090 420 0x6e17 40 InterArPfx 0.0.0.1 192.168.2.1 0x80000093 1641 0xfc5c 36 InterArPfx 0.0.0.2 192.168.2.1 0x80000093 1453 0x156 36 InterArPfx 0.0.0.3 192.168.2.1 0x80000093 141 0x2fa5 44 InterArPfx 0.0.0.4 192.168.2.1 0x80000090 1078 0xc320 44 InterArPfx 0.0.0.5 192.168.2.1 0x80000092 1266 0xf85a 36 InterArPfx 0.0.0.6 192.168.2.1 0x80000091 891 0xe1fc 44 InterArPfx 0.0.0.1 192.168.3.1 0x80000093 1827 0xf562 36 InterArPfx 0.0.0.2 192.168.3.1 0x80000094 1264 0x64e 36 InterArPfx 0.0.0.3 192.168.3.1 0x80000093 139 0xba27 44 InterArPfx 0.0.0.4 192.168.3.1 0x80000090 1077 0x2aaa 44 InterArPfx 0.0.0.5 192.168.3.1 0x80000091 1639 0xe56e 36 InterArPfx 0.0.0.6 192.168.3.1 0x80000090 702 0xdc02 44 InterArPfx *0.0.0.2 192.168.4.1 0x80000092 2202 0xf461 36 InterArPfx *0.0.0.3 192.168.4.1 0x80000092 2014 0xf85b 36 InterArPfx *0.0.0.4 192.168.4.1 0x80000091 1827 0xfe54 36 InterArPfx *0.0.0.5 192.168.4.1 0x80000091 233 0xd707 44 InterArPfx *0.0.0.6 192.168.4.1 0x80000090 1077 0xefec 44 InterArPfx *0.0.0.7 192.168.4.1 0x80000091 2389 0xbc95 36 InterArPfx *0.0.0.8 192.168.4.1 0x80000090 889 0x8d50 44 InterArPfx *0.0.0.9 192.168.4.1 0x80000091 702 0xeede 44 InterArPfx *0.0.0.10 192.168.4.1 0x8000008f 1639 0xac5a 44 IntraArPfx 0.0.0.1 192.168.0.1 0x80000095 1270 0xbda0 64 IntraArPfx 0.0.0.1 192.168.1.1 0x80000096 1271 0x85d7 64 IntraArPfx 0.0.0.1 192.168.2.1 0x80000096 2203 0xc7bd 64 IntraArPfx 0.0.0.1 192.168.3.1 0x80000097 2577 0x93f0 64 Area 0.0.0.1 Type ID Adv Rtr Seq Age Cksum Len Router 0.0.0.0 192.168.2.1 0x80000093 515 0x8f62 56 Router 0.0.0.0 192.168.3.1 0x80000094 327 0x37b8 56 Router *0.0.0.0 192.168.4.1 0x80000092 514 0x8768 56 InterArPfx 0.0.0.1 192.168.2.1 0x80000094 2015 0xec6c 36 InterArPfx 0.0.0.3 192.168.2.1 0x80000090 702 0x994d 44 InterArPfx 0.0.0.4 192.168.2.1 0x8000008f 1827 0xd839 44 InterArPfx 0.0.0.1 192.168.3.1 0x80000094 2202 0xd781 36 InterArPfx 0.0.0.3 192.168.3.1 0x80000090 889 0xe002 44 InterArPfx 0.0.0.4 192.168.3.1 0x8000008f 2014 0xc34e 44 InterArPfx *0.0.0.1 192.168.4.1 0x80000093 1920 0x193b 36 InterArPfx *0.0.0.3 192.168.4.1 0x80000090 1170 0xed1 44 InterArPfx *0.0.0.4 192.168.4.1 0x8000008f 1733 0xe824 44 IntraArPfx 0.0.0.1 192.168.2.1 0x80000097 2765 0x6bf1 76 IntraArPfx 0.0.0.1 192.168.3.1 0x80000099 1452 0xadb8 76 IntraArPfx *0.0.0.1 192.168.4.1 0x80000098 2577 0x3c26 76 Area 0.0.0.2 Type ID Adv Rtr Seq Age Cksum Len Router *0.0.0.0 192.168.4.1 0x80000091 45 0x4741 40 Router 0.0.0.0 192.168.5.1 0x80000090 270 0x3a50 40 InterArPfx *0.0.0.1 192.168.4.1 0x80000094 2295 0xfa5a 36 InterArPfx *0.0.0.2 192.168.4.1 0x80000094 2108 0xfe54 36 InterArPfx *0.0.0.3 192.168.4.1 0x80000093 139 0xe7f6 44 InterArPfx *0.0.0.4 192.168.4.1 0x80000091 2483 0xda7a 36 InterArPfx *0.0.0.5 192.168.4.1 0x80000090 983 0xab35 44 InterArPfx *0.0.0.6 192.168.4.1 0x80000091 795 0xdc3 44 InterArPfx *0.0.0.7 192.168.4.1 0x80000090 1545 0xa2b2 36 InterArPfx *0.0.0.9 192.168.4.1 0x80000090 1358 0x9cb5 36 InterArPfx *0.0.0.11 192.168.4.1 0x80000090 608 0x8f49 44 InterArPfx *0.0.0.12 192.168.4.1 0x80000090 327 0x37a3 44 InterArPfx *0.0.0.13 192.168.4.1 0x8000008f 1452 0x689e 44 InterArPfx *0.0.0.14 192.168.4.1 0x8000008f 1264 0x6c98 44 IntraArPfx *0.0.0.1 192.168.4.1 0x80000098 2858 0x82f5 64 IntraArPfx 0.0.0.1 192.168.5.1 0x80000095 1270 0xf25a 64 interface fe-1/1/0.0 Area 0.0.0.1 Type ID Adv Rtr Seq Age Cksum Len Link 0.0.0.7 192.168.2.1 0x80000092 2577 0x8de7 56 Link *0.0.0.8 192.168.4.1 0x80000091 2670 0x8ce5 56 interface t1-0/2/1.0 Area 0.0.0.1 Type ID Adv Rtr Seq Age Cksum Len Link 0.0.0.9 192.168.3.1 0x80000092 2389 0x1661 56 Link *0.0.0.7 192.168.4.1 0x80000092 2764 0x383f 56 interface fe-0/0/0.0 Area 0.0.0.2 Type ID Adv Rtr Seq Age Cksum Len Link *0.0.0.6 192.168.4.1 0x80000092 2952 0x79fc 56 Link 0.0.0.2 192.168.5.1 0x80000091 2270 0xb1c7 56 user@4> show ospf3 route Prefix Path Route NH Metric Type Type Type 192.168.0.1 Intra Router IP 2 NH-interface (null), NH-addr feee::10:255:71:3 192.168.1.1 Intra Router IP 3 NH-interface (null), NH-addr feee::10:255:71:3 192.168.2.1 Intra Area BR IP 1 NH-interface fe-1/1/0.0 192.168.3.1 Intra Area BR IP 1 NH-interface t1-0/2/1.0 192.168.5.1 Intra Router IP 1 NH-interface fe-0/0/0.0 9009:1::/64 Intra Network IP 2 NH-interface t1-0/2/1.0 9009:1::2/128 Intra Network IP 1 NH-interface t1-0/2/1.0 9009:2::/64 Intra Network IP 2 NH-interface fe-1/1/0.0 9009:2::2/128 Intra Network IP 1 NH-interface fe-1/1/0.0 9009:3::/64 Intra Network IP 2 NH-interface t1-0/2/1.0 NH-interface fe-1/1/0.0 9009:4::/64 Intra Network IP 1 NH-interface fe-1/1/0.0 9009:5::/64 Intra Network IP 1 NH-interface t1-0/2/1.0 9009:6::/64 Intra Network IP 1 NH-interface fe-0/0/0.0 9009:6::1/128 Intra Network IP 0 NH-interface fe-0/0/0.0 feee::10:255:71:1/128 Intra Network IP 2 NH-interface fe-1/1/0.0 feee::10:255:71:3/128 Intra Network IP 1 NH-interface t1-0/2/1.0 feee::10:255:71:4/128 Intra Network IP 2 NH-interface t1-0/2/1.0 feee::10:255:71:5/128 Intra Network IP 0 NH-interface lo0.0 feee::10:255:71:6/128 Intra Network IP 1 NH-interface fe-0/0/0.0 feee::10:255:71:11/128 Intra Network IP 1 NH-interface fe-1/1/0.0 user@4> show interfaces terse Interface Admin Link Proto Local Remote lt-1/2/0 t1-0/2/1.0 up up inet6 9009:5::2/64 fe80::2a0:a514:0:44c/64 fe-0/0/0.0 up up inet6 9009:6::1/64 fe80::2a0:a514:0:54c/64 fe-1/1/0.0 up up inet6 9009:4::2/64 fe80::2a0:a514:0:a4c/64 lo0 lo0.0 up up inet 192.168.4.1 --> 0/0 inet6 fe80::2a0:a50f:fc56:14c feee::10:255:71:5 ...
设备 5 状态
目的
验证设备 5 是否已学习预期的路由并建立预期的邻接邻。
行动
user@5> show ospf3 interface Interface State Area DR ID BDR ID Nbrs lo0.0 DRother 0.0.0.2 0.0.0.0 0.0.0.0 0 fe-0/0/0.0 PtToPt 0.0.0.2 0.0.0.0 0.0.0.0 1 user@5> show ospf3 neighbor ID Interface State Pri Dead 192.168.4.1 fe-0/0/0.0 Full 128 34 Neighbor-address fe80::2a0:a514:0:54c user@5> show ospf3 database Area 0.0.0.2 Type ID Adv Rtr Seq Age Cksum Len Router 0.0.0.0 192.168.4.1 0x80000091 509 0x4741 40 Router *0.0.0.0 192.168.5.1 0x80000090 732 0x3a50 40 InterArPfx 0.0.0.1 192.168.4.1 0x80000094 2759 0xfa5a 36 InterArPfx 0.0.0.2 192.168.4.1 0x80000094 2572 0xfe54 36 InterArPfx 0.0.0.3 192.168.4.1 0x80000093 603 0xe7f6 44 InterArPfx 0.0.0.4 192.168.4.1 0x80000091 2947 0xda7a 36 InterArPfx 0.0.0.5 192.168.4.1 0x80000090 1447 0xab35 44 InterArPfx 0.0.0.6 192.168.4.1 0x80000091 1259 0xdc3 44 InterArPfx 0.0.0.7 192.168.4.1 0x80000090 2009 0xa2b2 36 InterArPfx 0.0.0.9 192.168.4.1 0x80000090 1822 0x9cb5 36 InterArPfx 0.0.0.11 192.168.4.1 0x80000090 1072 0x8f49 44 InterArPfx 0.0.0.12 192.168.4.1 0x80000090 791 0x37a3 44 InterArPfx 0.0.0.13 192.168.4.1 0x8000008f 1916 0x689e 44 InterArPfx 0.0.0.14 192.168.4.1 0x8000008f 1728 0x6c98 44 IntraArPfx 0.0.0.1 192.168.4.1 0x80000099 322 0x80f6 64 IntraArPfx *0.0.0.1 192.168.5.1 0x80000095 1732 0xf25a 64 interface fe-0/0/0.0 Area 0.0.0.2 Type ID Adv Rtr Seq Age Cksum Len Link 0.0.0.6 192.168.4.1 0x80000093 416 0x77fd 56 Link *0.0.0.2 192.168.5.1 0x80000091 2732 0xb1c7 56 user@5> show interfaces terse Interface Admin Link Proto Local Remote lt-1/2/0 fe-0/0/0.0 up up inet6 9009:6::2/64 fe80::2a0:a514:0:64c/64 lo0 lo0.0 up up inet 192.168.5.1 --> 0/0 inet6 fe80::2a0:a50f:fc56:14c feee::10:255:71:6 ...