Partager via


Using IPv4-compatible addresses

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Using IPv4-compatible addresses

IPv4-compatible addresses, derived from IPv4 public addresses, provide a method for connecting IPv6 hosts or sites over the existing IPv4 Internet infrastructure. IPv6 traffic, when used with IPv4-compatible addresses, does not require the addition of IPv6 routers. Its traffic is encapsulated with an IPv4 header.

The following illustration shows the configuration of two nodes on separate subnets using IPv4-compatible addresses to communicate across an IPv4 router.

Using IPv4-compatible addresses across IPv4 router

When IPv4-compatible IPv6 addresses are enabled, the IPv6 protocol for the Windows Server 2003 family and Windows XP automatically configures IPv4-compatible addresses for IPv4 public addresses on the Automatic Tunneling Pseudo-Interface (interface ID 2). An IPv4-compatible address takes the form ::w.x.y.z, where w.x.y.z is an IPv4 public address assigned to an interface on the computer. When IPv4-compatible addresses are enabled, the IPv6 protocol also automatically creates a ::/96 route that forwards all IPv4-compatible addressed traffic with the Automatic Tunneling Pseudo-Interface (interface ID 2). All traffic forwarded by this host to IPv4-compatible destinations is encapsulated with an IPv4 header.

IPv4-compatible addresses are disabled by default. To enable IPv4-compatible addresses, open Command Prompt and type:

netsh interface ipv6 set state v4compat=enabled

When you send traffic to an IPv4-compatible address, the traffic is sent from an IPv4-compatible address and is encapsulated with an IPv4 header. The Protocol field is set to 41 in the IPv4 header to indicate that the payload is an IPv6 packet. The IPv4 header allows the traffic to travel across an IPv4 infrastructure. The IPv4 addresses that are embedded in the source and destination IPv4-compatible addresses of the IPv6 header become the IPv4 source and destination addresses in the IPv4 header.

For example, when Host A (which is configured with the IPv4 address of 131.107.41.17) uses IPv4-compatible addresses to send IPv6 traffic to Host B (which is configured with the IPv4 address of 157.60.15.93), the source and destination addresses for the IPv4 and IPv6 headers are listed in the following table.

Field Value

Source address in IPv6 header

::131.107.41.17

Destination address in IPv6 header

::157.60.15.93

Source address in IPv4 header

131.107.41.17

Destination address in IPv4 header

157.60.15.93

The IPv4 routing infrastructure forwards the packet from Host A to Host B, based on the IPv4 destination address of 157.60.15.93. After it is received at Host B, the IPv4 packet payload (the IPv6 packet) is passed to the IPv6 protocol.

To test connectivity, use the ping command. For example, Host A would use the following command to ping Host B by using its IPv4-compatible address:

ping ::157.60.15.93

For more information, see Add an IPv6 route.

For additional information about configurations, see IPv6 Configurations.

For information about using IPv6 in a test lab, see Setting up an IPv6 Test Lab.