Dual-stack, tunneling and NAT64 with DNS64
Mutegeki Nicholas | Research and Education Network for Uganda (RENU)
Moving to IPv6 does not have to mean replacing everything at once. The practical question is how to add IPv6 while keeping the services your users depend on available.
The right approach depends on where the limitation sits. Run both protocols where devices still need IPv4, use a configured tunnel across an IPv4-only link, or use NAT64 and DNS64 when IPv6-only clients need IPv4-only services. A network can use more than one approach.
Why IPv6 changes the address plan
IPv4 uses 32-bit addresses, giving about 4.3 billion possible addresses before reservations and other limits. IPv6 uses 128 bits. The larger space makes it possible to give networks a structured address plan without relying on IPv4 address sharing at every stage.

What this guide covers: A comparison of the three approaches, a decision guide, and two labs using Cisco IOS-XE, Juniper SRX and MikroTik RouterOS.
The compatibility gap: An IPv6-only client cannot communicate directly with an IPv4-only server. Routing alone does not translate one protocol into the other.
Running both protocols or crossing an IPv4 link
Dual stack
A dual-stack device runs IPv4 and IPv6 at the same time. It can reach an IPv6 service over IPv6 and an IPv4 service over IPv4. Many applications use a connection-selection process such as Happy Eyeballs to choose a working path.

Useful when: You can operate both protocols and still need IPv4 connectivity on the LAN.
Trade-off: You maintain addressing, routing, firewall policies and monitoring for both protocols. Dual-stack does not remove the need for IPv4 addresses, which may still be shared through NAT.
Configured tunneling
A 6in4 tunnel carries an IPv6 packet inside an IPv4 packet. The tunnel endpoints add and remove the outer IPv4 header, while the intermediate network forwards IPv4.

Useful when: IPv6 sites need to communicate across a link that only carries IPv4.
Trade-off: Encapsulation reduces the available MTU. Protocol 41 must pass between endpoints, and the IPv6 traffic needs its own security controls. The configured tunnel shown here is distinct from automatic 6to4.
Reaching IPv4 services from an IPv6 network
NAT64 and DNS64
DNS64 and NAT64 solve different parts of the same problem. A DNS64 resolver can synthesize an IPv6 AAAA response from an IPv4 A record. The client sends IPv6 packets to that address, and the NAT64 gateway translates the connection to IPv4.

Useful when: Clients can operate on IPv6 only, but still need access to IPv4-only services.
Trade-off: Applications that use IPv4 literals or embed IPv4 addresses may need additional support, such as 464XLAT. Size and monitor the translator for the expected sessions, ports and throughput.
Comparing the approaches
| Approach | What changes | Where it fits | Main concern |
|---|---|---|---|
| Dual-stack | Devices run IPv4 and IPv6. | LANs and services that need both protocols. | Two sets of policies and monitoring. |
| Configured 6in4 | IPv6 travels inside IPv4. | IPv6 sites separated by an IPv4-only path. | MTU and protocol 41 filtering. |
| NAT64 and DNS64 | IPv6 clients reach IPv4 destinations through translation. | IPv6-only client networks. | Application compatibility and translator capacity. |
These approaches can coexist. For example, a campus might keep staff devices dual-stack, tunnel one remote link and pilot an IPv6-only wireless network with NAT64 and DNS64.
Choosing a transition approach
Start with the traffic you need to support. Use the questions below for each part of the network, rather than assuming one answer must fit the entire organization.

Preparing the labs
Use GNS3, EVE-NG, Cisco CML or suitable physical equipment. The examples assume clean lab interfaces. Existing bridge membership, firewall rules and interface names may require changes.
| Capability | Cisco IOS-XE | Juniper SRX | MikroTik RouterOS |
|---|---|---|---|
| Dual-stack and SLAAC | Supported | Supported | Supported |
| Configured 6in4 | Tunnel interface | Platform-dependent ip- interface | 6to4 interface with explicit endpoints |
| NAT64 in these labs | Supported router image | Static NAT inet with source NAT | Separate translator |
| DNS64 in these labs | External resolver | External resolver | External resolver |
Check the exact software release and platform before starting. The commands are lab examples; they have not been executed on physical devices for this guide. Documentation prefixes are not publicly routed.
Lab 1: Joining two dual-stack LANs
The LANs run both protocols, but the link between R1 and R2 carries only IPv4. The goal is to carry IPv6 between the LANs through a configured 6in4 tunnel.

| Role | Cisco | Juniper | MikroTik |
|---|---|---|---|
| LAN | GigabitEthernet0/0 | ge-0/0/0.0 | ether2 |
| IPv4 WAN | GigabitEthernet0/1 | ge-0/0/1.0 | ether1 |
| Tunnel | Tunnel0 | ip-0/0/0.0 | 6in4-R2 on R1 |
Addressing both routers
| Setting | R1 | R2 |
|---|---|---|
| LAN IPv4 | 192.168.10.1/24 | 192.168.20.1/24 |
| LAN IPv6 | 2001:db8:a::1/64 | 2001:db8:b::1/64 |
| WAN IPv4 | 198.51.100.1/30 | 198.51.100.2/30 |
| Tunnel IPv6 | 2001:db8:ffff::1/64 | 2001:db8:ffff::2/64 |
| Remote IPv6 LAN | 2001:db8:b::/64 | 2001:db8:a::/64 |
| IPv6 next hop | 2001:db8:ffff::2 | 2001:db8:ffff::1 |
Configure one of the vendor examples on R1, then configure R2 using the values above. Give each test host an address in its LAN and use the local router as its default gateway. SLAAC requires Router Advertisements on the LAN.
Packet size: A 1500-byte IPv4 path without extra encapsulation leaves 1480 bytes for the inner IPv6 packet. Use a lower tunnel MTU if the underlay is smaller, and allow ICMPv6 Packet Too Big messages.
Lab 1: Cisco and MikroTik configurations
Cisco IOS XE on R1
ipv6 unicast-routing
interface GigabitEthernet0/0
description LAN A - dual-stack
ip address 192.168.10.1 255.255.255.0
ipv6 address 2001:DB8:A::1/64
no shutdown
!
interface GigabitEthernet0/1
description IPv4 WAN
ip address 198.51.100.1 255.255.255.252
no shutdown
!
interface Tunnel0
description 6in4 to R2
no ip address
ipv6 address 2001:DB8:FFFF::1/64
ipv6 mtu 1480
tunnel source GigabitEthernet0/1
tunnel destination 198.51.100.2
tunnel mode ipv6ip
!
ipv6 route 2001:DB8:B::/64 2001:DB8:FFFF::2
MikroTik RouterOS on R1
/ip address add address=192.168.10.1/24 interface=ether2
/ip address add address=198.51.100.1/30 interface=ether1
/ipv6 address add address=2001:db8:a::1/64 interface=ether2 advertise=yes
/interface 6to4 add name=6in4-R2 local-address=198.51.100.1 remote-address=198.51.100.2 mtu=1480
/ipv6 address add address=2001:db8:ffff::1/64 interface=6in4-R2 advertise=no
/ipv6 route add dst-address=2001:db8:b::/64 gateway=2001:db8:ffff::2
RouterOS uses the 6to4 interface menu for this manually configured 6in4 tunnel. With explicit local and remote IPv4 addresses, this example does not depend on an automatic 6to4 relay.
Firewall rules: Permit IPv4 protocol 41 from the peer before any input drop rule. Permit required ICMPv6 and intended IPv6 LAN-to-LAN traffic before forward drops. A rule allowing only ICMPv6 does not allow application traffic.
R2: Reverse the tunnel endpoints, use the R2 addresses in the “Addressing both routers” table and name the MikroTik tunnel 6in4-R1. Confirm the IPv6 forwarding setting and Router Advertisements on the LAN.
Lab 1: Juniper configuration and checks
Juniper Junos on R1
Enter the commands in configuration mode and commit after reviewing the changes. The ip- interface depends on the SRX platform; check that tunnel services are available.
set interfaces ge-0/0/0 unit 0 family inet address 192.168.10.1/24
set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:a::1/64
set interfaces ge-0/0/1 unit 0 family inet address 198.51.100.1/30
set interfaces ip-0/0/0 unit 0 tunnel source 198.51.100.1
set interfaces ip-0/0/0 unit 0 tunnel destination 198.51.100.2
set interfaces ip-0/0/0 unit 0 family inet6 address 2001:db8:ffff::1/64
set interfaces ip-0/0/0 unit 0 family inet6 mtu 1480
set protocols router-advertisement interface ge-0/0/0.0 prefix 2001:db8:a::/64
set routing-options rib inet6.0 static route 2001:db8:b::/64 next-hop 2001:db8:ffff::2
set security forwarding-options family inet6 mode flow-based
set security zones security-zone trust interfaces ge-0/0/0.0
set security zones security-zone trust host-inbound-traffic system-services ping
set security zones security-zone trust interfaces ip-0/0/0.0
set security zones security-zone untrust interfaces ge-0/0/1.0
set security zones security-zone untrust host-inbound-traffic system-services ping
set security policies from-zone trust to-zone trust policy lab match source-address any
set security policies from-zone trust to-zone trust policy lab match destination-address any
set security policies from-zone trust to-zone trust policy lab match application any
set security policies from-zone trust to-zone trust policy lab then permit
Verifying the path
| Check | Cisco | Juniper | MikroTik |
|---|---|---|---|
| Addresses | show ipv6 interface brief | show interfaces terse | /ipv6 address print |
| Tunnel | show interfaces tunnel 0 | show interfaces ip-0/0/0.0 | /interface 6to4 print |
| Routes | show ipv6 route static | show route table inet6.0 | /ipv6 route print |
| Neighbours | show ipv6 neighbors | show ipv6 neighbors | /ipv6 neighbor print |
From R1, ping 2001:db8:ffff::2, then ping 2001:db8:b::1 using 2001:db8:a::1 as the source. Repeat from a LAN host and test an application connection. An interface showing up does not prove that the remote endpoint is reachable.
If the test fails: Check underlay reachability, protocol 41 filtering, IPv6 routes in both directions and SRX security policies. The tunnel appears as a logical hop in the IPv6 path; the IPv4 core is hidden.
Lab 2: IPv6 clients reaching an IPv4 server
The client has IPv6 only. A DNS64 resolver supplies synthesised AAAA records, and a NAT64 gateway translates traffic to an IPv4-only server. The resolver and translator use 64:ff9b::/96 in this lab.

Client settings: Use 2001:db8:64::10/64, the gateway on this LAN and DNS server 2001:db8:64::53. Configure the IPv4 server with 203.0.113.80/24 and ensure the NAT64 pool address is reachable on that segment.
Configuring the DNS64 resolver
The BIND example below is for an isolated lab. The resolver needs an IPv6 address on the client LAN and working recursive DNS access. Set the client to use this resolver.
# /etc/bind/named.conf.options
options {
listen-on-v6 { any; };
recursion yes;
allow-query { localhost; 2001:db8:64::/64; };
allow-recursion { localhost; 2001:db8:64::/64; };
dns64 64:ff9b::/96 {
clients { 2001:db8:64::/64; };
exclude { 64:ff9b::/96; ::ffff:0.0.0.0/96; };
};
};
Check the BIND configuration and restart or reload the service after editing. Confirm that ordinary DNS queries work before troubleshooting synthesis. If a name already has a usable AAAA record, the client can normally reach it over native IPv6.
Documentation addresses: The server and client addresses shown here are for the lab. Use addresses assigned to your network for an operational deployment. IPv4 literals are used below to test translation separately from DNS64.
Lab 2: Cisco NAT64 gateway
Use an IOS-XE router image with stateful NAT64 support. GigabitEthernet0/0 faces the IPv6 LAN; GigabitEthernet0/1 faces the IPv4 server network.
ipv6 unicast-routing
!
ipv6 access-list NAT64-CLIENTS
permit ipv6 2001:DB8:64::/64 any
!
interface GigabitEthernet0/0
description IPv6-only LAN
ipv6 address 2001:DB8:64::1/64
nat64 enable
no shutdown
!
interface GigabitEthernet0/1
description IPv4 server network
ip address 203.0.113.10 255.255.255.0
nat64 enable
no shutdown
!
nat64 prefix stateful 64:FF9B::/96
nat64 v4 pool NAT64POOL 203.0.113.100 203.0.113.100
nat64 v6v4 list NAT64-CLIENTS pool NAT64POOL overload
How this configuration handles a connection
The access list selects the IPv6 clients that may use the translator. The prefix identifies IPv6 destinations that represent IPv4 addresses. The gateway uses 203.0.113.100 as the IPv4 source address on the server side.
The overload keyword enables port address translation so multiple client sessions can share the pool address. The gateway keeps translation state so reply traffic can return to the correct IPv6 client.
Checking the gateway
show nat64 translations
show nat64 statistics
show nat64 prefix stateful global
Generate traffic from the IPv6-only client before checking the table. If no translation appears, confirm the client route, the NAT64 prefix and the access-list match. If entries appear but the server does not answer, check pool- address reachability and IPv4 filtering.
Beyond this local lab: A remote IPv4 server requires appropriate IPv4 routing. A remote IPv6 client network also needs a return route. Confirm pool reachability and platform-specific NAT64 restrictions for the selected release.
Lab 2: Juniper SRX NAT64 gateway
SRX combines a static NAT rule using inet with source NAT to an IPv4 pool. Review the policy and commit in configuration mode.
set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:64::1/64
set interfaces ge-0/0/1 unit 0 family inet address 203.0.113.10/24
set protocols router-advertisement interface ge-0/0/0.0 prefix 2001:db8:64::/64
set security forwarding-options family inet6 mode flow-based
set security zones security-zone trust interfaces ge-0/0/0.0
set security zones security-zone trust host-inbound-traffic system-services ping
set security zones security-zone untrust interfaces ge-0/0/1.0
# Extract the IPv4 destination from the NAT64 prefix
set security nat static rule-set N64-D from zone trust
set security nat static rule-set N64-D rule r1 match destination-address 64:ff9b::/96
set security nat static rule-set N64-D rule r1 then static-nat inet
# Translate the client's IPv6 source to an IPv4 pool
set security nat source pool V4 address 203.0.113.100/32
set security nat source rule-set N64-S from zone trust
set security nat source rule-set N64-S to zone untrust
set security nat source rule-set N64-S rule r1 match source-address 2001:db8:64::/64
set security nat source rule-set N64-S rule r1 match destination-address 0.0.0.0/0
set security nat source rule-set N64-S rule r1 then source-nat pool V4
set security nat proxy-arp interface ge-0/0/1.0 address 203.0.113.100/32
# Permit lab sessions from the IPv6 LAN to the IPv4 side
set security policies from-zone trust to-zone untrust policy nat64 match source-address any
set security policies from-zone trust to-zone untrust policy nat64 match destination-address any
set security policies from-zone trust to-zone untrust policy nat64 match application any
set security policies from-zone trust to-zone untrust policy nat64 then permit
Checking translation and policy matches
show security flow session family inet6
show security nat source rule all
show security nat static rule all
The static rule extracts the IPv4 destination from the last 32 bits of the translated address. Source NAT assigns the IPv4 pool address, and proxy ARP makes that address reachable on the directly connected IPv4 segment.
Policy scope: The any-to-any policy is for an isolated lab. Define the intended applications and destinations when adapting the design to a live network.
Lab 2: Using MikroTik with a translator
RouterOS routes the IPv6 traffic to a separate NAT64 gateway in this example. The translator can be a suitable Cisco or Juniper device, or a Linux host using Jool or another NAT64 implementation.
# IPv6-only client LAN
/ipv6 address add address=2001:db8:64::1/64 interface=ether2 advertise=yes
# Transit link to the external NAT64 gateway
/ipv6 address add address=2001:db8:99::1/64 interface=ether3 advertise=no
/ipv6 route add dst-address=64:ff9b::/96 gateway=2001:db8:99::2
Assign 2001:db8:99::2/64 to the translator transit interface. Add a return route there for 2001:db8:64::/64 via 2001:db8:99::1. The translator still needs its NAT64 configuration and an IPv4 interface connected to the server network.
Firewall and DNS: Permit the intended traffic from ether2 to the translation prefix and established reply traffic before any forward drop rule. Keep the resolver at 2001:db8:64::53 on the client LAN. The MikroTik router remains the client gateway.
Testing from the IPv6 only client
# Check DNS64 synthesis using a known IPv4-only name
dig AAAA ipv4only.arpa @2001:db8:64::53
# Check translation independently of DNS
ping -6 64:ff9b::203.0.113.80
curl -6 -g "http://[64:ff9b::203.0.113.80]/"
The DNS response should contain synthesised addresses such as 64:ff9b::c000:aa and 64:ff9b::c000:ab, representing 192.0.0.170 and 192.0.0.171. The HTTP test requires a web server listening at 203.0.113.80.
| Test result | What it tells you |
|---|---|
| DNS64 answers but HTTP fails | Check the translator, prefix route, IPv4 pool and return path. |
| Literal HTTP test works but names fail | Check which DNS resolver the client uses and whether synthesis is active. |
| Native IPv6 works but IPv4-only services fail | Check the route and policy for 64:ff9b::/96. |
Some clients discover a NAT64 prefix through ipv4only.arpa or a PREF64 Router Advertisement option. Client and application support varies; confirm the behaviour of the devices you plan to deploy.
Troubleshooting the transition
| Symptom | Likely cause | What to check |
|---|---|---|
| Tunnel is up but IPv6 fails | Missing routes, blocked protocol 41 or an unreachable endpoint. | Ping both IPv4 endpoints. Check IPv6 routes and firewall counters on both routers. |
| Small pings work but larger transfers stall | MTU mismatch or filtered ICMPv6 Packet Too Big messages. | Confirm underlay and tunnel MTU. Permit required ICMPv6 and test larger packets. |
| Clients do not receive IPv6 addresses | Missing Router Advertisements or incorrect LAN configuration. | Check RA settings, the /64 prefix, client behaviour and ICMPv6 filtering. |
| SRX drops IPv6 traffic | Flow-mode or zone-policy configuration. | Check IPv6 forwarding mode, interface zones, policies and sessions. |
| DNS64 responds but NAT64 fails | Missing translation, unreachable pool or incorrect route. | Check NAT rules, translation state, ARP for the pool and the return path. |
| DNS64 does not synthesise an answer | Client uses another resolver, synthesis is disabled or a usable AAAA already exists. | Query the intended DNS64 resolver directly and inspect its response and logs. |
Record evidence from the lab
Keep the interface addresses, routing tables and relevant firewall counters with your results. For a tunnel, record a successful LAN-to-LAN test and the tested MTU. For NAT64, record the DNS64 answer, an application test and the matching translation or session entry.
A successful ping is a useful first check, but it does not establish that DNS, larger packets or the applications your users need will work. Test those separately before expanding the deployment.
Address ranges used in this guide
2001:db8::/32, 198.51.100.0/24 and 203.0.113.0/24 are documentation ranges. The two IPv4 LANs use private addresses. The 64:ff9b::/96 prefix is the well-known IPv4/IPv6 translation prefix. None of the documentation addresses should be advertised to the public internet.
Moving from the lab to a live network
A practical migration sequence
1 Audit the network
List routers, switches, firewalls, applications and external dependencies. Confirm IPv6 support on the exact software releases you run, including management and monitoring tools.
2 Plan the addressing
Allocate prefixes by site and function. Decide how clients receive addresses and DNS information, and document routing boundaries before enabling services.
3 Pilot one service or segment
Choose a small deployment with clear success checks. Use dual-stack where both protocols are needed, a tunnel for an IPv4-only path, or NAT64 and DNS64 for an IPv6-only client pilot.
4 Secure and monitor IPv6
Define IPv6 policies that match the intended access. Account for ICMPv6, Router Advertisements and neighbour discovery. Confirm logging, visibility and incident procedures for both protocols.
5 Reduce IPv4 where testing supports it
Retire IPv4 from a segment only after its applications and dependencies work without it. Keep a rollback plan and track the remaining reasons for retaining IPv4.
Problems to catch early
Look for hard-coded IPv4 addresses in applications and scripts, forgotten IPv6 firewall policies, tunnel MTU problems and gaps in monitoring. Avoid extending a temporary tunnel design after native IPv6 becomes available without reviewing whether it is still needed.
The decision to carry forward
Choose the mechanism that addresses the actual limitation. Dual-stack supports both protocols on the same network. A configured tunnel carries IPv6 across an IPv4 path. NAT64 and DNS64 connect IPv6-only clients to IPv4- only services. Test the chosen path with real applications, record the results and expand in stages.
What is the main obstacle on your network: device support, application compatibility, upstream connectivity or operating two protocols? That answer is a useful place to start the next phase.
Technical references
Use the standards for protocol behaviour and the vendor documentation for platform and release details. The lab commands in this guide are examples and should be checked against the selected image before use.
01 IPv6 specification
RFC 8200
02 Basic transition mechanisms including configured tunnels
RFC 4213
03 IPv4 embedded IPv6 address formats
RFC 6052
04 Stateful NAT64
RFC 6146
05 DNS64
RFC 6147
06 Happy Eyeballs version 2
RFC 8305
07 Discovering PREF64 in Router Advertisements
RFC 8781
08 Cisco IOS XE stateful NAT64
Cisco IP Addressing Configuration Guide 17.x
09 Juniper SRX static NAT64
Junos OS Static NAT documentation
10 MikroTik configured IPv6 over IPv4 tunnels
RouterOS 6to4 documentation
11 MikroTik NAT64 support
RouterOS IP Addressing FAQ
12 BIND DNS64 configuration
BIND 9 Administrator Reference Manual
