Phương pháp NAT64 - PAT (Port Address Translation), thường được sử dụng trong trường hợp bạn chỉ có một địa chỉ IPv4, nếu toàn bộ vùng IPv6 của bạn đều muốn kết nối ra ngoài - với một địa chỉ IPv4 thì lúc đó địa chỉ bên vùng IPv6 sẽ được chuyển đổi thành địa chỉ IPv4 kết hợp với chỉ số port (1-65535) nếu port đó chưa được sử dụng.
Mô hình Lab
Cấu hình Router 1 :
R1#show run
!
hostname R1
!
ipv6 unicast-routing
!
interface Serial0/0
ip address 192.168.30.10 255.255.255.0
ipv6 nat
clock rate 2000000
!
interface Serial0/1
no ip address
ipv6 address 2001:DB8:3002::9/64
ipv6 enable
ipv6 nat
clock rate 2000000
!
!
ipv6 route ::/0 2001:DB8:3002::10
ipv6 nat v4v6 source 192.168.30.9 2000::960B:202
ipv6 nat v6v4 source list v6list interface Serial0/0 overload
ipv6 nat prefix 2000::/96
!
!
ipv6 access-list v6list
permit ipv6 3001:11::/48 any
!
!
end
Cấu hình Router 2 :
R2#show run
!
hostname R2
!
interface Serial0/0
ip address 192.168.30.9 255.255.255.0
clock rate 2000000
!
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 192.168.30.10
!
!
!
end
Cấu hình Router 3 :
R3#show run
!
hostname R3
!
ipv6 unicast-routing
!
!
interface Loopback0
no ip address
ipv6 address 3001:11:0:1::1/64
!
interface Loopback1
no ip address
ipv6 address 3001:11:0:10::1/64
!
interface Loopback2
no ip address
ipv6 address 3001:11:0:20::2/64
!
interface Loopback3
no ip address
ipv6 address 3001:11:0:30::3/64
!
interface Loopback4
no ip address
ipv6 address 3001:11:0:40::4/64
!
!
interface Serial0/0
no ip address
ipv6 address 2001:DB8:3002::10/64
clock rate 2000000
!
!
ipv6 route ::/0 2001:DB8:3002::9
!
!
end
Kiểm tra kết quả :
Trên Router 3
R3#ping ipv6 2000::960b:202 source loopback 0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2000::960B:202, timeout is 2 seconds:
Packet sent with a source address of 3001:11:0:1::1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/31/72 ms
R3#ping ipv6 2000::960b:202 source loopback 1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2000::960B:202, timeout is 2 seconds:
Packet sent with a source address of 3001:11:0:10::1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/26/60 ms
R3#ping ipv6 2000::960b:202 source loopback 2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2000::960B:202, timeout is 2 seconds:
Packet sent with a source address of 3001:11:0:20::2
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/33/76 ms
R3#ping ipv6 2000::960b:202 source loopback 3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2000::960B:202, timeout is 2 seconds:
Packet sent with a source address of 3001:11:0:30::3
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/28/76 ms
R3#ping ipv6 2000::960b:202 source loopback 4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2000::960B:202, timeout is 2 seconds:
Packet sent with a source address of 3001:11:0:40::4
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/30/76 ms
Trên Router 1
R1#show ipv6 nat translations
Prot IPv4 source IPv6 source
IPv4 destination IPv6 destination
--- --- ---
192.168.30.9 2000::960B:202
icmp 192.168.30.10,5691 3001:11:0:1::1,5691
192.168.30.9,5691 2000::960B:202,5691
icmp 192.168.30.10,9670 3001:11:0:10::1,9670
192.168.30.9,9670 2000::960B:202,9670
icmp 192.168.30.10,7665 3001:11:0:20::2,7665
192.168.30.9,7665 2000::960B:202,7665
icmp 192.168.30.10,4786 3001:11:0:30::3,4786
192.168.30.9,4786 2000::960B:202,4786
icmp 192.168.30.10,1098 3001:11:0:40::4,1098
192.168.30.9,1098 2000::960B:202,1098