5. IPv6 address assignment
On IPv4 networks, addresses can be assigned to interfaces in
three ways: manually using static addresses, dynamically using DHCP,
or automatically using APIPA. Administrators of small networks often
configure IPv4 addresses manually, while midsize to large
organizations usually use DHCP. Automatic address configuration using
APIPA, however, is usually used only on very small networks such as a
home or office LAN that connects to the Internet using a DSL
router.
Address assignment on IPv6 networks is somewhat different. IPv6
addresses can be assigned to an interface by doing the
following:
-
Manually configuring one or more IPv6 addresses on the
interface
-
Stateful address autoconfiguration using a DHCPv6
server
-
Stateless address autoconfiguration based on the receipt of
Router Advertisement messages
-
Both stateful and stateless address autoconfiguration
In addition, a link-local address is always automatically
configured on an interface regardless of whether stateful or stateless
address autoconfiguration is being used.
The main difference, however, between address assignment in IPv6
and in IPv4 is that the IPv6 protocol was designed to be
autoconfiguring. This means that, in most cases, you will neither need
to assign addresses manually nor deploy a DHCPv6 server; instead, you
can use stateless address autoconfiguration for most of your network
hosts. This means that, in contrast with physical interfaces (network
adapters) on IPv4 hosts which are usually single-homed (have only a
single address assigned), most physical interfaces on IPv6 hosts are
multihomed (have multiple addresses assigned). Specifically, a
physical IPv6 interface usually has at least two addresses:
-
An automatically generated link-local address, which is used
for traffic on the local link
-
An additional unicast address (either a global address or a
unique local address), which is used for traffic that needs to be
routed beyond the local link
Manual address assignment
Manual assignment of IPv6 addresses is generally done only in
two scenarios:
On a computer running Windows Server 2012, you can manually
configure an IPv6 address using any of the following methods:
-
By opening the Internet Protocol Version 6 (TCP/IPv6)
Properties dialog box from the properties of an interface in the
Network Connection folder and configuring the IPv6 address,
subnet prefix length, default gateway, and DNS server addresses
as shown in Figure 4
-
By using the New-NetIPAddress and
Set-DnsClientServerAddress cmdlets of Windows PowerShell
-
By using commands from the netsh interface ipv6 context of
the Netsh.exe command-line utility
The following is an example of using Windows PowerShell to
manually configure an IPv6 address on a physical interface of a
computer running Windows Server 2012. First, here is the output from
running the Ipconfig command on the server:
PS C:\> ipconfig
Windows IP Configuration
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::2025:61fb:b68:c266%12
IPv4 Address. . . . . . . . . . . : 172.16.11.75
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 172.16.11.1
Tunnel adapter isatap.{DD59BFFD-706A-4685-9073-647788046335}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Tunnel adapter Teredo Tunneling Pseudo-Interface:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
From the preceding command, you can see that the physical
interface named Ethernet has two addresses assigned:
The %12 appended to the link-local
address is called a zone identifier and is used to specify the link
on which the address is located. On Windows platforms, the zone
identifier is equal to the index of the interface, and you can use
the Get-NetAdapter cmdlet to display a list of names and indexes of
physical interfaces on computers running Windows Server 2012 as
follows:
PS C:\> Get-NetAdapter | fl Name,ifIndex
Name : Ethernet
ifIndex : 12
Instead of using the Ipconfig command, you can also use the
Get-NetIPAddress cmdlet like this to display the address information
for the interface named Ethernet:
PS C:\> Get-NetIPAddress | where {$_.InterfaceAlias -eq "Ethernet"}
IPAddress : fe80::2025:61fb:b68:c266%12
InterfaceIndex : 12
InterfaceAlias : Ethernet
AddressFamily : IPv6
Type : Unicast
PrefixLength : 64
PrefixOrigin : WellKnown
SuffixOrigin : Link
AddressState : Preferred
ValidLifetime : Infinite ([TimeSpan]::MaxValue)
PreferredLifetime : Infinite ([TimeSpan]::MaxValue)
SkipAsSource : False
PolicyStore : ActiveStore
IPAddress : 172.16.11.75
InterfaceIndex : 12
InterfaceAlias : Ethernet
AddressFamily : IPv4
Type : Unicast
PrefixLength : 24
PrefixOrigin : Manual
SuffixOrigin : Manual
AddressState : Preferred
ValidLifetime : Infinite ([TimeSpan]::MaxValue)
PreferredLifetime : Infinite ([TimeSpan]::MaxValue)
SkipAsSource : False
PolicyStore : ActiveStore
Note how the preceding cmdlet output is more informative than
the Ipconfig command.
I’ll now show you how to use the NewNetIPAddress cmdlet to
assign a new global unicast IPv6 address with prefix length 64 and
also a default gateway address to the Ethernet interface:
PS C:\> New-NetIPAddress -InterfaceAlias "Ethernet" -IPAddress 2001:DB8:3FA9::D3:9C5A `
-PrefixLength 64 -DefaultGateway 2001:DB8:3FA9::0C01
IPAddress : 2001:db8:3fa9::d3:9c5a
InterfaceIndex : 12
InterfaceAlias : Ethernet
AddressFamily : IPv6
Type : Unicast
PrefixLength : 64
PrefixOrigin : Manual
SuffixOrigin : Manual
AddressState : Tentative
ValidLifetime : Infinite ([TimeSpan]::MaxValue)
PreferredLifetime : Infinite ([TimeSpan]::MaxValue)
SkipAsSource : False
PolicyStore : ActiveStore
IPAddress : 2001:db8:3fa9::d3:9c5a
InterfaceIndex : 12
InterfaceAlias : Ethernet
AddressFamily : IPv6
Type : Unicast
PrefixLength : 64
PrefixOrigin : Manual
SuffixOrigin : Manual
AddressState : Invalid
ValidLifetime : Infinite ([TimeSpan]::MaxValue)
PreferredLifetime : Infinite ([TimeSpan]::MaxValue)
SkipAsSource : False
PolicyStore : PersistentStore
To verify the result, you can use the Get-NetIPAddress cmdlet
with the –AddressFamily parameter to display
only IPv6 addressing information as follows:
PS C:\> Get-NetIPAddress -AddressFamily IPv6 | where {$_.InterfaceAlias -eq "Ethernet"}
IPAddress : fe80::2025:61fb:b68:c266%12
InterfaceIndex : 12
InterfaceAlias : Ethernet
AddressFamily : IPv6
Type : Unicast
PrefixLength : 64
PrefixOrigin : WellKnown
SuffixOrigin : Link
AddressState : Preferred
ValidLifetime : Infinite ([TimeSpan]::MaxValue)
PreferredLifetime : Infinite ([TimeSpan]::MaxValue)
SkipAsSource : False
PolicyStore : ActiveStore
IPAddress : 2001:db8:3fa9::d3:9c5a
InterfaceIndex : 12
InterfaceAlias : Ethernet
AddressFamily : IPv6
Type : Unicast
PrefixLength : 64
PrefixOrigin : Manual
SuffixOrigin : Manual
AddressState : Preferred
ValidLifetime : Infinite ([TimeSpan]::MaxValue)
PreferredLifetime : Infinite ([TimeSpan]::MaxValue)
SkipAsSource : False
PolicyStore : ActiveStore
The interface is now multihomed because it has one link-local
IPv6 address and one global IPv6 address. Opening the Internet
Protocol Version 6 (TCP/IPv6) Properties dialog box displays the
expected manually configured address information, as shown in Figure 5.
To configure preferred and alternate DNS servers for this
interface, use the Set-DnsClientServerAddress cmdlet. For more
information on Net TCP/IP and DNS client cmdlets, see the following
TechNet Library pages: