IPv4 in IPv6

IPv4-mapped addresses, 6to4, Teredo, and other IPv4-in-IPv6 transition mechanisms.

Why IPv4-in-IPv6?

During the transition from IPv4 to IPv6, several mechanisms were created to embed or reference IPv4 addresses within IPv6 addresses. These help with compatibility, tunneling, and gradual migration. Most of these are legacy mechanisms, but you'll still encounter them in network troubleshooting and configuration.

IPv4-in-IPv6 Mechanisms

IPv4-Mapped IPv6 Addresses [Active]
Prefix: ::ffff:0:0/96
Purpose: Represent IPv4 addresses in IPv6 format for dual-stack applications
Format: ::ffff:w.x.y.z or ::ffff:wxyz (hex)
Examples:
::ffff:192.0.2.1 (maps 192.0.2.1)
::ffff:c000:201 (same as above in hex)
::ffff:127.0.0.1 (maps 127.0.0.1)
Usage:
  • Dual-stack socket programming
  • Applications that need to handle both IPv4 and IPv6
  • Internal system representation
Note: Still widely used in modern systems for dual-stack compatibility
IPv4-Compatible IPv6 (Deprecated) [Deprecated]
Prefix: ::/96
Purpose: Originally for automatic IPv6 tunneling over IPv4
Format: ::w.x.y.z
Examples:
::192.0.2.1
::10.0.0.1
Usage:
  • Automatic tunneling (no longer used)
  • Early IPv6 transition mechanisms
Note: Deprecated due to security concerns. Never use in new deployments.
6to4 [Deprecated]
Prefix: 2002::/16
Purpose: Automatic tunneling of IPv6 over IPv4 internet
Format: 2002:wxyz::/48 (where wxyz is IPv4 in hex)
Examples:
2002:c000:201::/48 (for 192.0.2.1)
2002:0a00:0001::/48 (for 10.0.0.1)
Usage:
  • Automatic IPv6 connectivity over IPv4
  • Legacy transition mechanism
  • 6to4 relay routers
Note: Largely deprecated due to reliability issues and NAT incompatibility
Teredo [Legacy]
Prefix: 2001:0::/32
Purpose: IPv6 connectivity through NAT devices
Format: 2001:0:server:flags:cone:port:client:client
Examples:
2001:0:4137:9e76:2847:f613:446a:5dcb
2001:0:9d38:90d7:0:0:0:0
Usage:
  • Microsoft Windows IPv6 connectivity
  • NAT traversal for IPv6
  • Peer-to-peer applications
Note: Complex encoding includes server, client IPs, ports, and NAT type
ISATAP [Legacy]
Prefix: fe80::/64 or 2001:db8::/32
Purpose: IPv6 over IPv4 intranet tunneling
Format: prefix::5efe:w.x.y.z
Examples:
fe80::5efe:192.0.2.1
2001:db8:1:1::5efe:10.0.0.1
Usage:
  • Enterprise intranet IPv6 deployment
  • Windows automatic tunneling
  • Site-local IPv6 over IPv4
Note: Uses special infix :0:5efe: followed by IPv4 address
6rd (IPv6 Rapid Deployment) [Limited Use]
Prefix: Variable
Purpose: ISP-provided IPv6 over existing IPv4 infrastructure
Format: ISP-prefix:encoded-ipv4::/suffix-length
Examples:
2001:db8:c0a8:101::/64 (example encoding)
Varies by ISP implementation
Usage:
  • ISP IPv6 service over IPv4 infrastructure
  • Broadband IPv6 deployment
  • Customer premises equipment
Note: ISP-specific encoding of customer IPv4 address into IPv6 prefix

Quick Recognition Guide

PatternMeaningWhat to Do
::ffff:x.x.x.xIPv4-mapped addressExtract IPv4 from the end
::x.x.x.xIPv4-compatible (deprecated)Avoid using
2002:xxxx:xxxx::6to4 addressConvert hex back to IPv4
2001:0::Teredo addressComplex encoding, use tools
xxxx::5efe:x.x.x.xISATAP addressIPv4 follows :5efe:

IPv4 to Hex Conversion Examples

To understand embedded addresses, you need to convert IPv4 addresses to hexadecimal:

IPv4 AddressHex EquivalentBreakdown
192.0.2.1c000:0201192=c0, 0=00, 2=02, 1=01
10.0.0.10a00:000110=0a, 0=00, 0=00, 1=01
172.16.1.100ac10:0164172=ac, 16=10, 1=01, 100=64
203.0.113.1cb00:7101203=cb, 0=00, 113=71, 1=01
Quick Tip
Each IPv4 octet becomes 2 hex digits. For example: 192 = C0, 168 = A8, so 192.168.1.1 becomes C0A8:0101.

Modern Usage Guidelines

  • IPv4-mapped addresses are still used in dual-stack applications
  • 6to4 and Teredo are mostly disabled by default in modern systems
  • New deployments should use native IPv6 or IPv4/IPv6 dual-stack
  • Legacy mechanisms may appear in old configurations or troubleshooting
  • Most transition mechanisms are being phased out as IPv6 adoption grows

Common Troubleshooting Issues

Seeing ::ffff: addresses in logs

Cause: Dual-stack application treating IPv4 clients as IPv6

Solution: Normal behavior, indicates IPv4-mapped addressing

2002:: addresses not working

Cause: 6to4 infrastructure being deprecated

Solution: Switch to native IPv6 or other transition mechanisms

Teredo connectivity issues

Cause: NAT or firewall blocking UDP 3544

Solution: Configure firewall or disable Teredo if not needed

ISATAP addresses appearing

Cause: Windows automatic tunneling enabled

Solution: Disable if not needed: netsh interface ipv6 set global randomizeidentifiers=disabled

Security Considerations

Important Security Notes
IPv4-compatible addresses (::) are deprecated due to security issues
6to4 can be exploited for traffic injection attacks
Teredo may bypass firewall rules if not properly configured
Disable unused transition mechanisms to reduce attack surface
Monitor for unexpected embedded IPv4 traffic patterns
Security Warning
Many IPv4-in-IPv6 transition mechanisms have known security vulnerabilities. Disable unused mechanisms and monitor for unexpected embedded address patterns in your network.