Installing and Configuring an IPv6 Router via an IPv4 Tunnel

From The Wiki Guide

Jump to: navigation, search

Contents

Abstract

IPv6 is intended to provide more addresses for networked devices, allowing, for example, each cell phone and mobile electronic device to have its own address. IPv4 supports 4.3×109 (4.3 billion) addresses, which is inadequate for giving even one address to every living person, much less support the burgeoning market for connective devices. IPv6 supports 3.4×1038 addresses, or 5×1028(50 octillion) for each of the roughly 6.5 billion people alive today.

Invented by Steve Deering and Craig Mudge at Xerox PARC, IPv6 was adopted by the Internet Engineering Task Force in 1994, when it was called "IP Next Generation" (IPng). (Incidentally, IPv5 was not a successor to IPv4, but an experimental flow-oriented streaming protocol intended to support video and audio.)

Since ISPs do not provide IPv6 natively, tunneling is our only resort to allow us to connect to the IPv6 world. In this guide we will be configuring our tunnel using the Gentoo Linux Distribution.


Requirements

Account from an IPv6 Tunnel Broker
Linux with 2.6 Kernel (Gentoo, Fedora, Debian)
iptables
radvd

Installation

In this guide we will be using as our tunnel broker: BT Exact

Hurricane Electric also operates its own free IPv6 tunnel broker service

Linux

Make sure to have IPv6 support in your kernel or have it compiled as a module. Add "-X -doc -gtk ssl ipv6 extensions" to the USE flags in /etc/make.conf.


iptables

emerge -av iptables


radvd

emerge -av radvd

Configuration

Linux

nano /root/tunnel.sh

#!/bin/sh
if ! [ -f /proc/net/if_inet6 ]
then echo "IPv6 is not installed!" 1>&2; exit 1; fi
ifconfig sit0 up \
&& ifconfig sit0 inet6 tunnel ::213.121.24.85 \
&& ifconfig sit1 inet6 add 2001:618:400::4323:5931/128 \
&& route -A inet6 add ::/0 gw fe80::d579:1855 dev sit1 \
&& route -A inet6 add 2000::/3 gw fe80::d579:1855 dev sit1 \
&& ifconfig eth1 up \
&& ifconfig eth1 inet6 add 2001:618:400:140a::/64 \
&& echo 1 > /proc/sys/net/ipv6/conf/all/forwarding \
&& /etc/init.d/radvd start \
&& echo "IPv6 configuration completed" || \
 { echo "IPv6 configuration failed!" 1>&2; exit 1; }

chmod +x /root/tunnel.sh

or

nano /root/sixxs.sh (for sixxs tunnel)

#!/bin/sh
ifconfig sit0 up
ifconfig sit0 tunnel ::216.10.93.2
ifconfig sit1 up
#::2 endpoint
ifconfig sit1 add 2001:4830:1300:36::2/64
#::1 pop provider
route -A inet6 add 2000::/3 gw 2001:4830:1300:36::1 dev sit1

iptables

ravd

nano -w /etc/radvd.conf

interface eth0
 {
  AdvSendAdvert on;
   prefix 2001:618:400:140a::/64
   {
    AdvOnLink on;
    AdvAutonomous on;
   };
 };


Final Steps

Start the tunnel

/root/tunnel.sh

Test your tunnel. This is the result you should receive.

ping6 www.kame.net
PING www.kame.net(orange.kame.net) 56 data bytes
64 bytes from orange.kame.net: icmp_seq=1 ttl=52 time=290 ms
64 bytes from orange.kame.net: icmp_seq=2 ttl=52 time=277 ms
64 bytes from orange.kame.net: icmp_seq=3 ttl=52 time=280 ms
64 bytes from orange.kame.net: icmp_seq=4 ttl=52 time=279 ms
64 bytes from orange.kame.net: icmp_seq=5 ttl=52 time=277 ms
--- www.kame.net ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4038ms rtt min/avg/max/mdev = 277.040/281.041/290.046/4.699 ms
Personal tools