Difference between revisions of "IPv6 tunnel broker setup"

From ArchWiki
Jump to: navigation, search
(automatic style fixes)
Line 1: Line 1:
[[Category:Networking (English)]]
{{i18n|IPv6 - Tunnel Broker Setup}}
{{i18n|IPv6 - Tunnel Broker Setup}}

Revision as of 17:37, 23 April 2012

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Hurricane Electric offers a free tunnel broker service that is relatively painless to use under Arch if you wish to add IPv6 connectivity to an IPv4-only host.

These instructions work for SixXS tunnels as well.

Registering for a tunnel

It is not that hard to do. Feel free to fill in the directions here if something seems tricky, but otherwise just go the tunnel broker site and complete the registration.

Tunnel rc.d script

For this script to work you will need the iproute2 package installed:

# pacman -S iproute2

Try the following init script to start and stop an IPv6 tunnel once you have registered it with HE. I placed this at /etc/rc.d/6in4-tunnel. Obviously some of the variables up top will need to be filled in.

For DSL users the link_mtu should be set to 1472


server_ipv4='' # HE Server Endpoint IP
client_ipv4='' # Your local IP
client_ipv6='' # Your HE-assigned client IP


. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
    stat_busy "Starting $daemon_name daemon"

    ifconfig $if_name &>/dev/null
    if [ $? -eq 0 ]; then
      stat_busy "Interface $if_name already exists"
      exit 1

    ip tunnel add $if_name mode sit remote $server_ipv4 local $client_ipv4 ttl $tunnel_ttl
    ip link set $if_name up mtu $link_mtu
    ip addr add $client_ipv6 dev $if_name
    ip route add ::/0 dev $if_name
    # Here is how you would add additional ips....which should be on the eth0 interface
    # ip addr add 2001:XXXX:XXXX:beef:beef:beef:beef:1/64 dev eth0
    # ip addr add 2001:XXXX:XXXX:beef:beef:beef:beef:2/64 dev eth0
    # ip addr add 2001:XXXX:XXXX:beef:beef:beef:beef:3/64 dev eth0

    add_daemon $daemon_name

    stat_busy "Stopping $daemon_name daemon"

    ifconfig $if_name &>/dev/null
    if [ $? -ne 0 ]; then
      stat_busy "Interface $if_name does not exist"
      exit 1

    ip link set $if_name down
    ip tunnel del $if_name

    rm_daemon $daemon_name

    echo "usage: $0 {start|stop}"
exit 0

Start tunnel at boot time

Once you have that all setup how you want you will need to add 6in4-tunnel to your /etc/rc.conf file:

DAEMONS=(... 6in4-tunnel ...)