BGP 出口流量工程
使用 BGP 标记单播的出口对等流量工程概述
在模拟 ISP 无BGP核心的数据中心环境中,入口节点将服务流量隧道到也是AS边界路由器的出口路由器。出口对等流量工程允许中央控制器指示域中的入口路由器将流量定向到特定的出口路由器和特定的外部接口,以到达网络外的特定目标。出口对等流量工程允许选择最佳播发的出口路由,并将选定的最佳路由映射到特定的出口点。在入口处实现负载平衡时,此功能可确保播发出口路由得到最佳利用率。
入口路由器 通过在 MPLS 标签堆栈上推送相应的 MPLS 标签控制入口对等方选择,用于在 AS 之间建立流量工程链路。AS 边界路由器会自动将 IPv4 或 IPv6 对等 /32 或 /128 路由安装到已建立的外部 BGP 对等体(配置了出口流量工程功能)到转发表中 inet.3 。这些路由具有弹出和转发的转发操作,即移除标签,然后将数据包转发到外部 BGP 对等体。
AS 边界路由器通过自 IPv4 下一跃点将 IPv4 或 IPv6 对等 /32 或 /128 路由播发至入口 BGP 对等方。入口 BGP 对等方有一个传输隧道(如 MPLS LDP),以便到达 AS 边界路由器。因此,所有网络出口点都会作为标记的 BGP 路由播发到 MPLS 网络云。AS 边界路由器会播发服务路由,并将这些出口点作为协议下一跃点。AS 边界路由器将服务路由从外部 BGP 对等方重新播发至核心,而不更改下一跃点地址。但是,入口路由器会解析服务路由中的协议下一跃点,以便映射到出口对等接口的正确传输隧道。因此,入口路由器会将特定服务前缀的流量映射到特定出口路由器,或在可用出口设备之间均衡流量负载。此功能允许入口路由器将服务流量定向到特定的出口对等方。
除了出口对等流量工程,此功能还为其播发至 MPLS IPv4 网络云的每个出口设备提供 MPLS 快速重新路由 (FRR)。您可以为主出口 AS 边界路由器配置一个或多个备份设备。除了主路径外,Junos OS 还会自动将备份路径安装到已配置出口对等流量工程的已建立出口 BGP 对等体的 MPLS 转发表中。当主链路出现故障时,AS 边界路由器会切换到备用路径,并提供 MPLS FRR。指定的备份路径通过另一个直接连接的外部 BGP 对等体或远程下一跃点。您还可以使用表中的 inet6.0 ip 查找来配置备份路径。但是, remote-nexthop 和 ip-forward 备份选项是互斥的。
也可以看看
通过使用 BGP 标记的单播并启用 MPLS 快速重新路由来配置出口对等流量工程
出口对等流量工程 (流量工程) 允许中央控制器指示域中的入口路由器将流量定向到特定的出口路由器和特定的外部接口,以到达网络外的特定目标,以便在负载平衡期间优化利用播发的出口路由。
BGP 将网络隔离为多个层,例如传输层和服务层。BGP 标记的单播构成传输层,BGP 单播后续地址族标识符 (SAFI) 添加路径路由构成服务层。AS 边界路由器会触发传输层 BGP 标记的单播标签交换路径 (LSP),为出口对等方提供路由。服务层添加路径路由将这些出口对等方用作协议下一跃点。AS 边界路由器选择性地在传输层提供 MPLS 快速重新路由 (FRR),由于服务层对等问题很常见,因此必须加以利用。因此,您可以为主出口 AS 边界路由器指定一个或多个备份设备。除了主路径外,Junos OS 还会自动将备份路径安装到已配置出口对等流量工程的已建立出口 BGP 对等体的 MPLS 转发表中。当主链路出现故障时,备用路径提供 FRR。
也可以看看
示例:使用 BGP 标记的单播配置出口对等流量工程
此示例说明如何使用标记为单播的 BGP 配置出口对等流量工程。出口对等流量工程允许中央控制器指示域中的入口路由器将流量定向到特定的出口路由器和特定的外部接口,以到达网络外的特定目标。在入口处实现负载平衡时,此功能可确保播发出口路由得到最佳利用率。
要求
此示例使用以下硬件和软件组件:
-
九台 MX 系列路由器
-
Junos OS 14.2R4 或更高版本
概述
从 Junos OS 14.2R4 版开始,您可以启用服务流量的流量工程 (流量工程),例如使用BGP标记的 单播 在自治系统 (AS) 之间MPLS LSP 流量,以便在负载平衡期间以最佳方式利用播发的出口路由。
配置出口对等流量工程,以将核心服务流量(如 MPLS RSVP)定向到特定的出口 BGP 对等体。入口 BGP 对等体可以使用标记为单播的 BGP 对特定出口 BGP 对等体进行流量工程设计,将核心 inet 单播和 inet6 单播服务流量。
无法为外部 BGP 多跃点对等方配置出口对等流量工程。中的 inet.3 ARP 路由仅针对对等方 /32 和 /128 路由安装。
拓扑结构
概述 显示示例拓扑。路由器 R3 和路由器 R4 都是 AS 边界路由器。R3 上启用出口对等流量工程。入口路由器 R0 将发往远程网络的流量定向到启用了出口对等流量工程的路由器 R3。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层次结构级别的 [edit] CLI 中,然后从配置模式进入。commit
路由器 R0
set interfaces ge-2/1/4 unit 0 description "CONNECTED TO R1" set interfaces ge-2/1/4 unit 0 family inet address 10.100.100.1/30 set interfaces ge-2/1/4 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.1.1.1/32 set policy-options prefix-list server_v4_prefix 10.1.1.1/32 set policy-options policy-statement exp-svr-pre term 1 from prefix-list server_v4_prefix set policy-options policy-statement exp-svr-pre term 1 then accept set policy-options policy-statement nhs then next-hop self set routing-options router-id 10.1.1.1 set routing-options autonomous-system 64496 set protocols bgp group RR-1-2 type internal set protocols bgp group RR-1-2 local-address 10.1.1.1 set protocols bgp group RR-1-2 family inet labeled-unicast rib inet.3 set protocols bgp group RR-1-2 family inet unicast add-path receive set protocols bgp group RR-1-2 family inet unicast add-path send path-count 6 set protocols bgp group RR-1-2 export exp-svr-pre set protocols bgp group RR-1-2 export nhs set protocols bgp group RR-1-2 neighbor 10.4.4.4 set protocols bgp group R0RT0 type external set protocols bgp group R0RT0 family inet unicast set protocols bgp group R0RT0 peer-as 64499 set protocols bgp group R0RT0 neighbor 10.1.1.2 set protocols ldp interface all set protocols ldp interface fxp0.0 disable set protocols mpls no-cspf set protocols mpls label-switched-path to_asbr1_r3 to 10.6.6.6 set protocols mpls label-switched-path to_asbr2_r4 to 10.7.7.7 set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf area 0.0.0.0 interface ge-2/1/4.0 set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable
路由器 R1
set interfaces ge-1/0/4 unit 0 description "CONNECTED TO R0" set interfaces ge-1/0/4 unit 0 family inet address 00.100.100.2/30 set interfaces ge-1/0/4 unit 0 family mpls set interfaces ge-1/0/6 unit 0 description "CONNECTED TO R3" set interfaces ge-1/0/6 unit 0 family inet address 10.100.104.1/30 set interfaces ge-1/0/6 unit 0 family mpls set interfaces ge-1/0/9 unit 0 description "CONNECTED TO R4" set interfaces ge-1/0/9 unit 0 family inet address 100.100.105.1/30 set interfaces ge-1/0/9 unit 0 family mpls set interfaces ge-1/1/3 unit 0 description "CONNECTED TO R2" set interfaces ge-1/1/3 unit 0 family inet address 10.100.102.1/30 set interfaces ge-1/1/3 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.3.3.3/32 set routing-options router-id 10.3.3.3 set routing-options autonomous-system 64496 set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ldp interface all set protocols ldp interface fxp0.0 disable
路由器 R2
set interfaces et-0/0/0 unit 0 description "CONNECTED TO R1" set interfaces et-0/0/0 unit 0 family inet address 10.100.102.2/30 set interfaces et-0/0/0 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.4.4.4/32 set routing-options router-id 10.4.4.4 set routing-options autonomous-system 64496 set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols bgp group Client type internal set protocols bgp group Client local-address 10.4.4.4 set protocols bgp group Client advertise-inactive set protocols bgp group Client family inet unicast add-path receive set protocols bgp group Client family inet unicast add-path send path-count 6 set protocols bgp group Client family inet labeled-unicast rib inet.3 set protocols bgp group Client cluster 10.4.4.4 set protocols bgp group Client neighbor 10.1.1.1 set protocols bgp group Client neighbor 10.6.6.6 set protocols bgp group Client neighbor 10.7.7.7 set protocols ospf area 0.0.0.0 interface et-0/0/0.0 set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ldp interface all set protocols ldp interface fxp0.0 disable
路由器 R3
set interfaces ge-1/1/0 unit 0 description "CONNECTED TO R1" set interfaces ge-1/1/0 unit 0 family inet address 10.100.104.2/30 set interfaces ge-1/1/0 unit 0 family mpls set interfaces ge-2/2/5 unit 0 description "CONNECTED TO R5" set interfaces ge-2/2/5 unit 0 family inet address 10.200.203.1/28 set interfaces ge-2/2/8 unit 0 description "CONNECTED TO R5" set interfaces ge-2/2/8 unit 0 family inet address 10.200.202.1/30 set interfaces lo0 unit 0 family inet address 10.6.6.6/32 set policy-options prefix-list server_v4_pre 10.1.1.1/32 set policy-options policy-statement exp-arp-to-rrs term 1 from protocol arp set policy-options policy-statement exp-arp-to-rrs term 1 from rib inet.3 set policy-options policy-statement exp-arp-to-rrs term 1 then next-hop self set policy-options policy-statement exp-arp-to-rrs term 1 then accept set policy-options policy-statement exp-arp-to-rrs term 3 from protocol bgp set policy-options policy-statement exp-arp-to-rrs term 3 then accept set policy-options policy-statement exp-arp-to-rrs term 4 then reject set policy-options policy-statement pplb then load-balance per-packet set routing-options router-id 10.6.6.6 set routing-options autonomous-system 64496 set routing-options forwarding-table export pplb set protocols bgp group RR-1-2 type internal set protocols bgp group RR-1-2 local-address 10.6.6.6 set protocols bgp group RR-1-2 family inet labeled-unicast rib inet.3 set protocols bgp group RR-1-2 family inet unicast add-path receive set protocols bgp group RR-1-2 family inet unicast add-path send path-count 6 set protocols bgp group RR-1-2 export exp-arp-to-rrs set protocols bgp group RR-1-2 neighbor 10.4.4.4 set protocols bgp group Peer1-lan-1 type external set protocols bgp group Peer1-lan-1 family inet unicast set protocols bgp group Peer1-lan-1 peer-as 64497 set protocols bgp group Peer1-lan-1 neighbor 10.200.202.2 egress-te set protocols bgp group Peer1-lan-1 neighbor 10.200.203.2 egress-te set protocols bgp log-updown set protocols ldp interface all set protocols ldp interface fxp0.0 disable set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf area 0.0.0.0 interface ge-1/1/0.0 set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable
路由器 R4
set interfaces ge-3/0/2 vlan-tagging set interfaces ge-3/0/2 unit 0 description "CONNECTED TO R7" set interfaces ge-3/0/2 unit 0 vlan-id 1 set interfaces ge-3/0/2 unit 0 family inet address 10.200.204.1/24 set interfaces ge-3/0/2 unit 0 family mpls set interfaces ge-3/0/2 unit 1 vlan-id 2 set interfaces ge-3/2/4 unit 0 description "CONNECTED TO R1" set interfaces ge-3/2/4 unit 0 family inet address 10.100.105.2/30 set interfaces ge-3/2/4 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.7.7.7/32 set policy-options prefix-list server_v4_pre 10.1.1.1/32 set policy-options policy-statement exp-arp-to-rrs term 1 from protocol arp set policy-options policy-statement exp-arp-to-rrs term 1 from rib inet.3 set policy-options policy-statement exp-arp-to-rrs term 1 then next-hop self set policy-options policy-statement exp-arp-to-rrs term 1 then accept set policy-options policy-statement exp-arp-to-rrs term 3 from protocol bgp set policy-options policy-statement exp-arp-to-rrs term 3 then accept set policy-options policy-statement exp-arp-to-rrs term 4 then reject set policy-options policy-statement pplb then load-balance per-packet set routing-options router-id 10.7.7.7 set routing-options autonomous-system 64496 set routing-options forwarding-table export pplb set protocols bgp group RR-1-2 type internal set protocols bgp group RR-1-2 local-address 10.7.7.7 set protocols bgp group RR-1-2 family inet labeled-unicast rib inet.3 set protocols bgp group RR-1-2 family inet unicast add-path receive set protocols bgp group RR-1-2 family inet unicast add-path send path-count 6 set protocols bgp group RR-1-2 export exp-arp-to-rrs set protocols bgp group RR-1-2 neighbor 10.4.4.4 set protocols bgp group Peer5-6-lan type external set protocols bgp group Peer5-6-lan family inet unicast set protocols bgp group Peer5-6-lan peer-as 64497 set protocols ldp interface all set protocols ldp interface fxp0.0 disable set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf area 0.0.0.0 interface ge-3/2/4.0 set protocols ospf area 0.0.0.0 interface fxp0.0 disable set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols rsvp interface all set protocols rsvp interface fxp0.0 disable
路由器 R5
set interfaces ge-0/2/1 unit 0 description "CONNECTED TO R6" set interfaces ge-0/2/1 unit 0 family inet address 10.100.140.1/30 set interfaces ge-0/3/1 unit 0 description "CONNECTED TO R3" set interfaces ge-0/3/1 unit 0 family inet address 10.200.203.2/28 set interfaces ge-0/3/4 unit 0 description "CONNECTED TO R3" set interfaces ge-0/3/4 unit 0 family inet address 10.200.202.2/30 set interfaces lo0 unit 0 family inet address 10.8.8.8/32 set policy-options policy-statement exp-lo0 term 1 from interface lo0.0 set policy-options policy-statement exp-lo0 term 1 then accept set routing-options router-id 10.8.8.8 set routing-options autonomous-system 64497 set protocols bgp group Peer1-lan-1 type external set protocols bgp group Peer1-lan-1 family inet unicast set protocols bgp group Peer1-lan-1 export exp-lo0 set protocols bgp group Peer1-lan-1 peer-as 64496 set protocols bgp group Peer1-lan-1 neighbor 10.200.202.1 set protocols bgp group Peer1-lan-1 neighbor 10.200.203.1 set protocols bgp group Peer1-H1 type external set protocols bgp group Peer1-H1 family inet unicast set protocols bgp group Peer1-H1 neighbor 10.100.140.2 peer-as 64498
路由器 R6
set interfaces ge-1/1/2 unit 0 description "CONNECTED TO R5" set interfaces ge-1/1/2 unit 0 family inet address 10.100.140.2/30 set interfaces lo0 unit 0 family inet address 10.17.17.1/32 set policy-options policy-statement exp-lo0 term 1 from interface lo0.0 set policy-options policy-statement exp-lo0 term 1 then accept set policy-options policy-statement exp-lo0 term 2 from protocol direct set policy-options policy-statement exp-lo0 term 2 from protocol local set policy-options policy-statement exp-lo0 term 2 then accept set routing-options router-id 10.17.17.1 set routing-options autonomous-system 64498 set protocols bgp group H1-Peer1 type external set protocols bgp group H1-Peer1 family inet unicast set protocols bgp group H1-Peer1 export exp-lo0 set protocols bgp group H1-Peer1 neighbor 10.100.140.1 peer-as 64497
路由器 R7
set interfaces ge-1/0/6 unit 0 description "CONNECTED TO R8" set interfaces ge-1/0/6 unit 0 family inet address 10.100.141.1/30 set interfaces ge-1/1/4 vlan-tagging set interfaces ge-1/1/4 unit 0 description "CONNECTED TO R4" set interfaces ge-1/1/4 unit 0 vlan-id 1 set interfaces ge-1/1/4 unit 0 family inet address 10.200.204.2/24 set interfaces lo0 unit 0 family inet address 10.9.9.9/32 set policy-options policy-statement exp-lo0 term 1 from interface lo0.0 set policy-options policy-statement exp-lo0 term 1 then accept set routing-options router-id 10.9.9.9 set routing-options autonomous-system 64497 set protocols bgp group Peer1-lan-1 type external set protocols bgp group Peer1-lan-1 family inet unicast set protocols bgp group Peer1-lan-1 export exp-lo0 set protocols bgp group Peer1-lan-1 peer-as 64496 set protocols bgp group Peer1-lan-1 neighbor 10.200.204.1 set protocols bgp group Peer2-H2 type external set protocols bgp group Peer2-H2 family inet unicast set protocols bgp group Peer2-H2 neighbor 10.100.141.2 peer-as 64499
路由器 R8
set interfaces ge-4/0/5 unit 0 description "CONNECTED TO R7" set interfaces ge-4/0/5 unit 0 family inet address 10.100.141.2/30 set interfaces lo0 unit 0 family inet address 10.18.18.1/32 set policy-options policy-statement exp-lo0 term 1 from interface lo0.0 set policy-options policy-statement exp-lo0 term 1 then accept set policy-options policy-statement exp-lo0 term 2 then reject set routing-options router-id 10.18.18.1 set routing-options autonomous-system 64499 set protocols bgp group H2-Peer2 type external set protocols bgp group H2-Peer2 family inet unicast set protocols bgp group H2-Peer2 export exp-lo0 set protocols bgp group H2-Peer2 neighbor 10.100.141.1 peer-as 64497 set protocols bgp group R8RT0 type external set protocols bgp group R8RT0 family inet unicast set protocols bgp group R8RT0 peer-as 64496 set protocols bgp group R8RT0 neighbor 10.1.1.2
配置路由器 R3
分步程序
下面的示例要求您在各个配置层级中进行导航。有关导航 CLI 的信息,请参阅《CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
要配置路由器 R3,请执行以下操作:
修改相应的接口名称、地址和其他参数后,对其他路由器重复此过程。
-
使用 IPv4 地址配置接口。
[edit interfaces] user@R3#set ge-1/1/0 unit 0 description "CONNECTED TO R1" user@R3#set ge-1/1/0 unit 0 family inet address 10.100.104.2/30 user@R3#set ge-1/1/0 unit 0 family mpls user@R3#set ge-2/2/5 unit 0 description "CONNECTED TO R5" user@R3#set ge-2/2/5 unit 0 family inet address 10.200.203.1/28 user@R3#set ge-2/2/8 unit 0 description "CONNECTED TO R5" user@R3#set ge-2/2/8 unit 0 family inet address 10.200.202.1/30
-
配置环路地址。
[edit interfaces] user@R3#set lo0 unit 0 family inet address 10.6.6.6/32
-
配置路由器 ID 和自治系统 (AS) 编号。
[edit routing-options] user@R3# set router-id 10.6.6.6 user@R3# set autonomous-system 64496 user@R3#set forwarding-table export pplb
-
为除管理接口以外的所有接口配置 RSVP 协议。
[edit protocols] user@R3# set rsvp interface all user@R3# set rsvp interface fxp0.0 disable
-
为除管理接口以外的所有接口配置 MPLS 协议。
[edit protocols] user@R3# set mpls interface all user@R3# set mpls interface fxp0.0 disable
-
在面向核心的接口上配置 IBGP 对等会话。
[edit protocols] user@R3# set bgp log-updown user@R3# set bgp group RR-1-2 type internal user@R3# set bgp group RR-1-2 local-address 10.6.6.6 user@R3# set bgp group RR-1-2 family inet unicast add-path receive user@R3# set bgp group RR-1-2 family inet unicast add-path send path-count 6 user@R3# set bgp group RR-1-2 family inet labeled-unicast rib inet.3 user@R3#set bgp group RR-1-2 export exp-arp-to-rrs user@R3# set bgp group RR-1-2 neighbor 10.4.4.4
-
在面向外部边缘路由器的接口上配置 EBGP 对等会话。
[edit protocols] user@R3# set bgp group Peer1-lan-1 type external user@R3# set bgp group Peer1-lan-1 family inet unicast user@R3# set bgp group Peer1-lan-1 peer-as 64497
-
为外部 BGP 组 Peer1-lan-1 启用出口对等流量工程。
[edit protocols] user@R3# set bgp group Peer1-lan-1 neighbor 10.200.202.2 egress-te user@R3# set bgp group Peer1-lan-1 neighbor 10.200.203.2 egress-te
-
将 OSPF 协议配置为 IGP。
[edit protocols] user@R3# set ospf area 0.0.0.0 interface ge-1/1/0.0 user@R3# set ospf area 0.0.0.0 interface fxp0.0 disable user@R3# set ospf area 0.0.0.0 interface lo0.0 passive user@R3# set ldp interface all user@R3# set ldp interface fxp0.0 disable
-
定义用于将 ARP 路由导出到路由反射器的策略。
[edit policy-options] user@R3# set policy-statement exp-arp-to-rrs term 1 from protocol arp user@R3# set policy-statement exp-arp-to-rrs term 1 from rib inet.3 user@R3# set policy-statement exp-arp-to-rrs term 1 then next-hop self user@R3# set policy-statement exp-arp-to-rrs term 1 then accept user@R3# set policy-statement exp-arp-to-rrs term 3 from protocol bgp user@R3# set policy-statement exp-arp-to-rrs term 3 then accept user@R3# set policy-statement exp-arp-to-rrs term 4 then reject
-
将用于导出 ARP 路由的策略 exp-arp-to-rrs 应用于路由反射器到外部 BGP 组。
[edit protocols] user@R3# set bgp group RR-1-2 export exp-arp-to-rrs
-
使用 IPv4 路由定义前缀列表。
[edit policy-options] user@R3# set prefix-list server_v4_pre 10.1.1.1/32
-
定义按数据包的负载均衡策略。
[edit policy-options] user@R3# set policy-statement pplb then load-balance per-packet
-
应用按数据包负载均衡策略。
[edit routing-options] user@R3# set forwarding-table export pplb
结果
在配置模式下,输入 show interfaces、 show protocols、 show routing-options和 show policy-options 命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@R3# show interfaces
ge-1/1/0 {
unit 0 {
description "CONNECTED TO R1";
family inet {
address 10.100.104.2/30;
}
family mpls;
}
}
ge-2/2/5 {
unit 0 {
description "CONNECTED TO R5";
family inet {
address 10.200.203.1/28;
}
}
}
ge-2/2/8 {
unit 0 {
description "CONNECTED TO R5";
family inet {
address 10.200.202.1/30;
}
}
}
lo0 {
unit 0 {
family inet {
address 10.6.6.6/32;
}
}
}
user@R3# show protocols
bgp {
group RR-1-2 {
type internal;
local-address 10.6.6.6;
family inet {
labeled-unicast {
rib {
inet.3;
}
}
unicast {
add-path {
receive;
send {
path-count 6;
}
}
}
}
export exp-arp-to-rrs;
neighbor 10.4.4.4;
}
group Peer1-lan-1 {
type external;
family inet {
unicast;
}
peer-as 64497;
neighbor 10.200.202.2 {
egress-te;
}
neighbor 10.200.203.2 {
egress-te;
}
}
log-updown;
}
ldp {
interface all;
interface fxp0.0 {
disable;
}
}
mpls {
interface all;
interface fxp0.0 {
disable;
}
}
ospf {
area 0.0.0.0 {
interface ge-1/1/0.0;
interface fxp0.0 {
disable;
}
interface lo0.0 {
passive;
}
}
}
rsvp {
interface all;
interface fxp0.0 {
disable;
}
}
[edit]
user@R3# show routing-options
router-id 10.6.6.6;
autonomous-system 64496;
forwarding-table {
export pplb;
}
user@R3# show policy-options
prefix-list server_v4_pre {
10.1.1.1/32;
}
policy-statement exp-arp-to-rrs {
term 1 {
from {
protocol arp;
rib inet.3;
}
then {
next-hop self;
accept;
}
}
term 3 {
from protocol bgp;
then accept;
}
term 4 {
then reject;
}
}
policy-statement pplb {
then {
load-balance per-packet;
}
}
验证
确认配置工作正常。
标识标签和协议下一跃点
目的
从路由 10.17.17.2 的路由表中获取从 R0 传输到 R6 的数据包和下一跃点的数据包的标签号。
行动
在操作模式下,对路由器 R0 运行 show route 10.17.17.2 extensive active-path 命令。
user@R0> show route 10.17.17.2 extensive active-path
inet.0: 262 destinations, 516 routes (261 active, 0 holddown, 1 hidden)
10.17.17.1/32 (3 entries, 1 announced)
TSI:
KRT in-kernel 10.17.17.1/32 -> {indirect(1048576)}
Page 0 idx 0, (group R0RT0 type External) Type 1 val 0x9a87fe0 (adv_entry)
Advertised metrics:
Nexthop: Self
AS path: [65100] 1 65010 I
Communities:
Path 10.17.17.1 from 10.4.4.4 Vector len 4. Val: 0
*BGP Preference: 170/-101
Next hop type: Indirect
Address: 0x97724a0
Next-hop reference count: 339
Source: 10.4.4.4
Next hop type: Router, Next hop index: 624
Next hop: 10.100.100.2 via ge-2/1/4.0, selected
Label-switched-path to_asbr1_r3
Label operation: Push 299888, Push 300128(top)
Label TTL action: prop-ttl, prop-ttl(top)
Load balance label: Label 299888: None; Label 300128: None;
Session Id: 0x145
Protocol next hop: 10.200.201.2
Indirect next hop: 0x9a4c550 1048576 INH Session ID: 0x148
State: <Active Int Ext>
Local AS: 65100 Peer AS: 65100
Age: 1:33 Metric2: 2
Validation State: unverified
Task: BGP_100.10.4.4.4+179
Announcement bits (3): 0-KRT 5-BGP_RT_Background 6-Resolve tree 2
AS path: 1 10 I (Originator)
Cluster list: 10.4.4.4
Originator ID: 10.6.6.6
Accepted
Localpref: 100
Router ID: 10.4.4.4
Addpath Path ID: 1
Indirect next hops: 1
Protocol next hop: 10.200.202.2 Metric: 2
Indirect next hop: 0x9a4c550 1048576 INH Session ID: 0x148
Indirect path forwarding next hops: 1
Next hop type: Router
Next hop: 10.100.100.2 via ge-2/1/4.0
Session Id: 0x145
10.200.201.2/32 Originating RIB: inet.3
Metric: 2 Node path count: 1
Indirect nexthops: 1
Protocol Nexthop: 10.6.6.6 Metric: 2 Push 299888
Indirect nexthop: 0x9a4c220 - INH Session ID: 0x0 Indirect path forwarding nexthops: 1 Nexthop: 100.100.100.2 via ge-2/1/4.0
意义
数据包标签 299888 和下一跃点 10.200.202.2 都会显示在输出中。
验证带有标签299888的数据包的路径
目的
跟踪标签299888的路径,并验证 mpls.0 路由表中是否存在 VPN 条目。
行动
user@R3> show route table mpls.0 protocol vpn active-path label 299888 detail mpls.0: 17 destinations, 17 routes (17 active, 0 holddown, 0 hidden)523440(1 entry, 1 announced)*VPNPreference: 170 Next hop type: Router, Next hop index: 640 Address: 0xecfa130 Next-hop reference count: 2Next hop: 10.200.202.2via ge-2/2/8.0, selectedLabel operation: PopLoad balance label: None; Session Id: 0x16f State: <Active Int Ext> Local AS: 64496 Age: 3:49:16 Validation State: unverified Task: BGP_RT_Background Announcement bits (1): 1-KRT AS path: I Ref Cnt: 1
意义
带有 VPN 条目和下一跃点 10.200.202.2 的标签299888存在于 mpls.0 路由表中。
验证路由器 R3 上是否已启用出口对等流量工程
目的
验证是否已在路由器 R3 上配置出口对等流量工程。
行动
user@R3> show route protocol arp detail match-prefix 10.200.202.2
inet.0: 263 destinations, 514 routes (262 active, 0 holddown, 1 hidden)
inet.3: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
10.200.201.2/32 (1 entry, 1 announced)
*ARP Preference: 170
Next hop type: Router
Address: 0xecf91e0
Next-hop reference count: 5
Next hop: 10.200.202.2 via ge-2/2/8.0, selected
Label operation: Pop
Load balance label: None;
Session Id: 0x0
State: <Active Int Ext>
Local AS: 64496
Age: 3:52:52
Validation State: unverified
Task: BgpEgressPeeringTE
Announcement bits (3): 2-Resolve tree 1 3-BGP_RT_Background 4-Resolve tree 2
意义
输出指示路由器 R3 上已启用 BGP 出口对等流量工程。
CLOS 网络中的 BGP 确定性路径转发
BGP 确定性路径转发概述
BGP 确定性路径转发 (DPF) 将物理交换矩阵划分为多个逻辑交换矩阵,其中不同的流量被映射到不同的逻辑交换矩阵,以满足流量的需求。单跳 EBGP 尽力服务可能无法满足所有数据中心流量要求,特别是对于丢包和延迟敏感型 AI-ML 流量。BGP DPF 会根据指定的逻辑交换矩阵选择路径,以确保最佳链路利用率。
BGP DPF 是适用于数据中心 IP 交换矩阵的轻量级流量工程解决方案。数据中心通常将单跳 EBGP 用于 IPv4 和 IPv6 路由。这是一种简单且可扩展的逐跳 EBGP 路由,可为所有流量流提供单一的“尽力而为”服务。BGP DPF 将物理交换矩阵划分为多个逻辑交换矩阵。这样就可以将 IPv4 和 IPv6 流量映射到不同的逻辑交换矩阵。您可以根据可用带宽和不同的服务级别协议 (SLA) 使用单独的逻辑交换矩阵来实现跨链路的负载平衡。您可以配置 DPF 将流量映射到多个逻辑交换矩阵,以避免命运共享。
BGP DPF 使用交换矩阵颜色为每个链路上的单跳 EBGP 会话着色。例如,如果链路属于红色交换矩阵,则通过该链路的 EBGP 会话将分配一个红色 BGP 颜色社区。可以在全局、组或邻居级别为单跃点 EBGP 邻接方分配一种颜色。未分配颜色社区的路由可以通过任何彩色或未着色的 EBGP 会话进行通告。
-
如果接收器侧颜色不匹配,接收器会将路由标记为隐藏。
-
所有彩色路由都可以通过未着色的 BGP 邻接方进行通告。若要仅允许某些线路超过某些颜色,请勿混合使用未着色和有色织物。
-
您可以在所有有色交换矩阵上通告未着色的路由。要通过彩色交换矩阵通告匹配的彩色路由,请勿使用未着色的路由,但仅承载轻型控制流量的路由除外。
在 图 2 中,主干 1 和主干 2 通过多个连接连接到叶 1 和叶 2 设备。BGP DPF 使用交换矩阵颜色为每个链路上的单跳 EBGP 会话着色。主干 1 属于红色交换矩阵,通过红色链路上的 EBGP 会话也显示为红色。主干 2 属于蓝色交换矩阵,通过链路的 EBGP 会话也显示为蓝色。BGP 根据颜色匹配通过 EBGP 会话播发 IP 路由。如果只有红色社区或没有颜色社区,则 BGP 会通过红色 EBGP 会话播发路由。如果路由只有蓝色社区或没有蓝色社区,则 BGP 会通过蓝色 EBGP 会话播发路由。
划分物理交换矩阵
BGP DPF 的优势
-
适用于 IP 交换矩阵的轻量级流量工程解决方案。
-
底层与覆盖层的相关性,将大象流与小鼠流隔离开来。
fabric-color配置。但是,我们仍然支持这些功能用于未着色的路线。
在 CLOS 网络中配置 BGP 确定性路径转发
BGP 入口对等方的分段路由流量工程概述
此功能使 BGP 能够支持入口路由器流量工程的分段路由策略。控制器可以指定由多个路径组成的分段路由策略,以引导标签流量或 IP 流量。分段路由策略将有序的分段列表添加到数据包标头以进行流量引导。BGP 将分段路由策略的候选路由安装到路由表 bgp.inetcolor.0 或 bgp.inet6color.0 中。BGP从特定分段路由流量工程策略的候选路由中选择一个路由,并将其安装在新的路由表 junos-rti-tc-<color>.inet.0 或 junos-rti-tc-<color>.inet6.0 中。此功能支持入口路由器转发表中静态配置和 BGP 安装的分段路由流量工程策略。
了解分段路由策略
在分段路由中,控制器允许核心网络中的入口节点引导流量通过显式路径,同时消除中间节点中显式路径的状态。与分段路由策略关联的分段的有序列表将添加到数据包的标头中。这些分段列表或分段标识符 (SID) 列表表示网络中的路径,这些路径是从从各种来源获知的多个候选路径中选择的最佳候选路径。段的有序列表编码为标签堆栈。此功能允许根据网络或客户要求将数据包引导到特定路径。流量可以是标签流量或 IP 流量,并通过标签交换或基于目标的查找来引导这些分段路由流量工程路径。您可以在入口路由器上配置静态策略,以便在与控制器的链路出现故障时引导流量。静态分段路由策略有助于在控制器关闭或无法访问时确保流量引导。
BGP 在从分段路由策略选择路由中的作用
当 BGP 从控制器收到分段路由流量工程后续地址族标识符 (SAFI) 的更新时,BGP 会对这些更新执行一些基本检查和验证。不是 MPLS 标签的分段被视为无效。如果更新有效,则BGP会在路由表 bgp.inetcolor.0 和 bgp.inet6color.0 中安装分段路由流量工程策略,随后再安装在路由表 junos-rti-tc-<color>.inet.0 或 junos-rti-tc-<color>.inet6.0 中。这些路由表使用、endpoint address、和 color 等distinguisher属性作为键。
Junos OS 支持基于控制器的 BGP-SRTE 路由安装为分段路由流量工程 (SPRING-流量工程) 路由。BGP 在路由表 bgp.inetcolor.0 和 bgp.inet6color.0 中安装分段路由流量工程策略,随后通过 SPRING-流量工程 将其安装在路由表 junos-rti-tc-<color>.inet.0 或 junos-rti-tc-<color>.inet6.0 中。
策略操作 color: color-mode:color-value 在层次结构级别配置 [edit policy-options community name members] ,用于在从 inet-单播 和 inet6-单播 地址族导出前缀时附加颜色社区。
要为地址族启用 BGP IPv4 分段路由流量工程功能,请在层次结构级别包含[edit protocols bgp family inet]该segment-routing-te语句。
要为地址族启用 BGP IPv6 分段路由流量工程功能,请在层次结构级别包含[edit protocols bgp family inet6]该segment-routing-te语句。
在配置了分段路由流量工程策略的网络中,Junos OS 支持收集入口 IP 和中转 MPLS 流量的流量统计信息。要启用流量统计信息收集,请在层次结构级别加入telemetry[edit protocols source-packet-routing]该语句。
静态配置的分段路由策略
可以在入口路由器上配置静态策略,以便在与控制器的链路出现故障时也允许流量路由。在层次结构级别进行[edit protocols source-packet-routing]配置sr-preference,以选择静态配置的分段路由流量工程策略转发条目,而不是 BGP 信号分段路由流量工程转发条目。分段标识符标签堆栈的顶部标签与内部网关协议 (IGP) 顶部标签交换以进行解析。
静态分段路由流量工程策略可以包含带或不带加权 ECMP 的多条路径。如果 IGP 配置配置了加权 ECMP,则转发路径将提供层次结构加权等价多路径 (ECMP)。但是,如果未配置加权 ECMP,则相等平衡将应用于所有分段路由流量工程路径。
支持和不支持的功能
Junos OS 通过 BGP 分段路由流量工程支持以下功能:
-
对于 PTX 系列,具有增强型机箱模式的 FPC-PTX-P1-A 支持此功能。
-
加权 ECMP 和层次结构加权 ECMP。
-
分段路由流量工程策略中的路径支持 MPLS 快速重新路由 (FRR)。当可用于分段路由流量工程策略路径时,与顶部标签对应的 IGP 备份路径将安装到路由表中。
以下限制适用于 BGP 分段路由流量工程:
-
BGP 和静态分段路由流量工程策略仅支持主实例。
-
使用静态策略显式配置或通过 BGP 获知的分段路由流量工程路径仅限于仅表示绝对 MPLS 标签的分段标识符列表。
-
静态分段路由流量工程策略最多支持 128 个分段列表。
-
路由实例中的对等方不支持 BGP 分段路由流量工程 SAFI。
-
无法使用路由信息库 (RIB) 组(RIB 也称为路由表)将 BGP 分段路由流量工程网络层可达性信息 (NLRI) 导入到其他路由表中。
-
遍历分段路由策略的流量不支持流量统计信息。
-
不支持处理生存时间 (TTL) MPLS 标签分段标识符。
-
不支持不间断活动路由。
-
服务等级 (CoS) 策略适用于顶部标签。
-
仅支持非 VPN CoS 重写 CLI 命令;例如,支持顶部标签的 EXP 重写。
-
对于一个入口数据包,最多可解析 8 个标签,并在负载均衡散列计算中使用第 2 层或第 3 层 MPLS 有效负载字段。如果入口数据包中的标签深度超过 8 个标签,则不会解析 MPLS 有效负载,并且负载均衡散列计算中不会使用第 2 层和第 3 层 MPLS 有效负载字段。
-
最大标签堆栈深度支持为 5。您必须配置
maximum-labels为限制分段路由流量工程策略的标签深度。如果未配置,则maximum-labels应用有意义的默认值,将最大标签深度限制为 5。 -
颜色属性必须在分段路由流量工程 LSP 配置中指定。因此,入口路由将下载到 junos-rti-tc-<color>.inet{6}.0 表中。
-
当存在多个具有相同
Endpoint, color优先级但存在不同绑定分段标识符的静态分段路由流量工程策略时,表中mpls.0将安装与较小绑定分段标识符对应的路由。 -
不支持混合分段标识符:分段路由流量工程分段列表中的分段标识符必须专门是 IPv4 或 IPv6。
-
您必须在接口上显式配置 MPLS 最大标签,以容纳五个以上的标签;否则,超过五个标签可能会导致数据包丢失。
-
表 1 列出了受支持参数的默认限制:
表 1:分段路由流量工程支持的参数 参数
限制
支持的最大标签数
5
分段路由中的最大路径数 流量工程策略
8
BGP 分段路由流量工程策略的数量
32,000
静态分段路由流量工程策略的数量
32,000
也可以看看
在 BGP 网络中使用分段路由配置入口流量工程
BGP 发言者支持基于分段路由策略的流量引导。控制器可以指定由多个路径组成的分段路由策略,以引导标签流量或 IP 流量。此功能使 BGP 能够支持入口路由器流量工程的分段路由策略。分段路由策略将有序的分段列表添加到数据包标头以进行流量引导。可以在入口路由器上配置静态策略,以便在与控制器的链路出现故障时也允许流量路由。
配备 FPC-PTX-P1-A 的 PTX 系列支持此功能。对于具有多个 FPC 的设备,您必须在机箱上配置增强模式。
开始配置 BGP 以从控制器接收分段路由流量工程策略之前,请执行以下操作:
-
配置设备接口。
-
配置 OSPF 或任何其他 IGP 协议。
-
配置 MPLS 和分段路由标签。.
-
配置 BGP。
-
在控制器和所有其他路由器上配置分段路由。
要为 BGP 分段路由配置流量工程:
也可以看看
为 BGP 标记的单播启用流量统计信息收集
从 Junos OS 18.1R1 版开始,您可以在配置了分段路由的网络中的入口路由器上为带有 BGP 标记的单播流量启用流量统计信息收集。基于标签堆栈收集流量统计信息。例如,如果有两个路由具有相同的标签堆栈,但下一跃点不同,则会聚合这些路由的流量统计信息,因为标签堆栈相同。可以根据 BGP 路由更新中收到的标签堆栈,定期收集流量统计信息并将其保存到指定文件中。默认情况量统计信息收集处于禁用状态。启用流量统计信息收集会触发 BGP 导入策略。仅 IPv4 和 IPv6 地址族支持流量统计信息收集。
开始配置 BGP 以收集流量统计信息之前,请执行以下操作:
-
配置设备接口。
-
配置 OSPF 或任何其他 IGP 协议。
-
配置 MPLS 和 LDP。
-
配置 BGP。
-
在控制器和所有其他路由器上配置分段路由。
在配置了分段路由的网络中,系统会为每个节点和链路分配一个分段标识符 (SID),通过 IGP 或 BGP 播发。在 MPLS 网络中,系统会为每个分段分配一个唯一的分段标签,用作该分段的 SID。每个转发路径都表示为一个分段路由标签交换路径 (LSP)。分段路由 LSP 在入口处用一组 SID 标签表示。入口路由器可以施加这些标签来路由流量。使用标签为单播的 BGP,控制器可以对入口路由器进行编程,以引导流量并使用标签堆栈播发前缀。
要在入口处为带有 BGP 标签的单播启用流量统计信息收集:
也可以看看
BGP 中基于 SRv6 的 SRv6 网络编程和第 3 层服务概述
- SRv6 网络编程的优势
- BGP 网络中的 SRv6 网络编程
- 通过 SRv6 核心实现第 3 层 VPN 服务
- 向 BGP 对等方播发第 3 层 VPN 服务
- BGP 中 SRv6 网络编程支持和不支持的功能
SRv6 网络编程的优势
-
灵活部署 — BGP 利用设备的分段路由功能建立第 3 层 VPN 隧道。SRv6 入口节点可以传输 IPv4 数据包,即使中转路由器不支持 SRv6。这样就无需在 IPv6 网络中的所有节点上部署分段路由。
-
无缝部署 — 网络编程完全依赖于 IPv6 标头和报头扩展来传输数据包,无需 MPLS 等协议。这确保了无缝部署,无需在核心 IPv6 网络中进行任何重大硬件或软件升级。
-
单设备通用性 — Junos OS 在单个分段标识符 (SID) 上支持多种功能,并且可以在插入模式和封装模式下互操作。这使得单个设备可以同时扮演提供商 (P) 路由器和提供商边缘 (PE) 路由器的角色。
BGP 网络中的 SRv6 网络编程
网络编程是网络将网络程序编码为插入 IPv6 数据包标头的单个指令的能力。分段路由报头 (SRH) 是一种 IPv6 路由扩展报头,其中包含编码为 SRv6 SID 的分段列表。SRv6 SID 由定位器(即 IPv6 地址)和为SRv6 网络中支持 SRv6 的每个节点定义特定任务的函数组成。SRv6 网络编程消除了对 MPLS 的需求,并且提供了利用分段路由的灵活性。
确保使用唯一的 SID,BGP 使用该 SID 来分配 SRv6 SID。
要通过 SRv6 核心配置 IPv4 传输,请在层次结构级别包含end-dt4-sid sid[edit protocols bgp source-packet-routing srv6 locator name]该语句。
要通过 SRv6 核心配置 IPv6 传输,请在层次结构级别包含[edit routing protocols bgp source-packet-routing srv6 locator name]该end-dt6-sid sid语句。
要通过 SRv6 核心配置 IPv4 和 IPv6 传输,请在层次结构级别包含end-dt46-sid sid[edit routing protocols bgp source-packet-routing srv6 locator name]该语句。end-dt4-sid 语句表示具有解封装和 IPv4 表查找功能的端点 SID。end dt6-sid 语句是具有解封装和 IPv6 表查找功能的端点。end-dt46-sid 语句是具有解封装和特定 IP 表查找功能的端点。end-dt46 是 end.dt4 和 end.dt6 行为的变体。BGP 为 IPv4 和 IPv6 第 3 层 VPN 服务 SID 分配这些值。
通过 SRv6 核心实现第 3 层 VPN 服务
连接到出口 PE 时,入口 PE 会将有效负载封装在外部 IPv6 报头中,其中目标地址是与相关 BGP 路由更新关联的 SRv6 服务 SID。出口 PE 会将下一跃点设置为其 IPv6 地址之一,该地址也是分配 SRv6 服务 SID 的 SRv6 定位器。多个路由可以通过同一分段路由策略解析。
您可以通过 SRv6 核心配置基于 BGP 的第 3 层服务。您可以启用第 3 层叠加服务,将 BGP 用作控制平面,将 SRv6 用作数据平面。SRv6 网络编程提供了利用分段路由的灵活性,无需部署 MPLS。此类网络仅依靠 IPv6 报头和报头扩展名来传输数据。
确保 和 end-dt4-sid sid 是 end-dt6-sid sid 分段列表中的最后一个 SID,或者是没有 SRH 标头的数据包的目标地址。
要通过 SRv6 核心配置 IPv4 VPN 服务,请在层次结构级别包含end-dt4-sid[edit routing-instances instance-name protocols bgp source-packet-routing srv6 locator name]该语句。
终端 dt46 SID 必须是分段路由策略中的最后一个分段,并且 SID 实例必须与 IPv4 FIB 表和 IPv6 FIB 表相关联。
向 BGP 对等方播发第 3 层 VPN 服务
BGP 将特定服务的前缀从出口 PE 设备通告至入口 PE 节点的可达性。PE 设备之间交换的 BGP 消息携带 SRv6 服务 SID,BGP 使用该 SID 将 PE 设备互连以形成 VPN 会话。对于 BGP 使用按 VRF SID 分配的第 3 层 VPN 服务,同一 SID 将在多个网络层可达性信息 (NLRI) 地址族之间共享。
要将 SRv6 服务播发至出口节点上的 BGP 对等方,请在层次结构级别包含[edit protocols bgp family inet6-vpn unicast]该advertise-srv6-service语句。
支持基于 SRv6 的第 3 层服务的出口 PE 设备会播发叠加服务前缀以及服务 SID。BGP 入口节点接收这些播发,并将前缀添加到相应的虚拟路由和转发 (VRF) 表中。
要在入口节点上接受 SRv6 服务,请在层次结构级别包含accept-srv6-service[edit protocols bgp family inet6-vpn unicast]该语句。
BGP 中 SRv6 网络编程支持和不支持的功能
Junos OS 通过 BGP 中的 SRv6 网络编程支持以下功能:
-
在简化模式下,入口设备支持 7 个 SID,包括 VPN SID
-
出口设备支持七个 SID,包括 VPN SID
-
具有解封装和特定 IP 表查找功能的端点(End.DT46 SID)
-
用于 SRv6 路由的 BGP RIB 分片。有关使用 SRv6 路由进行 RIB 分片的更多信息,请参阅 了解 BGP RIB 分片和 BGP 更新 IO 线程 和 RIB 分片 。
-
VPN 选项 C
Junos OS 不支持以下功能与 BGP 中的 SRv6 网络编程结合使用:
-
SRv6 隧道中的分段和重装
-
VPN 选项 B
也可以看看
示例:在 BGP 网络中通过 SRv6 配置第 3 层服务
此示例说明如何在 BGP 网络中配置 SRv6 网络编程和第 3 层 VPN 服务。SRv6 网络编程提供了利用分段路由的灵活性,无需部署 MPLS。此功能对于网络以 IPv6 为主且尚未部署 MPLS 的服务提供商很有用。
要求
此示例使用以下硬件和软件组件:
-
五台配备 MPC7E、MPC8E 或 MPC9E 线卡的 MX 系列路由器
-
Junos OS 20.4R1 或更高版本
概述
您可以通过 SRv6 核心网络配置基于 BGP 的第 3 层服务。使用 SRv6 网络编程时,网络仅依靠 IPv6 报头和报头扩展名来传输数据。您可以启用第 3 层叠加服务,将 BGP 用作控制平面,将 SRv6 用作数据平面。
拓扑结构
在 图 4 中,路由器 R0 是入口路由器,路由器 R1 和 R2 是支持仅支持 IPv4 的客户边缘设备的出口路由器。路由器 R3 和 R4 构成一个仅支持 IPv6 的提供商核心网络。所有路由器都属于同一个自治系统。IS-IS 是一种内部网关协议,配置为支持 IPv6 核心路由器 R3 和 R4 中的 SRv6。在此示例中,路由器 R0、R1 和 R2 上配置了 BGP。路由器 R0 被配置为 IPv6 路由反射器,具有与路由器 R1 和路由器 R2 的 IBGP 对等会话。出口路由器 R1 将 L3VPN SID 播发至入口路由器 R0,后者接受并更新 VRF 表。
从 R1 开始,BGP 路由通过下一跃点自播发至路由器 R0。路由器 R0 有两条到 R1 的路径,通过 R3 的主路径和通过 R4 的备用路径。在路由器 R0 中,主路径使用默认度量,备份路径配置为度量 50。以下是从路由器 R1 到 R0 播发的一些路由:
| IPv4 |
21.0.0.0 |
| IPv6 |
2001:21:: |
| IPv4 VPN |
31.0.0.0 |
| IPv6 VPN |
2001:31:: |
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层次结构级别的 [edit] CLI 中,然后从配置模式进入 commit。
路由器 R0
set chassis network-services enhanced-ip set interfaces xe-0/0/0:0 unit 0 family inet address 1.4.1.1/30 set interfaces xe-0/0/0:0 unit 0 family iso set interfaces xe-0/0/0:0 unit 0 family inet6 address 2001:db8::4:1/64 set interfaces xe-0/0/0:2 unit 0 family inet address 1.6.1.1/30 set interfaces xe-0/0/0:2 unit 0 family iso set interfaces xe-0/0/0:2 unit 0 family inet6 address 2001:db8::6:1/64 set interfaces lo0 unit 0 family inet6 address 2001:db8:1:255::0/128 set policy-options policy-statement adv_global term v4 from route-filter 20.0.0.0/8 orlonger set policy-options policy-statement adv_global term v4 then next-hop self set policy-options policy-statement adv_global term v4 then accept set policy-options policy-statement adv_global term v6 from route-filter 2001:20::/64 orlonger set policy-options policy-statement adv_global term v6 then next-hop self set policy-options policy-statement adv_global term v6 then accept set policy-options policy-statement pplb then load-balance per-packet set policy-options community vpn1-target members target:100:1 set policy-options community vpn2-target members target:100:2 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 type external set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 local-address 11.1.1.5 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 family inet unicast set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 family inet6 unicast set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 peer-as 1002 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 neighbor 11.1.1.6 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 type external set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 local-address 2001:11:1:1::5 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 family inet6 unicast set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 peer-as 1002 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 neighbor 2001:11:1:1::6 set routing-instances vpn1 protocols bgp source-packet-routing srv6 locator loc1 end-dt4-sid 3001::4 set routing-instances vpn1 protocols bgp source-packet-routing srv6 locator loc1 end-dt6-sid 3001::5 set routing-instances vpn1 instance-type vrf set routing-instances vpn1 interface xe-0/0/0:3.1 set routing-instances vpn1 route-distinguisher 100:1 set routing-instances vpn1 vrf-target target:100:1 set routing-options source-packet-routing srv6 locator loc1 3001::/64 set routing-options source-packet-routing srv6 no-reduced-srh set routing-options router-id 128.53.38.52 set routing-options autonomous-system 100 set routing-options forwarding-table export pplb set protocols bgp group to-PE-all type internal set protocols bgp group to-PE-all local-address abcd::128:53:38:52 set protocols bgp group to-PE-all family inet unicast extended-nexthop set protocols bgp group to-PE-all family inet unicast advertise-srv6-service set protocols bgp group to-PE-all family inet unicast accept-srv6-service set protocols bgp group to-PE-all family inet-vpn unicast extended-nexthop set protocols bgp group to-PE-all family inet-vpn unicast advertise-srv6-service set protocols bgp group to-PE-all family inet-vpn unicast accept-srv6-service set protocols bgp group to-PE-all family inet6 unicast advertise-srv6-service set protocols bgp group to-PE-all family inet6 unicast accept-srv6-service set protocols bgp group to-PE-all family inet6-vpn unicast advertise-srv6-service set protocols bgp group to-PE-all family inet6-vpn unicast accept-srv6-service set protocols bgp group to-PE-all export adv_global set protocols bgp group to-PE-all cluster 128.53.38.52 set protocols bgp group to-PE-all neighbor abcd::128:53:35:39 set protocols bgp group to-PE-all neighbor abcd::128:53:35:35 set protocols bgp group to-TG-global-v4 type external set protocols bgp group to-TG-global-v4 local-address 11.1.1.1 set protocols bgp group to-TG-global-v4 family inet unicast set protocols bgp group to-TG-global-v4 family inet6 unicast set protocols bgp group to-TG-global-v4 peer-as 1001 set protocols bgp group to-TG-global-v4 neighbor 11.1.1.2 set protocols bgp group to-TG-global-v6 type external set protocols bgp group to-TG-global-v6 local-address 2001:11:1:1::1 set protocols bgp group to-TG-global-v6 family inet6 unicast set protocols bgp group to-TG-global-v6 peer-as 1001 set protocols bgp group to-TG-global-v6 neighbor 2001:11:1:1::2 set protocols bgp source-packet-routing srv6 locator loc1 end-dt4-sid 3001::2 set protocols bgp source-packet-routing srv6 locator loc1 end-dt6-sid 3001::3 set protocols isis interface all set protocols isis interface fxp0.0 disable set protocols isis level 1 disable
路由器 R1
set chassis network-services enhanced-ip set interfaces xe-0/0/0:2 unit 0 family inet address 2.5.1.1/30 set interfaces xe-0/0/0:2 unit 0 family iso set interfaces xe-0/0/0:2 unit 0 family inet6 address 2001:db8::52:0:1/64 set interfaces xe-0/0/0:3 unit 0 family inet address 2.6.1.1/30 set interfaces xe-0/0/0:3 unit 0 family iso set interfaces xe-0/0/0:3 unit 0 family inet6 address 2001:db8::26:1/64 set policy-options policy-statement adv_global term v4 from route-filter 21.0.0.0/8 orlonger set policy-options policy-statement adv_global term v4 from route-filter 12.1.1.1/30 orlonger set policy-options policy-statement adv_global term v4 then next-hop self set policy-options policy-statement adv_global term v4 then accept set policy-options policy-statement adv_global term v6 from route-filter 2001:21::/64 orlonger set policy-options policy-statement adv_global term v6 from route-filter 2001:12:1:1::1/126 orlonger set policy-options policy-statement adv_global term v6 then next-hop self set policy-options policy-statement adv_global term v6 then accept set policy-options policy-statement adv_vpn1 term v4 from route-filter 31.0.0.0/8 orlonger set policy-options policy-statement adv_vpn1 term v4 from route-filter 12.1.1.5/30 orlonger set policy-options policy-statement adv_vpn1 term v4 then community set vpn1-target set policy-options policy-statement adv_vpn1 term v4 then next-hop self set policy-options policy-statement adv_vpn1 term v4 then accept set policy-options policy-statement adv_vpn1 term v6 from route-filter 2001:31::/64 orlonger set policy-options policy-statement adv_vpn1 term v6 from route-filter 2001:12:1:1::5/126 orlonger set policy-options policy-statement adv_vpn1 term v6 then community set vpn1-target set policy-options policy-statement adv_vpn1 term v6 then next-hop self set policy-options policy-statement adv_vpn1 term v6 then accept set policy-options policy-statement pplb then load-balance per-packet set policy-options community vpn1-target members target:100:1 set policy-options community vpn2-target members target:100:2 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 type external set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 local-address 12.1.1.5 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 family inet unicast set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 family inet6 unicast set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 peer-as 1012 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 neighbor 12.1.1.6 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 type external set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 local-address 2001:12:1:1::5 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 family inet6 unicast set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 peer-as 1012 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 neighbor 2001:12:1:1::6 set routing-instances vpn1 protocols bgp source-packet-routing srv6 locator loc1 end-dt4-sid 3011::4 set routing-instances vpn1 protocols bgp source-packet-routing srv6 locator loc1 end-dt6-sid 3011::5 set routing-instances vpn1 instance-type vrf set routing-instances vpn1 interface xe-0/0/1:0.1 set routing-instances vpn1 route-distinguisher 100:1 set routing-instances vpn1 vrf-export adv_vpn1 set routing-instances vpn1 vrf-target target:100:1 set routing-options source-packet-routing srv6 locator loc1 3011::/64 set routing-options source-packet-routing srv6 no-reduced-srh set routing-options rib inet6.3 static route abcd::128:53:38:52/128 next-hop self set routing-options rib inet6.3 static route abcd::128:53:38:52/128 resolve set routing-options rib inet6.0 static route abcd::128:53:38:52/128 next-hop self set routing-options rib inet6.0 static route abcd::128:53:38:52/128 resolve set routing-options autonomous-system 100 set routing-options forwarding-table export pplb set protocols bgp group to-RR type internal set protocols bgp group to-RR local-address abcd::128:53:35:39 set protocols bgp group to-RR family inet unicast extended-nexthop set protocols bgp group to-RR family inet unicast advertise-srv6-service set protocols bgp group to-RR family inet unicast accept-srv6-service set protocols bgp group to-RR family inet-vpn unicast extended-nexthop set protocols bgp group to-RR family inet-vpn unicast advertise-srv6-service set protocols bgp group to-RR family inet-vpn unicast accept-srv6-service set protocols bgp group to-RR family inet6 unicast advertise-srv6-service set protocols bgp group to-RR family inet6 unicast accept-srv6-service set protocols bgp group to-RR family inet6-vpn unicast advertise-srv6-service set protocols bgp group to-RR family inet6-vpn unicast accept-srv6-service set protocols bgp group to-RR export adv_global set protocols bgp group to-RR neighbor abcd::128:53:38:52 set protocols bgp group to-TG-global-v4 type external set protocols bgp group to-TG-global-v4 local-address 12.1.1.1 set protocols bgp group to-TG-global-v4 family inet unicast set protocols bgp group to-TG-global-v4 family inet6 unicast set protocols bgp group to-TG-global-v4 peer-as 1011 set protocols bgp group to-TG-global-v4 neighbor 12.1.1.2 set protocols bgp group to-TG-global-v6 type external set protocols bgp group to-TG-global-v6 local-address 2001:12:1:1::1 set protocols bgp group to-TG-global-v6 family inet6 unicast set protocols bgp group to-TG-global-v6 peer-as 1011 set protocols bgp group to-TG-global-v6 neighbor 2001:12:1:1::2 set protocols bgp source-packet-routing srv6 locator loc1 end-dt4-sid 3011::2 set protocols bgp source-packet-routing srv6 locator loc1 end-dt6-sid 3011::3 set protocols isis interface all set protocols isis interface fxp0.0 disable set protocols isis level 1 disable
路由器 R2
set chassis network-services enhanced-ip set interfaces ge-0/0/0 unit 0 family inet address 3.5.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::3:5:1/64 set interfaces ge-0/0/1 unit 0 family inet address 3.6.1.1/30 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family inet6 address 2001:db8::3:6:1/64 set interfaces lo0 unit 0 family inet6 address 2001:db8:1:255::2/128 set policy-options policy-statement adv_global term v4 from route-filter 22.0.0.0/8 orlonger set policy-options policy-statement adv_global term v4 from route-filter 13.1.1.1/30 orlonger set policy-options policy-statement adv_global term v4 then next-hop self set policy-options policy-statement adv_global term v4 then accept set policy-options policy-statement adv_global term v6 from route-filter 2001:22::/64 orlonger set policy-options policy-statement adv_global term v6 from route-filter 2001:13:1:1::1/126 orlonger set policy-options policy-statement adv_global term v6 then next-hop self set policy-options policy-statement adv_global term v6 then accept set policy-options policy-statement adv_vpn1 term v4 from route-filter 32.0.0.0/8 orlonger set policy-options policy-statement adv_vpn1 term v4 from route-filter 13.1.1.5/30 orlonger set policy-options policy-statement adv_vpn1 term v4 then community set vpn1-target set policy-options policy-statement adv_vpn1 term v4 then next-hop self set policy-options policy-statement adv_vpn1 term v4 then accept set policy-options policy-statement adv_vpn1 term v6 from route-filter 2001:32::/64 orlonger set policy-options policy-statement adv_vpn1 term v6 from route-filter 2001:13:1:1::5/126 orlonger set policy-options policy-statement adv_vpn1 term v6 then community set vpn1-target set policy-options policy-statement adv_vpn1 term v6 then next-hop self set policy-options policy-statement adv_vpn1 term v6 then accept set policy-options policy-statement pplb then load-balance per-packet set policy-options community vpn1-target members target:100:1 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 type external set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 local-address 13.1.1.5 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 family inet unicast set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 family inet6 unicast set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 peer-as 1022 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 neighbor 13.1.1.6 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 type external set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 local-address 2001:13:1:1::5 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 family inet6 unicast set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 peer-as 1022 set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 neighbor 2001:13:1:1::6 set routing-instances vpn1 protocols bgp source-packet-routing srv6 locator loc1 end-dt4-sid 3021::4 set routing-instances vpn1 protocols bgp source-packet-routing srv6 locator loc1 end-dt6-sid 3021::5 set routing-instances vpn1 instance-type vrf set routing-instances vpn1 interface ge-0/0/2.1 set routing-instances vpn1 route-distinguisher 100:1 set routing-instances vpn1 vrf-export adv_vpn1 set routing-instances vpn1 vrf-target target:100:1 set routing-options source-packet-routing srv6 locator loc1 3021::/64 set routing-options source-packet-routing srv6 no-reduced-srh set routing-options rib inet6.3 static route abcd::128:53:38:52/128 next-hop self set routing-options rib inet6.3 static route abcd::128:53:38:52/128 resolve set routing-options rib inet6.0 static route abcd::128:53:38:52/128 next-hop self set routing-options rib inet6.0 static route abcd::128:53:38:52/128 resolve set routing-options autonomous-system 100 set routing-options forwarding-table export pplb set protocols bgp group to-RR type internal set protocols bgp group to-RR local-address abcd::128:53:35:35 set protocols bgp group to-RR family inet unicast extended-nexthop set protocols bgp group to-RR family inet unicast advertise-srv6-service set protocols bgp group to-RR family inet unicast accept-srv6-service set protocols bgp group to-RR family inet-vpn unicast extended-nexthop set protocols bgp group to-RR family inet-vpn unicast advertise-srv6-service set protocols bgp group to-RR family inet-vpn unicast accept-srv6-service set protocols bgp group to-RR family inet6 unicast advertise-srv6-service set protocols bgp group to-RR family inet6 unicast accept-srv6-service set protocols bgp group to-RR family inet6-vpn unicast advertise-srv6-service set protocols bgp group to-RR family inet6-vpn unicast accept-srv6-service set protocols bgp group to-RR export adv_global set protocols bgp group to-RR neighbor abcd::128:53:38:52 set protocols bgp group to-TG-global-v4 type external set protocols bgp group to-TG-global-v4 local-address 13.1.1.1 set protocols bgp group to-TG-global-v4 family inet unicast set protocols bgp group to-TG-global-v4 family inet6 unicast set protocols bgp group to-TG-global-v4 peer-as 1021 set protocols bgp group to-TG-global-v4 neighbor 13.1.1.2 set protocols bgp group to-TG-global-v6 type external set protocols bgp group to-TG-global-v6 local-address 2001:13:1:1::1 set protocols bgp group to-TG-global-v6 family inet6 unicast set protocols bgp group to-TG-global-v6 peer-as 1021 set protocols bgp group to-TG-global-v6 neighbor 2001:13:1:1::2 set protocols bgp source-packet-routing srv6 locator loc1 end-dt4-sid 3021::2 set protocols bgp source-packet-routing srv6 locator loc1 end-dt6-sid 3021::3 set protocols isis interface all set protocols isis interface fxp0.0 disable set protocols isis level 1 disable
路由器 R3
set chassis network-services enhanced-ip set interfaces xe-0/0/0:0 unit 0 family inet address 1.4.1.2/30 set interfaces xe-0/0/0:0 unit 0 family iso set interfaces xe-0/0/0:0 unit 0 family inet6 address 2001:db8::4:2/64 set interfaces xe-0/0/1:0 unit 0 family inet address 2.5.1.2/30 set interfaces xe-0/0/1:0 unit 0 family iso set interfaces xe-0/0/1:0 unit 0 family inet6 address 2001:db8::52:0:2/64 set interfaces xe-0/0/1:1 unit 0 family inet address 3.5.1.2/30 set interfaces xe-0/0/1:1 unit 0 family iso set interfaces xe-0/0/1:1 unit 0 family inet6 address 2001:db8::3:5:2/64 set interfaces xe-0/0/1:2 unit 0 family inet address 4.6.1.1/30 set interfaces xe-0/0/1:2 unit 0 family iso set interfaces xe-0/0/1:2 unit 0 family inet6 address 2001:db8::4:6:1/64 set interfaces lo0 unit 0 family inet6 address 2001:db8:1:255::3/128 set routing-options autonomous-system 100 set protocols isis interface all set protocols isis interface fxp0.0 disable set protocols isis level 1 disable
路由器 R4
set chassis network-services enhanced-ip set interfaces xe-0/0/0:0 unit 0 family inet address 1.6.1.2/30 set interfaces xe-0/0/0:0 unit 0 family iso set interfaces xe-0/0/0:0 unit 0 family inet6 address 2001:db8::6:2/64 set interfaces xe-0/0/0:1 unit 0 family inet address 2.6.1.2/30 set interfaces xe-0/0/0:1 unit 0 family iso set interfaces xe-0/0/0:1 unit 0 family inet6 address 2001:db8::26:2/64 set interfaces xe-0/0/0:2 unit 0 family inet address 3.6.1.2/30 set interfaces xe-0/0/0:2 unit 0 family iso set interfaces xe-0/0/0:2 unit 0 family inet6 address 2001:db8::3:6:2/64 set interfaces xe-0/0/0:3 unit 0 family inet address 4.6.1.2/30 set interfaces xe-0/0/0:3 unit 0 family iso set interfaces xe-0/0/0:3 unit 0 family inet6 address 2001:db8::4:6:2/64 set interfaces lo0 unit 0 family inet6 address 2001:db8:1:255::4/128 set routing-options autonomous-system 100 set protocols isis interface all set protocols isis interface fxp0.0 disable set protocols isis level 1 disable
配置路由器 R0
分步程序
要使用第 3 层 VPN 服务配置 SRv6 网络编程,请在路由器 R0 上执行以下步骤:
-
配置设备接口以启用 IP 传输。
[edit] user@R0# set interfaces xe-0/0/0:0 unit 0 family inet address 1.4.1.1/30 user@R0# set interfaces xe-0/0/0:0 unit 0 family iso user@R0# set interfaces xe-0/0/0:0 unit 0 family inet6 address 2001:db8::4:1/64 user@R0# set interfaces xe-0/0/0:2 unit 0 family inet address 1.6.1.1/30 user@R0# set interfaces xe-0/0/0:2 unit 0 family iso user@R0# set interfaces xe-0/0/0:2 unit 0 family inet6 address 2001:db8::6:1/64
-
配置路由器 ID 和自治系统 (AS) 编号,以便在属于同一 AS 的一组路由设备内传播路由信息 AS。
[edit] user@R0# set routing-options router-id 128.53.38.52 user@R0# set routing-options autonomous-system 100
-
全局启用 SRv6 和定位器地址以指示路由器的 SRv6 功能。SRv6 SID 是一个 IPv6 地址,由定位器和函数组成。路由协议播发定位器地址。
[edit] user@R0# set routing-options source-packet-routing srv6 locator loc1 3001::/64 user@R0# set routing-options source-packet-routing srv6 no-reduced-srh
-
为 IPv4 和 IPv6 流量配置外部路由实例 VPN1。为 VPN1 配置 BGP 协议,以便在提供商边缘设备之间启用对等互连和流量传输。
[edit] user@R0# set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 type external user@R0# set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 local-address 11.1.1.5 user@R0# set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 family inet unicast user@R0# set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 family inet6 unicast user@R0# set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 peer-as 1002 user@R0# set routing-instances vpn1 protocols bgp group to-TG-vpn1-v4 neighbor 11.1.1.6 user@R0# set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 type external user@R0# set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 local-address 2001:11:1:1::5 user@R0# set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 family inet6 unicast user@R0# set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 peer-as 1002 user@R0# set routing-instances vpn1 protocols bgp group to-TG-vpn1-v6 neighbor 2001:11:1:1::6
-
为参与路由实例的每个 PE 路由器配置 VPN 类型和唯一路由识别符。
[edit] user@R0# set routing-instances vpn1 instance-type vrf user@R0# set routing-instances vpn1 interface xe-0/0/0:3.1 user@R0# set routing-instances vpn1 route-distinguisher 100:1 user@R0# set routing-instances vpn1 vrf-target target:100:1
-
配置 end-dt4 和 end-dt6 SID 值以启用第 3 层 VPN 服务。
[edit] user@R0# set routing-instances vpn1 protocols bgp source-packet-routing srv6 locator loc1 end-dt4-sid 3001::4 user@R0# set routing-instances vpn1 protocols bgp source-packet-routing srv6 locator loc1 end-dt6-sid 3001::5
-
定义策略以对数据包进行负载均衡。
[edit] user@R0# set policy-options policy-statement pplb then load-balance per-packet user@R0# set policy-options community vpn1-target members target:100:1 user@R0# set policy-options community vpn2-target members target:100:2
-
应用按数据包的策略以启用流量的负载平衡。
[edit] user@R0# set routing-options forwarding-table export pplb
-
定义一个策略adv_global以接受从 R1 播发的路由。
[edit] user@R0# set policy-options policy-statement adv_global term v4 from route-filter 20.0.0.0/8 orlonger user@R0# set policy-options policy-statement adv_global term v4 then next-hop self user@R0# set policy-options policy-statement adv_global term v4 then accept user@R0# set policy-options policy-statement adv_global term v6 from route-filter 2001:20::/64 orlonger user@R0# set policy-options policy-statement adv_global term v6 then next-hop self user@R0# set policy-options policy-statement adv_global term v6 then accept
-
在面向核心的接口上配置 BGP,以建立内部和外部对等会话。
[edit] user@R0# set protocols bgp group to-PE-all type internal user@R0# set protocols bgp group to-PE-all local-address abcd::128:53:38:52 user@R0# set protocols bgp group to-PE-all family inet unicast extended-nexthop user@R0# set protocols bgp group to-PE-all family inet unicast advertise-srv6-service user@R0# set protocols bgp group to-PE-all family inet unicast accept-srv6-service user@R0# set protocols bgp group to-PE-all family inet-vpn unicast extended-nexthop user@R0# set protocols bgp group to-PE-all export adv_global user@R0# set protocols bgp group to-PE-all cluster 128.53.38.52 user@R0# set protocols bgp group to-PE-all neighbor abcd::128:53:35:39 user@R0# set protocols bgp group to-PE-all neighbor abcd::128:53:35:35 user@R0# set protocols bgp group to-TG-global-v4 type external user@R0# set protocols bgp group to-TG-global-v4 local-address 11.1.1.1 user@R0# set protocols bgp group to-TG-global-v4 family inet unicast user@R0# set protocols bgp group to-TG-global-v4 family inet6 unicast user@R0# set protocols bgp group to-TG-global-v4 user@R0# set protocols bgp group to-TG-global-v4 neighbor 11.1.1.2 user@R0# set protocols bgp group to-TG-global-v6 type external user@R0# set protocols bgp group to-TG-global-v6 local-address 2001:11:1:1::1 user@R0# set protocols bgp group to-TG-global-v6 family inet6 unicast user@R0# set protocols bgp group to-TG-global-v6 peer-as 1001 user@R0# set protocols bgp group to-TG-global-v6 neighbor 2001:11:1:1::2
-
使设备能够将 SRv6 服务播发至 BGP 对等方,并接受出口提供商边缘 (PE) 设备播发的路由。
[edit] user@R0# set protocols bgp group to-PE-all family inet-vpn unicast advertise-srv6-service user@R0# set protocols bgp group to-PE-all family inet-vpn unicast accept-srv6-service user@R0# set protocols bgp group to-PE-all family inet6 unicast advertise-srv6-service user@R0# set protocols bgp group to-PE-all family inet6 unicast accept-srv6-service user@R0# set protocols bgp group to-PE-all family inet6-vpn unicast advertise-srv6-service user@R0# set protocols bgp group to-PE-all family inet6-vpn unicast accept-srv6-service
-
启用 IS-IS 作为内部网关协议 (IGP),用于在核心提供商路由器之间路由流量。
[edit] user@R0# set protocols isis interface all user@R0# set protocols isis interface fxp0.0 disable user@R0# user@R0# set protocols isis level 1 disable
-
为前缀分段配置 end-dt4 和 end-dt6 SID 值。end-dt4 是具有解封装和 IPv4 表查找的端点 SID,end-dt6 是具有解封装和 IPv6 表查找的端点。BGP 为 IPv4 和 IPv6 第 3 层 VPN 服务 SID 分配这些 SID。
[edit] user@R0# set protocols bgp source-packet-routing srv6 locator loc1 end-dt4-sid 3001::2 user@R0# set protocols bgp source-packet-routing srv6 locator loc1 end-dt6-sid 3001::3
结果
在配置模式下,输入 show interfaces、 show protocols、 show policy-options和 show routing-options 命令以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
[edit]
user@R0# show interfaces
xe-0/0/0:0 {
unit 0 {
family inet {
address 1.4.1.1/30;
}
family iso;
family inet6 {
address 2001:db8::4:1/64;
}
}
}
xe-0/0/0:1 {
unit 0 {
family inet {
address 1.5.1.1/30;
}
family iso;
family inet6 {
address 2001:1:4:2::1/126;
}
}
}
xe-0/0/0:2 {
unit 0 {
family inet {
address 1.6.1.1/30;
}
family iso;
family inet6 {
address 2001:db8::6:1/64;
}
}
}
[edit]
user@R0# show protocols
bgp {
group to-PE-all {
type internal;
local-address abcd::128:53:38:52;
family inet {
unicast {
extended-nexthop;
advertise-srv6-service;
accept-srv6-service;
}
}
family inet-vpn {
unicast {
extended-nexthop;
advertise-srv6-service;
accept-srv6-service;
}
}
family inet6 {
unicast {
advertise-srv6-service;
accept-srv6-service;
}
}
family inet6-vpn {
unicast {
advertise-srv6-service;
accept-srv6-service;
}
}
export adv_global;
cluster 128.53.38.52;
neighbor abcd::128:53:35:39;
neighbor abcd::128:53:35:35;
}
group to-TG-global-v4 {
type external;
local-address 11.1.1.1;
family inet {
unicast;
}
family inet6 {
unicast;
}
peer-as 1001;
neighbor 11.1.1.2;
}
group to-TG-global-v6 {
type external;
local-address 2001:11:1:1::1;
family inet6 {
unicast;
}
peer-as 1001;
neighbor 2001:11:1:1::2;
}
source-packet-routing {
srv6 {
locator loc1 {
end-dt4-sid 3001::2;
end-dt6-sid 3001::3;
}
}
}
}
isis {
interface all;
interface fxp0.0 {
disable;
}
level 1 disable;
}
[edit]
user@R0# show policy-options
policy-options {
policy-statement adv_global {
term v4 {
from {
route-filter 20.0.0.0/8 orlonger;
}
then {
next-hop self;
accept;
}
}
term v6 {
from {
route-filter 2001:20::/64 orlonger;
}
then {
next-hop self;
accept;
}
}
}
policy-statement pplb {
then {
load-balance per-packet;
}
}
community vpn1-target members target:100:1;
community vpn2-target members target:100:2;
}
[edit]
user@R0# show routing-options
routing-options {
source-packet-routing {
srv6 {
locator loc1 3001::/64;
no-reduced-srh;
}
}
router-id 128.53.38.52;
autonomous-system 100;
forwarding-table {
export pplb;
}
}
[edit]
user@R0# show routing-instances
routing-instances {
vpn1 {
protocols {
bgp {
group to-TG-vpn1-v4 {
type external;
local-address 11.1.1.5;
family inet {
unicast;
}
family inet6 {
unicast;
}
peer-as 1002;
neighbor 11.1.1.6;
}
group to-TG-vpn1-v6 {
type external;
local-address 2001:11:1:1::5;
family inet6 {
unicast;
}
peer-as 1002;
neighbor 2001:11:1:1::6;
}
source-packet-routing {
srv6 {
locator loc1 {
end-dt4-sid 3001::4;
end-dt6-sid 3001::5;
}
}
}
}
}
instance-type vrf;
interface xe-0/0/0:3.1;
route-distinguisher 100:1;
vrf-target target:100:1;
}
}
完成设备配置后,从配置模式进入 commit 。
验证
确认配置工作正常。
- 验证播发的 IPv4 路由是否已安装在 IPv4 表中
- 验证 IPv4 表中是否安装了 SRv6 SID
- 验证 VPN 表中是否安装了 IPv6 VPN 路由
- 验证 VPN 表中是否安装了 IPv4 VPN 路由
验证播发的 IPv4 路由是否已安装在 IPv4 表中
目的
验证入口路由器 R0 是否已从出口路由器 R1 获知到 IPv4 前缀 21.0.0.0 的路由。
行动
在操作模式下,对路由器 R0 运行 show route 21.0.0.0 命令。
user@R0> show route 21.0.0.0
inet.0: 59 destinations, 59 routes (59 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
21.0.0.0/30 *[BGP/170] 09:15:25, localpref 100, from abcd::128:53:37:72
AS path: {65501} I, validation-state: unverified
> to fe80::2e6b:f5ff:fe28:2bcb via ae0.0, SRV6-Tunnel, Dest: 3011::
to fe80::2e6b:f5ff:fe28:2b04 via xe-0/0/0:2.0, SRV6-Tunnel, Dest: 3011::
to fe80::2e6b:f5ff:fe73:1e01 via xe-0/0/0:3.0, SRV6-Tunnel, Dest: 3011::
意义
输出确认 inet.0 表中安装了 IPv4 前缀 21.0.0.0。
验证 IPv4 表中是否安装了 SRv6 SID
目的
验证入口路由器 R0 是否已接收并接受来自出口路由器 R1 的 SRv6 end-dt4 SID 3011::2。
行动
在操作模式下,对路由器 R0 运行 show route 21.0.0.0 extensive 命令。
user@> show route 21.0.0.0 extensive
inet.0: 59 destinations, 59 routes (59 active, 0 holddown, 0 hidden)
21.0.0.0/30 (1 entry, 1 announced)
TSI:
KRT in-kernel 21.0.0.0/30 -> {composite(716)}
*BGP Preference: 170/-101
Next hop type: Indirect, Next hop index: 0
Address: 0xc5aa39c
Next-hop reference count: 20
Source: abcd::128:53:37:72
Next hop type: List, Next hop index: 1048574
Next hop: ELNH Address 0xc5a9e88, selected
Next hop type: Chain, Next hop index: 725
Address: 0xc5a9e88
Next-hop reference count: 1
Next hop: ELNH Address 0xc5a9aa0
SRV6-Tunnel: Reduced-SRH Encap-mode
Src: abcd::128:53:35:39 Dest: 3011::
Segment-list[0] 3011::
Next hop type: Router, Next hop index: 700
Address: 0xc5a9aa0
Next-hop reference count: 4
Next hop: fe80::2e6b:f5ff:fe28:2bcb via ae0.0
Next hop: ELNH Address 0xc5a9eec
Next hop type: Chain, Next hop index: 726
Address: 0xc5a9eec
Next-hop reference count: 1
Next hop: ELNH Address 0xc5a9c30
SRV6-Tunnel: Reduced-SRH Encap-mode
Src: abcd::128:53:35:39 Dest: 3011::
Segment-list[0] 3011::
Next hop type: Router, Next hop index: 702
Address: 0xc5a9c30
Next-hop reference count: 4
Next hop: fe80::2e6b:f5ff:fe28:2b04 via xe-0/0/0:2.0
Next hop: ELNH Address 0xc5aa0e0
Next hop type: Chain, Next hop index: 727
Address: 0xc5aa0e0
Next-hop reference count: 1
Next hop: ELNH Address 0xc5a9780
SRV6-Tunnel: Reduced-SRH Encap-mode
Src: abcd::128:53:35:39 Dest: 3011::
Segment-list[0] 3011::
Next hop type: Router, Next hop index: 647
Address: 0xc5a9780
Next-hop reference count: 20
Next hop: fe80::2e6b:f5ff:fe73:1e01 via xe-0/0/0:3.0
Protocol next hop: abcd::128:53:37:72
Composite next hop: 0xbd4e7d0 716 INH Session ID: 0x151
Indirect next hop: 0xc762204 1048582 INH Session ID: 0x151
State: <Active int Ext>
Local AS: 100 Peer AS: 100
Age: 9:13:44 Metric2: 20
Validation State: unverified
ORR Generation-ID: 0
Task: BGP_100.abcd::128:53:37:72
Announcement bits (1): 0-KRT
AS path: {65501}
Accepted
SRv6 SID: 3011::2
Localpref: 100
Router ID: 128.53.37.72
Composite next hops: 1
Protocol next hop: abcd::128:53:37:72 Metric: 20
Composite next hop: 0xbd4e7d0 716 INH Session ID: 0x151
Indirect next hop: 0xc762204 1048582 INH Session ID: 0x151
Indirect path forwarding next hops: 3
Next hop type: List
Next hop: fe80::2e6b:f5ff:fe28:2bcb via ae0.0
Next hop: fe80::2e6b:f5ff:fe28:2b04 via xe-0/0/0:2.0
Next hop: fe80::2e6b:f5ff:fe73:1e01 via xe-0/0/0:3.0
abcd::128:53:37:72/128 Originating RIB: inet6.3
Metric: 20 Node path count: 1
Indirect next hops: 1
Protocol next hop: 3011:: Metric: 20
Inode flags: 0x206 path flags: 0x0
Path fnh link: 0xc3bf4c0 path inh link: 0x0
Indirect next hop: 0xc76cd04 - INH Session ID: 0x0
Indirect path forwarding next hops: 3
Next hop type: List
Next hop: fe80::2e6b:f5ff:fe28:2bcb via ae0.0
Next hop: fe80::2e6b:f5ff:fe28:2b04 via xe-0/0/0:2.0
Next hop: fe80::2e6b:f5ff:fe73:1e01 via xe-0/0/0:3.0
3011:: Originating RIB: inet6.3
Metric: 20 Node path count: 1
Forwarding nexthops: 3
Next hop type: List
Next hop: fe80::2e6b:f5ff:fe28:2bcb via ae0.0
Next hop: fe80::2e6b:f5ff:fe28:2b04 via xe-0/0/0:2.0
Next hop: fe80::2e6b:f5ff:fe73:1e01 via xe-0/0/0:3.0
意义
输出显示 SRv6 SID,并确认在路由器 R0 和 R1 之间建立了 SRv6 隧道。
验证 VPN 表中是否安装了 IPv6 VPN 路由
目的
验证入口路由器 R0 是否已从出口路由器 R1 获知到 VPN IPv6 前缀 2001::30::/126 的路由。
行动
在操作模式下,对路由器 R0 运行 show route 2001:31:: 命令。
user@R0> show route 2001:31::
vpn1.inet6.0: 36 destinations, 36 routes (36 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
2001:31::/126 *[BGP/170] 09:15:40, localpref 100, from abcd::128:53:37:72
AS path: {65502} I, validation-state: unverified
> to fe80::2e6b:f5ff:fe28:2bcb via ae0.0, SRV6-Tunnel, Dest: 3011::
to fe80::2e6b:f5ff:fe28:2b04 via xe-0/0/0:2.0, SRV6-Tunnel, Dest: 3011::
to fe80::2e6b:f5ff:fe73:1e01 via xe-0/0/0:3.0, SRV6-Tunnel, Dest: 3011::
意义
输出确认前缀 2001:31::/126 的路由详细信息已安装在 vpn.inet6.0 表中。
验证 VPN 表中是否安装了 IPv4 VPN 路由
目的
验证入口路由器 R0 是否已从出口路由器 R1 获知到 VPN IPv4 前缀 31.0.0.0 的路由。
行动
在操作模式下,对路由器 R0 运行 show route 31.0.0.0 命令。
user@R0> show route 31.0.0.0
vpn1.inet.0: 34 destinations, 34 routes (34 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
31.0.0.0/30 *[BGP/170] 09:15:29, localpref 100, from abcd::128:53:37:72
AS path: {65502} I, validation-state: unverified
to fe80::2e6b:f5ff:fe28:2bcb via ae0.0, SRV6-Tunnel, Dest: 3011::
to fe80::2e6b:f5ff:fe28:2b04 via xe-0/0/0:2.0, SRV6-Tunnel, Dest: 3011::
> to fe80::2e6b:f5ff:fe73:1e01 via xe-0/0/0:3.0, SRV6-Tunnel, Dest: 3011::
意义
输出确认 vpn.inet.0 表中安装了 IPv4 前缀 31.0.0.0。
SRv6 隧道的 SR-流量工程策略概述
- SRv6 流量工程策略的优势
- SRv6 流量工程策略概述
- 什么是分段路由扩展报头?
- 适用于 SRv6 流量工程的 TI-LFA
- 通过 SRv6 核心实现第 3 层 VPN 服务
- 向 BGP 对等方播发第 3 层 VPN 服务
- SR-流量工程中 SRv6 网络编程支持和不支持的功能
SRv6 流量工程策略的优势
- 灵活部署 — 借助 SRv6 流量工程,无需部署 MPLS,即可利用分段路由。此类网络仅依靠 IPv6 报头和报头扩展名来传输数据。这对于网络以 IPv6 为主且尚未部署 MPLS 的服务提供商非常有用。
- 增强的可扩展性 — SRv6 流量工程确保您可以在核心 IPv6 网络中完成部署,而无需进行任何重大硬件或软件升级,从而提高了可扩展性。
- 提高效率 — SRv6 流量工程使用 IS-IS SRv6 SID 来形成分段列表。因此,它利用了 IS-IS SRv6 SID 的 TI-LFA 路径,并可以基于 IGP 形成备用路径。
- 负载平衡 — SRv6 流量工程利用 IS-IS 加权等价多路径 (ECMP),还可以在各个分段列表中拥有自己的 ECMP,以形成分层加权 ECMP,进而在粒度级别上执行负载平衡。
SRv6 流量工程策略概述
SR-流量工程策略包含一个或多个静态配置或由不同隧道源(即 PCEP、BGP-SRTE、DTM)贡献的 SR-流量工程隧道。Junos OS 支持具有静态配置的 SR-流量工程策略的 SRv6 数据平面。
在 SRv6 流量工程策略中:
- IS-IS 配置填充核心。
- SRv6 流量工程隧道配置将填充传输。
- BGP 网络层可达性信息 (NLRI) 填充了服务。
创建 SRv6 流量工程数据平面后,您可以启用以 BGP 作为控制平面、SRv6 作为数据平面的第 3 层叠加服务。所需的有效负载可以是 IPv4 或 IPv6。
图 5 描述了 SRv6 流量工程拓扑,其中 R1 是将 SRv6 流量工程策略配置为 R6 的入口节点。R6 是出口节点,配置了对 BGP 对等方的第 3 层 VPN 服务。核心构成 IS-IS SRv6。出口路由器 R6 将 L3VPN SID 播发至入口路由器 R1,后者接受并更新 VRF 表。R6 配置为 2001:db8:0:a6::d 06 作为终端 SID,L3VPN 服务导出到 CE7 到 R1,并将 2001:db8:0:a6::d 06 作为下一跃点。有两个分段列表:<R4、R5、R6> 和 <R2、R3、R6>。
什么是分段路由扩展报头?
分段标识符 (SID) 表示分段路由域中的特定分段。在 IPv6 网络中,使用的 SID 类型是 128 位 IPv6 地址,也称为 SRv6 分段或 SRv6 SID。SRv6 将这些 IPv6 地址堆叠起来,而不是分段路由扩展标头中的 MPLS 标签。分段路由扩展报头 (SRH) 是一种 IPv6 路由扩展报头。通常,SRH 包含编码为 SRv6 SID 的分段列表。SRv6 SID 由以下部分组成:
-
Locator— 定位符是 SID 的第一部分,由表示特定 SRv6 节点地址的最有效位组成。定位器类似于为其父节点提供路由的网络地址。IS-IS 协议在路由表中
inet6.0安装定位器路由。IS-IS 将分段路由到其父节点,父节点随后执行在 SRv6 SID 的其他部分中定义的功能。您还可以指定与此定位器关联的算法。 -
Function- SID 的另一部分定义在定位器指定的节点上本地执行的函数。Internet 草案 draft-ietf-spring-srv6-network-programming-07draft, SRv6 网络编程中已经定义了多个函数。但是,我们已经在 Junos OS 上实施了以下功能,这些功能在 IS-IS 中发出信号。IS-IS 在路由表中
inet6.0安装这些函数 SID。-
End— 用于前缀 SID 的 SRv6 实例化的端点函数。它不允许对外部标头进行解封装以删除 SRH。因此,结束 SID 不能是 SID 列表的最后一个 SID,也不能是没有 SRH 的数据包的目标地址 (DA)(除非与 PSP、USP 或 USD 类型结合使用)。
-
End.X—端点 X 函数是相邻 SID 的 SRv6 实例化。它是端点功能的一种变体,可将第 3 层交叉连接到第 3 层邻接数组。
您可以指定结束 SID 行为,例如倒数第二个分段弹出 (PSP)、终极分段弹出 (USP) 或终极分段解封装 (USD)。
-
PSP—当最后一个 SID 写入目标地址时,带有 PSP 风格的 End 和 End.X 函数会弹出最顶层的 SRH。后续堆叠的 SRH 可能存在,但不会作为函数的一部分进行处理。
-
USP— 当下一个报头是 SRH 且没有剩余分段时,IS-IS 协议会弹出顶部 SRH,查找更新的目标地址,并根据匹配表条目转发数据包。
-
USD— 当数据包中的下一个报头为 41 或是 SRH 并且没有剩余分段时,IS-IS 会弹出外部 IPv6 报头及其扩展报头,查找公开的内部 IP 目的地址,并将数据包转发到匹配的表条目。
-
例如,可以有一个 SRv6 SID,其中 2001::19:db8:AC05:FF01:FF01: 是定位符,A000:B000:C000:A000 是函数:
|
定位器 |
功能 |
|
2001::d b8:19:AC05:FF01:FF01 |
A000:B000:C000:A000 |
适用于 SRv6 流量工程的 TI-LFA
拓扑独立无环路备用 (TI-LFA) 可建立与融合后路径对齐的快速重新路由 (FRR) 路径。支持 SRv6 的节点可将单个分段插入 IPv6 标头,或将多个分段插入 SRH。多个 SRH 会显著增加封装开销,有时可能超过实际的数据包有效负载。因此,默认情况下,Junos OS 支持具有较低 SRH 的 SRv6 流量工程隧道封装。本地修复点 (PLR) 将 FRR 路径信息添加到包含 SRv6 SID 的 SRH。
TI-LFA 备份路径表示为 SRH 内的一组 SRv6 SID。在入口路由器上,IS-IS 将 SRH 封装在新的 IPv6 报头中。但是,在传输路由器上,IS-IS 会通过以下方式将 SRH 插入到数据流量中:
-
Encap Mode— 在封装模式下,原始 IPv6 数据包作为 IPv6 in-IPv6 封装数据包的内部数据包进行封装和传输。外部 IPv6 数据包携带带有分段列表的 SRH。原始 IPv6 数据包在网络中未经修改地传输。默认情况下,Junos OS 支持在简化的 SRH 中进行 SRv6 隧道封装。但是,您可以选择以下一种隧道封装方法:
-
Reduced SRH (default)—使用简化 SRH 模式时,如果由于只有一个 SID,因此未添加 SRH,并将最后一个 SID 复制到 IPV6 目标地址中。如果减少 SRH,则无法在 SRH 中保留整个 SID 列表。
-
Non-reduced SRH— 当您并且可能仍希望在 SRH 中保留整个 SID 列表时,可以配置非缩减 SRH 隧道封装模式。
-
由于静态配置的 SRv6 流量工程 LSP 的核心网络由 IS-IS SRv6 组成,因此可以使用 SRv6 流量工程分段来利用 IS-IS SRv6 TILFA。
通过 SRv6 核心实现第 3 层 VPN 服务
连接到出口 PE 时,入口 PE 会将有效负载封装在外部 IPv6 报头中,其中目标地址是与相关 BGP 路由更新关联的 SRv6 服务 SID。出口 PE 会将下一跃点设置为其 IPv6 地址之一,该地址也是分配 SRv6 服务 SID 的 SRv6 定位器。多个路由可以通过同一分段路由策略解析。
您可以通过 SRv6 核心配置基于 BGP 的第 3 层服务。您可以启用第 3 层叠加服务,将 BGP 用作控制平面,将 SRv6 用作数据平面。
向 BGP 对等方播发第 3 层 VPN 服务
BGP 将特定服务的前缀从出口 PE 设备通告至入口 PE 节点的可达性。PE 设备之间交换的 BGP 消息携带 SRv6 服务 SID,BGP 使用该 SID 将 PE 设备互连以形成 VPN 会话。对于 BGP 使用按 VRF SID 分配的第 3 层 VPN 服务,同一 SID 将在多个网络层可达性信息 (NLRI) 地址族之间共享。
支持基于 SRv6 的第 3 层服务的出口 PE 设备会播发叠加服务前缀以及服务 SID。BGP 入口节点接收这些播发,并将前缀添加到相应的虚拟路由和转发 (VRF) 表中。
SR-流量工程中 SRv6 网络编程支持和不支持的功能
SRv6 流量工程目前支持:
-
IPv4 和 IPv6 有效负载。
-
入口入口路由器处最多有 6 个处于缩减模式的 SID,入口处最多有 5 个处于非缩减模式的 SID。
-
入口入口路由器上的封装模式。
-
preserve-nexthop-hierarchy在平台层解析器下进行配置,以便能够组合来自 SR-流量工程和 IGP 路由的 SID。
SRv6 流量工程目前不支持:
-
SRv6 策略的本地 CSPF 功能。
-
IPv4 色隧道端点。
-
sBFD 和遥测。
-
PCE 发起和委托的 SRv6 LSP。
-
带有 SRv6 SID 的自动转换。
-
使用 SRv6 策略的 LDP 隧道。
-
逻辑系统。
-
用于 SR-流量工程隧道的 SR-流量工程绑定 SID。
-
SRTE SRv6 的 Ping 或 OAM。
-
通过 SRv6 流量工程隧道的任何静态 IPv4 路由。
-
SRv6 流量工程的插入模式。
-
用于 SRv6 流量工程 LSP 的 SRv6 灵活算法。
也可以看看
示例:为 SRv6 隧道配置静态 SR-流量工程策略
概述
此示例说明如何为 SRv6 隧道配置静态 SR-流量工程策略。此 SRv6 流量工程策略适用于网络主要使用 IPv6 且尚未部署 MPLS 的服务提供商。此类网络仅依靠 IPv6 报头和报头扩展名来传输数据。SRv6 网络编程提供了利用分段路由的灵活性,无需部署 MPLS。
拓扑结构
下图描述了 SRv6 流量工程拓扑,其中设备 R1 和设备 R6 是支持 IPv4 或 IPv6 设备 CE1 和 CE2 的入口和出口路由器。设备 R2、R3、R4 和 R5 构成一个仅支持 IPv6 的提供商核心网络。所有设备都属于同一个自治系统。IS-IS 是 IPv6 核心中的内部网关协议,配置为支持 SRv6。在此示例中,出口设备 R6 将 L3VPN SID 播发至入口设备 R1,后者接受并更新 VRF 表。设备 R6 配置为 2001:db8:0:a6::d 06 作为 end-sid,并将 L3VPN 服务导出到 CE7 到 R1,并将 2001:db8:0:a6::d 06 作为下一跃点。有两个分段列表:<R4、R5、R6> 和 <R2、R3、R6>。
要求
此示例使用以下硬件和软件组件:
-
六台 MX 系列路由器。
-
Junos OS 21.3R1 或更高版本。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到 [edit] 层次结构级别的 CLI 中,然后从配置模式进入 commit。
设备 R1
set interfaces ge-0/0/0 unit 0 description R1_to_CE0 set interfaces ge-0/0/0 unit 0 family inet address 192.168.10.2/24 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:10::2/64 set interfaces ge-0/0/3 unit 0 description R1_to_R2 set interfaces ge-0/0/3 unit 0 family iso set interfaces ge-0/0/3 unit 0 family inet6 address 2001:db8:12::1/64 set interfaces ge-0/0/3 unit 0 description R1_to_R4 set interfaces ge-0/0/5 unit 0 family iso set interfaces ge-0/0/5 unit 0 family inet6 address 2001:db8:14::1/64 set interfaces lo0 unit 0 family iso address 49.0001.0001.0101.0100 set interfaces lo0 unit 0 family inet6 address 2001:db8:1:255::1/128 set policy-options policy-statement to_CE0_community_export term 0 then community add to_CE0_community set policy-options policy-statement to_CE0_community_export term 0 then next-hop 2001:db8:0:a1::d01 set policy-options policy-statement to_CE0_community_export term 0 then accept set policy-options policy-statement to_CE0_community_import term 0 from community to_CE0_community set policy-options policy-statement to_CE0_community_import term 0 then accept set policy-options policy-statement v4vpn1_res_map1 term 1 from protocol bgp set policy-options policy-statement v4vpn1_res_map1 term 1 then accept set policy-options policy-statement v4vpn1_res_map1 term 1 then resolution-map map1 set policy-options policy-statement v6vpn1_res_map1 term 1 from family inet6-vpn set policy-options policy-statement v6vpn1_res_map1 term 1 from protocol bgp set policy-options policy-statement v6vpn1_res_map1 term 1 then accept set policy-options policy-statement v6vpn1_res_map1 term 1 then resolution-map map1 set policy-options policy-statement LBPP term 1 then load-balance per-packet set policy-options policy-statement mpath-resolve then multipath-resolve set policy-options resolution-map map1 mode ip-color set policy-options community to_CE0_community members target:65500:1 set routing-instances to_CE0 instance-type vrf set routing-instances to_CE0 protocols bgp group to_CE0_v6 type external set routing-instances to_CE0 protocols bgp group to_CE0_v6 as-override set routing-instances to_CE0 protocols bgp group to_CE0_v6 peer-as 65000 set routing-instances to_CE0 protocols bgp group to_CE0_v6 neighbor 2001:db8:10::1 set routing-instances to_CE0 protocols bgp group to_CE0_v4 type external set routing-instances to_CE0 protocols bgp group to_CE0_v4 as-override set routing-instances to_CE0 protocols bgp group to_CE0_v4 peer-as 65000 set routing-instances to_CE0 protocols bgp group to_CE0_v4 neighbor 192.168.10.1 set routing-instances to_CE0 protocols bgp source-packet-routing srv6 locator loc1 end-dt4-sid 2001:db8:0:a1::d410 set routing-instances to_CE0 protocols bgp source-packet-routing srv6 locator loc1 end-dt6-sid 2001:db8:0:a1::d610 set routing-instances to_CE0 interface ge-0/0/0.0 set routing-instances to_CE0 route-distinguisher 192.168.255.11:1 set routing-instances to_CE0 vrf-import to_CE0_community_import set routing-instances to_CE0 vrf-export to_CE0_community_export set routing-options source-packet-routing srv6 locator loc1 2001:db8:0:a1::/112 set routing-options resolution preserve-nexthop-hierarchy set routing-options resolution rib bgp.l3vpn-inet6.0 resolution-ribs inet6.3 set routing-options resolution rib bgp.l3vpn-inet6.0 inet6-resolution-ribs inet6.3 set routing-options resolution rib bgp.l3vpn-inet6.0 import mpath-resolve set routing-options resolution rib bgp.l3vpn-inet6.0 inet6-import mpath-resolve set routing-options resolution rib bgp.l3vpn-inet6.0 junos-rti-tc-<color>.inet6-import mpath-resolve set routing-options resolution rib bgp.l3vpn.0 import mpath-resolve set routing-options resolution rib bgp.l3vpn.0 inet6-import mpath-resolve set routing-options resolution rib inet6.0 import mpath-resolve set routing-options resolution rib inet.0 import mpath-resolve set routing-options router-id 192.168.255.11 set routing-options autonomous-system 65500 set routing-options forwarding-table srv6-chain-merge set routing-options forwarding-table export LBPP set protocols bgp group to_R6_ibgpv6 type internal set protocols bgp group to_R6_ibgpv6 family inet-vpn unicast accept-srv6-service set protocols bgp group to_R6_ibgpv6 family inet6 unicast extended-nexthop-color set protocols bgp group to_R6_ibgpv6 family inet6-vpn unicast advertise-srv6-service set protocols bgp group to_R6_ibgpv6 family inet6-vpn unicast accept-srv6-service set protocols bgp group to_R6_ibgpv6 local-address 2001:db8:1:255::1 set protocols bgp group to_R6_ibgpv6 import v4vpn1_res_map1 set protocols bgp group to_R6_ibgpv6 import v6vpn1_res_map1 set protocols bgp group to_R6_ibgpv6 family inet unicast extended-nexthop set protocols bgp group to_R6_ibgpv6 family inet-vpn unicast extended-nexthop set protocols bgp group to_R6_ibgpv6 family inet-vpn unicast advertise-srv6-serviceset protocols bgp group to_R6_ibgpv6 neighbor 2001:db8:6:255::6 set protocols bgp multipath set protocols isis interface ge-0/0/3.0 level 2 disable set protocols isis interface ge-0/0/3.0 level 1 srv6-adjacency-segment unprotected locator loc1 end-x-sid 2001:db8:0:a1::1a12 flavor psp set protocols isis interface ge-0/0/3.0 level 1 srv6-adjacency-segment unprotected locator loc1 end-x-sid 2001:db8:0:a1::1a12 flavor usd set protocols isis interface ge-0/0/3.0 point-to-point set protocols isis interface ge-0/0/5.0 level 2 disable set protocols isis interface ge-0/0/5.0 level 1 post-convergence-lfa set protocols isis interface ge-0/0/5.0 point-to-point set protocols isis interface all level 2 disable set protocols isis interface fxp0.0 disable set protocols isis interface lo0.0 set protocols isis source-packet-routing node-segment ipv6-index 101 set protocols isis source-packet-routing srv6 locator loc1 end-sid 2001:db8:0:a1::d01 flavor psp set protocols isis source-packet-routing srv6 locator loc1 end-sid 2001:db8:0:a1::d01 flavor usp set protocols isis source-packet-routing srv6 locator loc1 end-sid 2001:db8:0:a1::d01 flavor usd set protocols isis backup-spf-options use-post-convergence-lfa set protocols isis backup-spf-options use-source-packet-routing set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols source-packet-routing segment-list end-sids-segment srv6 set protocols source-packet-routing segment-list end-sids-segment hop1 srv6-sid 2001:db8:0:a4::d04 set protocols source-packet-routing segment-list end-sids-segment hop2 srv6-sid 2001:db8:0:a5::d05 set protocols source-packet-routing segment-list end-sids-segment hop3 srv6-sid 2001:db8:0:a6::d06 set protocols source-packet-routing segment-list end-x-sids-segment-last-sid-end-sid srv6 set protocols source-packet-routing segment-list end-x-sids-segment-last-sid-end-sid hop1 srv6-sid 2001:db8:0:a2::1a23 set protocols source-packet-routing segment-list end-x-sids-segment-last-sid-end-sid hop2 srv6-sid 2001:db8:0:a3::1a34 set protocols source-packet-routing segment-list end-x-sids-segment-last-sid-end-sid hop3 srv6-sid 2001:db8:0:a6::d06 set protocols source-packet-routing srv6 set protocols source-packet-routing source-routing-path nc_path_R1R6 srv6 set protocols source-packet-routing source-routing-path nc_path_R1R6 to 2001:db8:0:a6::d06 set protocols source-packet-routing source-routing-path nc_path_R1R6 from 2001:db8:1:255::1 set protocols source-packet-routing source-routing-path nc_path_R1R6 primary end-sids-segment weight 40 set protocols source-packet-routing source-routing-path nc_path_R1R6 primary end-x-sids-segment-last-sid-end-sid weight 30 set protocols source-packet-routing source-routing-path c_path_R1R6 srv6 set protocols source-packet-routing source-routing-path c_path_R1R6 to 2001:db8:0:a6::d06 set protocols source-packet-routing source-routing-path c_path_R1R6 from 2001:db8:1:255::1 set protocols source-packet-routing source-routing-path c_path_R1R6 color 6 set protocols source-packet-routing source-routing-path c_path_R1R6 primary end-sids-segment weight 40 set protocols source-packet-routing source-routing-path c_path_R1R6 primary end-x-sids-segment-last-sid-end-sid weight 30
设备 R2
set interfaces ge-0/0/0 unit 0 description R2_To_R1 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:12::2/64 set interfaces ge-0/0/2 unit 0 description R2_To_R3 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/2 unit 0 family inet6 address 2001:db8:23::1/64 set interfaces lo0 unit 0 family iso address 49.0001.0002.0202.0200 set interfaces lo0 unit 0 family inet6 address 2001:db8:2:255::2/128 set routing-options source-packet-routing srv6 locator loc2 2001:db8:0:a2::/112 set routing-options router-id 192.168.255.22 set protocols isis interface ge-0/0/0.0 level 2 disable set protocols isis interface ge-0/0/0.0 level 1 srv6-adjacency-segment unprotected locator loc2 end-x-sid 2001:db8:0:a2::1a12 flavor psp set protocols isis interface ge-0/0/0.0 level 1 srv6-adjacency-segment unprotected locator loc2 end-x-sid 2001:db8:0:a2::1a12 flavor usd set protocols isis interface ge-0/0/0.0 point-to-point set protocols isis interface ge-0/0/2.0 level 2 disable set protocols isis interface ge-0/0/2.0 level 1 srv6-adjacency-segment unprotected locator loc2 end-x-sid 2001:db8:0:a2::1a23 flavor psp set protocols isis interface ge-0/0/2.0 level 1 srv6-adjacency-segment unprotected locator loc2 end-x-sid 2001:db8:0:a2::1a23 flavor usd set protocols isis interface ge-0/0/2.0 point-to-point set protocols isis interface all level 2 disable set protocols isis interface fxp0.0 disable set protocols isis interface lo0.0 passive set protocols isis source-packet-routing node-segment ipv6-index 110 set protocols isis source-packet-routing srv6 locator loc2 end-sid 2001:db8:0:a2::d02 flavor psp set protocols isis source-packet-routing srv6 locator loc2 end-sid 2001:db8:0:a2::d02 flavor usp set protocols isis source-packet-routing srv6 locator loc2 end-sid 2001:db8:0:a2::d02 flavor usd set protocols isis backup-spf-options use-source-packet-routing set protocols mpls interface all set protocols mpls interface fxp0.0 disable
设备 R3
set interfaces ge-0/0/0 unit 0 description R3_To_R2 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:23::2/64 set interfaces ge-0/0/2 unit 0 description R3_To_R4 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/2 unit 0 family inet6 address 2001:db8:34::1/64 set interfaces ge-0/0/4 unit 0 description R3_To_R5 set interfaces ge-0/0/4 unit 0 family iso set interfaces ge-0/0/4 unit 0 family inet6 address 2001:db8:35::1/64 set interfaces lo0 unit 0 family iso address 49.0001.0003.0303.0300 set interfaces lo0 unit 0 family inet6 address 2001:db8:3:255::3/128 set routing-options source-packet-routing srv6 locator loc3 2001:db8:0:a3::/112 set routing-options router-id 192.168.255.33 set protocols isis interface ge-0/0/0.0 level 2 disable set protocols isis interface ge-0/0/0.0 level 1 srv6-adjacency-segment unprotected locator loc3 end-x-sid 2001:db8:0:a3::1a23 flavor psp set protocols isis interface ge-0/0/0.0 level 1 srv6-adjacency-segment unprotected locator loc3 end-x-sid 2001:db8:0:a3::1a23 flavor usd set protocols isis interface ge-0/0/0.0 point-to-point set protocols isis interface ge-0/0/2.0 level 2 disable set protocols isis interface ge-0/0/2.0 level 1 srv6-adjacency-segment unprotected locator loc3 end-x-sid 2001:db8:0:a3::1a34 flavor psp set protocols isis interface ge-0/0/2.0 level 1 srv6-adjacency-segment unprotected locator loc3 end-x-sid 2001:db8:0:a3::1a34 flavor usd set protocols isis interface ge-0/0/2.0 point-to-point set protocols isis interface ge-0/0/4.0 level 2 disable set protocols isis interface ge-0/0/4.0 level 1 srv6-adjacency-segment unprotected locator loc3 end-x-sid 2001:db8:0:a3::1a35 flavor psp set protocols isis interface ge-0/0/4.0 level 1 srv6-adjacency-segment unprotected locator loc3 end-x-sid 2001:db8:0:a3::1a35 flavor usd set protocols isis interface ge-0/0/4.0 point-to-point set protocols isis interface all level 2 disable set protocols isis interface fxp0.0 disable set protocols isis interface lo0.0set protocols isis source-packet-routing node-segment ipv6-index 120 set protocols isis source-packet-routing srv6 locator loc3 end-sid 2001:db8:0:a3::d03 flavor usp set protocols isis source-packet-routing srv6 locator loc3 end-sid 2001:db8:0:a3::d03 flavor usd set protocols isis backup-spf-options use-source-packet-routing set protocols mpls interface all set protocols mpls interface fxp0.0 disable
设备 R4
set interfaces ge-0/0/0 unit 0 description R4_To_R1 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:14::2/64 set interfaces ge-0/0/2 unit 0 description R4_To_R3 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/2 unit 0 family inet6 address 2001:db8:34::2/64 set interfaces ge-0/0/6 unit 0 description R4_To_R5 set interfaces ge-0/0/6 unit 0 family iso set interfaces ge-0/0/6 unit 0 family inet6 address 2001:db8:45::1/64 set interfaces lo0 unit 0 family iso address 49.0001.0004.0404.0400 set interfaces lo0 unit 0 family inet6 address 2001:db8:4:255::4/128 set routing-options source-packet-routing srv6 locator loc4 2001:db8:0:a4::/112 set routing-options router-id 192.168.255.44 set protocols isis interface ge-0/0/0.0 level 2 disable set protocols isis interface ge-0/0/0.0 level 1 srv6-adjacency-segment unprotected locator loc4 end-x-sid 2001:db8:0:a4::1a41 flavor psp set protocols isis interface ge-0/0/0.0 level 1 srv6-adjacency-segment unprotected locator loc4 end-x-sid 2001:db8:0:a4::1a41 flavor usd set protocols isis interface ge-0/0/0.0 point-to-point set protocols isis interface ge-0/0/2.0 level 2 disable set protocols isis interface ge-0/0/2.0 level 1 srv6-adjacency-segment unprotected locator loc4 end-x-sid 2001:db8:0:a4::1a34 flavor psp set protocols isis interface ge-0/0/2.0 level 1 srv6-adjacency-segment unprotected locator loc4 end-x-sid 2001:db8:0:a4::1a34 flavor usd set protocols isis interface ge-0/0/2.0 point-to-point set protocols isis interface ge-0/0/6.0 level 2 disable set protocols isis interface ge-0/0/6.0 level 1 srv6-adjacency-segment unprotected locator loc4 end-x-sid 2001:db8:0:a4::1a45 flavor psp set protocols isis interface ge-0/0/6.0 level 1 srv6-adjacency-segment unprotected locator loc4 end-x-sid 2001:db8:0:a4::1a45 flavor usd set protocols isis interface ge-0/0/6.0 point-to-point set protocols isis interface all level 2 disable set protocols isis interface fxp0.0 disable set protocols isis interface lo0.0set protocols isis source-packet-routing node-segment ipv6-index 130 set protocols isis source-packet-routing srv6 locator loc4 end-sid 2001:db8:0:a4::d04 flavor psp set protocols isis source-packet-routing srv6 locator loc4 end-sid 2001:db8:0:a4::d04 flavor usp set protocols isis source-packet-routing srv6 locator loc4 end-sid 2001:db8:0:a4::d04 flavor usd set protocols isis backup-spf-options use-source-packet-routing set protocols mpls interface all set protocols mpls interface fxp0.0 disable
设备 R5
set interfaces ge-0/0/0 unit 0 description R5_To_R3 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:35::2/64 set interfaces ge-0/0/2 unit 0 description R5_To_R4 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/2 unit 0 family inet6 address 2001:db8:45::2/64 set interfaces ge-0/0/6 unit 0 description R5_To_R6 set interfaces ge-0/0/6 unit 0 family iso set interfaces ge-0/0/6 unit 0 family inet6 address 2001:db8:56::1/64 set interfaces lo0 unit 0 family iso address 49.0001.0005.0505.0500 set interfaces lo0 unit 0 family inet6 address 2001:db8:5:255::5/128 set routing-options source-packet-routing srv6 locator loc5 2001:db8:0:a5::/112 set routing-options router-id 192.168.255.55 set protocols isis interface ge-0/0/0.0 level 2 disable set protocols isis interface ge-0/0/0.0 level 1 srv6-adjacency-segment unprotected locator loc5 end-x-sid 2001:db8:0:a5::1a35 flavor psp set protocols isis interface ge-0/0/0.0 level 1 srv6-adjacency-segment unprotected locator loc5 end-x-sid 2001:db8:0:a5::1a35 flavor usd set protocols isis interface ge-0/0/0.0 point-to-point set protocols isis interface ge-0/0/2.0 level 2 disable set protocols isis interface ge-0/0/2.0 level 1 srv6-adjacency-segment unprotected locator loc5 end-x-sid 2001:db8:0:a5::1a45 flavor psp set protocols isis interface ge-0/0/2.0 level 1 srv6-adjacency-segment unprotected locator loc5 end-x-sid 2001:db8:0:a5::1a45 flavor usd set protocols isis interface ge-0/0/2.0 point-to-point set protocols isis interface ge-0/0/6.0 level 2 disable set protocols isis interface ge-0/0/6.0 level 1 srv6-adjacency-segment unprotected locator loc5 end-x-sid 2001:db8:0:a5::1a56 flavor psp set protocols isis interface ge-0/0/6.0 level 1 srv6-adjacency-segment unprotected locator loc5 end-x-sid 2001:db8:0:a5::1a56 flavor usd set protocols isis interface ge-0/0/6.0 point-to-point set protocols isis interface all level 2 disable set protocols isis interface fxp0.0 disable set protocols isis interface lo0.0 set protocols isis source-packet-routing node-segment ipv6-index 150 set protocols isis source-packet-routing srv6 locator loc5 end-sid 2001:db8:0:a5::d05 flavor psp set protocols isis source-packet-routing srv6 locator loc5 end-sid 2001:db8:0:a5::d05 flavor usp set protocols isis source-packet-routing srv6 locator loc5 end-sid 2001:db8:0:a5::d05 flavor usd set protocols isis backup-spf-options use-source-packet-routing set protocols mpls interface all set protocols mpls interface fxp0.0 disable
设备 R6
set interfaces ge-0/0/0 unit 0 description R6_To_CE7 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:67::2/64 set interfaces ge-0/0/2 unit 0 description R6_To_R5 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:67::2/64 set interfaces ge-0/0/2 unit 0 description R6_To_R5 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/2 unit 0 family inet6 address 2001:db8:56::2/64 set interfaces lo0 unit 0 family iso address 49.0001.0006.0606.0600 set interfaces lo0 unit 0 family inet6 address 2001:db8:6:255::6/128 set policy-options policy-statement LBPP term 1 then load-balance per-packet set policy-options policy-statement mpath-resolve then multipath-resolve set policy-options policy-statement to_CE7_community_export term 0 then community add to_CE7_community set policy-options policy-statement to_CE7_community_export term 0 then community add to_ce7_color_com set policy-options policy-statement to_CE7_community_export term 0 then next-hop 2001:db8:0:a6::d06 set policy-options policy-statement to_CE7_community_export term 0 then accept set policy-options policy-statement to_CE7_community_import term 0 from community to_CE7_community set policy-options policy-statement to_CE7_community_import term 0 then accept set policy-options community to_CE7_community members target:65500:1 set policy-options community to_ce7_color_com members color:1:6 set routing-instances to_CE7 instance-type vrf set routing-instances to_CE7 protocols bgp group to_CE7_v6 type external set routing-instances to_CE7 protocols bgp group to_CE7_v6 as-override set routing-instances to_CE7 protocols bgp group to_CE7_v6 peer-as 65000 set routing-instances to_CE7 protocols bgp group to_CE7_v6 neighbor 2001:db8:67::1 set routing-instances to_CE7 protocols bgp group to_CE7_v4 type external set routing-instances to_CE7 protocols bgp group to_CE7_v4 as-override set routing-instances to_CE7 protocols bgp group to_CE7_v4 peer-as 65000 set routing-instances to_CE7 protocols bgp group to_CE7_v4 neighbor 192.168.67.1 set routing-instances to_CE7 protocols bgp source-packet-routing srv6 locator loc8 end-dt4-sid 2001:db8:0:a6::d467 set routing-instances to_CE7 protocols bgp source-packet-routing srv6 locator loc8 end-dt6-sid 2001:db8:0:a6::d667 set routing-instances to_CE7 interface ge-0/0/0.0 set routing-instances to_CE7 route-distinguisher 192.168.255.66:6 set routing-instances to_CE7 vrf-import to_CE7_community_import set routing-instances to_CE7 vrf-export to_CE7_community_export set routing-options source-packet-routing srv6 locator loc8 2001:db8:0:a6::/112 set routing-options resolution preserve-nexthop-hierarchy set routing-options resolution rib bgp.l3vpn-inet6.0 resolution-ribs inet6.3 set routing-options resolution rib bgp.l3vpn-inet6.0 inet6-resolution-ribs inet6.3 set routing-options resolution rib bgp.l3vpn-inet6.0 import mpath-resolve set routing-options resolution rib bgp.l3vpn.0 inet6-resolution-ribs inet6.3 set routing-options resolution rib bgp.l3vpn.0 import mpath-resolve set routing-options resolution rib inet6.0 import mpath-resolve set routing-options resolution rib inet.0 import mpath-resolve set routing-options router-id 192.168.255.66 set routing-options autonomous-system 65500 set routing-options forwarding-table srv6-chain-merge set routing-options forwarding-table export LBPP set protocols bgp group ibgp type internal set protocols bgp group ibgp local-address 2001:db8:6:255::6 set protocols bgp group ibgp family inet unicast extended-nexthop set protocols bgp group ibgp family inet-vpn unicast extended-nexthop set protocols bgp group ibgp family inet-vpn unicast advertise-srv6-service set protocols bgp group ibgp family inet-vpn unicast accept-srv6-service set protocols bgp group ibgp family inet6 unicast extended-nexthop-color set protocols bgp group ibgp family inet6-vpn unicast advertise-srv6-service set protocols bgp group ibgp family inet6-vpn unicast accept-srv6-service set protocols bgp group ibgp neighbor 2001:db8:1:255::1 set protocols bgp multipath set protocols isis interface ge-0/0/2.0 level 2 disable set protocols isis interface ge-0/0/2.0 level 1 srv6-adjacency-segment unprotected locator loc8 end-x-sid 2001:db8:0:a6::1a56 flavor psp set protocols isis interface ge-0/0/2.0 level 1 srv6-adjacency-segment unprotected locator loc8 end-x-sid 2001:db8:0:a6::1a56 flavor usd set protocols isis interface ge-0/0/2.0 point-to-point set protocols isis interface all level 2 disable set protocols isis interface fxp0.0 disable set protocols isis interface lo0.0 set protocols isis source-packet-routing srgb start-label 400000 set protocols isis source-packet-routing srgb index-range 5000 set protocols isis source-packet-routing node-segment ipv6-index 170 set protocols isis source-packet-routing srv6 locator loc8 end-sid 2001:db8:0:a6::d06 flavor psp set protocols isis source-packet-routing srv6 locator loc8 end-sid 2001:db8:0:a6::d06 flavor usp set protocols isis source-packet-routing srv6 locator loc8 end-sid 2001:db8:0:a6::d06 flavor usd set protocols isis backup-spf-options use-source-packet-routing set protocols mpls interface all set protocols mpls interface fxp0.0 disable
设备 CE0
set interfaces ge-0/0/0 unit 0 description CE0_To_R1 set interfaces ge-0/0/0 unit 0 family inet address 192.168.10.1/24 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:10::1/64 set interfaces lo0 unit 0 family inet address 10.100.10.1/32 set interfaces lo0 unit 0 family iso address 49.0001.000a.0a0a.0a00 set interfaces lo0 unit 0 family inet6 address 2001:db8:10:255::10/128 set policy-options policy-statement BGP_export term 0 from protocol direct set policy-options policy-statement BGP_export term 0 from interface lo0.0 set policy-options policy-statement BGP_export term 0 then accept set routing-options rib inet6.0 static route 0::0/0 next-hop 2001:db8:10::2 set routing-options rib inet.0 static route 0.0.0.0/0 next-hop 192.168.10.2 set routing-options router-id 10.100.10.1 set routing-options autonomous-system 65000 set protocols bgp group eBGPv6 type external set protocols bgp group eBGPv6 export BGP_export set protocols bgp group eBGPv6 peer-as 65500 set protocols bgp group eBGPv6 neighbor 2001:db8:10::2 set protocols bgp group eBGPv4 type external set protocols bgp group eBGPv4 export BGP_export set protocols bgp group eBGPv4 peer-as 65500 set protocols bgp group eBGPv4 neighbor 192.168.10.2 set protocols isis interface all level 2 disable set protocols isis interface fxp0.0 disable
设备 CE7
set system host-name CE7 set system services netconf ssh set system ports console log-out-on-disconnect set interfaces ge-0/0/0 unit 0 description CE7_To_R6 set interfaces ge-0/0/0 unit 0 family inet address 192.168.67.1/24 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:67::1/64 set interfaces lo0 unit 0 family inet address 10.100.10.7/32 set interfaces lo0 unit 0 family iso address 49.0001.0007.0707.0700 set interfaces lo0 unit 0 family inet6 address 2001:db8:7:255::7/128 set policy-options policy-statement BGP_export term 0 from protocol direct set policy-options policy-statement BGP_export term 0 from interface lo0.0 set policy-options policy-statement BGP_export term 0 then accept set routing-options rib inet6.0 static route 0::0/0 next-hop 2001:db8:67::2 set routing-options rib inet.0 static route 0.0.0.0/0 next-hop 192.168.67.2 set routing-options router-id 10.100.10.7 set routing-options autonomous-system 65000 set protocols bgp group eBGPv6 type external set protocols bgp group eBGPv6 export BGP_export set protocols bgp group eBGPv6 peer-as 65500 set protocols bgp group eBGPv6 neighbor 2001:db8:67::2 set protocols bgp group eBGPv4 type external set protocols bgp group eBGPv4 export BGP_export set protocols bgp group eBGPv4 peer-as 65500 set protocols bgp group eBGPv4 neighbor 192.168.67.2 set protocols isis interface all level 2 disable
配置设备 R1
分步程序
要为基于 IS-IS SRv6 核心的 SRV6 隧道配置静态 SR-流量工程策略,请在 R1 设备上执行以下步骤:
-
配置设备接口以启用 IP 传输。
[edit] user@R1#set interfaces ge-0/0/0 unit 0 description R1_To_CE0 user@R1#set interfaces ge-0/0/0 unit 0 family inet address 192.168.10.2/24 user@R1#set interfaces ge-0/0/0 unit 0 family iso user@R1#set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:10::2/64 user@R1#set interfaces ge-0/0/3 unit 0 description R1_To_R2 user@R1#set interfaces ge-0/0/3 unit 0 family iso user@R1#set interfaces ge-0/0/3 unit 0 family inet6 address 2001:db8:12::1/64 user@R1#set interfaces ge-0/0/5 unit 0 description R1_To_R4 user@R1#set interfaces ge-0/0/5 unit 0 family iso user@R1#set interfaces ge-0/0/5 unit 0 family inet6 address 2001:db8:14::1/64
-
使用用作 BGP 会话的路由器 ID 的 IPv4 和 IPv6 地址配置环路接口。
[edit] user@R1#set interfaces lo0 unit 0 family iso address 49.0001.0001.0101.0100 user@R1#set interfaces lo0 unit 0 family inet6 address 2001:db8:1:255::1/128
-
配置路由器 ID 和自治系统 (AS) 编号,以便在属于同一 AS 的一组路由设备内传播路由信息 AS。
[edit] user@R1#set routing-options router-id 192.168.255.11 user@R1#set routing-options autonomous-system 65500
- 在面向核心的接口上配置 BGP,以建立内部和外部对等会话。
[edit] user@R1#set protocols bgp group to_R6_ibgpv6 type internal user@R1#set protocols bgp group to_R6_ibgpv6 local-address 2001:db8:1:255::1 user@R1#set protocols bgp group to_R6_ibgpv6 import v4vpn1_res_map1 user@R1#set protocols bgp group to_R6_ibgpv6 import v6vpn1_res_map1 user@R1#set protocols bgp group to_R6_ibgpv6 family inet unicast extended-nexthop user@R1#set protocols bgp group to_R6_ibgpv6 family inet-vpn unicast extended-nexthop user@R1#set protocols bgp group to_R6_ibgpv6 neighbor 2001:db8:6:255::6
-
为 IPv4 和 IPv6 流量配置外部路由实例to_CE0。为 to_CE0 配置 BGP 协议,以便在提供商边缘设备之间启用对等互连和流量传输。
[edit] user@R1#set routing-instances to_CE0 protocols bgp group to_CE0_v6 type external user@R1#set routing-instances to_CE0 protocols bgp group to_CE0_v6 as-override user@R1#set routing-instances to_CE0 protocols bgp group to_CE0_v6 peer-as 65000 user@R1#set routing-instances to_CE0 protocols bgp group to_CE0_v6 neighbor 2001:db8:10::1 user@R1#set routing-instances to_CE0 protocols bgp group to_CE0_v4 type external user@R1#set routing-instances to_CE0 protocols bgp group to_CE0_v4 as-override user@R1#set routing-instances to_CE0 protocols bgp group to_CE0_v4 peer-as 65000 user@R1#set routing-instances to_CE0 protocols bgp group to_CE0_v4 neighbor 192.168.10.1
-
使用 ip-color 模式配置分辨率映射映射 map1。将 BGP 协议配置为使用多个路径,并定义包含 多路径-resolve 操作的策略 mpath-resolve,然后导入策略以解析 IBGP 多路径路由的所有可用路径。
[edit] user@R1#set protocols bgp multipath user@R1#set policy-options resolution-map map1 mode ip-color user@R1#set policy-options policy-statement mpath-resolve then multipath-resolve user@R1#set routing-options resolution rib bgp.l3vpn-inet6.0 resolution-ribs inet6.3 user@R1#set routing-options resolution rib bgp.l3vpn-inet6.0 inet6-resolution-ribs inet6.3 user@R1#set routing-options resolution rib bgp.l3vpn-inet6.0 import mpath-resolve user@R1#set routing-options resolution rib bgp.l3vpn-inet6.0 inet6-import mpath-resolve user@R1#set routing-options resolution rib bgp.l3vpn-inet6.0 junos-rti-tc-<color>.inet6-import mpath-resolve user@R1#set routing-options resolution rib bgp.l3vpn.0 import mpath-resolve user@R1#set routing-options resolution rib bgp.l3vpn.0 inet6-import mpath-resolve user@R1#set routing-options resolution rib bgp.l3vpn.0 junos-rti-tc-<color>.inet6-import mpath-resolve user@R1#set routing-options resolution rib inet6.0 import mpath-resolve user@R1#set routing-options resolution rib inet.0 import mpath-resolve
- 为 R1 设备的 VRF 表配置导入和导出策略。
[edit] user@R1#set policy-options policy-statement to_CE0_community_import term 0 from community to_CE0_community user@R1#set policy-options policy-statement to_CE0_community_import term 0 then accept user@R1#set policy-options policy-statement to_CE0_community_export term 0 then community add to_CE0_community user@R1#set policy-options policy-statement to_CE0_community_export term 0 then next-hop 2001:db8:0:a1::d01 user@R1#set policy-options policy-statement to_CE0_community_export term 0 then accept user@R1#set routing-instances to_CE0 vrf-import to_CE0_community_import user@R1#set routing-instances to_CE0 vrf-export to_CE0_community_export
-
为参与路由实例的每个 PE 路由器配置 VPN 类型和唯一路由识别符。
[edit] user@R1#set routing-instances to_CE0 instance-type vrf user@R1#set routing-instances to_CE0 interface ge-0/0/0.0 user@R1#set routing-instances to_CE0 route-distinguisher 192.168.255.11:1
- 定义用于均衡数据包负载的策略,并应用每个数据包的策略以启用流量的负载平衡。
[edit] user@R1#set policy-options policy-statement LBPP term 1 then load-balance per-packet user@R1#set policy-options community to_CE0_community members target:65500:1 user@R1#set routing-options forwarding-table export LBPP
- 定义策略v4vpn1_res_map1和v6vpn1_res_map1以接受从 R1 播发的路由。
[edit] user@R1#set policy-options policy-statement v4vpn1_res_map1 term 1 from protocol bgp user@R1#set policy-options policy-statement v4vpn1_res_map1 term 1 then accept user@R1#set policy-options policy-statement v4vpn1_res_map1 term 1 then resolution-map map1 user@R1#set policy-options policy-statement v6vpn1_res_map1 term 1 from family inet6-vpn user@R1#set policy-options policy-statement v6vpn1_res_map1 term 1 then accept user@R1#set policy-options policy-statement v6vpn1_res_map1 term 1 then resolution-map map1
- 禁用级别 2,启用 IS-IS 作为内部网关协议 (IGP),用于在核心设备之间路由流量。
[edit] user@R1#set protocols isis interface all level 2 disable user@R1#set protocols isis interface fxp0.0 disable user@R1#set protocols isis interface lo0.0
- 为 IS-IS 协议启用 TI-LFA。
[edit] user@R1#set protocols isis backup-spf-options use-post-convergence-lfa user@R1#set protocols isis backup-spf-options use-source-packet-routing
- 配置节点分段的 IPv6 索引值。
[edit] user@R1#set protocols isis source-packet-routing node-segment ipv6-index 101
-
全局启用 SRv6 和定位器地址以指示路由器的 SRv6 功能。SRv6 SID 是一个 IPv6 地址,由定位器和函数组成。路由协议播发定位器地址。
[edit] user@R1#set protocols source-packet-routing srv6 user@R1#set routing-options source-packet-routing srv6 locator loc1 2001:db8:0:a1::/112
注意:定位器长度限制为最大值 112,因此剩余的 16 位将用作函数长度。定位器配置通过块长度、函数长度和静态功能最大条目的配置进行了扩展。因此,某些静态 SID 格式可能无法通过提交检查。SRv6 定位器中的静态 SIDS 的范围只能从 fec0:6bfd:1ba:20:0001:0:0:0 到 fec0:6bfd:1ba:20:7fff:0:0:0。 -
为 SR-流量工程路由类型启用保留下一跃点层次结构,并为 SRv6 链下一跃点启用平台合并。
[edit] user@R1#set routing-options resolution preserve-nexthop-hierarchy user@R1#set routing-options forwarding-table srv6-chain-merge
-
配置 end-dt4 和 end-dt6 SID 值以启用第 3 层 VPN 服务。
[edit] user@R1#set routing-instances to_CE0 protocols bgp source-packet-routing srv6 locator loc1 end-dt4-sid 2001:db8:0:a1::d410 user@R1#set routing-instances to_CE0 protocols bgp source-packet-routing srv6 locator loc1 end-dt6-sid 2001:db8:0:a1::d610
-
使设备能够将 SRv6 服务播发至 BGP 对等方,并接受出口设备播发的路由。
[edit] user@R1#set protocols bgp group to_R6_ibgpv6 family inet-vpn unicast advertise-srv6-service user@R1#set protocols bgp group to_R6_ibgpv6 family inet-vpn unicast accept-srv6-service user@R1#set protocols bgp group to_R6_ibgpv6 family inet6 unicast extended-nexthop-color user@R1#set protocols bgp group to_R6_ibgpv6 family inet6-vpn unicast advertise-srv6-service user@R1#set protocols bgp group to_R6_ibgpv6 family inet6-vpn unicast accept-srv6-service
-
为前缀分段配置 End-SID 功能。指定类型,即根据网络要求的 End-SID 函数的行为。倒数第二个分段流行 (PSP)、终极分段流行 (USP) 和终极分段解封装 (USP) 是 SRv6 函数的三种可用类型。
注意:确保定位器和 End-SID 位于同一子网中,以避免提交错误。
[edit] user@R1#set protocols isis source-packet-routing srv6 locator loc1 end-sid 2001:db8:0:a1::d01 flavor psp user@R1#set protocols isis source-packet-routing srv6 locator loc1 end-sid 2001:db8:0:a1::d01 flavor usp user@R1#set protocols isis source-packet-routing srv6 locator loc1 end-sid 2001:db8:0:a1::d01 flavor usd
-
在邻接分段的点对点 (P2P) 接口上配置 End-X-SID 功能。为 End-X-SID 指定一个或多个类型。
注意:确保定位器和 End-X-SID 位于同一子网中,以避免提交错误。在将定位符映射到接口之前,必须在 启用 SRv6 并配置定位器
[edit routing-options]。[edit] user@R1#set protocols isis interface ge-0/0/3.0 level 2 disable user@R1#set protocols isis interface ge-0/0/3.0 level 1 srv6-adjacency-segment unprotected locator loc1 end-x-sid 2001:db8:0:a1::1a12 flavor psp user@R1#set protocols isis interface ge-0/0/3.0 level 1 srv6-adjacency-segment unprotected locator loc1 end-x-sid 2001:db8:0:a1::1a12 flavor usd user@R1#set protocols isis interface ge-0/0/3.0 point-to-point user@R1#set protocols isis interface ge-0/0/5.0 level 2 disable user@R1#set protocols isis interface ge-0/0/5.0 level 1 post-convergence-lfa user@R1#set protocols isis interface ge-0/0/5.0 point-to-point
-
配置 SRv6 分段列表 end-sids-segment 和 end-x-sids-segment-last-sid-end-sid 介于 <R4、R5、R6> 和 <R2、R3、R6> 之间。
[edit] user@R1#set protocols source-packet-routing segment-list end-sids-segment srv6 user@R1#set protocols source-packet-routing segment-list end-sids-segment hop1 srv6-sid 2001:db8:0:a4::d04 user@R1#set protocols source-packet-routing segment-list end-sids-segment hop2 srv6-sid 2001:db8:0:a5::d05 user@R1#set protocols source-packet-routing segment-list end-sids-segment hop3 srv6-sid 2001:db8:0:a6::d06 user@R1#set protocols source-packet-routing segment-list end-x-sids-segment-last-sid-end-sid srv6 user@R1#set protocols source-packet-routing segment-list end-x-sids-segment-last-sid-end-sid hop1 srv6-sid 2001:db8:0:a2::1a23 user@R1#set protocols source-packet-routing segment-list end-x-sids-segment-last-sid-end-sid hop2 srv6-sid 2001:db8:0:a3::1a34 user@R1#set protocols source-packet-routing segment-list end-x-sids-segment-last-sid-end-sid hop3 srv6-sid 2001:db8:0:a6::d06
-
对于无色路径 (nc_path_R1R6) 和有色路径 (c_path_R1R6),在 R1 和 R6 之间配置 SRv6-流量工程 隧道,其中 end-sids-segment-segment-last-sid-end-sid 权重为 30。
[edit] user@R1#set protocols source-packet-routing source-routing-path nc_path_R1R6 srv6 user@R1#set protocols source-packet-routing source-routing-path nc_path_R1R6 to 2001:db8:0:a6::d06 user@R1#set protocols source-packet-routing source-routing-path nc_path_R1R6 from 2001:db8:1:255::1 user@R1#set protocols source-packet-routing source-routing-path nc_path_R1R6 primary end-sids-segment weight 40 user@R1#set protocols source-packet-routing source-routing-path nc_path_R1R6 primary end-x-sids-segment-last-sid-end-sid weight 30 user@R1#set protocols source-packet-routing source-routing-path c_path_R1R6 srv6 user@R1#set protocols source-packet-routing source-routing-path c_path_R1R6 to 2001:db8:0:a6::d06 user@R1#set protocols source-packet-routing source-routing-path c_path_R1R6 from 2001:db8:1:255::1 user@R1#set protocols source-packet-routing source-routing-path c_path_R1R6 color 6 user@R1#set protocols source-packet-routing source-routing-path c_path_R1R6 primary end-sids-segment weight 40 user@R1#set protocols source-packet-routing source-routing-path c_path_R1R6 primary end-x-sids-segment-last-sid-end-sid weight 30
结果
检查配置结果:
interfaces {
ge-0/0/0 {
unit 0 {
description R1_To_CE0;
family inet {
address 192.168.10.1/24;
address 192.168.10.2/24;
}
family iso;
family inet6 {
address 2001:db8:10::2/64;
}
}
}
ge-0/0/3 {
unit 0 {
description R1_To_R2;
family iso;
family inet6 {
address 2001:db8:12::1/64;
}
}
}
ge-0/0/5 {
unit 0 {
description R1_To_R4;
family iso;
family inet6 {
address 2001:db8:14::1/64;
}
}
}
lo0 {
unit 0 {
family inet {
address 192.168.100.2/32;
}
family iso {
address 49.0002.0192.0168.0002.00;
address 49.0001.0001.0101.0100;
}
family inet6 {
address 2001:db8:1:255::1/128;
}
}
}
}
policy-options {
policy-statement LBPP {
term 1 {
then {
load-balance per-packet;
}
}
}
policy-statement mpath-resolve {
then multipath-resolve;
}
policy-statement to_CE0_community_export {
term 0 {
then {
community add to_CE0_community;
next-hop 2001:db8:0:a1::d01;
accept;
}
}
}
policy-statement to_CE0_community_import {
term 0 {
from community to_CE0_community;
then accept;
}
}
policy-statement v4vpn1_res_map1 {
term 1 {
from protocol bgp;
then {
accept;
resolution-map map1;
}
}
}
policy-statement v6vpn1_res_map1 {
term 1 {
from {
family inet6-vpn;
protocol bgp;
}
then {
accept;
resolution-map map1;
}
}
}
community to_CE0_community members target:65500:1;
resolution-map map1 {
mode ip-color;
}
}
routing-instances {
to_CE0 {
instance-type vrf;
protocols {
bgp {
group to_CE0_v6 {
type external;
as-override;
peer-as 65000;
neighbor 2001:db8:10::1;
}
group to_CE0_v4 {
type external;
as-override;
peer-as 65000;
neighbor 192.168.10.1;
}
source-packet-routing {
srv6 {
locator loc1 {
end-dt4-sid 2001:db8:0:a1::d410;
end-dt6-sid 2001:db8:0:a1::d610;
}
}
}
}
}
interface ge-0/0/0.0;
route-distinguisher 192.168.255.11:1;
vrf-import to_CE0_community_import;
vrf-export to_CE0_community_export;
}
}
routing-options {
source-packet-routing {
srv6 {
locator loc1 2001:db8:0:a1::/64;
}
}
resolution {
preserve-nexthop-hierarchy;
rib bgp.l3vpn-inet6.0 {
resolution-ribs inet6.3;
inet6-resolution-ribs inet6.3;
import mpath-resolve;
inet6-import mpath-resolve;
junos-rti-tc-<color>.inet6-import mpath-resolve;
}
rib bgp.l3vpn.0 {
import mpath-resolve;
inet6-import mpath-resolve;
junos-rti-tc-<color>.inet6-import mpath-resolve;
}
rib inet6.0 {
import mpath-resolve;
}
rib inet.0 {
import mpath-resolve;
}
}
router-id 192.168.255.11;
autonomous-system 65500;
forwarding-table {
srv6-chain-merge;
export LBPP;
}
}
protocols {
bgp {
group to_R6_ibgpv6 {
type internal;
local-address 2001:db8:1:255::1;
import [ v4vpn1_res_map1 v6vpn1_res_map1 ];
family inet {
unicast {
extended-nexthop;
}
}
family inet-vpn {
unicast {
extended-nexthop;
advertise-srv6-service;
accept-srv6-service;
}
}
family inet6 {
unicast {
extended-nexthop-color;
}
}
family inet6-vpn {
unicast {
advertise-srv6-service;
accept-srv6-service;
}
}
neighbor 2001:db8:6:255::6;
}
multipath;
}
isis {
interface ge-0/0/3.0 {
level 2 disable;
level 1 {
srv6-adjacency-segment {
unprotected {
locator loc1 {
end-x-sid 2001:db8:0:a1::1a12 {
flavor {
psp;
usd;
}
}
}
}
}
}
point-to-point;
}
interface ge-0/0/5.0 {
level 2 disable;
level 1 {
post-convergence-lfa;
}
point-to-point;
}
interface all {
level 2 disable;
}
interface fxp0.0 {
disable;
}
interface lo0.0;
source-packet-routing {
node-segment ipv6-index 101;
srv6 {
locator loc1 {
end-sid 2001:db8:0:a1::d01 {
flavor {
psp;
usp;
usd;
}
}
}
}
}
backup-spf-options {
use-post-convergence-lfa;
use-source-packet-routing;
}
}
mpls {
interface all;
interface fxp0.0 {
disable;
}
}
source-packet-routing {
segment-list end-sids-segment {
srv6;
hop1 srv6-sid 2001:db8:0:a4::d04;
hop2 srv6-sid 2001:db8:0:a5::d05;
hop3 srv6-sid 2001:db8:0:a6::d06;
}
segment-list end-x-sids-segment-last-sid-end-sid {
srv6;
hop1 srv6-sid 2001:db8:0:a2::1a23;
hop2 srv6-sid 2001:db8:0:a3::1a34;
hop3 srv6-sid 2001:db8:0:a6::d06;
}
srv6;
source-routing-path nc_path_R1R6 {
srv6;
to 2001:db8:0:a6::d06;
from 2001:db8:1:255::1;
primary {
end-sids-segment weight 40;
end-x-sids-segment-last-sid-end-sid weight 30;
}
}
source-routing-path c_path_R1R6 {
srv6;
to 2001:db8:0:a6::d06;
from 2001:db8:1:255::1;
color 6;
primary {
end-sids-segment weight 40;
end-x-sids-segment-last-sid-end-sid weight 30;
}
}
}
}
配置设备后,从配置模式进入。commit
验证
确认配置工作正常。
- 验证 SPRING 流量工程 LSP
- 验证由 SR-流量工程填充的传输 RIB
- 通过无色 SR-流量工程 SRv6 路由端验证 BGP 服务 IPv4 路由 DT4
- 通过彩色 SR-流量工程 SRv6 验证 BGP 服务 IPv6 路由 End.DT6
- 验证 CE0 和 CE7 之间的 IPv4 连接
验证 SPRING 流量工程 LSP
目的
验证入口设备 R1 上的 SPRING 流量工程 LSP
行动
在操作模式下,对设备 R1 运行 show spring-traffic-engineering lsp 命令。
user@R1>show spring-traffic-engineering lsp To State LSPname 2001:db8:0:a6::d06-6<c6> Up c_path_R1R6 2001:db8:0:a6::d06 Up nc_path_R1R6
意义
输出显示入口设备上的 SPRING 流量工程 LSP。
验证由 SR-流量工程填充的传输 RIB
目的
验证由 SR-流量工程填充的传输 RIB。
行动
在操作模式下,对设备 R1 运行 show route protocol spring-te extensive 命令。
user@R1>show route protocol spring-te extensive
inet.0: 36 destinations, 36 routes (36 active, 0 holddown, 0 hidden)
to_CE0.inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
iso.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
mpls.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
bgp.l3vpn.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
inet6.0: 36 destinations, 36 routes (36 active, 0 holddown, 0 hidden)
inet6.3: 10 destinations, 11 routes (10 active, 0 holddown, 0 hidden)
2001:db8:0:a6::d06/128 (2 entries, 1 announced)
*SPRING-TE Preference: 8
Next hop type: Indirect, Next hop index: 0
Address: 0x7972548
Next-hop reference count: 3
Next hop type: Chain, Next hop index: 0
Next hop: via Chain Tunnel Composite, SRv6
Next hop: ELNH Address 0x76b7aa8, selected
SRV6-Tunnel: Reduced-SRH Encap-mode
Src: 2001:db8:1:255::1 Dest: 2001:db8:0:a6::d06
Segment-list[0] 2001:db8:0:a2::1a23
Segment-list[1] 2001:db8:0:a3::1a34
Segment-list[2] 2001:db8:0:a6::d06
Next hop type: Chain, Next hop index: 0
Address: 0x76b7aa8
Next-hop reference count: 5
Next hop: via Chain Tunnel Composite, SRv6
Next hop: ELNH Address 0x76b7a3c
SRV6-Tunnel: Reduced-SRH Encap-mode
Src: abcd::128:205:174:232 Dest: 2001:db8:0:a2::
Segment-list[0] 2001:db8:0:a2::
Next hop type: Router, Next hop index: 634
Address: 0x76b7a3c
Next-hop reference count: 17
Next hop: fe80::5668:acff:feda:cc1b via ge-0/0/3.0 weight 0x1
Next hop type: Chain, Next hop index: 0
Next hop: via Chain Tunnel Composite, SRv6
Next hop: ELNH Address 0x797282c, selected
SRV6-Tunnel: Reduced-SRH Encap-mode
Src: 2001:db8:1:255::1 Dest: 2001:db8:0:a6::d06
Segment-list[0] 2001:db8:0:a4::d04
Segment-list[1] 2001:db8:0:a5::d05
Segment-list[2] 2001:db8:0:a6::d06
Next hop: ELNH Address 0x76b9104 weight 0x1, selected
Next hop type: Chain, Next hop index: 0
Address: 0x76b9104
Next-hop reference count: 1
Next hop: via Chain Tunnel Composite, SRv6
Next hop: ELNH Address 0x76b8ee8
SRV6-Tunnel: Reduced-SRH Encap-mode
Src: abcd::128:205:174:232 Dest: 2001:db8:0:a4::
Segment-list[0] 2001:db8:0:a4::
Next hop type: Router, Next hop index: 635
Address: 0x76b8ee8
Next-hop reference count: 32
Next hop: fe80::5668:acff:feda:cc51 via ge-0/0/5.0 weight 0x1
Next hop: ELNH Address 0x76b9170 weight 0xf000
Next hop type: Chain, Next hop index: 0
Address: 0x76b9170
Next-hop reference count: 1
Next hop: via Chain Tunnel Composite, SRv6
Next hop: ELNH Address 0x76b8f54
SRV6-Tunnel: Reduced-SRH Encap-mode
Src: abcd::128:205:174:232 Dest: 2001:db8:0:a4::
Segment-list[0] 2001:db8:0:a3::d03
Segment-list[1] 2001:db8:0:a4::
Next hop type: Router, Next hop index: 634
Address: 0x76b8f54
Next-hop reference count: 11
Next hop: fe80::5668:acff:feda:cc1b via ge-0/0/3.0 weight 0xf000
Protocol next hop: 2001:db8:0:a2::1a23 Balance: 43%
Indirect next hop: 0x7165534 - INH Session ID: 0 Weight 0x1
Protocol next hop: 2001:db8:0:a4::d04 Balance: 57%
Indirect next hop: 0x71656cc - INH Session ID: 0 Weight 0x1
State: <Active Int>
Local AS: 65500
Age: 14:29:23 Metric: 1 Metric2: 30
Validation State: unverified
Task: SPRING-TE
Announcement bits (5): 0-Resolve tree 2 2-Resolve tree 4 3-Resolve tree 6 4-Resolve_IGP_FRR task 5-Resolve tree 10
AS path: I
SRTE Policy State:
SR Preference/Override: 100/100
Tunnel Source: Static configuration
Session-IDs associated:
Session-id: 325 Version: 1
Session-id: 327 Version: 1
Thread: junos-main
Indirect next hops: 2
Protocol next hop: 2001:db8:0:a2::1a23 Metric: 10
Indirect next hop: 0x7165534 - INH Session ID: 0 Weight 0x1
Indirect path forwarding next hops: 1
Next hop type: Chain
Next hop: fe80::5668:acff:feda:cc1b via ge-0/0/3.0
2001:db8:0:a2::/64 Originating RIB: inet6.3
Metric: 10 Node path count: 1
Forwarding nexthops: 1
Next hop type: Chain
Next hop: fe80::5668:acff:feda:cc1b via ge-0/0/3.0
Protocol next hop: 2001:db8:0:a4::d04 Metric: 10
Indirect next hop: 0x71656cc - INH Session ID: 0 Weight 0x1
Indirect path forwarding next hops: 1
Next hop type: Chain
Next hop: fe80::5668:acff:feda:cc51 via ge-0/0/5.0
fe80::5668:acff:feda:cc1b via ge-0/0/3.0
2001:db8:0:a4::/64 Originating RIB: inet6.3
Metric: 10 Node path count: 1
Forwarding nexthops: 2
Next hop type: List
Next hop: fe80::5668:acff:feda:cc51 via ge-0/0/5.0
Next hop: fe80::5668:acff:feda:cc1b via ge-0/0/3.0
to_CE0.inet6.0: 9 destinations, 9 routes (9 active, 0 holddown, 0 hidden)
bgp.l3vpn-inet6.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
junos-rti-tc-<color>.inet6.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
2001:db8:0:a6::d06-6<c6>/160 (1 entry, 1 announced)
*SPRING-TE Preference: 8
Next hop type: Indirect, Next hop index: 0
Address: 0x79724b4
Next-hop reference count: 1
Next hop type: Chain, Next hop index: 0
Next hop: via Chain Tunnel Composite, SRv6
Next hop: ELNH Address 0x76b7aa8, selected
SRV6-Tunnel: Reduced-SRH Encap-mode
Src: 2001:db8:1:255::1 Dest: 2001:db8:0:a6::d06-6<c6>
Segment-list[0] 2001:db8:0:a2::1a23
Segment-list[1] 2001:db8:0:a3::1a34
Segment-list[2] 2001:db8:0:a6::d06
Next hop type: Chain, Next hop index: 0
Address: 0x76b7aa8
Next-hop reference count: 5
Next hop: via Chain Tunnel Composite, SRv6
Next hop: ELNH Address 0x76b7a3c
SRV6-Tunnel: Reduced-SRH Encap-mode
Src: abcd::128:205:174:232 Dest: 2001:db8:0:a2::
Segment-list[0] 2001:db8:0:a2::
Next hop type: Router, Next hop index: 634
Address: 0x76b7a3c
Next-hop reference count: 17
Next hop: fe80::5668:acff:feda:cc1b via ge-0/0/3.0 weight 0x1
Next hop type: Chain, Next hop index: 0
Next hop: via Chain Tunnel Composite, SRv6
Next hop: ELNH Address 0x797282c, selected
SRV6-Tunnel: Reduced-SRH Encap-mode
Src: 2001:db8:1:255::1 Dest: 2001:db8:0:a6::d06-6<c6>
Segment-list[0] 2001:db8:0:a4::d04
Segment-list[1] 2001:db8:0:a5::d05
Segment-list[2] 2001:db8:0:a6::d06
Next hop: ELNH Address 0x76b9104 weight 0x1, selected
Next hop type: Chain, Next hop index: 0
Address: 0x76b9104
Next-hop reference count: 1
Next hop: via Chain Tunnel Composite, SRv6
Next hop: ELNH Address 0x76b8ee8
SRV6-Tunnel: Reduced-SRH Encap-mode
Src: abcd::128:205:174:232 Dest: 2001:db8:0:a4::
Segment-list[0] 2001:db8:0:a4::
Next hop type: Router, Next hop index: 635
Address: 0x76b8ee8
Next-hop reference count: 32
Next hop: fe80::5668:acff:feda:cc51 via ge-0/0/5.0 weight 0x1
Next hop: ELNH Address 0x76b9170 weight 0xf000
Next hop type: Chain, Next hop index: 0
Address: 0x76b9170
Next-hop reference count: 1
Next hop: via Chain Tunnel Composite, SRv6
Next hop: ELNH Address 0x76b8f54
SRV6-Tunnel: Reduced-SRH Encap-mode
Src: abcd::128:205:174:232 Dest: 2001:db8:0:a4::
Segment-list[0] 2001:db8:0:a3::d03
Segment-list[1] 2001:db8:0:a4::
Next hop type: Router, Next hop index: 634
Address: 0x76b8f54
Next-hop reference count: 11
Next hop: fe80::5668:acff:feda:cc1b via ge-0/0/3.0 weight 0xf000
Protocol next hop: 2001:db8:0:a2::1a23 Balance: 43%
Indirect next hop: 0x716539c - INH Session ID: 0 Weight 0x1
Protocol next hop: 2001:db8:0:a4::d04 Balance: 57%
Indirect next hop: 0x7165864 - INH Session ID: 0 Weight 0x1
State: <Active Int>
Local AS: 65500
Age: 14:29:23 Metric: 1 Metric2: 30
Validation State: unverified
Task: SPRING-TE
Announcement bits (1): 1-Resolve tree 11
AS path: I
SRTE Policy State:
SR Preference/Override: 100/100
Tunnel Source: Static configuration
Thread: junos-main
Indirect next hops: 2
Protocol next hop: 2001:db8:0:a2::1a23 Metric: 10
Indirect next hop: 0x716539c - INH Session ID: 0 Weight 0x1
Indirect path forwarding next hops: 1
Next hop type: Chain
Next hop: fe80::5668:acff:feda:cc1b via ge-0/0/3.0
2001:db8:0:a2::/64 Originating RIB: inet6.3
Metric: 10 Node path count: 1
Forwarding nexthops: 1
Next hop type: Chain
Next hop: fe80::5668:acff:feda:cc1b via ge-0/0/3.0
Protocol next hop: 2001:db8:0:a4::d04 Metric: 10
Indirect next hop: 0x7165864 - INH Session ID: 0 Weight 0x1
Indirect path forwarding next hops: 1
Next hop type: Chain
Next hop: fe80::5668:acff:feda:cc51 via ge-0/0/5.0
fe80::5668:acff:feda:cc1b via ge-0/0/3.0
2001:db8:0:a4::/64 Originating RIB: inet6.3
Metric: 10 Node path count: 1
Forwarding nexthops: 2
Next hop type: List
Next hop: fe80::5668:acff:feda:cc51 via ge-0/0/5.0
Next hop: fe80::5668:acff:feda:cc1b via ge-0/0/3.0
意义
输出显示彩色和未着色的 SR-流量工程传输路由,每条路由都有三个 SRv6-流量工程分段列表。输出还表示,有色和无色路由分段列表遵循简化的 SRH 封装模式。
通过无色 SR-流量工程 SRv6 路由端验证 BGP 服务 IPv4 路由 DT4
目的
验证 BGP 服务 IPv4 路由是否通过未着色的 SR-流量工程 SRv6 路由 End.DT4 解析
行动
在操作模式下,对设备 R1 运行 show route 10.100.10.7 extensive expanded-nh 命令。
user@R1>show route 10.100.10.7 extensive expanded-nh
to_CE0.inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)10.100.10.7/32 (1 entry, 1 announced)
Installed-nexthop:
Indr Composite (0x76ba328) 2001:db8:0:a6::d06 Session-ID: 327
Krt_cnh (0x6fb4328) Index:642
Krt_inh (0x7166854) Index:1048583 PNH: 2001:db8:0:a6::d06 SRv6-TE uncolored LSP
List (0x7972f1c) Index:1048582
Frr_inh (0x76ba10c) Index:1048577 PNH: 2001:db8:0:a2::1a23 Session-ID: 324
Chain Fully resolved tunnel (0x76b7cc4) Index:637 SRv6
Router (0x76b7a3c) Index:634 fe80::5668:acff:feda:cc1b Session-ID: 322 via ge-0/0/3.0
Frr_inh (0x76b9fc8) Index:1048580 PNH: 2001:db8:0:a4::d04 Session-ID: 326
List (0x7972a7c) Index:1048578
Chain Fully resolved tunnel (0x76b8d38) Index:638 SRv6
Router (0x76b8ee8) Index:635 fe80::5668:acff:feda:cc51 Session-ID: 323 via ge-0/0/5.0
Chain Fully resolved tunnel (0x76b9464) Index:639 SRv6
Router (0x76b8f54) Index:634 fe80::5668:acff:feda:cc1b Session-ID: 322 via ge-0/0/3.0
TSI:
KRT in-kernel 10.100.10.7/32 -> {composite(642)}
*BGP Preference: 170/-101
Route Distinguisher: 192.168.255.66:6
Next hop type: Indirect, Next hop index: 0
Address: 0x76ba250
Next-hop reference count: 6
Source: 2001:db8:6:255::6
Next hop type: Chain, Next hop index: 0
意义
输出确认 BGP VPN IPv4 服务前缀 10.100.10.7/32 已安装在通过未着色 SRv6-流量工程策略解析的 vpn.inet.0 表中。
通过彩色 SR-流量工程 SRv6 验证 BGP 服务 IPv6 路由 End.DT6
目的
验证 BGP VPN IPv6 服务路由是否通过彩色 SRv6-流量工程策略解析。
行动
在操作模式下,对设备 R1 运行 show route 2001:db8:7:255::7/128 extensive expanded-nh 命令。
user@R1>show route 2001:db8:7:255::7/128 extensive expanded-nh
to_CE0.inet6.0: 9 destinations, 9 routes (9 active, 0 holddown, 0 hidden)
2001:db8:7:255::7/128 (1 entry, 1 announced)
Installed-nexthop:
Indr Composite (0x76ba1e4) 2001:db8:0:a6::d06-6<c6>
Krt_cnh (0x6fb25f4) Index:647
Krt_inh (0x7166d1c) Index:1048586 PNH: 2001:db8:0:a6::d06-6<c6> SRv6-TE IPV6 colored LSP
List (0x7972f1c) Index:1048585
Frr_inh (0x76ba034) Index:1048577 PNH: 2001:db8:0:a2::1a23 Session-ID: 328
Chain Fully resolved tunnel (0x76b7bec) Index:640 SRv6
Router (0x76b7a3c) Index:634 fe80::5668:acff:feda:cc1b Session-ID: 322 via ge-0/0/3.0
Frr_inh (0x76b9f5c) Index:1048582 PNH: 2001:db8:0:a4::d04 Session-ID: 329
List (0x79729e8) Index:1048581
Chain Fully resolved tunnel (0x76b938c) Index:641 SRv6
Router (0x76b8ee8) Index:635 fe80::5668:acff:feda:cc51 Session-ID: 323 via ge-0/0/5.0
Chain Fully resolved tunnel (0x76b93f8) Index:642 SRv6
Router (0x76b8f54) Index:634 fe80::5668:acff:feda:cc1b Session-ID: 322 via ge-0/0/3.0
TSI:
KRT in-kernel 2001:db8:7:255::7/128 -> {composite(647)}
*BGP Preference: 170/-101
Route Distinguisher: 192.168.255.66:6
Next hop type: Indirect, Next hop index: 0
Address: 0x76ba394
Next-hop reference count: 3
Source: 2001:db8:6:255::6
Next hop type: Chain, Next hop index: 0
Next hop: via Chain Tunnel Composite, SRv6
Next hop: ELNH Address 0x76b7aa8, selected
SRV6-Tunnel: Reduced-SRH Encap-mode
Src: 2001:db8:1:255::1 Dest: 2001:db8:0:a6::d06-6<c6>
Segment-list[0] 2001:db8:0:a2::1a23
Segment-list[1] 2001:db8:0:a3::1a34
Segment-list[2] 2001:db8:0:a6::d06
Next hop type: Chain, Next hop index: 0
Address: 0x76b7aa8
Next-hop reference count: 5
意义
输出确认 BGP VPN IPv6 服务前缀 2001:db8:7:255::7/128 已安装在通过彩色 SRv6-流量工程策略解析的 vpn.inet6.0 表中。
验证 CE0 和 CE7 之间的 IPv4 连接
目的
生成 ping 以验证通过 IPv6 提供商核心在客户边缘设备之间的 IPv4 连接。
行动
在操作模式下,对设备 CE0 运行 ping 10.100.10.7 命令。
user@CE0> ping 10.100.10.7 PING 10.100.10.7 (10.100.10.7): 56 data bytes 64 bytes from 10.100.10.7: icmp_seq=0 ttl=62 time=9.363 ms 64 bytes from 10.100.10.7: icmp_seq=1 ttl=62 time=7.696 ms ^C --- 10.100.10.7 ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max/stddev = 7.696/8.529/9.363/0.834 ms
意义
输出确认 IPv4 连接在客户边缘设备网络之间正常工作。这将验证在此示例中通过 IPv6 提供商核心的 SRv6 隧道是否工作正常。