NAT64靜態(tài)映射為一對一的對應(yīng)關(guān)系,通常應(yīng)用在IPv4網(wǎng)絡(luò)主動(dòng)訪問IPv6網(wǎng)絡(luò)的場景中。
?要求位于IPv4網(wǎng)絡(luò)中的PC通過IPv4地址1.1.1.10能夠直接訪問位于IPv6網(wǎng)絡(luò)中Server。
操作步驟
- 配置FW。
# 配置接口GigabitEthernet 0/0/1的IPv4地址。
<FW> 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報(bào)文轉(zhuǎn)發(fā)功能。
[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安全區(qū)域。
[FW] firewall zone trust
[FW-zone-trust] add interface GigabitEthernet 0/0/1
[FW-zone-trust] quit
# 將接口GigabitEthernet 0/0/2加入U(xiǎn)ntrust安全區(qū)域。
[FW] firewall zone untrust
[FW-zone-untrust] add interface GigabitEthernet 0/0/2
[FW-zone-untrust] quit
# 配置NAT64前綴,PC訪問Server的報(bào)文在IPv6網(wǎng)絡(luò)中傳輸時(shí)使用的源地址由NAT64前綴和PC的IPv4地址組合而成。
[FW] nat64 prefix 3001:: 96
? ?此處NAT64前綴以3001:: 96為例,如果不配置,則默認(rèn)為知名前綴。
# 配置NAT64靜態(tài)映射關(guān)系,將Server的IPv6地址2001::1映射為IPv4地址1.1.1.10。
[FW] nat64 static 2001::1 1.1.1.10 unr-route
# 開啟NAT64報(bào)文受安全策略控制功能。
[FW] nat64 security-policy enable
# 配置安全策略。
配置NAT64靜態(tài)映射需要配置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的操作系統(tǒng)有關(guān),配置方法略。)
# 配置PC的IPv4地址為1.1.1.2/24,與FW的接口GigabitEthernet 0/0/1同一網(wǎng)段。
配置Server的IPv6地址和路由。(IPv6地址和路由的配置方法與Server的操作系統(tǒng)有關(guān),配置方法略。)
# 配置Server的IPv6地址為2001::1/24,與FW的接口GigabitEthernet 0/0/2同一網(wǎng)段。
# 配置Server去往3001::/96網(wǎng)段的路由為2001::2。
結(jié)果驗(yàn)證
# 配置完成后,PC上執(zhí)行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任意視圖下執(zhí)行display firewall ipv6 session table,查看NAT64的會(huì)話表信息。
<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會(huì)話表得知IPv6與IPv4地址的轉(zhuǎn)換關(guān)系。文章來源:http://www.zghlxwxcb.cn/news/detail-737177.html
配置腳本
FW的配置腳本文章來源地址http://www.zghlxwxcb.cn/news/detail-737177.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
到了這里,關(guān)于IPv4網(wǎng)絡(luò)用戶訪問IPv6網(wǎng)絡(luò)服務(wù)器的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!