Debian ["IPv6"] Project

The purpose of the project is to provide a central place to find out about IP version 6 in Debian. All computers that talk on the Internet use a communications protocol called IP (Internet Protocol) and they all use version 4 of this protocol.

["IPv6"] is the new version (there was no 5 really) and is easy to setup in Debian.

There is a [http://people.debian.org/~csmall/ipv6/ Debian IPv6 page] available, which is run by ["CSmall"]

Native IPv6

If you already have native connectivity, Debian should pick it up automatically from router advertisments, and generate addresses for you. You can also use the "static" method in /etc/network/interfaces to set up addresses manually. PPP users may have to add +ipv6 to /etc/ppp/options, as not all PPP RAS servers advertise IPv6 support, even if they will negotiate it upon request.

If you have both native IPv6 and IPv4 (a dual-stacked host), you may still want to use 6to4 addresses as well as your native addresses; IPv6 specifies address selection rules that ensure that native hosts will use your native IPv6 connectivity, but 6to4 hosts will use your 6to4 connectivity (removing public relay routers, and reducing the number of points of failure in your setup).

IPv6 6to4 Configuration

You may not know this, but you already have IPv6 addresses. There is a feature called 6 to 4 which means any IPv4 address can be translated not only into one IPv6 address but many. For details, see http://people.debian.org/~csmall/ipv6/setup624.html

To configure 6to4, you need to calculate an IPv6 address, based on your existing IPv4 address. You can do so using the shell. In this example the IPv4 address is 192.0.2.3, you'll replace that with your actual public internet address.

$ printf "2002:%02x%02x:%02x%02x::1\n" 192 0 2 3
2002:c000:0203::1

Now edit /etc/network/interfaces, and add a stanza like this:

auto sit0
iface sit0 inet6 static
        address 2002:c000:0203::1
        netmask 16
        gateway ::192.88.99.1

The 192.88.99.1 address is a special anycast address that points to the nearest 6to4 router. Assuming that your nearest 6to4 router work, all you should need to do is ifup sit0 and enjoy your new IPv6 connectivity!

Experienced IPv6 users will wonder why the netmask for sit0 is /16, not /64; by setting the netmask to /16, you instruct your system to send packets directly to the IPv4 address of other 6to4 users; if it was /64, you'd send packets via the nearest relay router, increasing latency.

Setting up a 6to4 relay router using Debian

If you have a dual-stacked host (one with both IPv4 and IPv6 native connectivity), you may wish to offer a relay router for the rest of your network. There are two ways to do this; one is to have the relay on a normal address, which you share with your clients. The other is to add 192.88.99.1/24 to your IPv4 addresses and routing, so that clients that use 6to4 will pick up your relay router automatically. A relay router also helps with connectivity for IPv6-only hosts on your network; rather than relying on a public 6to4 relay router, your router can encapsulate IPv6 into IPv4 for your hosts.

A relay router should already be configured to forward IPv6 packets natively for its clients; you then add a sit0 interface without a gateway for the 6to4 relay. In /etc/network/interfaces, this looks like:

auto sit0
iface sit0 inet6 static
        address 2002:c000:0203::1
        netmask 16

Note that this is almost identical to a plain 6to4 setup; the only difference is that as you already have native connectivity, you do not need to use a relay router to act as your gateway.

IPv6 Tunnel Configuration

An IPv6 tunnel can be configured using /etc/network/interfaces on Debian (woody, sid and up):

Add to /etc/modules:

ipv6

Which will load the IPv6 module when it is not present on your system yet (or do a modprobe ipv6 for a similar effect). This is not needed with current versions of Debian, which should autoload ipv6.

Add to /etc/network/interfaces:

auto 6in4
iface 6in4 inet6 v4tunnel
  address [Your IPv6 Endpoint]
  netmask [Prefix Length]
  endpoint [PoP IPv4 Endpoint]
  ttl 64
  up ip link set mtu 1280 dev 6in4
  up ip route add default via [PoP IPv6 Endpoint] dev 6in4

Now you can use ifup(8) and ifdown(8) to control your tunnel. What's even better about it, is that the tunnel is set up at boot time, because in /etc/init.d/networking, "ifup -a" is called, which brings up all interfaces from /etc/network/interfaces configured with the "auto" option. More info about configuring IPv6 in Debian is at: [http://people.debian.org/~csmall/ipv6/setup.html Setup]. Note that on Linux <2.4.20 one needs to use 2000::/3, the reason for this is explained in the [http://marc.theaimsgroup.com/?l=linux-net&m=104067759607753&w=2 linux-net archives].

Automated Tunnel Configuration

Try the 'aiccu', for [http://www.sixxs.net SixXS] or 'tspc', for [http://www.hexago.com Hexago] package to automate most of the tunnel configuration.