You are using IPv4 to view this page.

HowTos

Testing IPv6

Linux

Use ifconfig to see if you already have an IPv6 address. The output will look something like this

eth0      Link encap:Ethernet  HWaddr 00:12:34:5A:BC:DE
          inet addr:65.110.240.55  Bcast:65.110.241.255  Mask:255.255.254.0
          inet6 addr: 2002:416e:f037::1/39 Scope:Global
          inet6 addr: fe80::0212:34ff:fe5a:bcde/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

If you have an address, your computer has autoconfigured itself for IPv6. Sometimes this is incorrect: if the address starts with 2002: and does not start with 2002:2667:3f3c, delete the address with ifconfig eth0 del address and set up your own tunnel.

Setting up an IPv6 tunnel

Get the ip command if it is not already installed (debian iproute package). Make sure it supports IPv6: running ip with no arguments should contain inet6 in the list of supported families. Then run:

ip tunnel add tun6 remote any local 38.103.63.60 mode sit

This adds a new interface tun6 that tunnels IPv6 inside IPv4 packets (as protocol 41, so adjust your firewall)

ip link set tun6 up
ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6 metric 10

Brings the interface up and adds a default route through the official IPv6 gateway address (192.88.99.1). If this command fails because of "RTNETLINK answers: No route to host", run ip -6 route add ::/96 dev tun6 first.

ip address add 2002:2667:3f3c::1/16 dev tun6
ip address add 2002:2667:3f3c:1::1/64 dev eth0

Gives this interface an IPv6 address of 2002:2667:3f3c::1, and eth0 the IPv6 address 2002:2667:3f3c:1::1. You should be able to use ping6 to ping these addresses, along with the loopback ::1. If this works, try ping6 daniel.6dns.org to ping this computer. You may also want to make sure the gateway is correct by trying ping6 www.kame.net, which has a 2001: address. Some older versions of linux need to have 2000::/3 instead of ::/0, try changing that if you can ping 2002: addresses but not 2001:.

Adding the tunnel to your /etc/network/interfaces

iface tun6 inet6 v4tunnel
address 2002:2667:3f3c::1
netmask 16
local 38.103.63.60
endpoint any
up /sbin/ip -6 route add ::/0 via ::192.88.99.1 dev tun6 metric 10

Generating IPv6 subnets from IPv4 Addresses

There are several utilities to convert IPv4 to IPv6 if you don't want to do it by hand. This is from ipv6tools.com:

If your IPv4 address changes often, you probably don't want to rewrite any scripts you have. Instead, just have the script get your IPv4 address and turn it into an IPv6 address. Example: ifconfig tun6 add `curl -s checkip.dyndns.org | perl -e '<> =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/; printf "2002:%x%02x:%x%02x::1/64",$1,$2,$3,$4'`

IPv6 Reverse DNS

If you use a tunnel broker, then they will usually ask what you want your reverse DNS to be. When you use 6to4 address (starting with 2002:), sign up using 6to4.nro.net (it's still in testing but works very well). You need to be able to connect on IPv6 using HTTPS and have two nameservers. FreeDNS.afraid.org will work as a secondary or as a master nameserver. (ns-1.afraid.org, ns-2.afraid.org, up to ns-4)

IPv6 Forwarding/Routing

Having a linux computer act as an IPv6 router is useful; for Debian, all I had to do was install the radvd package and edit radvd.conf:

interface eth1 {
    AdvSendAdvert on;
    prefix 0:0:0:1::/64 { 
        Base6to4Interface eth0;
    };
};

The prefix 0:0:0: will be changed to reflect the IPv4 address of eth0, and will forward traffic from eth1. Replace it with the correct prefix and remove the Base6to4Interface line if this is not the desired behavior.

With this setup, eth1 should have the IP 2002:2667:3f3c:1::1/64, and eth0 does not need an IPv6 address. If you decide to give eth0 an IP, give it one from a different subnet (like 2002:2667:3f3c:2::1/64).

Netmask

You might have noticed that my example output has a netmask of /39. This is because the network I am part of has the IPv4 netmask of 255.255.254.0, which is a 23-bit IPv4 mask. Add 16 bits for the 2002 to get 39. Changing the netmask lets you send IPv6 packets to others on the same network without being encapsulated in IPv4 packets (as if the network were IPv6 only).

Windows XP

Direct 6to4 (must have public IP)

Just run netsh interface ipv6 install and you should be able to access ipv6 websites.

As a client

This sets up Windows XP to use IPv6 with another computer acting as a router.

Run netsh from the Run dialog and type

interface ipv6
install
add route prefix=::/0 interface=Interface name metric=10 nexthop=Address of IPv6 router
add address interface=Interface name address=2002:2667:3f3c:1::1

Forcing use of IPv6

Many applications that are designed for IPv6 may default to using IPv4 unless steps are taken to force IPv6 use. This may be to prevent errors from having an OS that supports IPv6 but is not set up to connect to other IPv6 hosts. To force use of IPv6 on a site you visit (ex. www.kame.net), use host -a www.kame.net and put the IPv6 address in brackets. On Windows, run nslookup and type set type=AAAA, then www.kame.net.

Other applications need a line in a config file to enable IPv6. IPv6 applications I use, and how to configure them:

IPv6 DNS

Many applications support IPv6 addresses and domain names, but prefer IPv4 access if possible. The only way to force them to use IPv6 is to go to a domain that does not have an IPv4 address associated with it (like d6.6dns.org) or to use the address in brackets. This behavior was probably implemented because hosts with IPv6 addresses may not have connection to the IPv6 Internet and so trying to access IPv6-enabled sites on those computers would cause annoying delays.

Last modified Wed May 16 13:39:16 2007. ©2005-2007 Daniel De Graaf