KAREN wiki

KIWI ADVANCED RESEARCH AND EDUCATION NETWORK

IPv6

From KAREN wiki

Jump to: navigation, search

Contents

About IPv6

KAREN runs IPv6 and has done since its launch in December 2006.

You can find out about IPv6 at http://www.ipv6.org/ and in great depth http://en.wikipedia.org/wiki/Ipv6.

REANNZ advocates KAREN members planning and implementing IPv6 capability.

For uncoming IPv6 training and events visit InternetNZ at http://www.ipv6.org.nz/news.html

Setting a static IPv6 address

Windows Vista

to come

Windows XP (SP2)

We've found a couple of ways to install and configure a static IPv6 address under Windows XP.

  1. Use this How to install and configure IP version 6 in Windows Server 2003 Enterprise Server knowledge base article.
  2. Follow the alternate four-part guide below on checking, installing, configuring and testing.

Check

First check to see if IPv6 is installed.

  • Execute ipv6 if from a DOS windows.
  • If it returns the message below, then IPv6 is not installed. If it returns a large amount of interface configuration information, IPv6 is installed and you can proceed to the Configure section.
Could not access IPv6 protocol stack - the stack is not installed.

Install

To install IPv6 on Windows XP SP2, execute the following commands as a administrator from the command line (DOS window):

  • ipv6 install
  • The output from this command is likely to be 1 of 2 possibilities:'
  1. The command returns OK. IPv6 has installed correctly, proceed to the Configure section.
  2. The command returns
Installing...
Failed to complete the action.
Error 0x800704b8

This problem relates to a windows internal security database that needs to be integrity checked and possibly repaired. ** If you're using a corporate machine that is built as part of a Windows Domain, then please check with your IS people before following these procedures, as they may alter or erase Group Policy settings that have been pushed to your machine via a Domain Controller.**

  • If you issue esentutl /g c:\windows\security\Database\secedit.sdb, this will check the security database for errors.

Check the output of that command, if it declares...

Checking database integrity.
The database is not up-to-date. This operation may find that this database is corrupt
because data from the log files has yet to be placed in the database.
  • ...then the database has errors which need to be corrected before IPv6 can be installed. The following command will rebuild the Local Security database on the machine.

** THIS IS POTENTIALLY DAMAGING TO YOUR DOMAIN SETTINGS **

  • Execute "esentutl /p c:\windows\security\Database\secedit.sdb" as an Administrator user.
  • You will likely get a warning box pop up which states...
You should only run Repair on damaged or corrupted databases
  • ...Hit "OK"
  • Once the command has run-trough, re-execute esentutl /g c:\windows\security\Database\secedit.sdb which should result in the following output
Integrity check successful.
Operation completed successfully in X.xxx seconds.
  • Now, you should be able to execute the ipv6 install command successfully.
  • Run ipv6 if to confirm (see above).


Configure

Once IPv6 is Installed and running, it's time to assign IPv6 Addresses, gateways and routes.

To configure an IPv6 address, determine which of the Interfaces shown by the command ipv6 if matches the name of your main network connection under "START--Control Panel--Network Connection", it should be called something like "Local Area Connection X" where X is a number.

  • As an example, ipv6 if on my machine shows
Interface 5: Ethernet: Local Area Connection
 Guid {3E4601A7-041B-4D5A-ACD3-B6D840BBEF39}
zones: link 5 site 2
uses Neighbor Discovery
uses Router Discovery
link-layer address: 00-16-cb-97-4a-4e
  preferred global 2404:138:4000:1::203, life infinite (manual)
  preferred link-local fe80::216:cbff:fe97:4a4e, life infinite
  multicast interface-local ff01::1, 1 refs, not reportable
  multicast link-local ff02::1, 1 refs, not reportable
  multicast link-local ff02::1:ff97:4a4e, 1 refs, last reporter
  multicast link-local ff02::1:ff00:203, 1 refs, last reporter
link MTU 1500 (true link MTU 1500)
current hop limit 128
reachable time 20000ms (base 30000ms)
retransmission interval 1000ms
DAD transmits 1
default site prefix length 48
  • To assign 2404:138:4000:1::203 to Local Area Connection 5, execute ipv6 adu 5/2404:138:4000:1::203
  • To define the default gateway for that interface, execute ipv6 rtu ::/0 5/2404:138:4000:1::2. This defines the default route (::/0) on interface 5 as being 2404:138:4000:1::2.
  • To check IPv6 routes execute netsh, then interface ipv6 and then show route.
It should show something like
Publish  Type       Met  Prefix                    Idx  Gateway/Interface Name
-------  --------  ----  ------------------------  ---  ---------------------
no       Manual       0  ::/0                        5  2404:138:4000:1::2
  • To get out of netsh, type bye


Finalise

Once you have configured IPv6 Gateway and routes, test you can ping:

  1. Your local loopback. Try ping6 ::1. This should return replies that look similar to a normal IPv4 ping response
  2. Your v6 Gateway. Try ping6 <IPv6 gateway address>. Again, we're looking for a normal ping response.

If you are having problems pinging gateways, then it may be with the Teredo Tunneling adapter that XP & Vista installs by default. This can be disabled using the netsh command

  • At a DOS prompt, execute netsh
  • Execute interface and then execute ipv6
  • Execute set teredo disable
  • Execute bye to exit from netsh
  • Finally, ensure you have a DNS server configured that can return Ipv6 or AAAA (Quad A) records.

Mac OS X

--donaldsclark 18:59, 18 June 2008 (NZST)
Configuring a static (manual) IPv6 address under Mac OS X (version 10.5.3 in this instance) should be an easy case of bringing up the Network Preferences window, choosing your preferred interface, clicking on 'Advanced' and then choosing the TCIP/IP pane. From this pane, there is an ability to have IPv6 off, automatically configure or manually configure.

We haven't tried automatic configuration yet [June 2008] as we don't have an IPv6 DHCP server setup at the office. However, we do support IPv6 - as does KAREN of course - and have an allocation of IPv6 addresses.

Unfortunately, we discovered what appears to be a bug in using the GUI to manually set a static IPv6 address configuration in OS X. Whilst you can fill out the fields in the GUI pan and they are remembered, the underlying network configuration does not appear to change.

A manual workaround has been successful.

  • Ignore the GUI - at least for setting a static address
  • From the terminal, setup your IPv6 details:
    • sudo ifconfig en0 inet6 2404:138:4000:x::xx/64
    • sudo route add -inet6 -prefixlen 0 default 2404:138:4000:x::x
    • (replace en0 with the relevant network interface you want to IPv6 enable and xx with the relevant address numbering for your machine and the default gateway)
  • From the terminal, check the details have been applied
    • ifconfig en0 | grep inet6
inet6 fe80::21f:5bff:fe84:5a2f%en0 prefixlen 64 scopeid 0x4
inet6 2404:138:4000:x::xx prefixlen 64

(note the fe80: address is the internal IPv6 address assigned by the OS. It is similar to a 10.x or 192.168.x address under IPv4)

    • netstat -r -f inet6
Internet6:
Destination        Gateway            Flags      Netif Expire
::                 2404:138:4000:x::x UGSc        en0
default            2404:138:4000:x::x UGSc        en0


Note: As this method does not use the GUI, you may find that as you switch back to other networks using the same interface you will have to reset or manually remove your default gateway.

Linux/Unix

The following instructions were developed using Ubuntu Server 7.10, and is very simple. You need to edit /etc/network/interfaces with an appropriate editor such as vi. The catch is that the following lines need to be added before the IPv4 configuration.

  iface eth(n) inet6 static
    address 2404:138:xxxx:xxxx::xxxx (static address of your host)
    netmask 64
    gateway 2404:138:xxxx:xxxx::xxxx (static address of the default router)

Once this has been saved restart the interface and use ping6 <address> to test connectivity to a remote subnet.

Automatic IPv6 address configuration - DHCP v6

Update 14 August


Unfortunately, neither Mac OS X, Windows XP, nor most default linux installs come with a DHCPv6 client (Vista may, but we've not checked). This means that any DNS, default routes and search paths have to be set manually.

This reflects the (to my knowledge) non-finalised protocols / standards around DHCPv6.

Mac OS X does come with the option of "automatically" configuring IPv6, but as far as we an tell, this either sets up an internal fe80: address, which will work alongside 6to4 tunnelling, but is not much use if you want to use IPv6 directly outside your current subnet. I've heard it may obtain a stateless IPv6 address via autoconfig from a correctly configured router. I understand Apple have quite a small networking / IP team and they have been swamped with iPhone activity recently.

Apple's focus on IPv6 appears questionable. A report from IETF-71:

"during the Q&A session at the plenary (after the IPv6 only event), Stuart Cheshire of Apple was venting at the mike about why they should have to support yet another protocol for address assignment and other configuration info (I thought that was what stateless autoconfig was for, or something along those lines). Someone mentioned RFC 5006 to him, and he said yes, that's most likely what they would support ..

There is a way to get a semi-functioning DHCPv6 client under OS X described here by an IETF delegate in March 2008 (great blog - lots of detail). It uses Python.

The Internet2 gurus tell me that one of the challenges is support for IPv6 'helpers' (for example http://www.blackviper.com/WinXP/Services/IPv6_Helper_Service.htm).

Some community DHCP IPv6 links follow:

  • Dibbler - Dibbler is a portable DHCPv6 implementation. It supports stateful (i.e. IPv6 address granting) as well as stateless (i.e. option granting) autoconfiguration for IPv6. Supports IPv6 and WinXP.
  • dhcpv6 project - DHCPv6 is a stateful address autoconfiguration protocol for IPv6, a counterpart to IPv6 stateless address autoconfiguration protocol.
  • ISC DHCP suite - version 4 onwards supports DHCPv6

As a matter of course, it is worth keeping a watch on the Internet2 IPv6 site and their mailing list.

Configuring the ISC DHCP server for DHCPv6

As of Ubuntu 11 (Natty) and Debian 6 (Squeeze), ISC DHCP version 4.1 is included. This is the first ISC version to have DHCPv6 support, although the accompanying scripts still only support IPv4.

This can be installed using the following command: "apt-get install isc-dhcp-server"

By default this is configured for IPv4, and needs a bit of modifying to get it to work with IPv6. I've set it up here to work with IPv6 instead of IPv4, but if leave the IPv4 lines in instead of deleting them, you'll end up with daemons running for both IPv4 and IPv6.

Firstly, open the file /​etc/init.d/isc-dhcp-server. You'll need to set the CONFIG_FILE to /​etc/dhcp/dhcpd6.conf (should be line 20), add the -6 flag to the test config lines (48 and 51), change the lease file to dhcpd6.leases (lines 80-83) and add the -6 flag to the startup line 87. The following diff will have the same effect:

20c20
< CONFIG_FILE=/​etc/dhcp/dhcpd.conf
---
> CONFIG_FILE=/​etc/dhcp/dhcpd6.conf
23,24c23,24
< if [ -f /​etc/ltsp/dhcpd.conf ]; then
<        CONFIG_FILE=/​etc/ltsp/dhcpd.conf
---
> if [ -f /​etc/ltsp/dhcpd6.conf ]; then
>        CONFIG_FILE=/​etc/ltsp/dhcpd6.conf
48c48
< 	if ! /usr/sbin/dhcpd -t -q -cf $CONFIG_FILE > /dev/null 2>&1; then
---
> 	if ! /usr/sbin/dhcpd -t -q -6 -cf $CONFIG_FILE > /dev/null 2>&1; then
51c51
< 		/usr/sbin/dhcpd -t -cf $CONFIG_FILE
---
> 		/usr/sbin/dhcpd -t -6 -cf $CONFIG_FILE
80,83c80,83
< 		[ -e /var/lib/dhcp/dhcpd.leases ] || touch /var/lib/dhcp/dhcpd.leases
< 		chown dhcpd:dhcpd /var/lib/dhcp /var/lib/dhcp/dhcpd.leases
< 		if [ -e /var/lib/dhcp/dhcpd.leases~ ]; then
< 		    chown dhcpd:dhcpd /var/lib/dhcp/dhcpd.leases~
---
> 		[ -e /var/lib/dhcp/dhcpd6.leases ] || touch /var/lib/dhcp/dhcpd6.leases
> 		chown dhcpd:dhcpd /var/lib/dhcp /var/lib/dhcp/dhcpd6.leases
> 		if [ -e /var/lib/dhcp/dhcpd6.leases~ ]; then
> 		    chown dhcpd:dhcpd /var/lib/dhcp/dhcpd6.leases~
87c87
< 			--exec /usr/sbin/dhcpd -- -q -pf $DHCPDPID -cf $CONFIG_FILE $INTERFACES
---
> 			--exec /usr/sbin/dhcpd -- -q -6 -pf $DHCPDPID -cf $CONFIG_FILE $INTERFACES

You'll need a dhcpd6.conf file too, here's an example one (make sure you use your own IPv6 prefix)

default-lease-time 600;
max-lease-time 7200;
option dhcp6.rapid-commit;
subnet6 2404:138:4000:2::/64 {
	range6 2404:138:4000:2::100 2404:138:4000:2::200;
	option dhcp6.name-servers 2404:138:104:20::36;
	option dhcp6.domain-search "karen.ac.nz";
}

If you restart your dhcpd server now (/​etc/init.d/isc-dhcp-server restart) you'll probably get some errors under Ubuntu Server. This is thanks to Apparmor, which means you'll need to update the file /​etc/apparmor.d/usr.sbin.dhcpd to allow access to your config and lease files. Add the following lines:

  @{PROC}/[0-9]*/net/if_inet6 r,
  /var/lib/dhcp/dhcpd6.leases* lrw,
  /​etc/dhcpd6.leases* lrw,
  

Or just apply the following diff

19a20
>   @{PROC}/[0-9]*/net/if_inet6 r,
31a33
>   /var/lib/dhcp/dhcpd6.leases* lrw,
42a45
>   /​etc/dhcpd6.leases* lrw,

Sam.russell 15:16, 25 May 2011 (NZST)

Configuring the ISC DHCP client for DHCPv6

Ubuntu 11.10 and later

Ubuntu 11.10 supports DHCPv6 right out of the box

Other Linux

This is slightly harder, because the script for applying the DHCP leases has no DHCPv6 support. I've updated it to add and remove addresses with the following code which needs to be inserted under the block (case "$reason" in) in the file /sbin/dhclient-script

    BOUND6|RENEW6|EXPIRE6)
        if [ -n "$old_ip6_address" ]; then
            ifconfig $interface del $old_ip6_address/$old_ip6_prefixlen
        fi
        if [ -n "$new_ip6_address" ]; then
            ifconfig $interface add $new_ip6_address/$new_ip6_prefixlen
        fi
        ;;

Note that this will add addresses fine, but won't remove addresses for some reason. Disabling Apparmor sometimes works, but for the time being it looks like it'll just leave your old expired addresses attached to the interface.

To make this work, you need to clear your /​etc/dhcp/dhclient.conf file, as the options in it are for IPv4. Once this is done, start the client with "dhclient -6" or just call ifup and it should all be working.

Sam.russell 15:16, 25 May 2011 (NZST)

DHCPv6 for Windows XP

While capable of being upgraded for IPv6, Windows XP does not support DHCPv6 although it can use stateless auto-configuration if you allow it in your router advertisement messages. The only way to make stateful auto-configuration work on Windows XP is by using a third party product, such as Dibbler.

Sam.russell 19:37, 5 June 2011 (NZST)

DNS for IPv6

Anycast configuration for DNS forwarders

Contact:

  • Glen Turner
  • email: gdt_AT_gdt.id.au

I wrote up anycast DNS for a Linux user group meeting - configuration files and detailed instructions are included. Detailed Anycast DNS guide Kim Hawtin of the University of Adelaide and I did the work independently, and combined to produce the write-up. Kim gave a more extensive explanation at linux.conf.au.

The notes are only for IPv4, but the extension to IPv6 is simple. We're running our anycast DNS forwarders for both IPv4 and IPv6. If you are thinking of deploying a anycast DNS forwarder I can update the notes for IPv6.

Relevant presentations and material are at my web site

You might find these interesting:

  • 2008-07-08 Which describes the sophisticated BGP design used by AARNet3 and how sites can exploit that
  • 2008-05-29 Site eduroam configuration
  • 2008-01-29 TCP performance on long-haul links. In particular performance features.
  • 2007-12-10 Briefing for AARNet staff on IPv6 deployment.