Arch LinuxでHE

6to4でも繋げられたので次は、HE
Hurricane Electric
を使ってみます。

基本的には、
Arch Linuxで6to4
と同じように設定すればOKです。

何はともあれ
Hurricane Electric
で登録しましょ〜


登録すると、左の
Create Regular Tunnel
から、
IPv4 Endpoint (Your side):グローバルIPv4アドレス
Available Tunnel Servers:Tokyo(おすすめを使ってもいいです)
でトンネルほりほりします。

・トンネルデバイス名=tunhe
・Server IPv4 Address=74.82.46.6
・自分のローカルアドレス=198.51.100.100
・Client IPv6 Address=2001:470:1f04:xxxx::2/64
・2000::/3=IPv6グローバルスコープ

# ip tunnel add tunhe mode sit remote 74.82.46.6 local 198.51.100.100 ttl 64
# ip link set mtu 1434 dev tunhe up
# ip -6 addr add 2001:470:1f04:xxxx::2/64 dev tunhe
# ip -6 route add 2000::/3 dev tunhe metric 1

これで、繋がるはずです。

Routed /64=2001:470:ffff:xxxx::/64
は、ローカル内で使えるIPv6アドレス帯です。
Arch Linuxをルータとして使う場合に、必要になります。
(とりあえず、次回持越し)

スクリプトはこんな感じ。

# vim /etc/rc.d/tunhe
 
#!/bin/bash

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

case "$1" in
  start)
    stat_busy "Starting tunhe"
        ip tunnel add tunhe mode sit remote 74.82.46.6 local 198.51.100.100 ttl 64 &&
        ip link set mtu 1434 dev tunhe up &&
        ip -6 addr add 2001:470:1f04:xxxx::2/64 dev tunhe &&
        ip -6 route add 2000::/3 dev tunhe metric 1
    if [ $? -gt 0 ]; then
      stat_fail
    else
      stat_done
    fi
    ;;

  stop)
    stat_busy "Stopping tunhe"
        ip -6 tunnel del tunhe
    if [ $? -gt 0 ]; then
      stat_fail
    else
      stat_done
    fi
    ;;

  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"
esac
exit 0

実行権限を与えます

# chmod +x /etc/rc.d/tunhe

rc.confのDAEMONSに追記します。

# vim /etc/rc.conf 
 
DAEMONS=(... tunhe ...)

これで起動、停止が楽に行えます。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

Enter code * Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.