Whole document tree
    

Whole document tree

Setup of 6to4 tunnels

8.4. Setup of 6to4 tunnels

Pay attention that the support of 6to4 tunnels currently lacks on vanilla kernel series 2.2.x (see systemcheck/kernel for more information). Also note that that the prefix length for a 6to4 address is 16 because of from network point of view, all other 6to4 enabled hosts are on the same layer 2.

8.4.1. Add a 6to4 tunnel

First, you have to calculate your 6to4 prefix using your local assigned global routable IPv4 address (if your host has no global routable IPv4 address, in special cases NAT on border gateways is possible):

Assuming your IPv4 address is

1.2.3.4
   

the generated 6to4 prefix will be

2002:0102:0304::
   

Local 6to4 gateways should always assigned the manual suffix "::1", therefore your local 6to4 address will be

2002:0102:0304::1
   

Use e.g. following for automatic generation:

ipv4="1.2.3.4"; printf "2002:%02x%02x:%02x%02x::1" `echo $ipv4 | tr "." " "`
   

There are two ways possible to setup 6to4 tunneling now.

8.4.1.1. Using "ip" and a dedicated tunnel device

This is now the recommended way.

Create a new tunnel device

# /sbin/ip tunnel add tun6to4 mode sit remote any local <localipv4address> 
    

Bring interface up

# /sbin/ip link set dev tun6to4 up 
    

Add local 6to4 address to interface

# /sbin/ip -6 addr add <local6to4address>/16 dev tun6to4 
    

Add (default) route to the global IPv6 network using the all-6to4-routers IPv4 anycast address

# /sbin/ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6to4 metric 1