Skip to main content

Setting DNS and Default Gateway Settings for IPv6 with DHCPv6

This is a posting in response to my posting last October about how to set up DHCP on Windows Server 2008 to deliver IPv6 addresses. The question was how to publish the DNS and Default Gateway addresses to your IPv6 clients.  I’m sorry to say that the Microsoft implementation of DHCPv6 does not have these options.  So, here is an alternative…Create a login script.

After reading through the manual method posted at TechNet, I found two examples.  One to set the Default Gateway and one to set the DNS addresses.  Below is the relevant sections of that TechNet article with the examples in red.
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 withAddress_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

Comments

carlk4574 said…
Was the ability to configure DNS servers in DHCPv6 just missing from the first release of Server 2008? DHCPv6 on my 2K8R2 server has the option - and is currently configured to - distribute DNS servers to clients.

I do find it incredibly frustrating, though, that both stateful and stateless configuration methods seem incomplete on their own: stateless will get you an IP and default router but no DNS, and stateful with DHCPv6 will get you an IP and DNS but no default router. Run them both together and you'll end up with a messy IP configuration.
Anonymous said…
Please check this page.

http://egementanirer.blogspot.com/2012/08/configuring-windows-server-
2008r2-as.html
Anonymous said…
i am using win2008server R2, setup dhcp6 server, can release ipv6 to client, and also dns6 to client as well
i m using google dns6 2001:4860:4860::8888 and ::8844
however if i using auto for client get ip itself from server, i not able to browse ipv6 websites

client not able to get default gateway from win2008server.

if i manual add route ::/0 (ipv6 gateway address) at client, then it work, can surf Internet ipv6 website

pls help, anyone know what is the problem, why win2008 server not able to release the default gateway to client?

Popular posts from this blog

Adding a Comment to a GPO with PowerShell

As I'm writing this article, I'm also writing a customization for a PowerShell course I'm teaching next week in Phoenix.  This customization deals with Group Policy and PowerShell.  For those of you who attend my classes may already know this, but I sit their and try to ask the questions to myself that others may ask as I present the material.  I finished up my customization a few hours ago and then I realized that I did not add in how to put a comment on a GPO.  This is a feature that many Group Policy Administrators may not be aware of. This past summer I attended a presentation at TechEd on Group Policy.  One organization in the crowd had over 5,000 Group Policies.  In an environment like that, the comment section can be priceless.  I always like to write in the comment section why I created the policy so I know its purpose next week after I've completed 50 other tasks and can't remember what I did 5 minutes ago. In the Group Policy module for PowerShell V3, th

Return duplicate values from a collection with PowerShell

If you have a collection of objects and you want to remove any duplicate items, it is fairly simple. # Create a collection with duplicate values $Set1 = 1 , 1 , 2 , 2 , 3 , 4 , 5 , 6 , 7 , 1 , 2   # Remove the duplicate values. $Set1 | Select-Object -Unique 1 2 3 4 5 6 7 What if you want only the duplicate values and nothing else? # Create a collection with duplicate values $Set1 = 1 , 1 , 2 , 2 , 3 , 4 , 5 , 6 , 7 , 1 , 2   #Create a second collection with duplicate values removed. $Set2 = $Set1 | Select-Object -Unique   # Return only the duplicate values. ( Compare-Object -ReferenceObject $Set2 -DifferenceObject $Set1 ) . InputObject | Select-Object – Unique 1 2 This works with objects as well as numbers.  The first command creates a collection with 2 duplicates of both 1 and 2.   The second command creates another collection with the duplicates filtered out.  The Compare-Object cmdlet will first find items that are diffe

How to list all the AD LDS instances on a server

AD LDS allows you to provide directory services to applications that are free of the confines of Active Directory.  To list all the AD LDS instances on a server, follow this procedure: Log into the server in question Open a command prompt. Type dsdbutil and press Enter Type List Instances and press Enter . You will receive a list of the instance name, both the LDAP and SSL port numbers, the location of the database, and its status.