The Cable Guy - May 2006
Configuring IPv6 with Windows Vista
Microsoft® Windows Vista includes an implementation of Internet Protocol version 6 (IPv6) that, unlike Windows® XP, is installed and enabled by default. Although IPv6 is designed to be self-configuring, you can manually specify IPv6 configuration settings. This article describes how to manually configure IPv6 in Windows Vista using the Windows graphical user interface and at a command line.
Note The information in this article also applies to Windows 7.
Introduction to IPv6 Configuration
IPv6 was designed from the beginning to be easier to configure than Internet Protocol version 4 (IPv4). IPv6 can automatically configure itself, even without the use of a configuration protocol such as Dynamic Host Configuration Protocol for IPv6 (DHCPv6). All IPv6 nodes automatically configure a link-local address with the address prefix fe80::/64 for each physical or logical IPv6 interface. Link-local addresses can only be used to reach neighboring nodes, they are not registered in the Domain Name System (DNS), and require a zone ID when specifying a destination link-local address.
Additional IPv6 addresses and other configuration parameters for more useful IPv6 connectivity can be configured either automatically or manually.
Automatic Configuration
Beyond the link-local address, an IPv6 host (an IPv6 node that is not a router) can be automatically configured using the following:
Stateless address autoconfiguration with IPv6 router discovery
An IPv6 host sends a multicast Router Solicitation message and receives one or more Router Advertisement messages. The Router Advertisement messages contain subnet prefixes (from which the IPv6 host determines additional IPv6 addresses and adds routes to the IPv6 routing table) and other configuration parameters such as a default router (also known as a default gateway).
Stateful address autoconfiguration with DHCPv6
With DHCPv6, an IPv6 host can receive subnet prefixes and other configuration parameters. A common use of DHCPv6 for Windows-based IPv6 hosts is to automatically configure the IPv6 addresses of DNS servers, which are not configured through router discovery.
The Router Advertisement message received by the IPv6 host during router discovery contains a field indicating whether stateful address autoconfiguration should be performed.
Manual Configuration
Typical IPv6 hosts do not need to be manually configured. IPv6 routers do need to be manually configured for IPv6 addresses and routing behavior. You can manually configure IPv6 addresses and other parameters in Windows Vista using the following:
The properties of Internet Protocol Version 6 (TCP/IPv6) component
New to Windows Vista is the ability to configure IPv6 settings from the Windows graphical user interface. Just as you can configure IPv4 settings through the properties of the Internet Protocol Version 4 (TCP/IPv4) component in the Network Connections folder, you can now configure IPv6 settings through the properties of the Internet Protocol Version 6 (TCP/IPv6) component. The set of dialog boxes for IPv6 configuration are very similar to corresponding dialog boxes for IPv4.
Commands in the netsh interface ipv6 context
Just like Windows XP, you can configure IPv6 settings for Windows Vista from the interface ipv6 context of the Netsh.exe tool. For more information about Netsh.exe, see Managing Windows 2000 Networking Components with Netsh, the November 2001 The Cable Guy article.
Configuring IPv6 Through the Properties of Internet Protocol Version 6 (TCP/IPv6)
To manually configure IPv6 settings through the Windows graphical user interface, do the following:
From the Network Connections folder (available from Control Panel), right-click the connection or adapter on which you want to manually configure IPv6, and then click Properties.
On the Networking tab for the properties of the connection or adapter, double-click Internet Protocol Version 6 (TCP/IP) in the list under This connection uses the following items.
Windows Vista displays the Internet Protocol Version 6 (TCP/IPv6) Properties dialog box. The following figure shows an example.
General Tab
On the General tab of the Internet Protocol Version 6 (TCP/IPv6) Properties dialog box, you can configure the following:
Obtain an IPv6 address automatically Specifies that IPv6 addresses for this connection or adapter are automatically determined by stateful or stateless address autoconfiguration.
Use the following IPv6 address Specifies that an IPv6 address and default gateway for this connection or adapter are manually configured.
IPv6 address Provides a space for you to type an IPv6 unicast address. You can specify additional IPv6 addresses from the Advanced TCP/IP Settings dialog box described later in this article.
Subnet prefix length Provides a space for you to type the subnet prefix length for the IPv6 address. For IPv6 unicast addresses, this value is typically set to 64, its default value.
Default gateway Provides a space for you to type the IPv6 unicast address of the default gateway.
Obtain DNS server address automatically Specifies that the IPv6 addresses for DNS servers are automatically determined by stateful address autoconfiguration (DHCPv6).
Use the following DNS server addresses Specifies that the IPv6 addresses of the preferred and alternate DNS servers for this connection or adapter are manually configured.
Preferred DNS server Provides a space for you to type the IPv6 unicast address of the preferred DNS server.
Alternate DNS server Provides a space for you to type the IPv6 unicast address of the alternate DNS server. You can specify additional DNS servers from the Advanced TCP/IP Settings dialog box, described later in this article.
Advanced TCP/IP Settings
From the General tab, you can click Advanced to access the Advanced TCP/IP Settings dialog box. This dialog box is very similar to the Advanced TCP/IP Settings dialog box for the Internet Protocol Version 4 (TCP/IPv4) component except there is no WINS tab (IPv6 does not use NetBIOS and the Windows Internet Name Service [WINS]) or Options tab (TCP/IP filtering is only defined for IPv4 traffic). For IPv6, the Advanced TCP/IP Settings dialog box has IP Settings and DNS tabs. The following figure shows an example of the IP Settings tab.
From the IP Settings tab, you can configure the following:
Multiple IPv6 addresses (click Add under IP addresses)
For each unicast IPv6 address, you must specify an IPv6 address and a subnet prefix length. The Add button is only available if the Use the following IPv6 address option has been selected on the General tab of the Internet Protocol Version 6 (TCP/IPv6) Properties dialog box.
Multiple default gateways (click Add under Default gateways)
For each default gateway, you must specify the IPv6 address of the gateway and whether you want the metric for the default route associated with this default gateway to be manually specified or based on the speed of the connection or adapter.
Whether to use a specific metric for the routes associated with the configuration of IPv6 addresses or default gateways or a metric determined by the speed of the connection or adapter.
The following figure shows an example of the DNS tab.
From the DNS tab, you can configure the following:
The IPv6 addresses of DNS servers, in order of use (click Add under DNS server addresses, in order of use).
Primary and connection-specific DNS suffix and name registration and devolution behavior. These settings are the same as for IPv4.
Configuring IPv6 With the Netsh.exe Tool
In the same way as IPv6 for Windows XP, you can configure IPv6 addresses and other configuration parameters at the command line using commands in the netsh interface ipv6 context.
Configuring Addresses
To configure IPv6 addresses, you can use the netsh interface ipv6 add address command with the following syntax:
netsh interface ipv6 add address [interface=]Interface_Name_or_Index [address=]IPv6_Address[**/**Prefix_Length] [[type=]unicast|anycast] [[validlifetime=]Time|infinite] [preferredlifetime=]Time|infinite] [[store=]active|persistent]
interface The connection or adapter's name or interface index.
address The IPv6 address to add, optionally followed by the subnet prefix length (default of 64).
type The type of IPv6 address, either unicast (default) or anycast.
validlifetime The lifetime over which the address is valid. Time values can be expressed in days, hours, minutes, and seconds, for example 1d2h3m4s. The default value is infinite.
preferredlifetime The lifetime over which the address is preferred. Time values can be expressed in days, hours, minutes, and seconds. The default value is infinite.
store How to store the IPv6 address, either active (the address is removed upon system restart) or persistent (address remains after system restart) (default).
For example, to configure the IPv6 unicast address 2001:db8:290c:1291::1 on the interface named "Local Area Connection" with infinite valid and preferred lifetimes and make the address persistent, you would use the following command:
netsh interface ipv6 add address "Local Area Connection" 2001:db8::290c:1291::1
Adding Default Gateways
To configure a default gateway, you can use the netsh interface ipv6 add route command and add a default route (::/0) with the following syntax:
netsh interface ipv6 add route [prefix=]::/0 [interface=]Interface_Name_or_Index [[nexthop=]IPv6_Address] [[siteprefixlength=]Length] [[metric=]Metric_Value] [[publish=]no|yes|immortal] [[validlifetime=]Time|infinite] [[preferredlifetime=]Time|infinite] [[store=]active|persistent]
prefix The IPv6 address prefix and prefix length for the default route. For other routes, you can substitute ::/0 with Address_Prefix**/**Prefix_Length.
interface The connection or adapter's name or interface index.
nexthop If the prefix is for destinations that are not on the local link, the next-hop IPv6 address of a neighboring router.
siteprefixlength If the prefix is for destinations on the local link, you can optionally specify the prefix length for the address prefix assigned to the site to which this IPv6 node belongs.
metric A value that specifies the preference for using the route. Lower values are more preferred.
publish As an IPv6 router, this option specifies whether the subnet prefix corresponding to the route will be included in router advertisements and whether the lifetimes for the prefixes are infinite (the immortal option).
validlifetime The lifetime over which the route is valid. Time values can be expressed in days, hours, minutes, and seconds, for example 1d2h3m4s. The default value is infinite.
preferredlifetime The lifetime over which the route is preferred. Time values can be expressed in days, hours, minutes, and seconds. The default value is infinite.
store How to store the route, either active (route is removed upon system restart) or persistent (route remains after restart) (default).
For example, to add a default route that uses the interface named "Local Area Connection" with a next-hop address of fe80::2aa:ff:fe9a:21b8, you would use the following command:
netsh interface ipv6 add route ::/0 "Local Area Connection" fe80::2aa:ff:fe9a:21b8
Adding DNS Servers
To configure the IPv6 addresses of DNS servers, you can use the netsh interface ipv6 add dnsserver command with the following syntax:
netsh interface ipv6 add dnsserver [interface=]Interface_Name_or_Index [[address=]IPv6_Address] [[index=]Preference_Value]
interface The connection or adapter's name or interface index.
address The IPv6 address of the DNS server.
index The preference for the DNS server address.
By default, the DNS server is added to the end of the list of DNS servers. If an index is specified, the DNS server is placed in that position in the list and the other DNS servers are moved down the list.
For example, to add a DNS server with the IPv6 address 2001:db8::99:4acd::8 that uses the interface named "Local Area Connection," you would use the following command:
netsh interface ipv6 add dnsserver "Local Area Connection" 2001:db8::99:4acd::8
Disabling IPv6
Unlike Windows XP, IPv6 in Windows Vista cannot be uninstalled. However, you can disable IPv6 in Windows Vista by doing one of the following:
In the Connections and Adapters folder, obtain properties on all of your connections and adapters and clear the check box next to the Internet Protocol version 6 (TCP/IPv6) component in the list under This connection uses the following items. This method disables IPv6 on your LAN interfaces and connections, but does not disable IPv6 on tunnel interfaces or the IPv6 loopback interface.
Add the following registry value (DWORD type) set to 0xFFFFFFFF:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\DisabledComponents
This method disables IPv6 on all your LAN interfaces, connections, and tunnel interfaces but does not disable the IPv6 loopback interface. You must restart the computer for this registry value to take effect. DisabledComponents is set to 0 by default.
The DisabledComponents registry value is a bit mask that controls the following series of flags, starting with the low order bit (Bit 0):
- Bit 0 Set to 1 to disable all IPv6 tunnel interfaces, including ISATAP, 6to4, and Teredo tunnels. Default value is 0.
- Bit 1 Set to 1 to disable all 6to4-based interfaces. Default value is 0.
- Bit 2 Set to 1 to disable all ISATAP-based interfaces. Default value is 0.
- Bit 3 Set to 1 to disable all Teredo-based interfaces. Default value is 0.
- Bit 4 Set to 1 to disable IPv6 over all non-tunnel interfaces, including LAN interfaces and Point-to-Point Protocol (PPP)-based interfaces. Default value is 0.
- Bit 5 Set to 1 to modify the default prefix policy table to prefer IPv4 to IPv6 when attempting connections. Default value is 0.
Note Bits beyond Bit 5 are not used.
To determine the value of DisabledComponents for a specific set of bits, construct a binary number consisting of the bits and their values in their correct position and convert the resulting number to hexadecimal. For example, if you want to disable 6to4 interfaces, disable Teredo interfaces, and prefer IPv4 to IPv6, you would construct the following binary number: 101010. When converted to hexadecimal, the value of DisabledComponents is 0x2A.
You must restart the computer for the changes to the DisabledComponents registry value to take effect.
For More Information
For more information about IPv6, consult the following resources:
For a list of all The Cable Guy articles, click here.