示例:在 IS-IS 的分段路由中配置 SRGB
此示例说明如何为 IS-IS 协议的网络分段数据包路由 (SPRING) 或分段路由 (SR) 定义分段路由标签块 (SRGB) 标签范围。此配置可确保标签在分段路由域中的可预测性更高,从而对网络速度产生有利影响。
我们的内容测试团队已经验证并更新了此示例。
要求
此示例使用以下硬件和软件组件:
-
两台 MX 系列路由器
-
在所有设备上运行的 Junos OS 17.2 或更高版本
-
在 Junos OS 21.1R1 版上使用 vMX 进行更新和重新验证。
-
在为 IS-IS 域中的分段路由配置 SRGB 标签范围之前,请确保已配置路由和信令协议。
概述
目前,Junos OS 仅允许您配置节点段索引。开始标签的值取决于系统中可用的动态标签。由于分配给 SRGB 的动态标签范围无法预测,因此 Junos OS 允许您配置分段路由使用的 SRGB 标签范围。SRGB 范围内的标签用于 IS-IS 域中的分段路由。这意味着在整个分段路由域中,播发的标签更具可预测性和确定性。
拓扑学
图 1 显示了在路由器 R1 和路由器 R2 上配置的 SRGB。

配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层 [edit] 级的 CLI 中,然后从配置模式进入 commit
。
R1
set chassis network-services enhanced-ip set interfaces ge-0/0/0 unit 0 family inet address 172.16.1.1/30 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:1:1::1/128 set interfaces ge-0/0/0 unit 0 family mpls set interfaces lo0 unit 0 family inet address 192.168.0.1/32 set interfaces lo0 unit 0 family iso address 49.0004.0192.0168.0001.00 set interfaces lo0 unit 0 family inet6 address 2001:db8:10:10::1/128 set protocols isis interface ge-0/0/0.0 set protocols isis interface lo0.0 passive set protocols isis source-packet-routing srgb start-label 400000 set protocols isis source-packet-routing srgb index-range 4000 set protocols isis source-packet-routing node-segment ipv4-index 2001 set protocols isis source-packet-routing node-segment ipv6-index 3001 set protocols isis level 1 disable set protocols mpls interface ge-0/0/0.0
R2
set chassis network-services enhanced-ip set interfaces ge-0/0/0 unit 0 family inet address 172.16.1.2/30 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:1:1::2/64 set interfaces ge-0/0/0 unit 0 family mpls set interfaces lo0 unit 0 family inet address 192.168.0.2/32 set interfaces lo0 unit 0 family iso address 49.0004.0192.0168.0002.00 set interfaces lo0 unit 0 family inet6 address 2001:db8:20:20::1/128 set protocols isis interface ge-0/0/0.0 set protocols isis interface lo0.0 passive set protocols isis source-packet-routing srgb start-label 400000 set protocols isis source-packet-routing srgb index-range 4000 set protocols isis source-packet-routing node-segment ipv4-index 2002 set protocols isis source-packet-routing node-segment ipv6-index 3002 set protocols isis level 1 disable set protocols mpls interface ge-0/0/0.0
配置设备 R1
分步过程
下面的示例要求您在各个配置层级中进行导航。有关 CLI 导航的信息,请参阅《Junos OS CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
要配置设备 R1,请执行以下作:
在修改相应的接口名称、地址和其他参数后,对设备 R2 重复此过程。
在 MX 系列上配置增强型 IP 模式,因为只有具有 MPC 和 MIC 接口的路由器支持 SRGB 功能。提交此配置后,需要重新启动系统。
[edit chassis] user@R1# set network-services enhanced-ip
配置接口。
[edit interfaces] user@R1# set ge-0/0/0 unit 0 family inet address 172.16.1.1/30 user@R1# set ge-0/0/0 unit 0 family iso user@R1# set ge-0/0/0 unit 0 family inet6 address 2001:db8:1:1::1/128 user@R1# set ge-0/0/0 unit 0 family mpls user@R1# set lo0 unit 0 family inet address 192.168.0.1/32 user@R1# set lo0 unit 0 family iso address 49.0004.0192.0168.0001.00 user@R1# set lo0 unit 0 family inet6 address 2001:db8:10:10::1/128
-
在接口上配置 MPLS 协议。要使分段路由正常工作,您可以在 [
edit protocols mpls
] 层次结构下配置任何语句。例如,abstract-hop
、、class-of-service
label-range
、optimize-switchover-delay
等。[edit protocols] user@R1# set mpls interface ge-0/0/0.0
配置 SRGB 的起始标签和索引范围。
注意:确保绑定段 ID (SID) 的 MPLS 标签是 SRGB 起始标签和 SID 索引值的总和。此外,SID 索引值必须小于或等于配置中指定的索引范围值。
-
通过 IS-IS 导出策略分配 SID 索引时,Junos 不会检查 SID 索引是否在 SRGB 的范围内。如果配置的索引超出配置的 SRGB 范围,则不会在日志中或在提交配置时看到任何错误消息。仅当在层次结构级别下 [edit protocols isis source-packet-routing] 配置 SID 时,Junos OS 才会显示提交错误。
[edit protocols] user@R1# set isis source-packet-routing srgb start-label 400000 user@R1# set isis source-packet-routing srgb index-range 4000
配置节点分段的 IPv4 索引值。
[edit protocols] user@R1# set isis source-packet-routing node-segment ipv4-index 2001
配置节点分段的 IPv6 索引值。
[edit protocols] user@R1# set isis source-packet-routing node-segment ipv6-index 3001
禁用级别 1,在接口上配置 IS-IS 协议,并将环路接口 lo0.0 配置为被动接口。
[edit protocols] user@R1# set isis level 1 disable user@R1# set isis interface ge-0/0/0.0 user@R1# set isis interface lo0.0 passive
结果
在配置模式下,输入show chassisshow interfaces、和show protocols命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@R1# show chassis network-services enhanced-ip;
user@R1# show interfaces ge-0/0/0 { unit 0 { family inet { address 172.16.1.1/30; } family iso; family inet6 { address 2001:db8:1:1::1/128; } family mpls; } } lo0 { unit 0 { family inet { address 192.168.0.1/32; } family iso { address 49.0004.0192.0168.0001.00; } family inet6 { address 2001:db8:10:10::1/128; } } }
user@R1# show protocols isis { interface ge-0/0/0.0; interface lo0.0 { passive; } source-packet-routing { srgb start-label 400000 index-range 4000; node-segment { ipv4-index 2001; ipv6-index 3001; } } level 1 disable; } mpls { interface ge-0/0/0.0; }
验证
确认配置工作正常。
验证可配置的 SRGB
目的
验证 IS-IS 概述信息中的可配置 SRGB 标签范围。
行动
在作模式下,运行 show isis overview
命令以显示 IS-IS 概述信息。
user@R1> show isis overview
Instance: master
Router ID: 128.53.50.230
IPv6 Router ID: abcd::128:53:50:230
Hostname: R1
Sysid: 1280.5305.0230
Areaid: 47.0005.80ff.f800.0000.0108.0001
Adjacency holddown: enabled
Maximum Areas: 3
LSP life time: 1200
Attached bit evaluation: enabled
SPF delay: 200 msec, SPF holddown: 5000 msec, SPF rapid runs: 3
IPv4 is enabled, IPv6 is enabled, SPRING based MPLS is enabled
Traffic engineering: enabled
Traffic engineering v6: disabled
Restart: Disabled
Helper mode: Enabled
Layer2-map: Disabled
Source Packet Routing (SPRING): Enabled
SRGB Config Range :
SRGB Start-Label : 400000, SRGB Index-Range : 4000
SRGB Block Allocation: Success
SRGB Start Index : 400000, SRGB Size : 4000, Label-Range: [ 400000, 403999 ]
Node Segments: Enabled
Ipv4 Index : 2001, Ipv6 Index : 3001
SRv6: Disabled
Post Convergence Backup: Disabled
Level 1
Internal route preference: 15
External route preference: 160
Prefix export count: 0
Wide metrics are enabled, Narrow metrics are enabled
Source Packet Routing is enabled
Level 2
Internal route preference: 18
External route preference: 165
Prefix export count: 0
Wide metrics are enabled, Narrow metrics are enabled
Source Packet Routing is enabled
意义
输出显示配置的 SRGB 起始标签和 SRGB 索引范围。SRGB 标签范围的末尾是起始标签值和索引范围之和。分段路由域中的所有设备必须具有相同的 SRGB 范围值。