CLI example: Allowing IPv4 Internet access from an IPv6 network

Network configuration

As shown in Figure 1, a company upgrades the network to IPv6 and has IPv4 addresses from 10.1.1.1 to 10.1.1.3.

To allow IPv6 hosts on subnet 2013::/96 to access the IPv4 Internet, configure the following AFT policies on the device:

Figure 1 Network diagram

 

Software versions used

This configuration example was created and verified on F9900 of the F5000-AI120 device.

Procedures

1.        Assign IP addresses to interfaces:

# Assign an IP address to interface GigabitEthernet 1/0/1.

<Device> system-view

[Device] interface gigabitethernet 1/0/1

[Device-GigabitEthernet1/0/1] ipv6 address 2013::1 96

[Device-GigabitEthernet1/0/1] quit

# Assign IP addresses to other interfaces in the same way. (Details not shown.)

2.        Add interfaces to security zones.

[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.        Configure settings for routing.

This example configures a static route with next hop address 10.1.1.100.

[Device] ip route-static 20.1.1.0 24 10.1.1.100

4.        Configure security policies:

# In the IPv6 security policy, configure a rule named aftlocalin to allow the device to perform AFT on the IPv6 host traffic destined for the IPv4 servers.

[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

# In the IPv6 security policy, configure a rule named aftlocalout to allow the device to forward the AFT-translated packets to the IPv4 servers.

[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.        Configure AFT settings:

# Create AFT address group 0, and add the address range from 10.1.1.1 to 10.1.1.3 to the group.

[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

# Configure IPv6 ACL 2000 to permit IPv6 packets only from subnet 2013::/96 to pass through.

[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

# Configure the device to translate source IPv6 addresses of packets permitted by IPv6 ACL 2000 to IPv4 addresses in address group 0.

[Device] aft v6tov4 source acl ipv6 number 2000 address-group 0

# Configure the device to use NAT64 prefix 2012::/96 to translate destination IPv6 addresses of IPv6 packets.

[Device] aft prefix-nat64 2012:: 96

# Enable AFT on the interfaces connected to the IPv6 network and IPv4 Internet, respectively.

[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

Verifying the configuration

# Verify the connectivity between IPv6 hosts and IPv4 servers. This example pings IPv4 server A from IPv6 host 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

# Display detailed information about IPv6 AFT sessions on the device.

[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

# Display detailed information about IPv4 AFT sessions on the device.

[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

Configuration files

#

interface GigabitEthernet1/0/1

 aft enable

 ipv6 address 2013::1/96

#

interface GigabitEthernet1/0/2

 ip address 10.1.1.4 255.255.255.0

 aft enable

#

security-zone name Trust

 import interface GigabitEthernet1/0/1

#

security-zone name Untrust

 import interface GigabitEthernet1/0/2

#

 ip route-static 20.1.1.0 24 10.1.1.100

#

acl ipv6 basic 2000

 rule 0 permit source 2013::/96

 rule 5 deny

#

aft address-group 0

 address 10.1.1.1 10.1.1.3

#

 aft prefix-nat64 2012:: 96

 aft v6tov4 source acl ipv6 number 2000 address-group 0

#

security-policy ip

 rule 0 name aftlocalout

  action pass

  source-zone local

  destination-zone untrust

  source-ip-host 10.1.1.1

  source-ip-host 10.1.1.2

  source-ip-host 10.1.1.3

  destination-ip-host 20.1.1.1

  destination-ip-host 20.1.1.2

#

security-policy ipv6

 rule 0 name aftlocalin

  action pass

  source-zone trust

  destination-zone local

  source-ip-subnet 2013::/96

  destination-ip-host 2012::1401:101

  destination-ip-host 2012::1401:102

#