MRDBS

Dummy Information Store

24 Aug

Setting Up a 6to4 Tunnel In Debian


As I was wondering about and because my current host (www.slicehost.com) 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: http://en.wikipedia.org/wiki/6to4)

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=173.45.232.146
$ printf "2002:%02x%02x:%02x%02x::1\n" $(echo $MYIP | sed -e "s%\.% %g")
2002:ad2d:e892::1

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

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

::192.88.99.1  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 www6.ulak.net.tr
PING www6.ulak.net.tr(2001:a98:10::36) 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
 
--- www6.ulak.net.tr 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

References:


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

  2. ipv6 code

Post a Comment