一台1140的防护墙,上面有一根IPV6的公网专线, 内网全部是v4的网络,需求 内网主机需要上互联网,内网有一台web服务器,需要通过外网访问,请问上述需求如何实现,有案例请发个链接,谢谢!!!!
(0)
最佳答案
Internet已经升级到了IPv6,但是某公司内部网络仍然是IPv4网络。而该公司内部网络的10.1.1.0/24网段的用户仍需要访问IPv6 Internet中的服务器,其他用户不能访问。
为满足上述要求,本例中使用如下方式实现:
· 使用IPv4到IPv6源地址动态地址转换策略,将IPv4报文的源地址转换为IPv6地址。
· 通过IPv6到IPv4的源地址静态转换策略为IPv6 Internet上服务器的IPv6地址指定一个对应的IPv4地址,Router收到发往该IPv4地址的报文时将其转换为对应的IPv6地址。
图1-10 IPv4网络访问IPv6 Internet中的服务器配置组网图
# 按照组网图配置各接口的IP地址,具体配置过程略。
# 配置ACL 2000,仅允许IPv4网络中10.1.1.0/24网段的用户可以访问IPv6 Internet。
<Router> system-view
[Router] acl basic 2000
[Router-acl-ipv4-basic-2000] rule permit source 10.1.1.0 0.0.0.255
[Router-acl-ipv4-basic-2000] rule deny
[Router-acl-ipv4-basic-2000] quit
# 配置NAT64前缀,此前缀将在IPv4到IPv6源地址动态转换策略中被调用,将报文的源地址转换为IPv6地址。
[Router] aft prefix-nat64 2012:: 96
# 配置IPv4到IPv6源地址动态转换策略,将匹配ACL 2000报文的源地址根据NAT64前缀转换为IPv6地址。
[Router] aft v4tov6 source acl number 2000 prefix-nat64 2012:: 96
# 配置IPv6到IPv4的源地址静态转换策略,用于将报文的目的地址转换为IPv6地址。
[Router] aft v6tov4 source 2013:0:ff14:0101:100:: 20.1.1.1
# 在IPv4侧接口GigabitEthernet1/0/1开启AFT。
[Router] interface gigabitethernet 1/0/1
[Router-GigabitEthernet1/0/1] aft enable
[Router-GigabitEthernet1/0/1] quit
# 在IPv6侧接口GigabitEthernet1/0/2开启AFT。
[Router] interface gigabitethernet 1/0/2
[Router-GigabitEthernet1/0/2] aft enable
[Router-GigabitEthernet1/0/2] quit
# 以上配置完成后,检查IPv4 host与IPv6 server的连通性。以IPv4 host A ping IPv6 server为例:
D:\>ping 20.1.1.1
Pinging 20.1.1.1 with 32 bytes of data:
Reply from 20.1.1.1: bytes=32 time=14ms TTL=63
Reply from 20.1.1.1: bytes=32 time=1ms TTL=63
Reply from 20.1.1.1: bytes=32 time=1ms TTL=63
Reply from 20.1.1.1: bytes=32 time=1ms TTL=63
# 通过查看AFT会话,可以看到创建了一个IPv4会话和IPv6会话,分别对应转换前和转换后的报文。
[Router] display aft session ipv4 verbose
Initiator:
Source IP/port: 10.1.1.1/1025
Destination IP/port: 20.1.1.1/2048
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: ICMP(1)
Inbound interface: GigabitEthernet1/0/1
Responder:
Source IP/port: 20.1.1.1/1025
Destination IP/port: 10.1.1.1/0
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: ICMP(1)
Inbound interface: GigabitEthernet1/0/2
State: ICMP_REPLY
Application: OTHER
Start time: 2014-03-13 08:52:59 TTL: 27s
Initiator->Responder: 4 packets 240 bytes
Responder->Initiator: 4 packets 240 bytes
Total sessions found: 1
[Router] display aft session ipv6 verbose
Initiator:
Source IP/port: 2012::0A01:0101/0
Destination IP/port: 2013:0:FF14:0101:0100::/32768
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: IPV6-ICMP(58)
Inbound interface: GigabitEthernet1/0/1
Responder:
Source IP/port: 2013:0:FF14:0101:0100::/0
Destination IP/port: 2012::0A01:0101/33024
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: IPV6-ICMP(58)
Inbound interface: GigabitEthernet1/0/2
State: ICMPV6_REPLY
Application: OTHER
Start time: 2014-03-13 08:52:59 TTL: 23s
Initiator->Responder: 4 packets 320 bytes
Responder->Initiator: 4 packets 320 bytes
Total sessions found: 1
(0)
zhiliao_zc1tt 这样的话,如果内网所有用户还需要通过IPV6专线上网的话,怎么实现,AFT类似于nat server 是实现1对1的V4到v6的转换
针对V4的端口这块有没有转换的案例
您好,请知:
可以使用AFT来实现。
https://www.h3c.com/cn/d_202212/1743098_30005_0.htm#_Toc122990021
以下是配置举例:
某公司将网络升级到了IPv6,但是仍然希望内网2013::/96网段的用户可以访问IPv4 Internet,其它网段的用户不能访问IPv4 Internet。该公司访问IPv4 Internet使用的IPv4地址为10.1.1.1、10.1.1.2和10.1.1.3。
为满足上述需求,本例中实现方式如下:
· 使用NAT64前缀与IPv4网络中的主机地址组合成为IPv6地址,此IPv6地址将与IPv4 Internet内的主机建立相应的映射关系,IPv6网络中的主机访问该IPv6地址即可实现对IPv4 Internet的访问。报文到达Device后,设备将根据NAT64前缀将该目的IPv6地址转换为对应的IPv4地址。
· 使用IPv6到IPv4源地址动态转换策略将IPv6网络到IPv4网络报文的源地址转换为IPv4地址10.1.1.1、10.1.1.2或10.1.1.3。
图1-7 IPv6网络访问IPv4 Internet配置组网图
(1) 配置接口IP地址
# 根据组网图中规划的信息,配置各接口的IP地址,具体配置步骤如下。
<Device> system-view
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] ipv6 address 2013::1 96
[Device-GigabitEthernet1/0/1] quit
请参考以上步骤配置其他接口的IP地址,具体配置步骤略。
(2) 将接口加入安全域
# 请根据组网图中规划的信息,将接口加入对应的安全域,具体配置步骤如下。
[Device] security-zone name trust
[Device-security-zone-Trust] import interface gigabitethernet 1/0/1
[Device-security-zone-Trust] quit
[Device] security-zone name untrust
[Device-security-zone-Untrust] import interface gigabitethernet 1/0/2
[Device-security-zone-Untrust] quit
(3) 配置静态路由
本举例仅以静态路由方式配置路由信息。实际组网中,请根据具体情况选择相应的路由配置方式。
# 请根据组网图中规划的信息,配置静态路由,本举例假设到达Server所在网络的下一跳IP地址为10.1.1.100,实际使用中请以具体组网情况为准,具体配置步骤如下。
[Device] ip route-static 20.1.1.0 24 10.1.1.100
(4) 配置安全策略
# 配置名称为aftlocalin的安全策略,使Device能对Host访问Server的报文进行AFT转换,具体配置步骤如下。
[Device] security-policy ipv6
[Device-security-policy-ipv6] rule name aftlocalin
[Device-security-policy-ipv6-1-aftlocalin] source-zone trust
[Device-security-policy-ipv6-1-aftlocalin] destination-zone local
[Device-security-policy-ipv6-1-aftlocalin] source-ip-subnet 2013:: 96
[Device-security-policy-ipv6-1-aftlocalin] destination-ip-host 2012::20.1.1.1
[Device-security-policy-ipv6-1-aftlocalin] destination-ip-host 2012::20.1.1.2
[Device-security-policy-ipv6-1-aftlocalin] action pass
[Device-security-policy-ipv6-1-aftlocalin] quit
[Device-security-policy-ipv6] quit
# 配置名称为aftlocalout的安全策略,允许将AFT转换后的报文转发至Server,具体配置步骤如下。
[Device] security-policy ip
[Device-security-policy-ip] rule name aftlocalout
[Device-security-policy-ip-1-aftlocalout] source-zone local
[Device-security-policy-ip-1-aftlocalout] destination-zone untrust
[Device-security-policy-ip-1-aftlocalout] source-ip-host 10.1.1.1
[Device-security-policy-ip-1-aftlocalout] source-ip-host 10.1.1.2
[Device-security-policy-ip-1-aftlocalout] source-ip-host 10.1.1.3
[Device-security-policy-ip-1-aftlocalout] destination-ip-host 20.1.1.1
[Device-security-policy-ip-1-aftlocalout] destination-ip-host 20.1.1.2
[Device-security-policy-ip-1-aftlocalout] action pass
[Device-security-policy-ip-1-aftlocalout] quit
[Device-security-policy-ip] quit
(5) 配置AFT功能
# 配置地址组0包含三个IPv4地址10.1.1.1、10.1.1.2和10.1.1.3。
[Device] aft address-group 0
[Device-aft-address-group-0] address 10.1.1.1 10.1.1.3
[Device-aft-address-group-0] quit
# 配置IPv6 ACL 2000,该ACL用来匹配源IPv6地址属于2013::/96网段的报文。
[Device] acl ipv6 basic 2000
[Device-acl-ipv6-basic-2000] rule permit source 2013:: 96
[Device-acl-ipv6-basic-2000] rule deny
[Device-acl-ipv6-basic-2000] quit
# 配置IPv6到IPv4的源地址动态转换策略,将匹配ACL 2000的IPv6报文源地址转换为地址组0中的地址,即将2013::/96网段内主机所发送报文的源IPv6地址转换为IPv4地址10.1.1.1、10.1.1.2或10.1.1.3。
[Device] aft v6tov4 source acl ipv6 number 2000 address-group 0
# 配置NAT64前缀为2012::/96,报文的目的地址根据该NAT64前缀转换为IPv4地址。
[Device] aft prefix-nat64 2012:: 96
# 在设备IPv6侧和IPv4侧接口开启AFT功能。
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] aft enable
[Device-GigabitEthernet1/0/1] quit
[Device] interface gigabitethernet 1/0/2
[Device-GigabitEthernet1/0/2] aft enable
[Device-GigabitEthernet1/0/2] quit
# 以上配置完成后,检查IPv6 Host与IPv4 Server的连通性。以IPv6 host A ping IPv4 server A为例:
D:\>ping 2012::20.1.1.1
Pinging 2012::20.1.1.1 with 32 bytes of data:
Reply from 2012::20.1.1.1: time=3ms
Reply from 2012::20.1.1.1: time=3ms
Reply from 2012::20.1.1.1: time=3ms
Reply from 2012::20.1.1.1: time=3ms
# 通过查看AFT会话,可以看到创建了一个IPv6会话和IPv4会话,分别对应转换前和转换后的报文。
[Device] display aft session ipv6 verbose
Initiator:
Source IP/port: 2013::100/0
Destination IP/port: 2012::1401:0101/32768
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: IPV6-ICMP(58)
Inbound interface: GigabitEthernet1/0/1
Source security zone: Trust
Responder:
Source IP/port: 2012::1401:0101/0
Destination IP/port: 2013::100/33024
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: IPV6-ICMP(58)
Inbound interface: GigabitEthernet1/0/2
Source security zone: Local
State: ICMPV6_REPLY
Application: ICMP
Rule ID: -/-/-
Rule name:
Start time: 2014-03-13 08:52:59 TTL: 23s
Initiator->Responder: 4 packets 320 bytes
Responder->Initiator: 4 packets 320 bytes
Total sessions found: 1
[Device] display aft session ipv4 verbose
Initiator:
Source IP/port: 10.1.1.1/1025
Destination IP/port: 20.1.1.1/2048
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: ICMP(1)
Inbound interface: GigabitEthernet1/0/1
Source security zone: Local
Responder:
Source IP/port: 20.1.1.1/1025
Destination IP/port: 10.1.1.1/0
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: ICMP(1)
Inbound interface: GigabitEthernet1/0/2
Source security zone: Untrust
State: ICMP_REPLY
Application: ICMP
Rule ID: 0
Rule name: aftlocalout
Start time: 2014-03-13 08:52:59 TTL: 27s
Initiator->Responder: 4 packets 240 bytes
Responder->Initiator: 4 packets 240 bytes
Total sessions found: 1
某公司将网络升级到了IPv6,此时Internet仍然是IPv4网络。该公司希望内部的FTP服务器能够继续为IPv4 Internet的用户提供服务。该公司拥有的IPv4地址为10.1.1.1。
为满足上述要求,本例实现方式如下:
· 使用IPv6侧服务器配置将IPv6内部服务器的地址及端口映射为IPv4地址及端口,Device收到来自IPv4 Internet的报文后,根据该配置策略将报文IPv4目的地址转换为IPv6地址;
· 使用NAT64前缀将报文源IPv4地址转换为IPv6地址。
图1-8 IPv4 Internet访问IPv6网络内部服务器配置组网图
(1) 配置接口IP地址
# 根据组网图中规划的信息,配置各接口的IP地址,具体配置步骤如下。
<Device> system-view
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] ip address 10.1.1.2 24
[Device-GigabitEthernet1/0/1] quit
请参考以上步骤配置其他接口的IP地址,具体配置步骤略。
(2) 将接口加入安全域
# 请根据组网图中规划的信息,将接口加入对应的安全域,具体配置步骤如下。
[Device] security-zone name trust
[Device-security-zone-Trust] import interface gigabitethernet 1/0/2
[Device-security-zone-Trust] quit
[Device] security-zone name untrust
[Device-security-zone-Untrust] import interface gigabitethernet 1/0/1
[Device-security-zone-Untrust] quit
(3) 配置安全策略
# 配置名称为aftlocalin的安全策略,使Device能对Host访问Server的报文进行AFT转换,具体配置步骤如下。
[Device] security-policy ip
[Device-security-policy-ip] rule name aftlocalin
[Device-security-policy-ip-1-aftlocalin] source-zone untrust
[Device-security-policy-ip-1-aftlocalin] destination-zone local
[Device-security-policy-ip-1-aftlocalin] destination-ip-host 10.1.1.1
[Device-security-policy-ip-1-aftlocalin] action pass
[Device-security-policy-ip-1-aftlocalin] quit
[Device-security-policy-ip] quit
# 配置名称为aftlocalout的安全策略,允许将AFT转换后的报文转发至Server,具体配置步骤如下。
[Device] security-policy ipv6
[Device-security-policy-ipv6] rule name aftlocalout
[Device-security-policy-ipv6-1-aftlocalout] source-zone local
[Device-security-policy-ipv6-1-aftlocalout] destination-zone trust
[Device-security-policy-ipv6-1-aftlocalout] source-ip-subnet 2012:: 96
[Device-security-policy-ipv6-1-aftlocalout] destination-ip-host 2013::102
[Device-security-policy-ipv6-1-aftlocalout] action pass
[Device-security-policy-ipv6-1-aftlocalout] quit
[Device-security-policy-ipv6] quit
(4) 配置AFT功能
# 配置IPv6侧服务器对应的IPv4地址及端口号。IPv4网络内用户通过访问该IPv4地址及端口即可访问IPv6服务器。
[Device] aft v6server protocol tcp 10.1.1.1 21 2013::102 21
# 报文的源地址将根据配置的NAT64前缀转换为IPv6地址。
[Device] aft prefix-nat64 2012:: 96
# 在设备IPv4侧和IPv6侧接口开启AFT。
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] aft enable
[Device-GigabitEthernet1/0/1] quit
[Device] interface gigabitethernet 1/0/2
[Device-GigabitEthernet1/0/2] aft enable
[Device-GigabitEthernet1/0/2] quit
# 以上配置完成后,IPv4 Host可以通过FTP协议访问IPv6 FTP Server。
# 通过查看AFT会话,可以看到创建了一个IPv4会话和IPv6会话,分别对应转换前和转换后的报文。
[Device] display aft session ipv4 verbose
Initiator:
Source IP/port: 20.1.1.1/11025
Destination IP/port: 10.1.1.1/21
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: TCP(6)
Inbound interface: GigabitEthernet1/0/1
Source security zone: Untrust
Responder:
Source IP/port: 10.1.1.1/21
Destination IP/port: 20.1.1.1/11025
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: TCP(6)
Inbound interface: GigabitEthernet1/0/2
Source security zone: Local
State: TCP_ESTABLISHED
Application: FTP
Rule ID: -/-/-
Rule name:
Start time: 2014-03-13 09:07:30 TTL: 3577s
Initiator->Responder: 3 packets 124 bytes
Responder->Initiator: 2 packets 108 bytes
Total sessions found: 1
[Device] display aft session ipv6 verbose
Initiator:
Source IP/port: 2012::1401:0101/1029
Destination IP/port: 2013::102/21
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: TCP(6)
Inbound interface: GigabitEthernet1/0/1
Source security zone: Local
Responder:
Source IP/port: 2013::102/21
Destination IP/port: 2012::1401:0101/1029
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: TCP(6)
Inbound interface: GigabitEthernet1/0/2
Source security zone: Trust
State: TCP_ESTABLISHED
Application: FTP
Rule ID: 0
Rule name: aftlocalout
Start time: 2014-03-13 09:07:30 TTL: 3582s
Initiator->Responder: 3 packets 184 bytes
Responder->Initiator: 2 packets 148 bytes
Total sessions found: 1
某公司内部同时部署了IPv4网络和IPv6网络,并且希望IPv4网络和IPv6网络能够互相访问。
为满足上述需求,本例中使用如下方式实现:
· 为IPv6网络分配一个IVI前缀和IPv4网段,IPv6网络中所有IPv6主机的地址均配置为由IVI前缀和IPv4网段中地址组合而成的IPv6地址。
· 为IPv4网络分配一个NAT64前缀,IPv4网络主动访问IPv6网络时,IPv4源地址使用NAT64前缀转换为IPv6地址;IPv6网络主动访问IPv4网络时,目的地址使用NAT64前缀和IPv4地址组合成的IPv6地址。
图1-9 IPv4网络和IPv6网络互访配置组网图
(1) 配置接口IP地址
# 根据组网图中规划的信息,配置各接口的IP地址,具体配置步骤如下。
<Device> system-view
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] ip address 20.1.1.1 24
[Device-GigabitEthernet1/0/1] quit
请参考以上步骤配置其他接口的IP地址,具体配置步骤略。
(2) 将接口加入安全域
# 请根据组网图中规划的信息,将接口加入对应的安全域,具体配置步骤如下。
[Device] security-zone name trust
[Device-security-zone-Trust] import interface gigabitethernet 1/0/1
[Device-security-zone-Trust] import interface gigabitethernet 1/0/2
[Device-security-zone-Trust] quit
(3) 配置静态路由
本举例仅以静态路由方式配置路由信息。实际组网中,请根据具体情况选择相应的路由配置方式。
# 请根据组网图中规划的信息,配置静态路由,本举例假设到达IPv6 Host所在网络的下一跳IPv6地址为2014::100,到达IPv4 Host所在网络的下一跳IP地址为20.1.1.2,实际使用中请以具体组网情况为准,具体配置步骤如下。
[Device] ipv6 route-static 2013:: 32 2014::100
[Device] ip route-static 10.1.1.0 24 20.1.1.2
(4) 配置安全策略
a. 配置安全策略放行IPv4 Host访问IPv6 Host的流量。
# 配置名称为aftlocalin4的安全策略,使Device能对IPv4 Host访问IPv6 Host的报文进行AFT转换,具体配置步骤如下。
[Device] security-policy ip
[Device-security-policy-ip] rule name aftlocalin4
[Device-security-policy-ip-1-aftlocalin4] source-zone trust
[Device-security-policy-ip-1-aftlocalin4] destination-zone local
[Device-security-policy-ip-1-aftlocalin4] source-ip-subnet 10.1.1.0 24
[Device-security-policy-ip-1-aftlocalin4] destination-ip-subnet 20.1.1.0 24
[Device-security-policy-ip-1-aftlocalin4] action pass
[Device-security-policy-ip-1-aftlocalin4] quit
[Device-security-policy-ip] quit
# 配置名称为aftlocalout6的安全策略,允许将AFT转换后的报文转发至IPv6 Host,具体配置步骤如下。
[Device] security-policy ipv6
[Device-security-policy-ipv6] rule name aftlocalout6
[Device-security-policy-ipv6-1-aftlocalout6] source-zone local
[Device-security-policy-ipv6-1-aftlocalout6] destination-zone trust
[Device-security-policy-ipv6-1-aftlocalout6] source-ip-subnet 2012:: 96
[Device-security-policy-ipv6-1-aftlocalout6] destination-ip-subnet 2013:: 32
[Device-security-policy-ipv6-1-aftlocalout6] action pass
[Device-security-policy-ipv6-1-local-ipv6] quit
b. 配置安全策略放行IPv6 Host访问IPv4 Host的流量。
# 配置名称为aftlocalin6的安全策略,使Device能对IPv6 Host访问IPv4 Host的报文进行AFT转换,具体配置步骤如下。
[Device-security-policy-ipv6] rule name aftlocalin6
[Device-security-policy-ipv6-2-aftlocalin6] source-zone trust
[Device-security-policy-ipv6-2-aftlocalin6] destination-zone local
[Device-security-policy-ipv6-2-aftlocalin6] source-ip-subnet 2013:: 32
[Device-security-policy-ipv6-2-aftlocalin6] destination-ip-subnet 2012:: 96
[Device-security-policy-ipv6-2-aftlocalin6] action pass
[Device-security-policy-ipv6-2-aftlocalin6] quit
[Device-security-policy-ipv6] quit
# 配置名称为aftlocalout4的安全策略,允许将AFT转换后的报文转发至IPv4 Host,具体配置步骤如下。
[Device] security-policy ip
[Device-security-policy-ip] rule 2 name aftlocalout4
[Device-security-policy-ip-2-aftlocalout4] source-zone local
[Device-security-policy-ip-2-aftlocalout4] destination-zone trust
[Device-security-policy-ip-2-aftlocalout4] source-ip-subnet 20.1.1.0 24
[Device-security-policy-ip-2-aftlocalout4] destination-ip-subnet 10.1.1.0 24
[Device-security-policy-ip-2-aftlocalout4] action pass
[Device-security-policy-ip-2-aftlocalout4] quit
[Device-security-policy-ip] quit
(5) 配置AFT功能
# 配置ACL 2000用来过滤需要访问IPv6网络的用户,同时匹配该ACL 2000的报文的目的地址将会根据配置的IVI前缀转换为IPv6地址。此处所有IPv4网络用户均需要访问IPv6网络。
[Device] acl basic 2000
[Device-acl-ipv4-basic-2000] rule permit
[Device-acl-ipv4-basic-2000] quit
# 配置NAT64前缀,用于进行IPv4到IPv6的源地址转换和IPv6到IPv4的目的地址转换。
[Device] aft prefix-nat64 2012:: 96
# 配置IVI前缀,用于进行IPv6到IPv4源地址转换,且在IPv4到IPv6动态目的地址转换策略中引用该前缀。
[Device] aft prefix-ivi 2013::
# 配置IPv4到IPv6动态目的地址转换策略,IPv4到IPv6报文的目的IPv4地址转换为IPv6地址。
[Device] aft v4tov6 destination acl number 2000 prefix-ivi 2013::
# 在设备IPv4侧和IPv6侧接口开启AFT。
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] aft enable
[Device-GigabitEthernet1/0/1] quit
[Device] interface gigabitethernet 1/0/2
[Device-GigabitEthernet1/0/2] aft enable
[Device-GigabitEthernet1/0/2] quit
# 以上配置完成后,IPv4 host与IPv6 host可以互通。以IPv6 host A ping IPv4 host A为例:
D:\>ping 2012::a01:0101
Pinging 2012::a01:0101 with 32 bytes of data:
Reply from 2012::a01:0101: time=3ms
Reply from 2012::a01:0101: time=3ms
Reply from 2012::a01:0101: time=3ms
Reply from 2012::a01:0101: time=3ms
# 通过查看AFT会话,可以看到创建了一个IPv6会话和IPv4会话,分别对应转换前和转换后的报文。显示内容如下:
[Device] display aft session ipv6 verbose
Initiator:
Source IP/port: 2013:0:FF14:0101:0100::/0
Destination IP/port: 2012::0a01:0101/32768
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: IPV6-ICMP(58)
Inbound interface: GigabitEthernet1/0/2
Source security zone: Trust
Responder:
Source IP/port: 2012::0a01:0101/0
Destination IP/port: 2013:0:FF14:0101:0100::/33024
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: IPV6-ICMP(58)
Inbound interface: GigabitEthernet1/0/1
Source security zone: Local
State: ICMPV6_REPLY
Application: ICMP
Rule ID: -/-/-
Rule name:
Start time: 2014-03-13 08:52:59 TTL: 23s
Initiator->Responder: 4 packets 320 bytes
Responder->Initiator: 4 packets 320 bytes
Total sessions found: 1
[Device] display aft session ipv4 verbose
Initiator:
Source IP/port: 20.1.1.1/1025
Destination IP/port: 10.1.1.1/2048
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: ICMP(1)
Inbound interface: GigabitEthernet1/0/2
Source security zone: Local
Responder:
Source IP/port: 10.1.1.1/1025
Destination IP/port: 20.1.1.1/0
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: ICMP(1)
Inbound interface: GigabitEthernet1/0/1
Source security zone: Trust
State: ICMP_REPLY
Application: ICMP
Rule ID: 2
Rule name: aftlocalout4
Start time: 2014-03-13 08:52:59 TTL: 27s
Initiator->Responder: 4 packets 240 bytes
Responder->Initiator: 4 packets 240 bytes
Total sessions found: 1
Internet已经升级到了IPv6,但是某公司内部网络仍然是IPv4网络。而该公司内部网络的10.1.1.0/24网段的用户仍需要访问IPv6 Internet中的服务器,其他用户不能访问。
为满足上述要求,本例中使用如下方式实现:
· 使用IPv4到IPv6源地址动态地址转换策略,将IPv4报文的源地址转换为IPv6地址。
· 通过IPv6到IPv4的源地址静态转换策略为IPv6 Internet上服务器的IPv6地址指定一个对应的IPv4地址,Device收到发往该IPv4地址的报文时将其转换为对应的IPv6地址。
图1-10 IPv4网络访问IPv6 Internet中的服务器配置组网图
(1) 配置接口IP地址
# 根据组网图中规划的信息,配置各接口的IP地址,具体配置步骤如下。
<Device> system-view
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] ip address 10.1.1.3 24
[Device-GigabitEthernet1/0/1] quit
请参考以上步骤配置其他接口的IP地址,具体配置步骤略。
(2) 将接口加入安全域
# 请根据组网图中规划的信息,将接口加入对应的安全域,具体配置步骤如下。
[Device] security-zone name trust
[Device-security-zone-Trust] import interface gigabitethernet 1/0/1
[Device-security-zone-Trust] quit
[Device] security-zone name untrust
[Device-security-zone-Untrust] import interface gigabitethernet 1/0/2
[Device-security-zone-Untrust] quit
(3) 配置静态路由
本举例仅以静态路由方式配置路由信息。实际组网中,请根据具体情况选择相应的路由配置方式。
# 请根据组网图中规划的信息,配置静态路由,本举例假设到达Server所在网络的下一跳IPv6地址为2014::100,实际使用中请以具体组网情况为准,具体配置步骤如下。
[Device] ipv6 route-static 2013:0:ff14:0101:100:: 64 2014::100
(4) 配置安全策略
# 配置名称为aftlocalin的安全策略,使Device能对Host访问Server的报文进行AFT转换,具体配置步骤如下。
[Device] security-policy ip
[Device-security-policy-ip] rule name aftlocalin
[Device-security-policy-ip-1-aftlocalin] source-zone trust
[Device-security-policy-ip-1-aftlocalin] destination-zone local
[Device-security-policy-ip-1-aftlocalin] source-ip-subnet 10.1.1.0 24
[Device-security-policy-ip-1-aftlocalin] destination-ip-host 20.1.1.1
[Device-security-policy-ip-1-aftlocalin] action pass
[Device-security-policy-ip-1-aftlocalin] quit
[Device-security-policy-ip] quit
# 配置名称为aftlocalout的安全策略,允许将AFT转换后的报文转发至Server,具体配置步骤如下。
[Device] security-policy ipv6
[Device-security-policy-ipv6] rule name aftlocalout
[Device-security-policy-ipv6-1-aftlocalout] source-zone local
[Device-security-policy-ipv6-1-aftlocalout] destination-zone untrust
[Device-security-policy-ipv6-1-aftlocalout] source-ip-subnet 2012:: 96
[Device-security-policy-ipv6-1-aftlocalout] destination-ip-host 2013:0:ff14:0101:100::1
[Device-security-policy-ipv6-1-aftlocalout] action pass
[Device-security-policy-ipv6-1-aftlocalout] quit
[Device-security-policy-ipv6] quit
(5) 配置AFT功能
# 配置ACL 2000,仅允许IPv4网络中10.1.1.0/24网段的用户可以访问IPv6 Internet。
[Device] acl basic 2000
[Device-acl-ipv4-basic-2000] rule permit source 10.1.1.0 0.0.0.255
[Device-acl-ipv4-basic-2000] rule deny
[Device-acl-ipv4-basic-2000] quit
# 配置NAT64前缀,此前缀将在IPv4到IPv6源地址动态转换策略中被调用,将报文的源地址转换为IPv6地址。
[Device] aft prefix-nat64 2012:: 96
# 配置IPv4到IPv6源地址动态转换策略,将匹配ACL 2000报文的源地址根据NAT64前缀转换为IPv6地址。
[Device] aft v4tov6 source acl number 2000 prefix-nat64 2012:: 96
# 配置IPv6到IPv4的源地址静态转换策略,用于将报文的目的地址转换为IPv6地址。
[Device] aft v6tov4 source 2013:0:ff14:0101:100::1 20.1.1.1
# 在设备IPv4侧和IPv6侧接口开启AFT。
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] aft enable
[Device-GigabitEthernet1/0/1] quit
[Device] interface gigabitethernet 1/0/2
[Device-GigabitEthernet1/0/2] aft enable
[Device-GigabitEthernet1/0/2] quit
# 以上配置完成后,检查IPv4 host与IPv6 server的连通性。以IPv4 host A ping IPv6 server为例:
D:\>ping 20.1.1.1
Pinging 20.1.1.1 with 32 bytes of data:
Reply from 20.1.1.1: bytes=32 time=14ms TTL=63
Reply from 20.1.1.1: bytes=32 time=1ms TTL=63
Reply from 20.1.1.1: bytes=32 time=1ms TTL=63
Reply from 20.1.1.1: bytes=32 time=1ms TTL=63
# 通过查看AFT会话,可以看到创建了一个IPv4会话和IPv6会话,分别对应转换前和转换后的报文。
[Device] display aft session ipv4 verbose
Initiator:
Source IP/port: 10.1.1.1/1025
Destination IP/port: 20.1.1.1/2048
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: ICMP(1)
Inbound interface: GigabitEthernet1/0/1
Source security zone: Trust
Responder:
Source IP/port: 20.1.1.1/1025
Destination IP/port: 10.1.1.1/0
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: ICMP(1)
Inbound interface: GigabitEthernet1/0/2
Source security zone: Local
State: ICMP_REPLY
Application: ICMP
Rule ID: -/-/-
Rule name:
Start time: 2014-03-13 08:52:59 TTL: 27s
Initiator->Responder: 4 packets 240 bytes
Responder->Initiator: 4 packets 240 bytes
Total sessions found: 1
[Device] display aft session ipv6 verbose
Initiator:
Source IP/port: 2012::0A01:0101/0
Destination IP/port: 2013:0:FF14:0101:0100::/32768
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: IPV6-ICMP(58)
Inbound interface: GigabitEthernet1/0/1
Source security zone: Local
Responder:
Source IP/port: 2013:0:FF14:0101:0100::/0
Destination IP/port: 2012::0A01:0101/33024
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: IPV6-ICMP(58)
Inbound interface: GigabitEthernet1/0/2
Source security zone: Untrust
State: ICMPV6_REPLY
Application: ICMP
Rule ID: 0
Rule name: aftlocalout
Start time: 2014-03-13 08:52:59 TTL: 23s
Initiator->Responder: 4 packets 320 bytes
Responder->Initiator: 4 packets 320 bytes
Total sessions found: 1
Internet已经升级到了IPv6,但是某公司内部网络仍然是IPv4网络。而该公司仍希望为IPv6 Internet内的用户提供FTP服务。该公司访问IPv6 Internet使用的IPv6地址为2012::1。
为满足上述要求,实现方式如下:
· 通过IPv4到IPv6源地址静态转换策略,为IPv4网络中的FTP服务器地址指定一个对应的IPv6地址,IPv6 Internet中的主机通过访问该IPv6地址可以访问IPv4网络中的FTP服务器。Device收到发往该IPv6地址的报文时将其目的地址转换为对应的IPv4地址。
· 通过IPv6到IPv4源地址动态转换策略,将IPv6 Internet发送过来的IPv6报文源地址转换为IPv4地址30.1.1.1和30.1.1.2。
图1-11 IPv6 Internet访问IPv4网络配置组网图
(1) 配置接口IP地址
# 根据组网图中规划的信息,配置各接口的IP地址,具体配置步骤如下。
<Device> system-view
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] ipv6 address 2014::1 96
[Device-GigabitEthernet1/0/1] quit
请参考以上步骤配置其他接口的IP地址,具体配置步骤略。
(2) 将接口加入安全域
# 请根据组网图中规划的信息,将接口加入对应的安全域,具体配置步骤如下。
[Device] security-zone name trust
[Device-security-zone-Trust] import interface gigabitethernet 1/0/2
[Device-security-zone-Trust] quit
[Device] security-zone name untrust
[Device-security-zone-Untrust] import interface gigabitethernet 1/0/1
[Device-security-zone-Untrust] quit
(3) 配置安全策略
# 配置名称为aftlocalin的安全策略,使Device能对Host访问Server的报文进行AFT转换,具体配置步骤如下。
[Device] security-policy ipv6
[Device-security-policy-ipv6] rule name aftlocalin
[Device-security-policy-ipv6-1-aftlocalin] source-zone untrust
[Device-security-policy-ipv6-1-aftlocalin] destination-zone local
[Device-security-policy-ipv6-1-aftlocalin] destination-ip-host 2012::1
[Device-security-policy-ipv6-1-aftlocalin] action pass
[Device-security-policy-ipv6-1-aftlocalin] quit
[Device-security-policy-ipv6] quit
# 配置名称为aftlocalout的安全策略,允许将AFT转换后的报文转发至Server,具体配置步骤如下。
[Device] security-policy ip
[Device-security-policy-ip] rule name aftlocalout
[Device-security-policy-ip-1-aftlocalout] source-zone local
[Device-security-policy-ip-1-aftlocalout] destination-zone trust
[Device-security-policy-ip-1-aftlocalout] source-ip-host 30.1.1.1
[Device-security-policy-ip-1-aftlocalout] source-ip-host 30.1.1.2
[Device-security-policy-ip-1-aftlocalout] destination-ip-host 20.1.1.1
[Device-security-policy-ip-1-aftlocalout] action pass
[Device-security-policy-ip-1-aftlocalout] quit
[Device-security-policy-ip] quit
(4) 配置AFT功能
# 配置IPv4到IPv6源地址静态转换策略,手动指定IPv4与IPv6地址一一对应的转换关系,此策略可将报文的目的地址转换为对应的IPv4地址。
[Device] aft v4tov6 source 20.1.1.1 2012::1
# 配置地址组0包含2个IPv4地址:30.1.1.1和30.1.1.2。
[Device] aft address-group 0
[Device-aft-address-group-0] address 30.1.1.1 30.1.1.2
[Device-aft-address-group-0] quit
# 配置IPv6 ACL 2000,匹配IPv6网络到IPv4网络的报文。此处允许所有IPv6网络内主机访问IPv4 FTP Server。
[Device] acl ipv6 basic 2000
[Device-acl-ipv6-basic-2000] rule permit
[Device-acl-ipv6-basic-2000] quit
# 配置IPv6到IPv4的源地址动态转换策略,将匹配ACL 2000的IPv6报文源地址转换为地址组0中的IPv4地址30.1.1.2或30.1.1.3。
[Device] aft v6tov4 source acl ipv6 number 2000 address-group 0
# 在设备IPv6侧和IPv4侧接口GigabitEthernet1/0/1开启AFT。
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] aft enable
[Device-GigabitEthernet1/0/1] quit
[Device] interface gigabitethernet 1/0/2
[Device-GigabitEthernet1/0/2] aft enable
[Device-GigabitEthernet1/0/2] quit
# 以上配置完成后,检查IPv6 host与IPv4 FTP server的连通性。以IPv6 host A ping IPv4 FTP server为例:
D:\>ping 2012::1
Pinging 2012::1 with 32 bytes of data:
Reply from 2012::1: time=3ms
Reply from 2012::1: time=3ms
Reply from 2012::1: time=3ms
Reply from 2012::1: time=3ms
# 通过查看AFT会话,可以看到创建了一个IPv6会话和IPv4会话,分别对应转换前和转换后的报文。
[Device] display aft session ipv6 verbose
Initiator:
Source IP/port: 2013:0:FF0A:0101:0100::/1029
Destination IP/port: 2012::1/21
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: IPV6-ICMP(58)
Inbound interface: GigabitEthernet1/0/1
Source security zone: Untrust
Responder:
Source IP/port: 2012::1/21
Destination IP/port: 2013:0:FF0A:0101:0100::/1029
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: IPV6-ICMP(58)
Inbound interface: GigabitEthernet1/0/2
Source security zone: Local
State: ICMPV6_REPLY
Application: ICMP
Rule ID: -/-/-
Rule name:
Start time: 2014-03-13 09:07:30 TTL: 3582s
Initiator->Responder: 3 packets 184 bytes
Responder->Initiator: 2 packets 148 bytes
Total sessions found: 1
[Device] display aft session ipv4 verbose
Initiator:
Source IP/port: 30.1.1.1/11025
Destination IP/port: 20.1.1.1/21
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: ICMP(1)
Inbound interface: GigabitEthernet1/0/1
Source security zone: Local
Responder:
Source IP/port: 20.1.1.1/21
Destination IP/port: 30.1.1.1/11025
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: ICMP(1)
Inbound interface: GigabitEthernet1/0/2
Source security zone: Trust
State: ICMP_REPLY
Application: ICMP
Rule ID: 0
Rule name: aftlocalout
Start time: 2014-03-13 09:07:30 TTL: 3577s
Initiator->Responder: 3 packets 124 bytes
Responder->Initiator: 2 packets 108 bytes
Total sessions found: 1
(0)
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
针对V4的端口这块有没有转换的案例