LoginSignup
1
1

More than 3 years have passed since last update.

YAMAHAルーターでIPv6 over IPv4サービスを使う

Last updated at Posted at 2019-12-08

YAMAHAルーターでIPv6 over IPv4サービスを使う方法について。本稿では、IPv6 over IPv4サービスとしてHurricane Electric Free IPv6 Tunnel Brokerを利用する。

対象

ISPがIPv6サービスを提供していない環境向け。

ただ、Hurricane Electricのレイテンシーは大きいため(当方の環境だとTokyoのtunnelを使用してもwww.kame.netとのpingで300ms~)利用シーンは限定的かも。

前提

  • staticなグローバルIPアドレスを持っていること。tunnelの設定に必須。

ユーザー登録とトンネル設定

ユーザー登録

Hurricane Electric Free IPv6 Tunnel Brokerは https://tunnelbroker.net/ から登録できる。Registerからどうぞ。

ss01_1.png

tunnelの作成

ユーザー登録後、ログインしCreate Regular Tunnelから。

ss02_2.png

赤枠箇所にコチラ側のグローバルIPアドレスを指定する。

ss03_1.png

最寄りのtunnelサーバーを指定する。そしてCreate Tunnelを押下。

ss04_1.png

YAMAHAルーターの設定

トンネル設定項目の確認

使用する値は下図の(1)(4)(5)。(5)の代わりに(6)を使う、あるいは(5)および(6)の併用も可能。(2)はpingの疎通にでも使って。

ss06_1.png

ルーターのconfig

(1)(4)(5)をそれぞれ以下と仮定し

(1) 74.82.46.6
(4) 2001:470:23:beaf::2/64
(5) 2001:470:24:beaf::/64

# ゲートウェイの設定
ip route default gateway IPv4のゲートウェイのアドレス
ipv6 route default gateway tunnel 1
# LANインターフェイスの設定
ipv6 prefix 1 2001:470:24:beaf::/64
ip lan1 address 192.168.0.1/24
ipv6 lan1 address 2001:470:24:beaf::1/64
ipv6 lan1 prefix 2001:470:24:beaf::/64
ipv6 lan1 rtadv send 1
# WANインターフェイスの設定
ip lan2 address グローバルIPアドレス
ip lan2 nat descriptor 1
# VPNの設定
tunnel select 1
 description tunnel "IPv6 Tunnel Broker"
 tunnel encapsulation ipip
 tunnel endpoint address 192.168.0.1 74.82.46.6
 ipv6 tunnel address 2001:470:23:beaf::2/64
 ipv6 tunnel tcp mss limit auto
 tunnel enable 1
# NATの設定
nat descriptor type 1 masquerade
nat descriptor address outer 1 primary
nat descriptor address inner 1 auto
# DHCPの設定
dhcp service server
dhcp server rfc2131 compliant except remain-silent
dhcp scope 1 192.168.0.2-192.168.0.254/24
# DNSの設定
dns service recursive
dns server プライマリDNSサーバー セカンダリDNSサーバー
dns notice order dhcp me

疎通確認

ping6 www.kame.net

クライアントサイドは https://ipv6-test.com/ でどうぞ。

解説

configのうち、このようにコチラ側のエンドポイントアドレスがローカルアドレスなのは、

 tunnel endpoint address 192.168.0.1 74.82.46.6

YAMAHAのページの説明に従ったもの。

IPIPとNATを併用する場合、ローカルエンドポイントアドレスに「アドレス変換後のルーター自身のアドレス」を指定してください。

注意事項

(6)の/48プレフィックスでRAする場合は/64に分割しないといけない。アドバタイズはされるけどクライアント側が応じた動きをしない。

2001:470:cafe::/48が提供されるなら以下の要領でどうぞ。

ipv6 prefix 100 2001:470:cafe:100::/64
ipv6 prefix 200 2001:470:cafe:200::/64
ipv6 lan1 prefix 200 2001:470:cafe::/48
ipv6 lan1 rtadv send 100 200

参考

qiitaで類似記事があることを確認せずに投稿してしまった..。恥ずかしい。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1