Microsoft Windows DHCP Team Blog

The world's most deployed DHCP Server! Deploy and discuss about your fav. server, here!

DHCPv6 - Understanding of address configuration in automatic mode and installation of DHCPv6 Server

DHCPv6 - Understanding of address configuration in automatic mode and installation of DHCPv6 Server

  • Comments 32
  • Likes

Understanding of address configuration in automatic mode

 

 

Windows Server 2008 and Windows Vista include a DHCPv6-capable DHCP client that will perform stateful address autoconfiguration with a DHCPv6 server. Windows Server 2008 includes a DHCPv6-capable DHCP server.

 

A host (DHCP Client) can configure itself with an IPv6 address to be used on the network. Address

configuration can be performed in a stateful or a stateless mode. A host can use both stateless and stateful address configuration completely independent of each other. The router advertisement messages with the appropriate flags set would indicate the precise method to be used. However the host (DHCP Client) can also be configured by manual means. The latter is seldom an occurrence in a well managed network.

 

Stateless Address Configuration

 

The stateless mechanism allows a host to generate its own addresses using a combination of locally available information and information advertised by routers. The stateless approach is used when a site is not particularly concerned with the exact addresses hosts use, so long as they are unique and properly routable. 

Stateless Address Autoconfiguration is used to configure both link-local addresses and additional non-link-local addresses by exchanging Router Solicitation and Router Advertisement messages with neighboring routers.

 

Following are the two approaches with which IPv6 node can configure its address in a stateless fashion:

·         Using automatic address configuration with prefix discovery: This is based on RFC2462. If the ‘autonomous’ flag of a Prefix Information Option contained in a router advertisement is set, the IPv6 host may automatically generate its global IPv6 address by appending its 64-bit interface identifier to the prefix contained in the router advertisement.

·         Stateless DHCPv6: This is not mentioned as an option given in router advertisements [RFC2461].

 

Stateful Address Configuration

 

In the stateful address auto-configuration model, hosts obtain interface addresses and/or configuration information and parameters from a server. The stateful approach is used when a site requires tighter control over exact address assignments.

 

Stateful Address Autoconfiguration is used to configure non-link-local addresses through the use of a configuration protocol such as DHCP.

 

As far as the IPv6 host is concerned, using stateful DHCPv6 is little different to using stateless

DHCPv6 as the observed request/response times should be the same in most cases. However, it is possible that the extra overhead of reading and writing state to memory inside the DHCPv6 server may lead to a small increase in latency when compared to its stateless equivalent. This may be important for the configuration time of mobile nodes, which must perform address configuration when moving into a new network.

 

Delegating a prefix to an entire site is commonly a stateful operation, as the service provider routing scheme must always know where a site topologically resides, a packet targeted to a site must be routed back to the site. DHCPv6 server typically stores the DHCPv6 delegated prefix.

 

IPv6 host behaviour

 

An IPv6 host performs stateless address autoconfiguration automatically and uses a configuration protocol such as DHCPv6 based on the following flags in the Router Advertisement message sent by a neighboring router:

 

Managed Address Configuration Flag, which is also known as the M flag. When set to 1, this flag instructs the host to use a configuration protocol to obtain stateful addresses.

 

Other Stateful Configuration Flag , which is also known as the O flag. When set to 1, this flag instructs the host to use a configuration protocol to obtain other configuration settings.

Combining the values of the M and O flags can yield the following:

 

Both M and O Flags are Set to 0. This combination corresponds to a network without a DHCPv6 infrastructure. Hosts use router advertisements for non-link-local addresses and other methods (such as manual configuration) to configure other settings.

 

Both M and O Flags are Set to 1. DHCPv6 is used for both addresses and other configuration settings. This combination is known as DHCPv6 stateful, in which DHCPv6 is assigning stateful addresses to IPv6 hosts.

 

The M Flag is Set to 0 and the O Flag is Set to 1. DHCPv6 is not used to assign addresses, only to assign other configuration settings. Neighboring routers are configured to advertise non-link-local address prefixes from which IPv6 hosts derive stateless addresses. This combination is known as

DHCPv6 stateless: DHCPv6 is not assigning stateful addresses to IPv6 hosts, but stateless configuration settings.

 

The M Flag is Set to 1 and the O Flag is Set to 0. In this combination, DHCPv6 is used for address configuration but not for other settings. Because IPv6 hosts typically need to be configured with other settings, such as the IPv6 addresses of Domain Name System (DNS) servers, this is an unlikely combination.

 

Like DHCP for IPv4, the components of a DHCPv6 infrastructure consist of DHCPv6 clients that request configuration, DHCPv6 servers that provide configuration, and DHCPv6 relay agents that convey messages between clients and servers when clients are on subnets that do not have a DHCPv6 server.

 

 Installation of DHCP Server

 

In the installation of DHCP Server using the role installation in the Server Manager, following is specific details with regard to IPv6 configuration during the role installation:

               

Behavior - 1

In case, “Enable DHCPv6 stateless mode for this server” option was selected during role installation

 

It would have asked for Parent Domain and IPv6 DNS Server (primary – mandatory and secondary – optional) information.

 

Therefore, in the post installation phase following Server Options under IPv6 node in the DHCP MMC will be with the configured values:

-          00023 DNS Recursive Name Server IPv6 Address List

-          00024 Domain Search List

 

Behavior - 2

In case, “Disable DHCPv6 stateless mode for this server” option was selected during role installation

 

It would NOT have asked for Parent Domain and IPv6 DNS Server (primary – mandatory and secondary – optional) information at all as that page in wizard will be hidden.

 

Therefore, in the post installation phase if you do not see Server Options under IPv6 node in the DHCP MMC.

 

In this case, this means the DHCPv6 Stateless mode is NOT configured on the DHCP Server.

However, in this stage if Admin wants to configure DHCP Server as stateless mode, he needs to configure the above mentioned Server Options explicitly.

 

Following are the options that can be configured at the IPv6 Scope Level and/or the IPv6 Server Level

  

Server Options

Description

00021 SIP Server Domain Name List

This option specifies a list of the domain names of the SIP outbound proxy servers for the client to use.

00022 SIP Servers IPv6 Address List

This option specifies a list of IPv6 addresses indicating SIP outbound proxy servers available to the client.  Servers MUST be listed in order of preference.

00023 DNS Recursive Name Server IPv6 Address

The DNS Recursive Name Server option carries a list of IPv6 addresses of RDNSSes to which the host may send DNS queries.   The DNS servers are listed in the order of preference for use by the DNS resolver on the host.

00024 Domain Search List

The Domain Search List option specifies the domain search list the client is to use when resolving hostnames with DNS.  This option does not apply to other name resolution mechanisms.

00027 NIS IPv6 Address List

This option specifies a list of IPv6 addresses indicating Network Information Services (NIS) Servers available to the client. Clients MUST treat the list of NIS servers as an ordered list.  The server MAY list the NIS servers in the order of   preference.

00028 NIS + IPv6 Address List

This option specifies a list of IPv6 addresses indicating Network Information Services v2 (NIS +) Servers available to the client. Clients MUST treat the list of NIS+ servers as an ordered list.  The server MAY list the NIS+ servers in the order of   preference.

00029 NIS Domain List

The Network Information Service (NIS) Domain Name List is used by the server to convey client's list of NIS Domain Name info to the client.

00030 NIS + Domain Name List

The Network Information Service v2 (NIS+) Domain Name List is used by the server to convey client's list of NIS+ Domain Name info to the client.

00031 SNTP Servers IPv6 Address List

Simple Network Time Protocol (SNTP) servers option provides a list of one or more IPv6 addresses of SNTP [3] servers available to the client for synchronization.

 

Comments
  • PingBack from http://feeds.bscopes.com/2009/03/15/blog-microsoft-windows-dhcp-team-blog/

  • Dir Administrator,

    I'm try to use Stateful Address Configuration in widnwso 2008 ,as you mention as below

    "Using automatic address configuration with prefix discovery: This is based on RFC2462. If the ‘autonomous’ flag of a Prefix Information Option contained in a router advertisement is set, the IPv6 host may automatically generate its global IPv6 address by appending its 64-bit interface identifier to the prefix contained in the router advertisement. "

    but I can't see any Prefix Information in RA

    can ?

    can I assign a prefix to RA and use it under Stateful Address Configuration

  • Hi Norman,

    IPv6 Stateless Address Autoconfiguration specified in RFC 2462, is yet another way in which ipv6 address is acquired by network elements.Stateful address assignment is done through a Dhcp Server. It is very much possible that Clients can have addresses acquired using both the modes.

    The Router prefix can be advertised in RA's from Windows machine,by running following netsh commands from elevated prompt:

    Netsh interface ipv6 add route <ipv6prefix>::/<prefixlength> <server_interface > publish=yes

    netsh interface ipv6 set interface < server_interface > adv=en managed=en other=en on server.

    Ravi

  • Hi Ravi,

    I could delegate prefix when windows 7 sent dhcpv6 solicit for IA_PD.

    Now, I'd like to flush delegated & stored prefix somewhere of windows 7 in order to get it start over again.

    Is there a netsh command or a knob to force windows 7 to ask IA_PD again?

    Thanks,

    - Simon Rho

  • Hi Simon Rho

    The requested prefix can be released by invoking call to Dhcpv6ReleasePrefix() Api. Please refer to following link for more information on usgae of api : http://msdn.microsoft.com/en-us/library/aa363323(VS.85).aspx. A subsequent call to Dhcpv6RequestPrefix() call makes win7 client to request prefix all over again.

    Alternatively, a new prefix can be requested (with previously requested prefix still retained)by invoking call to Dhcpv6RequestPrefix Api, with a different value of iaid.

    Ravi

  • Hello teamdhcp,

    I'm trying to use the Dhcpv6RequestPrefix() api on Windows 7 Ultimate to request a prefix from the DHCPv6 server.

    The first call to this api returns ERROR_MORE_DATA as expected because the first call does not provide memory for the prefixes and the serverid.

    After following the instructions from the MSDN documentation -

    "The caller must follow these considerations when assigning the values of the nPrefixes, iaid, and ServerIdLen members of the DHCPV6PrefixLeaseInformation structure. Based on these values, memory must also be properly allocated to the ServerId and PrefixArray members before the Dhcpv6RequestPrefix function is called."

    The subsequent call to Dhcpv6RequestPrefix() returns ERROR_INVALID_PARAMETER.

    MSDN states -

    "Returned if one of the following conditions are true:

    AdapterName is NULL.

    prefixleaseInfo is NULL.

    pdwTimeToWait is NULL.

    The iaid member of the prefixleaseInfo is zero."

    I have verified that the adaptername is not NULL. Memory for prefixleaseInfo is allocated(i.e. not NULL). pdwTimeToWait is not NULL.  iaid is not zero.

    Please see code snippet below.  Is there something I missed?  Is DHCPV6CAPI_CLASSID a required parameter?

    I also verified that the DHCPv6 client and DHCPv6 server have completed the prefix request change.

    i.e. the packet trace shows DHCPv6 Solicit, Advertise, Request, Reply

    Any help is appreciated.

    -glen

    --- Start Code Snippet ----

    DWORD dwError, dwTimeout = 0xFFFFFFFF;

    int dw, iNumPrefixes = 1;

    DWORD dwServerIdLen = 128;

    WCHAR wszAdapter[260];

    WCHAR wszDescription[512];

    PDHCPV6PrefixLeaseInformation pPrefixInfo = NULL;

    pPrefixInfo = (PDHCPV6PrefixLeaseInformation)malloc(sizeof(DHCPV6PrefixLeaseInformation));

    memset(pPrefixInfo, 0, sizeof(DHCPV6PrefixLeaseInformation));

    pPrefixInfo->iaid = 1;

    CString strTemp;

    strTemp = pApp->m_pAdapterInfo[i].szMacDeviceID;

    dw = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, strTemp, -1, wszAdapter, 0);

    MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, strTemp, -1, wszAdapter, dw);

    strTemp = pApp->m_pAdapterInfo[i].szDescription;

    dw = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, strTemp, -1, wszDescription, 0);

    MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, strTemp, -1, wszDescription, dw);

    dwError = Dhcpv6RequestPrefix(wszAdapter,

    NULL, // no class id

    pPrefixInfo,

    &dwTimeout);

    if(dwError == ERROR_MORE_DATA){

    // The value of the nPrefixes or the ServerIdLen member specified

    // is less than the number of prefixes available from the server

    // or the available server ID length. Increase the nPrefixes or

           // the ServerIdLen member and make sure the corresponding memory

    // has been allocated properly before calling the Dhcpv6RequestPrefix

    // function again.

    iNumPrefixes = 1;

    pPrefixInfo->prefixArray = (LPDHCPV6Prefix)malloc(iNumPrefixes*sizeof(DHCPV6Prefix));

    memset(pPrefixInfo->prefixArray, 0, iNumPrefixes*sizeof(DHCPV6Prefix));

    pPrefixInfo->ServerId = (LPBYTE)malloc(dwServerIdLen);

    memset(pPrefixInfo->ServerId, 0, dwServerIdLen);

    pPrefixInfo->ServerIdLen = dwServerIdLen;

    dwError =Dhcpv6RequestPrefix(wszAdapter,

    NULL, // no class id

    pPrefixInfo,

    &dwTimeout);

    }

    if(pPrefixInfo->prefixArray) free(pPrefixInfo->prefixArray);

    if(pPrefixInfo->ServerId) free(pPrefixInfo->ServerId);

    if(pPrefixInfo) free(pPrefixInfo);;

    --- End Code snippet ---

  • Hi Glen,

    DHCPV6CAPI_CLASSID is not a required parameter for Dhcpv6RequestPrefix. What I see missing from below code, during second invocation of call is setting of nPrefixes field of DHCPV6PrefixLeaseInformation structure:

    pPrefixInfo->nPrefixes = iNumPrefixes;

    When pPrefixInfo->prefixArray is initialized, the nPrefixes field should be set to number of prefixes requested. The Api call should pass, after above addition to your code.

    Regards

    Ravi

  • Hello Ravi,

    Thank you for the quick reply.

    I tried your suggestion above -

    added pPrefixInfo->nPrefixes=iNumPrefixes

    but I still got a ERROR_INVALID_PARAMETER return code after the second call to DHCPV6RequestPrefix()

    Below is the content of the DHCPV6PrefixLeaseInformation structure copied from the debugger.

    pPrefixInfo = 0x03c720c0 {nPrefixes=1 prefixArray=0x03c72280 iaid=1 ...}

    nPrefixes = 1

    prefixArray = 0x03c72280 {prefix=0x03c72280 "" prefixLength=0 preferredLifeTime=0 ...}

    iaid = 1

    T1 = 0

    T2 = 0

    MaxLeaseExpirationTime = 60129542144

    LastRenewalTime = 0

    status = STATUS_NO_ERROR

    ServerId = 0x03c72cf0 ""

    ServerIdLen = 128

    Is there anything else you can see that might cause the api to return ERROR_INVALID_PARAMETER?

    -glen

  • Dear Teamdhcp,

    I just only want to get a DHCPv6 address, a DNS server and a default gateway. I use ISC as DHCPv6 Server and win7 as client. The client's first hop is a Cisco router. On win7client, I enabled "routerdiscovery" and "managedaddress" and "otherstateful" in "netsh interface ipv6...".

    The client successfully get a DHCPv6 address and a DNS Server and a default gateway. In addition, the win7 client automaticlly produces two addresses at the same time since  there is a RA announcement from a Cisco router. But this is not what I want. In fact, I do not want to get the two RA addresses.

    So, I turned off RA from Cisco router afterwards. This time, I can only get a DHCPv6 address and a DNS Server **without default gateway**. This is not what I want neither. I need the default gateway!

    I tried many times but I failed.  I am wondering if there is anyway, no more no less, to only get a DHCPv6 address, a DNS server and a default gateway without manully configuration?

    thank you!

  • Configure Cisco router to send router advertisement with M flag set.

    Disable router discovery and other flags (managed / other ) on windows7 client and with this windows7 client would get Dhcpv6 address, DNS Server address and default gateway from Cisco router.

    regards

    Ravi

  • Dear DHCP team,

    How can i advertise default router to clients, if DHCPv6 and IPv6 router in the same WS2008 OS?

    I've tried

    netsh int ipv6

    set int Local adv=en

    add route ::/0 Local fc00:10:18:1::10 publish=yes

    where 10:18:1::10 address of DHCP/Router

    but clients get this route "::/0 on-link" ("::" in ipconfig).

    So default route links to whole Network Interface instead of router address.

    If i set clinet route manually, all is ok.

    Please help me to properly advertise WS2008 IPv6 router.

  • Hi argon

    The command is

    add route ::/0 Local <router address> publish=yes

    where <router address> is address of your DHCP/Router

    Try using 10:18:1::10 ?

    Just make sure that it is the correct v6 address of your router.

    Thanks

    Arun

    DHCP team

  • Don't know if my last message was submitted correctly... Again...

    ------------------------

    fc00:10:18:1::10 was an example, real address of router is  fc00:10:0:18::10.

    on server:

    -----

    netsh interface ipv6>show route

    Publish  Type      Met  Prefix                    Idx  Gateway/Interface Name

    -------  --------  ---  ------------------------  ---  ------------------------

    Yes      Manual    256  ::/0                       10  Local1

    No       Manual    256  ::1/128                     1  Loopback Pseudo-Interface 1

    Yes      Manual    256  fc00:10:0:18::/64          10  Local1

    ...

    >route print

    ...

    Active Routes:

    If Metric Network Destination      Gateway

    10    261 ::/0                     On-link

     1    306 ::1/128                  On-link

    10    261 fc00:10:0:18::/64        On-link

    ...

    on client:

    -----

    netsh interface ipv6>show route

    Publish  Type      Met  Prefix                    Idx  Gateway/Interface Name

    -------  --------  ---  ------------------------  ---  ------------------------

    No      Manual    8   ::/0                       11  Lan

    No       Manual    256  ::1/128                     1  Loopback Pseudo-Interface 1

    No      Manual    8    fc00:10:0:18::/64          11  Lan

    ...

    >route print

    ...

    Active Routes:

    If Metric Network Destination      Gateway

    11    13  ::/0                     On-link

     1    306 ::1/128                  On-link

    11   13 fc00:10:0:18::/64        On-link

    -----

    So, clients get On-Link route (to ip 0.0.0.0 with  mask 0.0.0.0 in terms of IPv4), and don't get route to 10:0:18::10

  • Dear DHCP team, please don't disappear.

  • Hi Argon

    If I get your query right, your requirement is to advertise Ipv6 Router from WS2008 machine, so that the ipv6 address obtained from Dhcp Server is routable.

    In that case, the ipv6 prefix needs to be advertised from the WS2008 machine. Please run below netsh commands and let us know, if it works :

    netsh int ipv6 set int Local adv=en

    add route <ipv6_prefix>/64  Local publish=yes

    Note : Replace <ipv6_prefix> with 64-bit prefix of Ipv6 router / ipv6 prefix configured on Dhcp Server

    Ravi

    DHCP team

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment