二.基本思路:
A.测试环境:
GNS,Cisco IOS Software, 7200 Software (C7200-ADVENTERPRISEK9-M), Version 12.4(24)T7, RELEASE SOFTWARE (fc2)
D.测试环境ip cef和ipv6 cef对NAT转换有时有影响,有时没有影响
E.不知是否是IOS的问题,只配置v6v4的NAT,通不了,路由器不会自动根据nat前缀将IPV4的地址转成IPV6的地址
F.经过测试,双栈路由器配置IPV6地址的接口可以不用配置Iipv6 enable,而只配置IPV4地址的接口需要敲ipv6 enable
G.动态NAT-PT,V6可以主动访问V4(使用V4地址池),还是V4可以主动访问V6(使用V6地址池),跟动态NAT类似,每次都需要占用一个地址,而不能像PAT那样
四.配置步骤:
A.R1:
interface FastEthernet0/0
ip address 192.168.30.1 255.255.255.0
no shut
!
ip route 0.0.0.0 0.0.0.0 192.168.30.2
ip address 192.168.30.1 255.255.255.0
no shut
!
ip route 0.0.0.0 0.0.0.0 192.168.30.2
B.R2:
interface FastEthernet0/0
ip address 192.168.30.2 255.255.255.0
ipv6 enable
ipv6 nat
!
interface FastEthernet0/1
ipv6 address 2001:DB8:3002::2/64
ipv6 nat
!
ipv6 route ::/0 2001:DB8:3002::3
ipv6 nat v4v6 source 192.168.30.1 2000::C0A8:1E01
ipv6 nat v6v4 source 3001:11:0:1::1 150.11.3.1
ipv6 nat prefix 2000::/96
ip address 192.168.30.2 255.255.255.0
ipv6 enable
ipv6 nat
!
interface FastEthernet0/1
ipv6 address 2001:DB8:3002::2/64
ipv6 nat
!
ipv6 route ::/0 2001:DB8:3002::3
ipv6 nat v4v6 source 192.168.30.1 2000::C0A8:1E01
ipv6 nat v6v4 source 3001:11:0:1::1 150.11.3.1
ipv6 nat prefix 2000::/96
C.R3:
interface Loopback0
ipv6 address 3001:11:0:1::1/64
!
interface FastEthernet0/0
ipv6 address 2001:DB8:3002::3/64
!
ipv6 route ::/0 2001:DB8:3002::2
ipv6 address 3001:11:0:1::1/64
!
interface FastEthernet0/0
ipv6 address 2001:DB8:3002::3/64
!
ipv6 route ::/0 2001:DB8:3002::2
五.测试:
R1#ping 150.11.3.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 150.11.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/87/168 ms
R1#
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 150.11.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/87/168 ms
R1#
R3#debug ipv6 icmp
ICMP Packet debugging is on
R3#
*Dec 28 17:24:06.699: ICMPv6: Received echo request, Src=2000::C0A8:1E01, Dst=3001:11:0:1::1
*Dec 28 17:24:06.703: ICMPv6: Sent echo reply, Src=3001:11:0:1::1, Dst=2000::C0A8:1E01
*Dec 28 17:24:06.779: ICMPv6: Received echo request, Src=2000::C0A8:1E01, Dst=3001:11:0:1::1
*Dec 28 17:24:06.783: ICMPv6: Sent echo reply, Src=3001:11:0:1::1, Dst=2000::C0A8:1E01
*Dec 28 17:24:06.839: ICMPv6: Received echo request, Src=2000::C0A8:1E01, Dst=3001:11:0:1::1
*Dec 28 17:24:06.843: ICMPv6: Sent echo reply, Src=3001:11:0:1::1, Dst=2000::C0A8:1E01
*Dec 28 17:24:06.907: ICMPv6: Received echo request, Src=2000::C0A8:1E01, Dst=3001:11:0:1::1
R3#
*Dec 28 17:24:06.907: ICMPv6: Sent echo reply, Src=3001:11:0:1::1, Dst=2000::C0A8:1E01
*Dec 28 17:24:07.015: ICMPv6: Received echo request, Src=2000::C0A8:1E01, Dst=3001:11:0:1::1
*Dec 28 17:24:07.015: ICMPv6: Sent echo reply, Src=3001:11:0:1::1, Dst=2000::C0A8:1E01
R3#
ICMP Packet debugging is on
R3#
*Dec 28 17:24:06.699: ICMPv6: Received echo request, Src=2000::C0A8:1E01, Dst=3001:11:0:1::1
*Dec 28 17:24:06.703: ICMPv6: Sent echo reply, Src=3001:11:0:1::1, Dst=2000::C0A8:1E01
*Dec 28 17:24:06.779: ICMPv6: Received echo request, Src=2000::C0A8:1E01, Dst=3001:11:0:1::1
*Dec 28 17:24:06.783: ICMPv6: Sent echo reply, Src=3001:11:0:1::1, Dst=2000::C0A8:1E01
*Dec 28 17:24:06.839: ICMPv6: Received echo request, Src=2000::C0A8:1E01, Dst=3001:11:0:1::1
*Dec 28 17:24:06.843: ICMPv6: Sent echo reply, Src=3001:11:0:1::1, Dst=2000::C0A8:1E01
*Dec 28 17:24:06.907: ICMPv6: Received echo request, Src=2000::C0A8:1E01, Dst=3001:11:0:1::1
R3#
*Dec 28 17:24:06.907: ICMPv6: Sent echo reply, Src=3001:11:0:1::1, Dst=2000::C0A8:1E01
*Dec 28 17:24:07.015: ICMPv6: Received echo request, Src=2000::C0A8:1E01, Dst=3001:11:0:1::1
*Dec 28 17:24:07.015: ICMPv6: Sent echo reply, Src=3001:11:0:1::1, Dst=2000::C0A8:1E01
R3#
R2#show ipv6 nat translations
Prot IPv4 source IPv6 source
IPv4 destination IPv6 destination
--- --- ---
192.168.30.1 2000::C0A8:1E01
--- 150.11.3.1 3001:11:0:1::1
--- ---
Prot IPv4 source IPv6 source
IPv4 destination IPv6 destination
--- --- ---
192.168.30.1 2000::C0A8:1E01
--- 150.11.3.1 3001:11:0:1::1
--- ---