DS-Lite 软线
配置 DS-Lite Softwire 集中器
DS-Lite 在 M 系列路由器上的多服务 100、400 和 500 PIC 上受支持, 在配备多服务 DPC 的 MX 系列路由器上。从 Junos OS 版本 17.4R1 开始,带 MS-MPC 和 MS-MIC 的 MX 系列路由器支持 DS-Lite。从 Junos OS 版本 19.2R1 开始,MX 虚拟机箱和 MX 宽带网络网关 (BNG) 路由器支持 DS-Lite。
要配置 DS-Lite 软线集中器:
另请参阅
配置 IPv6 组播接口
当 IPv6 NAT 用于邻接方发现时,在以太网接口上配置组播过滤器。这使路由器能够在两个方向处理软线启动的流。
要配置 IPv6 组播接口:
另请参阅
示例:基本 DS-Lite 配置
DS-Lite 采用 IPv4-over-IPv6 隧道穿越 IPv6 接入网络以到达运营商级 IPv4-IPv4 NAT。这通过向后兼容 IPv4,促进了互联网上 IPv6 的分阶段引入。请参阅 了解 IPv6 双堆栈 Lite。
要求
以下硬件组件可以执行 DS-Lite:
采用多服务 PIC 的 M 系列多服务边缘路由器。
带多服务 PIC 的 T 系列核心路由器。
具有多服务 DPC 的 MX 系列 5G 通用路由平台。从 Junos OS 版本 17.4R1 开始,带 MS-MPC 和 MS-MIC 的 MX 系列路由器支持 DS-Lite。从 Junos OS 版本 19.2R1 开始,MX 虚拟机箱和 MX 宽带网络网关 (BNG) 路由器支持 DS-Lite。
配置概述和拓扑
此示例介绍如何将带 MS-DPC 的 MX 系列路由器配置为 AFTR 以方便 图 1 中显示的流量。

在此示例中,DS-Lite softwire 集中器 (AFTR) 是带有两个千兆位接口和一个服务 DPC 的 MX 系列路由器。面向 B4 元素的接口为 ge-3/1/5,面向 Internet 的接口为 ge-3/1/0。
配置
机箱配置
逐步过程
要使用第 3 层服务包配置服务 PIC (FPC 0 插槽 0):
输入 编辑机箱 层次结构级别。
user@host# edit chassis
配置第 3 层服务包。
[edit chassis]
user@host# set fpc 0 pic 0 adaptive-services service-package layer-3
接口配置
逐步过程
要配置面向 B4(softwire 发起器)且面向互联网的接口:
转到面向互联网的
[edit interfaces]
ge-3/1/0 的编辑层次。host# edit interfaces ge-3/1/0
定义接口。
[edit interfaces ge-3/1/0]
user@host# set description AFTR-Internet user@host# set unit 0 family inet address 128.0.0.2/24进入面向 B4 的
[edit interfaces]
ge-3/1/5 的层次级别。user@host# up 1
[edit]
user@host# edit interfaces ge-3/1/5定义接口。
[edit interfaces ge-3/1/5]
user@host# set description AFTR-B4 user@host# set unit 0 family inet user@host# edit unit 0 family inet6[edit unit 0 family inet6]
user@host# set service input service-set sset user@host# set service output service-set sset user@host# set address 2001:0:0:2::1/48转至
[edit interfaces]
sp-0/0/0 的层次结构级别,用于托管 DS-Lite AFTR。[edit]
user@host# edit interfaces sp-0/0/0定义接口。
[edit interfaces sp-0/0/0]
user@host# set description AFTR-B4 user@host# set unit 0 family inet user@host# edit unit 0 family inet6
结果
user@host# show interfaces ge-3/1/0 description AFTR-Internet; unit 0 { family inet { address 128.0.0.2/24; } } user@host# show interfaces ge-3/1/5 description AFTR-B4; unit 0 { family inet; family inet6 { service { input { service-set sset; } output { service-set sset; } } address 2001:0:0:2::1/48; } } user@host# show interfaces sp-o/o/o unit 0 { family inet; family inet6; }
网络地址和端口转换配置
逐步过程
要配置 NAPT:
转到
[edit services nat]
层次结构级别。user@host# edit services nat
[edit services nat]
定义 NAT 池 p1。
user@host# set pool p1 address 129.0.0.1/32 port automatic
定义 NAT 规则,从匹配方向开始。
[edit services nat]
user@host# set rule r1 match-direction input定义规则的 术语 ,从语句开始。
[edit services nat]
user@host# set rule r1 term t1 from source-address 10.0.0.0/16在 随后 的语句中定义所需的转换。在这种情况下,请使用动态源转换。
[edit services nat]
user@host# set rule r1 term t1 then translated source-pool p1 translation-type napt-44(可选)配置规则转换信息的日志记录。
[edit services nat]
user@host# set rule r1 term t1 then syslog
结果
user@host# show services nat pool p1 { address 129.0.0.1/32; port { automatic; } } rule r1 { match-direction input; term t1 { from { source-address { 10.0.0.0/16; } } then { translated { source-pool p1; translation-type { napt-44; } } syslog; } }
Softwire 配置
逐步过程
要配置 DS-Lite softwire 集中器和相关规则:
转到
[edit services softwire]
层次结构级别。user@host# edit services softwire
定义 DS-Lite 软线集中器。
[edit services softwire]
user@host# set softwire-concentrator ds-lite ds-1 softwire-address 1001::1 mtu-v6 1460定义 softwire 规则。
[edit services softwire]
user@host# set rule r1 match-direction input term t1 then ds-lite ds1.
结果
user@host# show services softwire softwire-concentrator { ds-lite ds1 { softwire-address 1001::1; mtu-v6 1460; } } rule r1 { match-direction input; term t1 { then { ds-lite ds1; } } }
服务集配置
逐步过程
配置包含软线和 NAT 规则的服务集,并指定接口服务或下一跃点服务。此示例使用下一跳服务。
转至
[edit services service-set]
层次结构级别,命名服务集。user@host# edit services service-set sset
定义要用于 IPv4 到 IPv4 转换的 NAT 规则。
[edit services service-set sset]
user@host# set nat-rules r1定义软线规则以定义软线隧道。
[edit services service-set sset]
user@host# set softwire-rules r1定义接口服务
[edit services service-set sset]
user@host# set interface-service service-interface sp-0/0/0.0提示:为避免或最小化 IPv6 分片,您可以为服务集配置 TCP 最大分段大小 (MSS)。
(可选)定义 TCP MSS。
[edit services service-set sset]
user@host# set tcp-mss 1024
结果
user@host# show services service-set syslog { host local { services any; } } softwire-rules r1; nat-rules r1; interface-service { service-interface sp-0/0/0; } }
示例:在同一服务集中配置 DS-Lite 和第 6 名
要求
以下硬件组件可以执行 DS-Lite:
采用多服务 PIC 的 M 系列多服务边缘路由器。
带多服务 PIC 的 T 系列核心路由器。
具有多服务 DPC 的 MX 系列 5G 通用路由平台。从 Junos OS 版本 17.4R1 开始,带 MS-MPC 和 MS-MIC 的 MX 系列路由器支持 DS-Lite。从 Junos OS 版本 19.2R1 开始,MX 虚拟机箱和 MX 宽带网络网关 (BNG) 路由器支持 DS-Lite。从 Junos OS 20.2R1 版开始,DS-Lite 受 MX240、MX480 和 MX960 路由器上的 CGNAT 下一代服务支持。
概述
此示例介绍在同一服务集中包括 DS-Lite 和第 6 位的软线解决方案。
配置
机箱配置
逐步过程
要配置机箱:
配置入口接口。
user@host# edit interfaces ge-1/2/0 [edit interfaces ge-1/2/0] user@host# set unit 0 family inet service input service-set v6rd-dslite-service-set user@host# set unit 0 family inet service output service-set v6rd-dslite-service-set user@host# set unit 0 family inet address address 10.10.10.1/24 user@host# set unit 0 family inet6 service input service-set v6rd-dslite-service-set user@host# set unit 0 family inet6 service output service-set v6rd-dslite-service-set user@host# set unit 0 family inet6 address address address 2001::1/16
此处,服务集适用于子云端 0 的 inet (IPv4) 和 inet6 (IPv6) 系列。DS-Lite IPv6 流量和 6rd IPv4 流量都会击中服务过滤器,并发送至服务 PIC。
配置出口接口 (IPv6 Internet)。DS-Lite 客户端尝试到达的 IPv4 服务器为 200.200.200.2/24,而 IPv6 服务器为 3ABC::2/16。
user@host# edit interfaces ge-1/2/2 [edit interfaces ge-1/2/2] user@host# set unit 0 family inet address 200.200.200.1/24 user@host# set unit 0 family inet6 address 3ABC::1/16
配置服务 PIC。
user@host# edit interfaces sp-3/0/0 [edit interfaces sp-3/0/0] user@host# set unit 0 family inet user@host# set unit 0 family inet6
结果
[edit interfaces] user@host# show ge-1/2/0 { unit 0 { family inet { service { input { service-set v6rd-dslite-service-set; } output { service-set v6rd-dslite-service-set; } } address 10.10.10.1/24; } family inet6 { service { input { service-set v6rd-dslite-service-set; } output { service-set v6rd-dslite-service-set; } } address 2001::1/16; } } } ge-1/2/2 { unit 0 { family inet { address 200.200.200.1/24; } family inet6 { address 3ABC::1/16; } } } sp-3/0/0 { unit 0 { family inet; family inet6; } }
Softwire 集中器、Softwire 规则、有状态防火墙规则配置
逐步过程
要配置 softwire 集中器、softwire 规则和有状态防火墙规则:
配置 DS-Lite 和 6rd softwire 集中器。
user@host# edit services softwire softwire-concentrator ds-lite ds1 [edit services softwire softwire-concentrator ds-lite ds1] user@host# set softwire-address 1001::1 user@host# mtu-v6 9192 usert@host# up 1 usert@host# edit v6rd v6rd-dom1 [edit services softwire softwire-concentrator v6rd v6rd-dom1] user@host# set softwire-address 30.30.30.1 user@host# set ipv4-prefix 10.10.10.0/24 user@host# set v6rd-prefix 3040::0/16 user@host# set mtu-v4 9192
配置软线规则。
user@host# edit services softwire rule v6rd-r1] [edit services softwire rule v6rd-r1] user@host# set match-direction input user@host# set term t1 then v6rd v6rd-dom1 user@host# up 1 user@host# edit services softwire] [edit services softwire] user@host# edit rule dslite-r1 [edit services softwire rule dslite-r1] user@host# set term dslite-t1 then ds-lite ds1
路由引擎上的服务 PIC 守护程序会添加以下路由:
user@host# run show route 30.30.30.1 inet.0: 43 destinations, 46 routes (42 active, 0 holddown, 1 hidden) + = Active Route, - = Last Active, * = Both 30.30.30.1/32 *[Static/786432] 00:24:11 Service to v6rd-dslite-service-set [edit] user@host# run show route 3040::0/16 inet6.0: 23 destinations, 33 routes (23 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 3040::/16 *[Static/786432] 00:24:39 Service to v6rd-dslite-service-set
user@host# run show route 1001::1 inet6.0: 33 destinations, 43 routes (33 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 1001::1/128 *[Static/1] 1w2d 22:05:41 Service to v6rd-dslite-service-set
配置有状态防火墙规则。
user@host# edit services stateful-firewall rule r1 [edit services stateful-firewall rule r1] user@host# set match-direction input-output user@host# set term t1 then accept
[edit services stateful-firewall] rule r1 { match-direction input-output; term t1 { then { accept; } } }
结果
[edit services softwire] user@host# show softwire-concentrator { ds-lite ds1 { softwire-address 1001::1; mtu-v6 9192; } v6rd v6rd-dom1 { softwire-address 30.30.30.1; ipv4-prefix 10.10.10.0/24; v6rd-prefix 3040::0/16; mtu-v4 9192; } } rule v6rd-r1 { match-direction input; term t1 { then { v6rd v6rd-dom1; } } } rule dslite-r1 { match-direction input; term dslite-t1 { then { ds-lite ds1; } } }
[edit services stateful-firewall] user@host# show rule r1 { match-direction input-output; term t1 { then { accept; } } }
DS-Lite 的 NAT 配置
逐步过程
要为 DS-Lite 配置 NAT:
为 DS-Lite 配置 NAT 池。
user@host# edit services nat pool dslite-pool [edit services nat pool dslite-pool] user@host# set address-range low 33.33.33.1 high 33.33.33.32 user@host# set port automatic
配置 NAT 规则。
user@host# up 1 [edit services nat rule dslite-nat-r1] user@host# set match-direction input user@host# set term dslite-nat-t1 from source-address 20.20.0.0/16 then translated translation-type napt-44
结果
[edit services nat] user@host# show pool dslite-pool { address-range low 33.33.33.1 high 33.33.33.32; port { automatic; } } rule dslite-nat-r1 { match-direction input; term dslite-nat-t1 { from { source-address { 20.20.0.0/16; } } then { translated { source-pool dslite-pool; translation-type { source dynamic; } } } } }
由于此 NAT 规则,将为反向 DS-Lite 流量安装以下 NAT 路由:
user@host# run show route 33.33.33.0/24 inet.0: 48 destinations, 52 routes (47 active, 0 holddown, 1 hidden) + = Active Route, - = Last Active, * = Both 33.33.33.1/32 *[Static/1] 1w2d 23:08:38 Service to v6rd-dslite-service-set 33.33.33.2/31 *[Static/1] 1w2d 23:08:38 Service to v6rd-dslite-service-set 33.33.33.4/30 *[Static/1] 1w2d 23:08:38 Service to v6rd-dslite-service-set 33.33.33.8/29 *[Static/1] 1w2d 23:08:38 Service to v6rd-dslite-service-set 33.33.33.16/28 *[Static/1] 1w2d 23:08:38 Service to v6rd-dslite-service-set 33.33.33.32/32 *[Static/1] 1w2d 23:08:38 Service to v6rd-dslite-service-set
NAT 规则触发 20.20.0.0/16 到公共地址范围 33.33.33.1 到 33.33.33.32 的流量的地址转换。
服务集配置
逐步过程
此服务集具有状态防火墙规则和第 6 条第 6 条服务规则。服务集还包括 DS-Lite 的软线规则和 NAT 规则,用于执行所有 DS-Lite 流量的地址转换。NAT 规则在 DS-Lite 流量的源地址和端口上执行 NAPT 转发方向的 NAPT 转换。
要配置服务集:
定义服务集。
user@host# edit services service-set v6rd-dslite-service-set
配置服务集规则。
[edit services service-set v6rd-dslite-service-set] user@host# set softwire-rules dslite-r1 user@host# set stateful-firewall-rules r1 user@host# set nat-rules dslite-nat-r1
配置服务集接口服务。
[edit services service-set v6rd-dslite-service-set] user@host# set interface-service service-interface sp-3/0/0
结果
[edit services service-set] user@host# show v6rd-dslite-service-set { softwire-rules v6rd-r1; softwire-rules dslite-r1; stateful-firewall-rules r1; nat-rules dslite-nat-r1; interface-service { service-interface sp-3/0/0; }
DS-Lite 子网限制
每个子网的 DS-Lite 限制概述
借助 Junos OS,您可以在给定时间点限制来自订阅者基本桥接宽带 (B4) 设备的软线流数量,从而防止订阅者过度使用子网内的地址。此限制可降低拒绝服务 (DoS) 攻击的风险。配备 MS-DPC 的 MX 系列路由器支持此限制。从 Junos OS 版本 18.2R1 开始,MS-MPC 和 MS-MIC 还支持子网限制功能。从 Junos OS 19.2R1 版开始,MX 虚拟机箱和 MX 宽带网络网关 (BNG) 路由器还支持子网限制功能。从 Junos OS 20.2R1 版开始,DS-Lite 受 MX240、MX480 和 MX960 路由器上的 CGNAT 下一代服务支持。
使用带 DS-Lite 的 IPv6 的家庭是一个子网,而不仅仅是一个单独的 IP 地址。子网限制功能将订阅者和映射与 IPv6 前缀关联,而不是 IPv6 地址。订阅者可将前缀中的任何 IPv6 地址用作 DS-Lite B4 地址,并且可能耗尽运营商级 NAT 资源。子网限制功能通过使用前缀而不是特定地址识别订阅者,可以更好地控制资源利用率。
子网限制提供以下功能:
流利用完整的 B4 地址。
在单个服务集的软线选项下,可以根据每个服务集配置前缀长度。
端口块按订阅者 B4 设备的前缀分配,而不是分配在每个 B4 地址上(如果前缀长度小于 128)。如果前缀长度为 128,则每个 IPv6 地址都被视为 B4。端口块按 128 位 IPv6 地址分配。
在 DS-Lite softwire 集中器配置下定义的会话限制前缀的 IPv4 会话数。
EIM、EIF 和 PCP 映射按软线隧道创建(完整 128 位 IPv6 地址)。Stale 根据超时值对超时时间进行映射。
如果配置了前缀长度,则 PCP
max-mappings-per-subscriber
(可在下pcp-server
配置)仅基于前缀,而非完整的 B4 地址。用于 PBA 分配和版本的 SYSLOGS 包含所有零完成的地址的前缀部分。用于 PCP 分配和发布、流创建和删除的 SYSLOGS 仍将包含完整的 IPv6 地址。
操作 show services nat mappings address-pooling-paired
命令输出现在显示前缀的映射。映射显示活动 B4 的地址。
输出 show services softwire statistics ds-lite
包括一个新字段,显示 MPC 超过会话限制的次数。
对于 MX240、MX480 和 MX960 路由器上的新一代服务,字段中 Softwire session limit exceeded
显示子网限制统计信息。
显示服务软线统计信息 (MX-SPC3)
user@host> show services softwire statistics vms-2/0/0 Total Session Interest events :3 Total Session Destroy events :2 Total Session Public Request events :0 Total Session Accepts :1 Total Session Discards :0 Total Session Ignores :0 Total Session extension alloc failures :0 Total Session extension set failures :0 Softwire statistics Total Softwire sessions created :1 Total Softwire sessions deleted :2 Total Softwire sessions created for reverse packets :1 Total Softwire session create failed for reverse pkts :0 Total Softwire rule match success :1 Total Softwire rule match failed :0 Softwire session limit exceeded :0 Softwire packet statistics Total Packets processed :1 Total packets encapsulated :1 Total packets decapsulated :1 Encapsulation errors :0 Decapsulation errors :0 Encapsulated pkts re-inject failures :0 Decapsulated pkts re-inject failures :0 DS-Lite ICMPv4 Echo replies sent :0 DS-Lite ICMPv4 TTL exceeded messages sent :0 ICMPv6 ECHO request messages received destined to AFTR :0 ICMPv6 ECHO reply messages sent from AFTR :0 ICMPv6 ECHO requests to AFTR process failures :0 V6 untunnelled packets destined to AFTR dropped :1 Softwire policy add errors :0 Softwire policy delete errors :0 Softwire policy memory alloc failures :0 Softwire Untunnelled packets ignored :0 Softwire Misc errors DS-Lite ICMPv4 TTL exceed message process errors :0
另请参阅
配置每个子网的 DS-Lite 会话限制以防止拒绝服务攻击
您可以在配备 MS-DPC 的 MX 系列路由器上配置每个子网限制的 DS-Lite。从 Junos OS 版本 18.2R1 开始,MS-MPC 和 MS-MIC 还支持子网限制功能。从 Junos OS 20.2R1 版开始,新一代服务 MX-SPC3 安全服务卡支持子网限制功能。
从 Junos OS 19.2R1 版开始,MX 虚拟机箱和 MX 宽带网络网关 (BNG) 路由器还支持子网限制功能。
要按子网会话限制配置 DS-Lite:
另请参阅
mtu-v6
使用 MS-MPC 或 MS-MIC 的 MX 系列路由器支持该选项。