IPv4网络用户访问IPv6网络服务器

NAT64静态映射为一对一的对应关系,通常应用在IPv4网络主动访问IPv6网络的场景中。

要求位于IPv4网络中的PC通过IPv4地址1.1.1.10能够直接访问位于IPv6网络中Server。

操作步骤

  1. 配置FW。

    配置接口GigabitEthernet 0/0/1的IPv4地址。

    system-view
    [FW] interface GigabitEthernet 0/0/1
    [FW-GigabitEthernet0/0/1] ip address 1.1.1.1 24
    [FW-GigabitEthernet0/0/1] quit

开启IPv6报文转发功能。

复制代码
[FW] ipv6

配置接口GigabitEthernet 0/0/2的IPv6地址。

复制代码
[FW] interface GigabitEthernet 0/0/2
[FW-GigabitEthernet0/0/2] ipv6 enable
[FW-GigabitEthernet0/0/2] ipv6 address 2001::2 64

开启接口GigabitEthernet 0/0/2的NAT64功能。

复制代码
[FW-GigabitEthernet0/0/2] nat64 enable
[FW-GigabitEthernet0/0/2] quit

将接口GigabitEthernet 0/0/1加入Trust安全区域。

复制代码
[FW] firewall zone trust
[FW-zone-trust] add interface GigabitEthernet 0/0/1
[FW-zone-trust] quit

将接口GigabitEthernet 0/0/2加入Untrust安全区域。

复制代码
[FW] firewall zone untrust
[FW-zone-untrust] add interface GigabitEthernet 0/0/2
[FW-zone-untrust] quit

配置NAT64前缀,PC访问Server的报文在IPv6网络中传输时使用的源地址由NAT64前缀和PC的IPv4地址组合而成。

复制代码
[FW] nat64 prefix 3001:: 96

此处NAT64前缀以3001:: 96为例,如果不配置,则默认为知名前缀。

配置NAT64静态映射关系,将Server的IPv6地址2001::1映射为IPv4地址1.1.1.10。

复制代码
[FW] nat64 static 2001::1 1.1.1.10 unr-route

开启NAT64报文受安全策略控制功能。

复制代码
[FW] nat64 security-policy enable

配置安全策略。

配置NAT64静态映射需要配置IPv6安全策略。

复制代码
[FW] security-policy
[FW-policy-security] rule name policy_sec_1
[FW-policy-security-rule-policy_sec_1] source-zone trust
[FW-policy-security-rule-policy_sec_1] destination-zone untrust
[FW-policy-security-rule-policy_sec_1] destination-address 2001::1 64
[FW-policy-security-rule-policy_sec_1] action permit
[FW-policy-security-rule-policy_sec_1] quit

配置PC的IPv4地址。(IPv4地址的配置方法与PC的操作系统有关,配置方法略。)

配置PC的IPv4地址为1.1.1.2/24,与FW的接口GigabitEthernet 0/0/1同一网段。

配置Server的IPv6地址和路由。(IPv6地址和路由的配置方法与Server的操作系统有关,配置方法略。)

配置Server的IPv6地址为2001::1/24,与FW的接口GigabitEthernet 0/0/2同一网段。

配置Server去往3001::/96网段的路由为2001::2。

结果验证

配置完成后,PC上执行ping 1.1.1.10。

复制代码
C:\> ping 1.1.1.10
Pinging 1.1.1.10 with 32 bytes of data:

Reply from 1.1.1.10: time=69ms
Reply from 1.1.1.10: time=34ms
Reply from 1.1.1.10: time=17ms
Reply from 1.1.1.10: time=18ms

Ping statistics for 1.1.1.10:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 17ms, Maximum = 69ms, Average = 34ms

PC可以ping通Server的IPv4映射地址。

在FW任意视图下执行display firewall ipv6 session table,查看NAT64的会话表信息。

复制代码
<FW> display firewall ipv6 session table
 Current total IPv6 sessions: 1                                                 
 Slot: 6 CPU: 1                                                                 
NAT64: icmp6 VPN: public --> public  3001::101:102.44006[1.1.1.2:44006] --> 2001::1.2048[1.1.1.10:2048]

由NAT64会话表得知IPv6与IPv4地址的转换关系。

配置脚本

FW的配置脚本

html 复制代码
#                                                                               
 sysname FW                                      
#                                                                               
 ipv6
#                                                                               
interface GigabitEthernet0/0/1                                                  
 ip address 1.1.1.1 255.255.255.0                                               
#                                                                               
interface GigabitEthernet0/0/2                                                  
 ipv6 enable
 nat64 enable
 ipv6 address 2001::2/64                                              
#                                                                               
firewall zone trust                                                             
 set priority 85                                                                
 add interface GigabitEthernet0/0/1                                             
#                                                                               
firewall zone untrust                                                             
 set priority 5                                                                
 add interface GigabitEthernet0/0/2                                             
#  
 nat64 prefix 3001:: 96                                                        
 nat64 static 2001::1 1.1.1.10 unr-route                                                             
# 
nat64 security-policy enable
#                                                                          
security-policy                                                                 
  rule name policy_sec_1                                                        
    source-zone trust                                                           
    destination-zone untrust                                                    
    destination-address 2001::1 64                                               
    action permit                                                               
#                                                                                
return
相关推荐
csdn_aspnet5 小时前
在 Docker 容器中本地运行 SQL Server
运维·docker·容器·sqlserver
叼烟扛炮5 小时前
[LangChain] 学习笔记(15):为什么你的重试没用——429、抖动、fallback 与熔断
java·服务器·前端
hi_ro_a6 小时前
Ext系列⽂件系统详解
linux·服务器·操作系统
Z21-X7 小时前
云原生运维学习笔记:Kubernetes Volume 与 Secret 实验
运维·笔记·学习·云原生·kubernetes
你住过的屋檐8 小时前
【SeaweedFS】Linux上搭建SeaweedFS文件存储服务完整教程
linux·运维·服务器
Decay__9 小时前
PostgreSQL 体系架构全解 —— 进程模型、共享内存、MVCC 与 WAL 预写日志深入
运维·数据库·sql·mysql·架构
分布式存储与RustFS9 小时前
桶里的文件想当目录使:用 ZeroFS 把 RustFS 挂成一棵 POSIX 树
运维·云原生·开源·对象存储·分布式存储·s3·性能基准
老余说AI10 小时前
跨境电商、课程出海:六款多语言视频翻译工具选型指南
大数据·运维·人工智能
分布式存储与RustFS10 小时前
向量表别堆本地盘:用 LanceDB 把数据集建在 RustFS 上
运维·云原生·开源·对象存储·分布式存储·s3·性能基准
2401_8685347811 小时前
天融信网络安全面试题
服务器·网络