分段路由 (SR) 或网络中的源数据包路由 (SPRING) 是一种控制平面架构,使入口路由器能够引导数据包通过一组特定的节点和链路,而无需依赖网络中的中间节点来确定其应采用的实际路径。分段路由全局块 (SRGB) 是分段路由中使用的标签值范围。Junos OS 允许您将前缀分段标识符 (SID) 和节点 SID 配置为通过策略配置在 IS-IS 中播发的前缀。
在为 IS-IS 协议配置 SPRING SRGB、前缀 SID 和任播 SID 之前,您必须:
配置路由器接口。
配置路由器 ID。
配置 IS-IS。
要为 IS-IS 协议配置带有 SPRING SRGB、前缀 SID 和任播 SID 的设备 R1:
- 配置 SRGB 的起始标签和索引范围。
[edit protocols isis source-packet-routing]
user@host# set srgb start-label start-label-value
user@host# set srgb index-range index-range-value
例如,将 SRGB 配置为 start-label 800000 和 index-range 40000 。
[edit protocols isis source-packet-routing]
user@host# set srgb start-label 800000
user@host# set srgb index-range 40000
- 配置路由策略以完全匹配路由(IPv4 或 IPv6)。为给定术语配置前缀分段的索引和节点段,并接受路由策略。
[edit policy-options policy-statement policy-name term term-value]
user@host# set from route-filter IP address exact
user@host# set then prefix-segment index index-value
user@host# set then prefix-segment node-segment
user@host# set accept
注意:
在环路接口 (lo0.0) 或有效末节接口上将节点分段配置为 /32 前缀。
例如,将路由策略配置为与 IPv4 路由完全匹配。为给定术语配置前缀分段的索引和节点段,并接受路由策略。
[edit policy-options policy-statement policy-name term term-value]
user@host# set from route-filter 198.51.100.1/32 exact
user@host# set then prefix-segment index index-value
user@host# set then prefix-segment node-segment
user@host# set accept
例如,将路由策略配置为与 IPv6 路由完全匹配。为给定术语配置前缀分段的索引和节点段,并接受路由策略。
[edit policy-options policy-statement policy-name term term-value]
user@host# set from route-filter 2001:db8::/32 exact
user@host# set then prefix-segment index index-value
user@host# set then prefix-segment node-segment
user@host# set accept
- 为 给定术语配置前缀分段的索引和节点段,并接受路由策略。
[edit policy-options policy-statement policy-name term term-value then]
user@host# set prefix-segment index index-value
user@host# set prefix-segment node-segment
user@host# set accept
例如,为索引为 1004 的前缀分段和策略语句前缀 SID 的术语 1 配置节点分段,并接受路由策略。
[edit policy-options policy-statement prefix-sid term 1 then]
user@host# set prefix-segment index 1004
user@host# set prefix-segment node-segment
user@host# set accept
- 在 任播 SID 的多个路由器上使用相同的前缀(IPv4 或 IPv6)和相同的前缀分段配置路由策略。
注意:
对于任播前缀 SID,在环路接口 (lo0.0) 上配置前缀 SID。
[edit policy-options policy-statement prefix-sid term 1 ]
user@host# set from route-filter IP address exact
user@host# set then prefix-segment index index-value
user@host# set then accept
例如,在任播 SID 的两台路由器 R0 和 R1 上配置 IPv4 前缀 198.51.100.1/32,前缀为分段 1000。
[edit policy-options policy-statement prefix-sid term 1 ]
user@host# set from route-filter 198.51.100.1/32 exact
user@host# set then prefix-segment index 1000
user@host# set then accept
例如,在任播 SID 的两台路由器 R0 和 R1 上配置带有前缀分段 1000 的 IPv6 前缀 2001:db8::/32。
[edit policy-options policy-statement prefix-sid term 1 ]
user@host# set from route-filter 2001:db8::/32 exact
user@host# set then prefix-segment index 2000
user@host# set then accept
- 在 IS-IS 协议上配置导出策略。
[edit protocols isis]
user@host# export prefix-sid
- 配置显式 NULL 以在所有前缀 SID 播发中启用 E 位和 P 位。
[edit protocol isis source-packet-routing]
user@host# set explicit-null
- 配置邻接分段保持时间以保留分段邻接。
[edit protocol isis source-packet-routing]
user@host# set adjacency-segment hold-time hold-time
例如,配置保持时间为 240000 毫秒的邻接分段。
[edit protocol isis source-packet-routing]
user@host# set adjacency-segment hold-time 240000