Dummy Information Store

24 Aug

Setting Up a 6to4 Tunnel In Debian

As I was wondering about and because my current host ( doesn’t have native support, I decided to try out a on my box.

Basically, a is a system that allows packets transmitted over network ( Internet). (see:

First, we need to create a tunnel device. You need to install iproute package if you haven’t already

$ sudo aptitude install iproute

Create a tunnel device

$ sudo ip tunnel add tun6to4 mode sit remote any

Calculate your address reserved to your address. Yes, if you have a public address you already have a address reserved for you.

$ export MYIP=
$ printf "2002:%02x%02x:%02x%02x::1\n" $(echo $MYIP | sed -e "s%\.% %g")

Edit your /etc/network/interfaces file and add your device

auto tun6to4
iface tun6to4 inet6 v4tunnel
        address 2002:ad2d:e892::1
        netmask 16
        gateway ::
        endpoint any
        local #fits address

::  is a special anycast address that points to the nearest router. And assuming that router is working, get your new device up

$ sudo ifconfig tun6to4 up

You may now enjoy your connectivity. For example:

$ ping6 -c 4
PING 56 data bytes
64 bytes from 2001:a98:10::36: icmp_seq=1 ttl=51 time=228 ms
64 bytes from 2001:a98:10::36: icmp_seq=2 ttl=51 time=224 ms
64 bytes from 2001:a98:10::36: icmp_seq=3 ttl=51 time=224 ms
64 bytes from 2001:a98:10::36: icmp_seq=4 ttl=51 time=224 ms
--- ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 224.013/225.013/228.013/1.732 ms


Filed under: linux Tags: , , , ,
  1. 1 Trackback(s)

  2. ipv6 code

Post a Comment