在 NFX 系列设备上配置 MAP-E
概述
此示例介绍如何在 NFX 系列设备上配置地址和端口封装映射 (MAP-E) 功能。有关 MAP-E 的详细信息,请参阅 在 NFX 系列设备上使用封装映射地址和端口。
要求
此示例使用以下硬件和软件组件:
运行 Junos OS 19.4R1 版的 NFX150 设备,部署为客户边缘 (CE) 设备。
MX480 设备,部署为边界中继 (BR) 设备。
将物理接口映射到虚拟接口。有关更多信息,请参阅 NFX150 设备上的接口映射。
拓扑概述
此拓扑显示了如何在 NFX 系列设备上配置 MAP-E CE 功能。此拓扑还显示了来自 MAP-E CE 设备的 IPv4 数据包如何通过 IPv6 路由拓扑进行封装并通过 IPv4-over-IPv6 隧道传输到 MAP-E 提供商边缘 (PE) 设备(也称为边界中继 [BR] 设备),其中数据包被解散以进行进一步处理。MX 系列设备用作 MAP-E BR 设备,这是一种同时连接到公共 IPv4 网络和 IPv6 MAP-E 网络的双堆栈设备。
图 1 显示了 NFX 系列设备上的 MAP-E 部署。

将 NFX 系列设备配置为 MAP-E CE 设备
要将 NFX 系列设备配置为 MAP-E 客户边缘设备,请执行以下操作:
将 MX 系列设备配置为 BR 设备
要将 MX 系列设备配置为边界中继设备:
验证 MAP-E 配置
目的
在 NFX 系列设备上完成 MAP-E 配置后,您可以验证 MAP-E 配置的状态。
行动
验证数据包流的状态:
user@host> show security flow session Session ID: 134218806, Policy name: my_ce/4, Timeout: 1800, Valid In: 10.10.10.2/57630 --> 203.0.113.2/22;tcp, Conn Tag: 0x0, If: ge-1/0/1.0, Pkts: 50, Bytes: 5797, Out: 203.0.113.2/22 --> 192.0.2.18/20691;tcp, Conn Tag: 0x0, If: lt-1/0/0.1, Pkts: 33, Bytes: 5697, Session ID: 134218807, Policy name: my_ce/4, Timeout: 1800, Valid In: 2001:db8:12:3400:c0:2:1200:3400/1 --> 2001:db8::a/1;ipip, Conn Tag: 0x0, If: lt-1/0/0.2, Pkts: 50, Bytes: 7797, Out: 2001:db8::a/1 --> 2001:db8:12:3400:c0:2:1200:3400/1;ipip, Conn Tag: 0x0, If: ge-1/0/2.0, Pkts: 33, Bytes: 7017, Total sessions: 2
验证是否正确配置了 IPv4 和 IPv6 地址:
user@host> show security softwires map-e domain mapce1 Role : CE Version : 3 Domain Name : mapce1 BR Address : 2001:db8::a/128 End User Ipv6 prefix : 2001:db8:12:3400::/56 BMR Mapping Rule : Rule Name : bmr Rule Ipv4 Prefix : 192.0.2.0/24 Rule Ipv6 Prefix : 2001:db8::/40 PSID offset : 6 PSID length : 8 EA bit length : 16 Port SetID : 0x34 MAP-E Ipv4 address : 192.0.2.18/32 MAP-E Ipv6 address : 2001:db8:12:3400:c0:2:1200:3400
验证地图规则统计信息:
user@host> show security softwires map-e domain mapce1 statistics rule bmr BMR Rule Name :bmr Encapsulated packets :289 Decapsulated packets :269 Encapsulation errors :0 Decapsulation errors :0 Encapsulated fragmentation :0 Decapsulated fragmentation :0 Invalid port set :0 IPv6 address mismatch :0
查看 NAT 源规则的详细信息:
user@host> show security nat source rule all Total rules: 1 Total referenced IPv4/IPv6 ip-prefixes: 5/0 source NAT rule: r1 Rule-set: mape Rule-Id : 1 Rule position : 1 From zone : v4zone To interface : lt-1/0/0.1 : ge-1/0/1.0 Match Source addresses : 10.10.10.0 - 10.10.10.255 Destination addresses : 10.10.10.0 - 10.10.10.255 198.51.100.0 - 198.51.100.255 203.0.113.0 - 203.0.113.255 192.0.2.0 - 192.0.2.255 Action : my_mape Persistent NAT type : any-remote-host Persistent NAT mapping type : address-port-mapping Inactivity timeout : 300 Max session number : 30 Translation hits : 1 Successful sessions : 1 Failed sessions : 0 Number of sessions : 1
查看 NAT 源池的详细信息:
user@host> show security nat source pool all Total pools: 1 Pool name : my_mape Pool id : 4 Routing instance : default Host address base : 0.0.0.0 Map-e domain name : mapce1 Map-e rule name : bmr PSID offset : 6 PSID length : 8 PSID : 0x34 Port overloading : 1 Address assignment : no-paired Total addresses : 1 Translation hits : 1 Address range Single Ports Twin Ports 192.0.2.18 - 192.0.2.18 1 0 Total used ports : 1 0
查看 NAT 源摘要:
user@host> show security nat source summary show security nat source summary Total port number usage for port translation pool: 252 Maximum port number for port translation pool: 33554432 Total pools: 1 Pool Address Routing PAT Total Name Range Instance Address my_mape 192.0.2.18-192.0.2.18 default yes 1 Total rules: 1 Rule name Rule set From To Action r1 mape v4zone lt-1/0/0.1 my_mape r1 ge-1/0/1.0
查看持久 NAT 表:
user@host> show security nat source persistent-nat-table all Internal Reflective Source Type Left_time/ Curr_Sess_Num/ Source In_IP In_Port I_Proto Ref_IP Ref_Port R_Proto NAT Pool Conf_time Max_Sess_Num NAT Rule 10.10.10.2 57630 tcp 192.0.2.18 20691 tcp my_mape any-remote-host -/300 1/30 r1
查看 MX 系列设备上的软线统计信息:
user@host> show services inline softwire statistics mape Service PIC Name si-1/0/0 Control Plane Statistics MAPE ICMPv6 echo requests to softwire concentrator 0 MAPE ICMPv6 echo responses from softwire concentrator 0 MAPE Dropped ICMPv6 packets to softwire concentrator 0 Data Plane Statistics (v6-to-v4) Packets Bytes MAPE decaps 15034 1388760 MAPE ICMP decap errors 0 0 MAPE decap spoof errors 0 0 MAPE v6 reassembled 0 0 MAPE dropped v6 fragments 0 0 MAPE v6 unsupp protocol drops 0 0 Data Plane Statistics (v4-to-v6) Packets Bytes MAPE encaps 149544 223527457 MAPE ICMP encap errors 0 0 MAPE v6 mtu errors 0 0 MAPE v4 reassembled 0 0 MAPE dropped v4 fragments 0 0
意义
本节介绍 NFX 系列设备上 MAP-E 配置的输出字段。
Role | MAP-E 部署在 CE 设备上。目前,仅支持 CE 角色。 |
Version | MAP-E 版本:MAP-E draft-3。 |
BR address | 在没有匹配的 FMR 规则的情况下用作目标地址的边界路由器地址。 |
Rule name | 配置的 BMR 或 FMR 规则的名称。 |
Rule IPv4 prefix | BMR 或 FMR 规则中的 IPv4 前缀。 |
Rule IPv6 prefix | BMR 或 FMR 规则中的 IPv6 前缀。 |
Port set ID | 端口集标识符,用于通过算法识别专门分配给 CE 设备的一组端口。 |
PSID offset | 端口集标识符偏移量,用于指定排除端口的范围。 |
PSID length | 端口集标识符长度,用于指定共享比率。 |
EA bit length | 嵌入式地址位长度,用于指定 IPv4 地址或 PSID 的一部分。 |