分段路由 (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
例如,使用开始标签 800000 和索引范围 40000 配置 SRGB。
[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
例如,在两个路由器 R0 和 R1 上为任播 SID 配置 IPv4 前缀 198.51.100.1/32。
[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
例如,在两个路由器 R0 和 R1 上为任播 SID 配置 IPv6 前缀 2001:db8::/32 使用前缀分段 1000。
[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
- 为 IPv4-MPLS 系列流量配置流量工程捷径。
[edit protocols isis traffic-engineering]
user@host# set family inet-mpls shortcuts
- 为 IPv6-MPLS 系列流量配置流量工程捷径。
[edit protocols isis traffic-engineering]
user@host# set family inet6-mpls shortcuts
- 配置显式 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
例如,将邻接分段配置为 240,000 毫秒的保持时间。
[edit protocol isis source-packet-routing]
user@host# set adjacency-segment hold-time 240000