Copyright © 2004 by Daniël de Kok
$Id: ipv6.xml,v 1.2 2004/01/13 11:25:56 danieldk Exp $
IP version 6 is the next generation internet protocol, which is
regarded to be the successort of IP version 4. IPv6 provides a
larger address space, simplified headers and better security
through ipsec integration. This article provides a general introduction
to using IPv6 with Slackware Linux.
IPv6 is the next generation internet protocol. One of the advantages is
that it has a much larger address space. In IPv4 (the internet protocol
that is commonly used today) addresses are 32-bit, this address space
is almost completely used right now, and there is a lack of IPv4 addresses.
IPv6 uses 128-bit addresses, which provides an unimaginable huge address
space (2^128 addresses). IPv6 uses another address notation, first of
all hex numbers are used instead of decimal numbers, and the address is
noted in pairs of 16-bits, separated by a colon (":").
Let's have a look at an example address:
fec0:ffff:a300:2312:0:0:0:1
A block of zeroes can be replaced by two colons ("::"). Thus,
thee address above can be written as:
fec0:ffff:a300:2312::1
Each IPv6 address has a prefix. Normally this consists of two elements:
32 bits identifying the address space the provider provides you, and a
16-bit number that specifies the network. These two elements form the
prefix, and in this case the prefixlength is 32 + 16 = 48 bits. Thus,
if you have a /48 prefix you can make 2^16 subnets and have 2^80 hosts
on each subnet. The image below shows the structure of an IPv6 address
with a 48-bit prefix.
There are a some specially reserved prefixes, most notable include:
Table 1. Important IPv6 Prefixes
| Prefix | Description |
|---|
| fe80:: | Link local addresses, which are not routed. |
| fec0:: | Site local addresses, which are locally routed, but not on or to the internet. |
| 2002:: | 6to4 addresses, which are used for the transition from IPv4 to IPv6. |
The Linux kernel binaries included in Slackware Linux do not support IPv6
by default, but support is included as a kernel module. This module can be
loaded using modprobe:
# modprobe ipv6
You can verify if IPv6 support is loaded correctly by looking at the
kernel output using the dmesg:
$ dmesg
[..]
IPv6 v0.8 for NET4.0
IPv6 support can be enabled permanently by adding the following line to
/etc/rc.d/rc.modules:
/sbin/modprobe ipv6
Interfaces can be configured using ifconfig. But it
is recommended to make IPv6 settings using the ip
command, which is part of the "iputils" package that can
be found in the extra/ directory of the Slackware
tree.
If there are any router advertisers on a network there is a chance
that the interfaces on that network already received an IPv6 address
when the IPv6 kernel support was loaded. If this is not the case
an IPv6 address can be added to an interface using the ip
utility. Suppose we want to add the address "fec0:0:0:bebe::1"
with a prefix length of 64 (meaning "fec0:0:0:bebe" is the
prefix). This can be done with the following command syntax:
# ip -6 addr add <ip6addr>/<prefixlen> dev <device>
For example:
# ip -6 addr add fec0:0:0:bebe::1/64 dev eth0
The /etc/hosts provides a simple way to make names
resolve on smaller networks. The /etc/hosts file
specifies an IPv6 and which hostnames should resolve to that IP address.
You can add IPv6 addresses to the hosts file, just
like you would add IPv4 addresses. This is an example of a
/etc/hosts file with IPv4 and IPv6 entries:
# IPv4 entries
127.0.0.1 localhost
192.168.1.1 tazzy.slackfans.org tazzy
192.168.1.2 gideon.slackfans.org
# IPv6 entries
::1 localhost
fec0:0:0:bebe::2 flux.slackfans.org
Please note that "::1" is the default IPv6 loopback.