目录
一、组网需求
将IPv6内部服务器,发布到IPv4网络之中,允许用户通过192.168.118.86 来对其进行访问。
二、网络拓扑
三、配置要点
1、基础上网配置
2、配置虚拟ip(DNAT)
3、配置安全策略
4、开启NAT64
四、操作步骤
1 基础配置
进入菜单:系统管理--网络--接口--编辑internal
config system interface
edit "internal"
set vdom "root"
set ip 192.168.1.200 255.255.255.0
set allowaccess ping https ssh http
set type physical
set description " "
set snmp-index 1
config ipv6
set ip6-address 2001:aa:1::10/48
set ip6-send-adv enable
config ip6-prefix-list
edit 2001:db8:1::/48
set autonomous-flag enable
set onlink-flag enable
next
end
end
编辑wan1:
配置路由
菜单: 路由--静态--静态路由
目的的IP/子网掩码: 由于是默认网关,使用默认的0.0.0.0/0.0.0.0即可。
设备: 该路由所关联的接口,wan1口,必须正确填写,否则该路由无法工作。
网关: 下一跳ip地址, 即wan1口对端运营商设备接口的ip地址。
路径长度:默认10 . 长度小的路由会被装入路由表。
优先级:默认0. 优先级小的优先使用。
2、配置虚拟ip(DNAT)
(1)菜单:防火墙--虚拟ip---NAT46虚拟ip
(2)配置虚拟IP
config firewall vip46
edit "webserver"
set extip 192.168.118.86
set mappedip 2001:aa:1::11
next
end
3、配置策略
config firewall policy46
edit 1
set srcintf "wan1"
set dstintf "internal"
set srcaddr "all"
set dstaddr "webserver" // vip46
set schedule "always"
set service "all"
next
end
4、开启NAT64
config system nat64
set status enable
end
五、验证效果
可以正常访问https://192.168.118.86。
查看会话:
RG-WALL # diagnose sys session list
session info: proto=6 proto_state=05 duration=1 expire=0 timeout=3600 flags=00000000 sockflag=00000000 sockport=0 av_idx=0 use=3
origin-shaper=
reply-shaper=
per_ip_shaper=
ha_id=0 policy_dir=0 tunnel=/
state=may_dirty npu nlb
statistic(bytes/packets/allow_err): org=820/6/1 reply=389/6/1 tuples=2
orgin->sink: org pre->org, reply nataf->post dev=5->3/3->5 gwy=192.168.118.86/0.0.0.0
hook=pre dir=org act=dnat 10.10.69.80:55035->192.168.118.86:443(192.168.118.86:443)
hook=post dir=reply act=snat 192.168.118.86:443->10.10.69.80:55035(192.168.118.86:443)
hook=5 dir=org act=noop 64:ff9b::a0a:4550:55035 ->2001:aa:1::11:443(:::0)
hook=6 dir=reply act=noop 2001:aa:1::11:443 ->64:ff9b::a0a:4550:55035(:::0)
pos/(before,after) 0/(0,0), 0/(0,0)
misc=0 policy_id=1 id_policy_id=0 auth_info=0 chk_client_info=0 vd=0
serial=0000a00d tos=ff/ff ips_view=0 app_list=0 app=0
dd_type=0 dd_mode=0
npu_state=00000000
npu info: flag=0x00/0x00, offload=0/0, ips_offload=0/0, epid=0/0, ipid=0/0, vlan=0/0