IPv6, successore di IPv4, è una nuova versione del protocollo IP progettata per correggere i suoi difetti, in particolare la scarsità di indirizzi IP disponibili. Questo protocollo gestisce il livello di rete, il suo scopo è di fornire indirizzi alle macchine, di trasmettere dati verso la destinazione finale e di gestire la frammentazione dei dati se necessario (in altre parole, di dividere i pacchetti in blocchi con una dimensione che dipende dai collegamenti di rete da utilizzare sul percorso e di ricomporre i pezzi nel loro giusto ordine all'arrivo).
Debian kernels include IPv6 handling in the core kernel (with the exception of some architectures that have it compiled as a module named ipv6
). Basic tools such as ping
and traceroute
have their IPv6 equivalents in ping6
and traceroute6
, available respectively in the iputils-ping and iputils-tracepath packages.
La rete IPv6 è configurata in modo simile a IPv4, in /etc/network/interfaces
. Se si vuole rendere questa rete accessibile a livello globale, è necessario assicurarsi di avere un router che supporti il traffico dati IPv6 verso la rete globale IPv6.
Esempio 10.10. Esempio di configurazione IPv6
iface eth0 inet6 static
address 2001:db8:1234:5::1:1
netmask 64
# Disabling auto-configuration
# autoconf 0
# The router is auto-configured and has no fixed address
# (accept_ra 1). If it had:
# gateway 2001:db8:1234:5::1
IPv6 subnets usually have a netmask of 64 bits. This means that 2
64 distinct addresses exist within the subnet. This allows Stateless Address Autoconfiguration (
SLAAC) to pick an address based on the network interface's MAC address. By default, if
SLAAC is activated in your network and IPv6 on your computer, the kernel will automatically find IPv6 routers and configure the network interfaces.
This behavior may have privacy implications. If you switch networks frequently, e.g. with a laptop, you might not want your
MAC address being a part of your public IPv6 address. This makes it easy to identify the same device across networks. A solution to this are IPv6 privacy extensions (which Debian enables by default if IPv6 connectivity is detected during initial installation), which will assign an additional randomly generated address to the interface, periodically change them and prefer them for outgoing connections. Incoming connections can still use the address generated by SLAAC. The following example, for use in
/etc/network/interfaces
, activates these privacy extensions.
Esempio 10.11. IPv6 privacy extensions
iface eth0 inet6 auto
# Prefer the randomly assigned addresses for outgoing connections.
privext 2
IPv6 connections can be restricted, in the same fashion as for IPv4: the standard Debian kernels include an adaptation of netfilter for IPv6. This IPv6-enabled netfilter is configured in a similar fashion to its IPv4 counterpart, except the program to use is ip6tables
instead of iptables
.
If a native IPv6 connection is not available, the fallback method is to use a tunnel over IPv4. Gogo6 is one (free) provider of such tunnels:
To use a Freenet6 tunnel, you need to register for a Freenet6 Pro account on the website, then install the gogoc package and configure the tunnel. This requires editing the /etc/gogoc/gogoc.conf
file: userid
and password
lines received by e-mail should be added, and server
should be replaced with authenticated.freenet6.net
.
IPv6 connectivity is proposed to all machines on a local network by adding the three following directives to the /etc/gogoc/gogoc.conf
file (assuming the local network is connected to the eth0 interface):
host_type=router
prefixlen=56
if_prefix=eth0
The machine then becomes the access router for a subnet with a 56-bit prefix. Once the tunnel is aware of this change, the local network must be told about it; this implies installing the radvd
daemon (from the similarly-named package). This IPv6 configuration daemon has a role similar to dhcpd
in the IPv4 world.
Il file di configurazione /etc/radvd.conf
deve essere creato (vedere /usr/share/doc/radvd/examples/simple-radvd.conf
come punto di partenza). Nel nostro caso, l'unico cambiamento richiesto è il prefisso, che deve essere sostituito con quello fornito da Freenet6 e può essere trovato in output al comando ifconfig
, nel blocco relativo all'interfaccia tun
.
Then run service gogoc restart
and service radvd start
, and the IPv6 network should work.