Configurazione domain controller in IPv6

Se si desidera configurare un Domain Controller solo in IPv6 senza utilizzare l’IPv4 è possibile fare riferimento alla guida Pv6 Test Lab Extension: Demonstrating an IPv6-only Environment che suggerisce i passi per creare una infrastruttura Active Directory IPv6 only.

Passo 1: Disabilitare l’IPv4 sul domain controller

E’ possibile disabilitare l’IPv4 tramite l’applet ncpa.cpl o tramite PowerShell, di seguito il comando nell’ipotesi che il nome dell’interfaccia di rete sia “Ethernet”:

Disable-NetAdapterBinding -Name “Ethernet” -DisplayName “Internet Protocol Version 4 (TCP/IPv4)”

Passo 2: Impostare un indirizzo IPv6 statico

Per evitare il warning relativo alla mancanza dell’IP statico occorre impostare un indirizzo IPv6 di tipo unicast Global (RFC 3587, RFC 4291), gli indizzi unicast Unique Local Addresses (RFC 4193) non vengono considerati statici (a riguardo si veda il prost Tip about setting up Static IPv6 address for Domain Controllers di Nathan Winters).

E’ possibile quindi impostare un indirizzo IPv6 con il prefisso 2001:DB8::/32 destinato alla documentazione (RFC 3849) impostando ad esempio l’indirizzo 2001:db8::1111/32 tramite l’applet ncpa.cpl o tramite il comando:

netsh interface ipv6 add address Ethernet 2001:db8::1111

in alternativa è possibile usare il seguente comando PowerShell:

New-NetIPAddress -InterfaceAlias “Ethernet” -IPAddress 2001:db8::1111 -AddressFamily IPv6 -Type Unicast -PrefixLength 32

Si tenga anche presente che, come specificato nel libro Practical IPv6 for Windows Administrators, che solo gli indirizzi unicast global o unique local vengono registrati dinamicamente nel DNS:

“It should be noted that a Windows host will only register via dynamic DNS its global unicast address or unique local address. It will not register any multicast or link-local addresses in dynamic DNS.”

Passo 3: Promuovere il server a Domain Controller

Passo 4: Configurare uno scope nel DHCP per rilasciare gli indirizzi IPv6 ai clinet e impostare il domain controller come server DNS

Facendo riferimento alle configurazioni IPv6 impostate sul domain controller è possibile impostare uno scope IPv6 sul DHCP con le seguenti impostazioni:

  • Prefix: 2001:db8::
  • Nelle Server Options configurare l’opzione 0023 DNS Recursive Name Server IPv6 Addresses a 2001:db8::1111 ovvero l’indirizzo IPv6 del domain controller impostato precedentemente.

Passo 5: Configurare l’interfaccia IPv6

Eseguire il seguente comando per configurare il domain controller come un advertising e forwarding IPv6 router che esegue l’advertise dei prefissi IPv6 nativi sulla subnet dell’interfaccia di rete (di seguito si ipotizza che l’interfaccia di rete sia denominata Ethernet):

netsh interface ipv6 set interface Ethernet advertise=enabled forwarding=enabled otherstateful=enabled advertisedefaultroute=enabled

in alternativa è possibile usare il seguente comando PowerShell:

Set-NetIPInterface -InterfaceAlias “Ethernet” -AddressFamily IPv6 -Advertising Enabled -Forwarding Enabled -OtherStatefulConfiguration Enabled -AdvertiseDefaultRoute Enabled

Di seguito il significato delle impostazioni Forwarding, Advertising e AdvertiseDefaultRoute:

  • Forwarding: Specifies the packet forwarding value for the IP interface. This value determines if this IP interface forwards packets that arrive on this interface to other interfaces.
  • Advertising: Specifies the router advertisement value for the IP interface.
  • AdvertiseDefaultRoute: Specifies the default router advertisement for an interface. This parameter value indicates whether the IP interface should advertise itself as a default router regardless of whether the node has a default route itself. This parameter is valid only for advertising interfaces.
  • OtherStatefulConfiguration: Specifies the value for configuration other than addresses. This parameter determines if an IP interface uses a stateful protocol, such as DHCP, to obtain configuration information other than addresses. This parameter setting has no effect on an interface that has router discovery enabled and advertising disabled. In that case, the parameter is controlled by router discovery.

Eseguire il seguente comando per consentire l’utilizzo dei protocolli stateful (di seguito si ipotizza che l’interfaccia di rete sia denominata Ethernet):

netsh interface ipv6 set interface Ethernet managedaddress=enable otherstateful=enable

in alternativa è possibile usare il seguente comando PowerShell:

Set-NetIPInterface -InterfaceAlias “Ethernet” -AddressFamily IPv6 -ManagedAddressConfiguration Enabled -OtherStatefulConfiguration Enabled

Di seguito il significato delle impostazioni ManagedAddressConfiguration e OtherStatefulConfiguration:

  • ManagedAddressConfiguration: Specifies the value for managed address configuration. This parameter determines if an IP interface uses a stateful protocol, such as DHCP, to obtain an address. Setting this parameter has no effect on an interface that has router discovery enabled and advertising disabled. In that case, the parameter is controlled by router discovery.
  • OtherStatefulConfiguration: Specifies the value for configuration other than addresses. This parameter determines if an IP interface uses a stateful protocol, such as DHCP, to obtain configuration information other than addresses. This parameter setting has no effect on an interface that has router discovery enabled and advertising disabled. In that case, the parameter is controlled by router discovery.

I comandi precedenti devono essere eseguiti nell’ordine indicato, dopo l’esecuzione di tali comandi è consigliabile riavviare il sistema.

Per impostazione predefinita il domain controller oltre ad avere un indirizzi statico richiederà al DHCP anche un indirizzo dinamico per disabilitare tale comportamento è possibile eseguire il seguente comando:

Set-NetIPInterface -InterfaceAlias “Ethernet” -DHCP Disabled

Passo 4: Disabilitare sui client l’IPv4 ed eseguire il join a dominio

Note aggiuntive

Il warning relativo alla mancanza di IP statico descritto nel passo 2 può essere ignorato e volendo sul domani controller si può impostare un indirizzo IPv6 Unique Local Addresses, ad esempio sarebbe possibile impostare su domain controller l’indirizzo fd00:0000:0001:0001::/64:

Prefix/L: fd
Global ID: 0000000001
Subnet ID: 0001
Combined/CID: fd00:0000:0001:0001::/64
IPv6 addresses: fd00:0000:0001:0001:xxxx:xxxx:xxxx:xxxx

Per la generazione di indirizzi IPv6 Unique Local Addresses è possibile utilizzare il sito https://simpledns.com/private-ipv6.

Se sul domain controller viene impostato l’indirizzo fd00:0000:0001:0001::/64 ovviamente il DHCP dovrà poi essere configurato in modo adeguato:

  • Prefix: fd00:0:1:1::
  • Nelle Server Options configurare l’opzione 0023 DNS Recursive Name Server IPv6 Addresses a fd00:0000:0001:0001:: ovvero l’indirizzo IPv6 del domain controller.

Nel caso si vogliano eseguire vari test un modo rapido per ripristinare l’interfaccia di rete ai valori di default è quello di disinstallare l’interfaccia dall’applet dei dispositivi (hdwwiz.cpl).