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

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.

How to run GPResult on a remote client with PowerShell

In the past, to run the GPResult command, you would need to either physically visit this client, have the user do it, or use and RDP connection.  In all cases, this will disrupt the user.  First, you need PowerShell remoting enabled on the target machine.  You can do this via Group Policy . Open PowerShell and type this command. Invoke-Command –ScriptBlock {GPResult /r} –ComputerName <ComputerName> Replace <ComputerName> with the name of the target.  Remember, the target needs to be online and accessible to you.

Error icon when creating a GPO Preference drive map

You may not have an error at all.  Take a look at the drive mapping below. The red triangle is what threw us off.  It is not an error.  It is simply a color representation of the Replace option of the Action field in the properties of the drive mappings. Create action This give you a green triangle. The Create action creates a new mapped drive for users. Replace Action The Replace action gives you a red triangle.  This action will delete and recreate mapped drives for users. The net result of the Replace action is to overwrite all existing settings associated with the mapped drive. If the drive mapping does not exist, then the Replace action creates a new drive mapping. Update Action The Update action will have a yellow triangle. Update will modify settings of an existing mapped drive for users. This action differs from Replace in that it only updates settings defined within the preference item. All other settings remain as configured on the ma...