Advanced Windows PowerShell Scripting Video Training

Advanced Windows PowerShell Scripting Video Training
Advanced Windows PowerShell Scripting Video Training

Tuesday, June 21, 2011

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

3 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?