--- lang: ja-jp breaks: true --- # AsahiNet YAMAHA RTX1200 DS-Lite(Dual-Stack Lite)でインターネット接続 2021-06-05 > ISP「ASAHIネット」会員向けにDS-Lite方式の接続サービスを提供開始 > https://asahi-net.co.jp/news/2021/0401.html > IPv6接続機能(IPv4 over IPv6接続 > https://asahi-net.jp/service/ftth/ipv6/4over6.html > ASAHIネットのDS-Liteの終端(AFTR)を取得する > https://gist.github.com/stkchp/4daea9158439c32d7a70a255d51e568b > IPv6マイグレーション技術の国内標準プロビジョニング方式 【第1.0版】 > https://github.com/v6pc/v6mig-prov/blob/1.0/spec.md > DS-Lite(transix)でインターネット接続 : コマンド設定 > https://network.yamaha.com/setting/router_firewall/ipv6/ds-lite/ds-lite_dhcp.txt > 9.1.7 IP の静的経路情報の設定 > http://www.rtpro.yamaha.co.jp/RT/manual/rt-common/ip/ip_route.html > フィルタ型ルーティング > http://www.rtpro.yamaha.co.jp/RT/docs/filter-routing/filter-routing.html > https://www.yamaha.com/products/zh/network/ja/techdocs/filter_route/ ## 前提環境 * 事前に、IPoEによりIPv6によるインターネット接続設定が完了していること。 * Asahi-Netの「IPv6接続機能 契約確認」ページで、IPv4 over IPv6接続が「提供中(DS-Lite方式)」となっていること。 ![](https://i.imgur.com/1ElRtZC.png) * linux環境 ```shell= $ uname -a Linux vm-ubuntu 5.8.0-55-generic #62~20.04.1-Ubuntu SMP Wed Jun 2 08:55:04 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux ``` ## IPoE DHCPv6 で使用されている DNSサーバのIPアドレスを取得 ```shell= systemd-resolve --status ``` Windows、Linux等のクライアント側より取得したDNSでうまくいかない場合は、Yamaha RTX1200より取得したDNSを取得する。 ```shell= show status ipv6 dhcp ``` ```shell= ・・・ DNS server[1]: xxxx:xxxx:xxxx::a DNS server[2]: xxxx:xxxx:xxxx:9::a ・・・ ``` ## DNSサーバより、4over6.info のTXTレコードを取得 ```shell= dig 4over6.info TXT +short [DNS Server] "v=v6mig-1 url=https://example.net/cpe/v1/config t=b" ``` :::info [DNS Server]の前に`@`をつけると正常に取得できなかった。 ```shell= $ dig 4over6.info TXT 2405:6586:3c0:7400::1 ; <<>> DiG 9.16.1-Ubuntu <<>> 4over6.info TXT xxxx:xxxx:xxxx:xxxx::9 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12870 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 65494 ;; QUESTION SECTION: ;4over6.info. IN TXT ;; ANSWER SECTION: 4over6.info. 3484 IN TXT "v=v6mig-1 url=https://example.net/cpe/v1/config t=b" ;; Query time: 0 msec ;; SERVER: 127.0.0.53#53(127.0.0.53) ;; WHEN: 土 6月 05 15:18:04 JST 2021 ;; MSG SIZE rcvd: 117 ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 24654 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 65494 ;; QUESTION SECTION: ;xxxx:xxxx:xxxx:xxxx::9. IN A ;; Query time: 0 msec ;; SERVER: 127.0.0.53#53(127.0.0.53) ;; WHEN: 土 6月 05 15:18:04 JST 2021 ;; MSG SIZE rcvd: 50 ``` ::: ## 取得したURLに対してGETリクエストを投げて、AFTR を取得する。 ```shell= curl "https://example.com/cpe/v1/config?vendorid=acde48-v6pc_swg_hgw&product=V6MIG-ROUTER&version=0_00&capability=dslite" > result.json ``` :::info * vendorid=acde48-v6pc_swg_hgw > * ベンダーOUI、および、任意コード24文字を以下のフォーマットで送信する(MUST)。 > * 「ベンダーOUI(16進数表記6文字)」+「-」+「任意文字(0-9,a-z,A-Z,_のみ)最大24文字」 > * ベンダーOUIのみをMUSTとし、ハイフン以降の値の付与は任意とする。 > * ex) vendorid=acde48-v6pc_swg_hgw * product=V6MIG-ROUTER > * CPE 本体の製品名を値として送信する(MUST)。 > * 値は ASCII 半角英数字、ハイフン、アンダースコアで構成される 32 文字以下とする。 > * ex) product=V6MIG-ROUTER * version=0_00 > * CPE のファームウェアバージョンを送信する(MUST)。 > * 値は、数字またはアンダースコアからなる最大 32 文字の文字列とする ([0-9_]{1,32})。 > * ピリオドの代わりにアンダースコアを利用すること。 > * ex) version=1_32 * capability=dslite > * CPE のサポートするマイグレーション技術を送信する(MUST)。 > * サポートする以下のマイグレーション技術を , で接続した文字列を送信する。 464xlat CPE は 464XLAT をサポートする。 dslite CPE は DS-Lite をサポートする。 ipip CPE は IPIP トンネル接続をサポートする。 lw4o6 CPE は Lightweight 4over6 をサポートする。 map_e CPE は MAP-E をサポートする。 map_t CPE は MAP-T をサポートする。 hubspoke CPE は MAP-E の Hub&Spoke 方式をサポートする。 mesh CPE は MAP-E の MESH 方式をサポートする。 > * ex) capability=map_e,dslite,lw4o6,hubspoke ::: ```shell= cat result.json | python -m json.tool ``` ```json= { "ttl": 61200, "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "service_name": "v6 \u30b3\u30cd\u30af\u30c8", "enabler_name": "v6 \u30b3\u30cd\u30af\u30c8", "dslite": { "aftr": "xxxxxx.test.net" }, "order": [ "dslite" ] } ``` ## AFTR の IPv6アドレスを取得する。 ```shell= dig xxxxxx.test.net AAAA +short [DNS Server] xxxx:xxxx:xxxx:xxxx::9999 ``` :::info ASAHIネットの場合、`dslite.v6connect.net` `2405:6586:3c0:7400::1` で接続できるようだ。 ::: ## Yamaha RTX1200 の トンネリング設定 ```= # ipv4 over ipv6 トンネルの設定 tunnel select 90 tunnel encapsulation ipip tunnel endpoint address (AFTRのアドレス) description tunnel "AsahiNet ipv4 over ipv6 tunnel" tunnel enable 90 ``` :::warning ※RTX1200 は、`tunnel endpoint address`が使用可能。`tunnel endpoint remote address`は使用できない。 ※RTX1210 は、`tunnel endpoint remote address`を使用する。 ::: ## Yamaha RTX1200 の ルーティング設定 インターネット用のデフォルトルートを「ipv4 over ipv6」トンネルに設定 ```= ip route default gateway tunnel 90 ``` ある決まったホストと通信する場合は、これまで通りPPPoEを使用する。 ```= ip route xxx.xxx.xxx.xxx/32 gateway pp 1 ``` L2TP/IPSec 経由で接続されたパケットの戻りは、これまで通りPPPoEを使用する。 ```= ip filter 204080 pass * * esp * * ip filter 204081 pass * * udp 500 * ip filter 204082 pass * * udp 4500 * ip filter 204083 pass * * udp 1701 * ip route default gateway pp 1 filter 204080 204081 204082 204083 gateway tunnel 90 ``` :::warning `udp 1701`は不要かと思っていたが、この設定がないと通信できなかった。 ::: ## ネットワーク遅延の比較 :::info ※土曜日の日中 ::: ### PPPoE ```shell= >ping -4 www.google.co.jp www.google.co.jp [216.58.197.3]に ping を送信しています 32 バイトのデータ: 216.58.197.3 からの応答: バイト数 =32 時間 =21ms TTL=114 216.58.197.3 からの応答: バイト数 =32 時間 =18ms TTL=114 216.58.197.3 からの応答: バイト数 =32 時間 =24ms TTL=114 216.58.197.3 からの応答: バイト数 =32 時間 =26ms TTL=114 216.58.197.3 の ping 統計: パケット数: 送信 = 4、受信 = 4、損失 = 0 (0% の損失)、 ラウンド トリップの概算時間 (ミリ秒): 最小 = 18ms、最大 = 26ms、平均 = 22ms ``` ### IPv4 over IPv6 ```shell= >ping -4 www.google.co.jp www.google.co.jp [172.217.161.227]に ping を送信しています 32 バイトのデータ: 172.217.161.227 からの応答: バイト数 =32 時間 =19ms TTL=115 172.217.161.227 からの応答: バイト数 =32 時間 =18ms TTL=115 172.217.161.227 からの応答: バイト数 =32 時間 =18ms TTL=115 172.217.161.227 からの応答: バイト数 =32 時間 =18ms TTL=115 172.217.161.227 の ping 統計: パケット数: 送信 = 4、受信 = 4、損失 = 0 (0% の損失)、 ラウンド トリップの概算時間 (ミリ秒): 最小 = 18ms、最大 = 19ms、平均 = 18ms ``` ## ネットワーク帯域の比較 :::info ※土曜日の日中 ::: ### PPPoE ![](https://i.imgur.com/KLSY71C.png) ### IPv4 over IPv6 ![](https://i.imgur.com/U302twa.png) ## 再計測 月曜日19:20 ![](https://i.imgur.com/esI35pc.png) ###### tags: `DS-Lite` `AsahiNet` `ipv4 over ipv6` `Yamaha RTX1200`