This section provides an example for configuring Network Address Translation IPv6-to-IPv4 (NAT64) to implement multiple-to-multiple translations from internal IPv6 addresses of enterprise users to external IPv4 addresses and allow only PCs on a specified network segment to access the IPv4 Internet.
In Figure 1, DeviceA connects to a CR attached to a NAT64 device. An IPv6 user is assigned a private network address from the CPE through DeviceA. When the IPv6 user needs to access the IPv4 Internet over the IPv6 network, the NAT64 device must translate the user's IPv6 address to an external IPv4 address.
The configuration roadmap is as follows:
[~HUAWEI] service-location 1 [*HUAWEI-service-location-1] location slot 1 [*HUAWEI-service-location-1] commit [~HUAWEI-service-location-1] quit
[~HUAWEI] service-instance-group instance-group1 [*HUAWEI-instance-group-instance-group1] service-location 1 [*HUAWEI-instance-group-instance-group1] commit [~HUAWEI-instance-group-instance-group1] quit
[~HUAWEI] nat64 instance nat1 id 1 [*HUAWEI-nat64-instance-nat1] service-instance-group instance-group1
[*HUAWEI-nat64-instance-nat1] nat64 address-group address-group1 group-id 1 11.11.11.100 11.11.11.105
[*HUAWEI-nat64-instance-nat1] nat64 prefix 64:FF9B:: prefix-length 96 1
This IPv6 prefix is set according to a standard. The prefix of the DNS64 server must be the same as the IPv6 prefix.
[~HUAWEI] ipv6 route-static 2001:DB8::1:1112 126 2001:DB8::1:110F [*HUAWEI] commit
# Display NAT64 user information.
<HUAWEI> display nat user-information slot 1 verbose This operation will take a few minutes. Press 'Ctrl+C' to break ... Slot: 1 Total number: 1. --------------------------------------------------------------------------- User Type : NAT64 IPv6Address : 2001:db8::1:1112 User ID : - VPN Instance : - Address Group : address-group1 NAT64 Instance : nat1 Public IP : 11.11.11.100 NoPAT Public IP : 0.0.0.0 Start Port : 0 Port Range : 128 Port Total : 0 MTU : 1500 Extend Port Alloc Times : 1 Extend Port Alloc Number : 128 First/Second/Third Extend Port Start : 0/0/0 Total/TCP/UDP/ICMP Session Limit : 0/0/0/0 Total/TCP/UDP/ICMP Session Current : 1/0/1/0 Total/TCP/UDP/ICMP Rev Session Limit : 0/0/0/0 Total/TCP/UDP/ICMP Rev Session Current: 0/0/0/0 Nat ALG Enable : ALL Token/TB/TP : 0/0/0 Port Forwarding Flag : Non Port Forwarding Port Forwarding Ports : 0 0 0 0 0 Aging Time(s) : 0 Left Time(s) : 0 Port Limit Discard Count : 0 Session Limit Discard Count : 0 Fib Miss Discard Count : 0 -->Transmit Packets : 3597637 -->Transmit Bytes : 784284866 -->Drop Packets : 0 <--Transmit Packets : 0 <--Transmit Bytes : 0 <--Drop Packets : 0 ---------------------------------------------------------------------------
NAT64 device configuration file
# sysname HUAWEI # service-location 1 location slot 1 # service-instance-group instance-group1 service-location 1 # nat64 instance nat1 id 1 service-instance-group instance-group1 nat64 address-group address-group1 group-id 1 11.11.11.100 11.11.11.105 nat64 prefix 64:FF9B:: prefix-length 96 1 # acl ipv6 number 3003 rule 5 permit ipv6 source 2001:db8::1:1110/126 destination 64:FF9B::/96 # traffic classifier c1 if-match ipv6 acl 3003 # traffic behavior b1 nat64 bind instance nat1 # traffic policy p1 share-mode classifier c1 behavior b1 # interface GigabitEthernet0/1/9 undo shutdown ipv6 enable ipv6 address 2001:db8::1:110e 126 traffic-policy p1 inbound # ipv6 route-static 2001:DB8::1:1112 126 2001:DB8::1:110F # return