古いMac mini(Mid 2011)でWindows10


まだ間に合う!Windows10の無償アップグレードはまだ出来たという記事をみて、Mac miniのWindows8.1を10に入れ換えることにしました。

クリーンインストールしたいと思い、Windows10用のISOファイルをダウンロードした後、MacOSにてWindowsパーティションを消して、いざBootCampからインストール。これが長い道のりになりました。
macOSは、 High Sierraにしています。これも厄介なことに。

■ Boot CampからWindows10ダメじゃん
Windows10を使用できるMacモデルがMid2012以降になっています。
最初に確認しておけばよかったと後悔、仕方なくWindows8.1からアップデートするしかありません。Windows8.1をインストールすることに。

■ Boot CampからWindowsパーティション作成できない。
USBにファイル作成がやっと終わり、つぎにパーティション作成、しかしこのパーティション作成でこけます
仕方なく、ディスクユーティリティからFirsr Aidを実行し、パーティション作成を試みますが、これもだめ、apfsが縮小できないとエラーを吐いています。
タイムマシンのローカルスナップショットが悪さしているとわかりました。タイムマシンの自動作成をオフして
tmutil listlocalsnapshots /
:
com.apple.TimeMachine.2017-12-09-141149
com.apple.TimeMachine.2017-12-09-160421
:
このファイルを削除するといいのですが、選ぶの面倒なのでまとめて消します。
tmutil thinlocalsnapshots / 9999999999999999
ローカルスナップショット全て消した後にディスクユーティリティでWindows用パーティションを作成しました。

Boot Campを最初からやり直してもいいですが、あの長いUSB作成するのは嫌なので、手動でインストールします。作成したUSBをさしたままoptionキーを押しながら再起動します。
Startup Managerが出たらUSBを選んでWindowsインストール画面に従いインストールします。

■えっ、今度は「新しいシステムパーティションをできなかったか既存の・・・」だと 
ところが、Windows用に作成したパーティションをWindowsインストール先にしても「新しいシステムパーティションをできなかったか、既存の・・・」エラーが出て先に進めない。NTFSにフォーマットしてもだめ。・・・
ググると他の増設Diskを全て切り離してやるといいらしい。再度リブートしてインストール開始、今度はすんなり先に進みました。
やっとWindows8.1がインストールされましたので、Windows8.1から10にアップデート。こちらはなんの問題なくアップデート。最初からBootCampなど使わず、Windows8.1からアッブデートすればよかった。

■ WindowsとMacOS切り替えはStartup Managerからやるしかないそうです。
apfsがBootCamp認識していないらしい。apfs利用している環境でのBootCamp曲者ですね。

■ まとめ
High Sierraでブートディスクをapfsにしている場合は、「タイムマシーンをOff」にして、 おまじない「tmutil thinlocalsnapshots / 9999999999999999」を打ったあとに、「外付けディスクを全て外して」Boot Campをやりましょう。

古いMac Minは、Boot Camp使わないで、Windows8.1から素直にWindows10にアップデートしましょう。(笑)

EdgeRouter XとGCP(Google Cloud Platform)をVPN接続 その2

前回は、EdgeRouterXを設定しましたので、今回は、GCP(Google Cloud Platform)の設定をします。GCPはあらかじめ、静的なグローバルIPと仮想サーバを準備しておいてください。

1.VPNの設定

VPNの設定をしていきます。IPアドレスにグローバルIPを選択してください。それ以外は適宜設定してください。
次にトンネルの設定です。リモートピアIPアドレスに家庭内LANのグローバルIPを設定し、IKEバージョンはV2としました。共通シークレットはEdeRouterXに設定したものと同じものを設定します。リモートネットワークIPの範囲は、家庭内LANの192.168.10.0/24と設定し、ローカルIP範囲はGCP側の10.140.0.0/20を設定します。
しばらくすると、緑色のレ点がつくと思います。これで接続完了です。うまく接続されない場合はログを確認して見てください。

2.接続テスト 

GCPの仮想サーバにログインし、家庭内LANにあるサーバにpingが通るか試します。
ping -c 5 192.168.10.202
PING 192.168.10.202 (192.168.10.202) 56(84) bytes of data.
64 bytes from 192.168.10.202: icmp_seq=1 ttl=63 time=48.0 ms
64 bytes from 192.168.10.202: icmp_seq=2 ttl=63 time=46.4 ms
64 bytes from 192.168.10.202: icmp_seq=3 ttl=63 time=46.4 ms
64 bytes from 192.168.10.202: icmp_seq=4 ttl=63 time=48.1 ms
64 bytes from 192.168.10.202: icmp_seq=5 ttl=63 time=48.3 ms

--- 192.168.10.202 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 46.423/47.468/48.321/0.879 ms
接続確認できたので、次に家庭内LANのサーバからGCPのサーバにPingして見ます。
ping -c 5 10.140.0.3
PING 10.140.0.3 (10.140.0.3) 56(84) bytes of data.
64 bytes from 10.140.0.3: icmp_seq=1 ttl=63 time=47.5 ms
64 bytes from 10.140.0.3: icmp_seq=2 ttl=63 time=46.5 ms
64 bytes from 10.140.0.3: icmp_seq=3 ttl=63 time=46.5 ms
64 bytes from 10.140.0.3: icmp_seq=4 ttl=63 time=57.3 ms
64 bytes from 10.140.0.3: icmp_seq=5 ttl=63 time=51.3 ms

--- 10.140.0.3 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4002ms
rtt min/avg/max/mdev = 46.529/49.875/57.382/4.151 ms
こちらも接続できたようです。これでedgerouterXからGCP(Google Cloud Platform)とVPN接続できました。あまりにもすんなり接続されるのでちょっと拍子抜けかな・・・便利な世の中になってきました。

EdgeRouter XとGCP(Google Cloud Platform)をVPN接続 その1

今回のテーマは、EdgeRouterXとGCP(Google Cloud Platform)をIPsec VPNで接続してみようと思います。 はじめは、IPv6で接続しようとも考えましたが、GCP側不明だったのでIPv4で接続することにしました。


1.環境

GCPであらかじめ、静的なグローバルIPとローカルネットワークで接続する仮想サーバを準備します。家庭内LANは、192.168.10.0/24に接続、グローバルIPはPPPoEのものを利用します。IKEはV2、ハッシュアルゴリズムはSHA1、暗号化アルゴリズムは、AES128ビットとします。
VS(10.140.0.3)--GCP(35.xx.xx.xx)--(IPSec VPN)--EGRT(153.xx.xx.xx)--VS(192.168.10.202)
こんなイメージの接続です。

2.EdgeRouterXの設定

今回は、GUIから設定して見ます。VPN-IPsec Site-to-SiteタグからPeer:GCPのグローバルIP、Encryption:AES-128,Hash:SHA1を設定します。Pre-shared secretにはGCPにも設定する共通キーを設定します。local subnetは、家庭内LAN側の192.168.10.0/24を設定し、Remote subnetにはGCP側の10.140.0.0/20を設定します。
残念ながらIKEの設定箇所がありません。EdgeRouterXのdefaultはIKEv1のようです。今回はV2にしたいので、Config Treeから設定を追加します。Config TreeタグのVPN-ipsec-ike-groupにあるkey-exchangeがikev1となっていますので、これをikev2に変更して更新します。
これで設定は完了です。下に全体の設定項目をつけておきます。なおFireWallの設定は前に記述したEdgeRouter XでDS-Lite+公開サーバ用PPPoE設定 その3を参照してください。
 ipsec {
     auto-firewall-nat-exclude enable
     esp-group FOO0 {
         proposal 1 {
             encryption aes128
             hash sha1
         }
     }
     ike-group FOO0 {
         key-exchange ikev2
         proposal 1 {
             dh-group 14
             encryption aes128
             hash sha1
         }
     }
     site-to-site {
         peer 35.xx.xx.xx {
             authentication {
                 mode pre-shared-secret
                 pre-shared-secret xxxxxxxxxxxxxxx
             }
             connection-type initiate
             description GCP
             ike-group FOO0
             local-address any
             tunnel 1 {
                 esp-group FOO0
                 local {
                     prefix 192.168.10.0/24
                 }
                 remote {
                     prefix 10.140.0.0/20
                 }
             }
         }
     }
 }
これでEdgeRouterX側の設定が完了しました。次回は、GCP側の設定です。

EdgeRouter XでDS-Lite+公開サーバ用PPPoE設定 動作検証

今回は、IPoE+DS-LiteとPPPoEがそれぞれ正しく動作するか確認したいと思います。
検証はtreacerouteでルート確認、ping,SpeedTestで速度、SSLテストサイトから公開サーバをアクセスして確認したいと思います。

1.traceroute確認

(1)PPPoE 192.168.10.0/24
traceroute to google.com (172.217.25.206), 30 hops max, 60 byte packets
 1  gateway (192.168.10.1)  0.628 ms  0.472 ms  0.563 ms
 2  118.23.10.236 (118.23.10.236)  4.639 ms  4.590 ms  4.608 ms
 3  118.23.10.93 (118.23.10.93)  4.763 ms  4.690 ms  4.523 ms
 4  153.153.223.197 (153.153.223.197)  5.741 ms  5.729 ms  5.704 ms
 5  180.8.126.49 (180.8.126.49)  5.145 ms  5.012 ms  5.031 ms
 6  60.37.54.77 (60.37.54.77)  5.441 ms 122.1.245.57 (122.1.245.57)  4.807 ms 60.37.54.77 (60.37.54.77)  5.105 ms
 7  60.37.54.162 (60.37.54.162)  6.643 ms 122.1.245.66 (122.1.245.66)  11.121 ms 60.37.54.162 (60.37.54.162)  13.931 ms
 8  211.0.193.22 (211.0.193.22)  12.036 ms  11.342 ms  11.747 ms
 9  108.170.242.97 (108.170.242.97)  12.294 ms  11.936 ms  12.003 ms
10  108.170.233.17 (108.170.233.17)  12.350 ms  13.365 ms  12.820 ms
11  nrt12s13-in-f206.1e100.net (172.217.25.206)  12.251 ms  12.103 ms  26.927 ms
(2)DS-Lite 192.168.1.0/24
traceroute to google.com (172.217.25.206), 30 hops max, 60 byte packets
 1  gateway (192.168.1.1)  0.499 ms  0.419 ms  0.541 ms
 2  ike-gw00.transix.jp (14.0.9.66)  6.602 ms  6.740 ms  6.527 ms
 3  ike-bbrt10.transix.jp (14.0.9.65)  6.870 ms  6.838 ms  6.796 ms
 4  bek-bbrt10.transix.jp (14.0.8.66)  7.565 ms bek-bbrt10.transix.jp (14.0.8.82)  8.145 ms  8.102 ms
 5  210.173.176.243 (210.173.176.243)  7.463 ms  7.683 ms  7.672 ms
 6  108.170.242.97 (108.170.242.97)  7.648 ms 108.170.242.129 (108.170.242.129)  4.801 ms  5.106 ms
 7  108.170.233.15 (108.170.233.15)  5.178 ms  5.021 ms 108.170.233.17 (108.170.233.17)  4.966 ms
 8  nrt12s13-in-f206.1e100.net (172.217.25.206)  5.206 ms  5.161 ms  5.154 ms

192.168.1.0/24の方は、transit.jp経路になっているようですね。hop数も少ない見たい。

2.pingで確認

(1)PPPoE 192.168.10.0/24
PING google.com (172.217.25.206) 56(84) bytes of data.
64 bytes from nrt12s13-in-f14.1e100.net (172.217.25.206): icmp_seq=1 ttl=52 time=10.2 ms
64 bytes from nrt12s13-in-f14.1e100.net (172.217.25.206): icmp_seq=2 ttl=52 time=5.97 ms
64 bytes from nrt12s13-in-f14.1e100.net (172.217.25.206): icmp_seq=3 ttl=52 time=5.23 ms
64 bytes from nrt12s13-in-f14.1e100.net (172.217.25.206): icmp_seq=4 ttl=52 time=5.58 ms
64 bytes from nrt12s13-in-f14.1e100.net (172.217.25.206): icmp_seq=5 ttl=52 time=7.16 ms

--- google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 5.232/6.838/10.243/1.822 ms
(2)DS-Lite 192.168.1.0/24
PING google.com (172.217.25.206) 56(84) bytes of data.
64 bytes from nrt12s13-in-f14.1e100.net (172.217.25.206): icmp_seq=1 ttl=56 time=4.83 ms
64 bytes from nrt12s13-in-f14.1e100.net (172.217.25.206): icmp_seq=2 ttl=56 time=4.55 ms
64 bytes from nrt12s13-in-f14.1e100.net (172.217.25.206): icmp_seq=3 ttl=56 time=5.11 ms
64 bytes from nrt12s13-in-f14.1e100.net (172.217.25.206): icmp_seq=4 ttl=56 time=4.90 ms
64 bytes from nrt12s13-in-f14.1e100.net (172.217.25.206): icmp_seq=5 ttl=56 time=4.70 ms

--- google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 4.550/4.820/5.112/0.208 ms
PPPoE rtt min/avg/max/mdev = 5.232/6.838/10.243/1.822 ms
DS-Lite rtt min/avg/max/mdev = 4.550/4.820/5.112/0.208 ms
の結果となりました。当然、DS-Liteが早いですね

3.speedtest

linuxサーバからSpeedTestで確認しました。SpeedTestコマンドは、Fedora26ならばこんな感じでインストールできます。
 sudo easy_install python-setuptools
 sudo dnf install speedtest-cli

(1)PPPoE 192.168.10.0/24
Retrieving speedtest.net configuration...
Testing from OCN (153.165.154.116)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by TB (Tokyo) [8.86 km]: 17.871 ms
Testing download speed................................................................................
Download: 287.37 Mbit/s
Testing upload speed....................................................................................................
Upload: 191.12 Mbit/s
Share results: http://www.speedtest.net/result/6475679363.png
(2)DS-Lite 192.168.1.0/24
Retrieving speedtest.net configuration...
Testing from INTERNET MULTIFEED (103.2.248.53)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by TB (Tokyo) [8.86 km]: 21.664 ms
Testing download speed................................................................................
Download: 444.01 Mbit/s
Testing upload speed................................................................................................
Upload: 347.26 Mbit/s
Share results: http://www.speedtest.net/result/6475673103.png
左がPPPoEで、右がDS-Liteです。ちゃんとISP左がOCN、右がINTERNET MULTIFEEDになってますね。
PPPoEが星三つで、DS-Liteが星三つ半でした。
最近、DS-Liteの方もばらつきが大きくなってきたような気がします。上の結果、土曜日の夕方の結果です。

4.公開サーバ確認

最後に、家庭LANにあるサーバにアクセスできるか試します。SSLチェックも兼ねてSSLチェックサイトで確認します。
定番のQualys SSL LABSのSSL Server Testで試して見ました。
まずまずといったところでしょうか

EdgeRouter XでDS-Lite+公開サーバ用PPPoE設定 その3

今回は、IPoE+DS-Lite+PPPoEの私の設定内容を公開しようと思います。
ネットワーク環境は、WAN側光電話なし、東NTT光をeth0に接続してます。LAN1は、公開サーバ用のネットワーク192.168.10.0/24です。こちらはPPoEのパケットを流し込みします。LAN2は、ネットサーフィン用のネットワーク192.168.1.0/24です。こちらにDS-Lite接続のパケットを流し込みます。

1.FireWallの設定

 firewall {
     all-ping enable
     broadcast-ping disable
     ipv6-name WANv6_IN {
         default-action drop
         description "WANv6 to LAN"
         enable-default-log
         rule 10 {
             action accept
             description "Allow established/related"
             state {
                 established enable
                 related enable
             }
         }
         rule 20 {
             action accept
             description "Allow IPv6 ICMP"
             protocol ipv6-icmp
         }
         rule 30 {
             action drop
             description "Drop invalid state"
             state {
                 invalid enable
             }
         }
     }
     ipv6-name WANv6_LOCAL {
         default-action drop
         description "WANv6 to Router"
         enable-default-log
         rule 10 {
             action accept
             description "Allow established/related"
             state {
                 established enable
                 related enable
             }
         }
         rule 20 {
             action accept
             description "Allow IPv6 ICMP"
             protocol ipv6-icmp
         }
         rule 30 {
             action drop
             description "Drop invalid state"
             state {
                 invalid enable
             }
         }
     }
     ipv6-receive-redirects disable
     ipv6-src-route disable
     ip-src-route disable
     log-martians enable
     modify LAN_PBR {
         rule 10 {
             action modify
             description "LAN to PPPoE"
             destination {
                 address !192.168.0.0/16
             }
             modify {
                 table 1
             }
             source {
                 address 192.168.10.0/24
             }
         }
         rule 20 {
             action modify
             description "LAN to DSLite"
             destination {
                 address !192.168.0.0/16
             }
             modify {
                 table 2
             }
             source {
                 address 192.168.1.0/24
             }
         }
     }
     name DSLite_IN {
         default-action drop
         description "DSLite to LAN"
         rule 10 {
             action accept
             description "Allow established/related"
             state {
                 established enable
                 related enable
             }
         }
         rule 20 {
             action drop
             description "Drop invalid state"
             state {
                 invalid enable
             }
         }
     }
     name DSLite_LOCAL {
         default-action drop
         description "DSLite to Router"
         rule 10 {
             action accept
             description "Allow established/related"
             state {
                 established enable
                 related enable
             }
         }
         rule 40 {
             action drop
             description "Drop invalid state"
             state {
                 invalid enable
             }
         }
     }
     name PPPoE_IN {
         default-action drop
         description "PPPoE to LAN"
         rule 10 {
             action accept
             description "Allow established/related"
             state {
                 established enable
                 related enable
             }
         }
         rule 20 {
             action drop
             description "Drop invalid state"
             state {
                 invalid enable
             }
         }
     }
     name PPPoE_LOCAL {
         default-action drop
         description "PPPoE to Router"
         rule 10 {
             action accept
             description "Allow established/related"
             state {
                 established enable
                 related enable
             }
         }
         rule 20 {
             action accept
             description "Allow IKE, L2TP, NAT-T"
             destination {
                 port 500,1701,4500
             }
             protocol udp
         }
         rule 30 {
             action accept
             description "Allow ESP"
             protocol esp
         }
         rule 40 {
             action drop
             description "Drop invalid state"
             state {
                 invalid enable
             }
         }
     }
     options {
         mss-clamp {
             interface-type pppoe
             mss 1414
         }
     }
     receive-redirects disable
     send-redirects enable
     source-validation disable
     syn-cookies enable
 }
modify LAN_PBRがDS-LiteとPPPoEを両方を切り分けのポイントです。あと、PPPoE_LOCALのrule20,30はGoogle Cloud Platformとvpn接続のためのものです。VPN IPsec利用しないときは不要です。

2.Interfacesの設定

 interfaces {
     ethernet eth0 {
         description WAN(IPoE+DS-Lite+PPPoE)
         duplex auto
         firewall {
             in {
                 ipv6-name WANv6_IN
             }
             local {
                 ipv6-name WANv6_LOCAL
             }
         }
         ipv6 {
             address {
                 autoconf
             }
             disable-forwarding
             dup-addr-detect-transmits 1
         }
         pppoe 0 {
             default-route auto
             firewall {
                 in {
                     name PPPoE_IN
                 }
                 local {
                     name PPPoE_LOCAL
                 }
             }
             mtu 1454
             name-server auto
             password xxxx
             user-id xxx@xxxxxx
         }
         speed auto
     }
     ethernet eth1 {
         address 192.168.10.1/24
         description LAN1
         duplex auto
         firewall {
             in {
                 modify LAN_PBR
             }
         }
         speed auto
     }
     ethernet eth2 {
         description LAN2
         duplex auto
         speed auto
     }
     ethernet eth3 {
         description LAN2
         duplex auto
         speed auto
     }
     ethernet eth4 {
         description LAN2
         duplex auto
         speed auto
     }
     ipv6-tunnel v6tun0 {
         description DSLite
         encapsulation ipip6
         firewall {
             in {
                 name DSLite_IN
             }
             local {
                 name DSLite_LOCAL
             }
         }
         local-ip 2409:xx:xx:xx:xx:xx:xx:xx
         multicast disable
         remote-ip 2404:8e00::feed:100
         ttl 64
     }
     loopback lo {
     }
     switch switch0 {
         address 192.168.1.1/24
         description LAN2
         firewall {
             in {
                 modify LAN_PBR
             }
         }
         mtu 1500
         switch-port {
             interface eth2 {
             }
             interface eth3 {
             }
             interface eth4 {
             }
             vlan-aware disable
         }
     }
 }
pppoeとipv6-tunnelの設定はそれぞれの環境に合わせてください。eth1とswitchにfirewallで設定したmodify LAN_PBRを設定します。

3.Port-forwardの設定

 port-forward {
     auto-firewall enable
     hairpin-nat enable
     lan-interface eth1
     rule 1 {
         description http
         forward-to {
             address 192.168.10.202
             port 80
         }
         original-port 80
         protocol tcp
     }
     rule 2 {
         description https
         forward-to {
             address 192.168.10.202
             port 443
         }
         original-port 443
         protocol tcp
     }
     wan-interface pppoe0
 }

WANからのhttpとhttpsは、公開サーバに転送。

4.Protocolsの設定

 protocols {
     static {
         interface-route 0.0.0.0/0 {
             next-hop-interface pppoe0 {
                 distance 200
             }
             next-hop-interface v6tun0 {
             }
         }
         table 1 {
             interface-route 0.0.0.0/0 {
                 next-hop-interface pppoe0 {
                 }
             }
         }
         table 2 {
             interface-route 0.0.0.0/0 {
                 next-hop-interface v6tun0 {
                 }
             }
         }
     }
 }
table1,2を追加して行き先をpppoe0かv6tun0を設定しています。

5.Serviceの設定

 service {
     dhcp-server {
         disabled false
         hostfile-update disable
         shared-network-name LAN1 {
             authoritative enable
             subnet 192.168.10.0/24 {
                 default-router 192.168.10.1
                 dns-server 192.168.10.1
                 lease 86400
                 start 192.168.10.38 {
                     stop 192.168.10.199
                 }
                 static-mapping 10 {
                     ip-address 192.168.10.201
                     mac-address xx:xx:xx:xx:xx:xx
                 }
                 static-mapping 11 {
                     ip-address 192.168.10.202
                     mac-address xx:xx:xx:xx:xx:xx
                 }
             }
         }
         shared-network-name LAN2 {
             authoritative enable
             subnet 192.168.1.0/24 {
                 default-router 192.168.1.1
                 dns-server 192.168.1.1
                 lease 86400
                 start 192.168.1.38 {
                     stop 192.168.1.199
                 }
                 static-mapping 20 {
                     ip-address 192.168.1.201
                     mac-address xx:xx:xx:xx:xx:xx
                 }
                 static-mapping 21 {
                     ip-address 192.168.1.202
                     mac-address xx:xx:xx:xx:xx:xx
                 }
                 static-mapping 22 {
                     ip-address 192.168.1.203
                     mac-address xx:xx:xx:xx:xx:xx
                 }
             }
         }
         use-dnsmasq disable
     }
     dns {
         dynamic {
             interface pppoe0 {
                 service custom-duckdns {
                     host-name xxxx.duckdns.org
                     login nouser
                     password xxxx-xxxx-xxxx-xxxx-xxxx
                     protocol dyndns2
                     server www.duckdns.org
                 }
             }
         }
         forwarding {
             cache-size 150
             listen-on eth1
             listen-on switch0
             system
         }
     }
     gui {
         http-port 80
         https-port 443
         older-ciphers enable
     }
     nat {
         rule 5010 {
             description "masquerade for PPPoE"
             outbound-interface pppoe0
             type masquerade
         }
     }
     ssh {
         port 22
         protocol-version v2
     }
 }
dnsは、duckdnsの例です。PPPoEのIPを利用しています。

6.Systemの設定

 port-forward {
 system {
     host-name xxxx
     login {
         user xxxxxx {
             authentication {
                 encrypted-password xxxxxxxxxxxxxxxxxxxxxxx
             }
             level admin
         }
     }
     name-server 2001:4860:4860::8888
     name-server 2001:4860:4860::8844
     ntp {
         server 0.ubnt.pool.ntp.org {
         }
         server 1.ubnt.pool.ntp.org {
         }
         server 2.ubnt.pool.ntp.org {
         }
         server 3.ubnt.pool.ntp.org {
         }
     }
     offload {
         hwnat enable
         ipv6 {
         }
     }
     static-host-mapping {
         host-name xxx {
             alias xxx.xxx.duckdns.org
             inet 192.168.1.xxx
         }
     }
     syslog {
         global {
             facility all {
                 level notice
             }
             facility protocols {
                 level debug
             }
         }
         host 192.168.1.203 {
             facility all {
                 level warning
             }
         }
     }
     time-zone Asia/Tokyo
     traffic-analysis {
         dpi enable
         export enable
     }
 }
特に説明はいらないでしょう。それぞれの環境に合わせて設定してください。

次回は、IPv6+DS-LiteとPPPoEが正しく動いているか確認したいと思います。

EdgeRouter XでDS-Lite+公開サーバ用PPPoE設定 その2

DS-Liteは、自宅サーバを公開するためのIPが利用できません。今回、PPPoEを利用し、DS-LiteとPPPoEの共存に挑戦したいと思います。

1.PPPoEの設定

eth0にPPPoEを追加します。user-id,passwordはそれぞれの環境に合わせてください。
 interfaces {
     ethernet eth0 {
         description WAN(IPoE+DS-Lite+PPPoE)
          :
         pppoe 0 {
             default-route auto
             firewall {
                 in {
                     name PPPoE_IN
                 }
                 local {
                     name PPPoE_LOCAL
                 }
             }
             mtu 1454
             name-server auto
             password xxxx
             user-id xxxx@xxxx
         }
         speed auto
   }
     :
 }
次にstatic routeにPPPoEを追加します。
 protocols {
     static {
         interface-route 0.0.0.0/0 {
             next-hop-interface pppoe0 {
                 distance 200
             }
             next-hop-interface v6tun0 {
             }
         }
     }
 }
ですが、ここで192.168.10.0/24はPPPoEが利用し、192.168.1.0/24はDS-Lite側で利用したいので FireWall modifyの設定で、特定のLANから来たパケットに対してmarkを入れたいと思います。
 firewall {
     all-ping enable
     broadcast-ping disable
     :
     modify LAN_PBR {
         rule 10 {
             action modify
             description "LAN to PPPoE"
             destination {
                 address !192.168.0.0/16
             }
             modify {
                 table 1
             }
             source {
                 address 192.168.10.0/24
             }
         }
         rule 20 {
             action modify
             description "LAN to DSLite"
             destination {
                 address !192.168.0.0/16
             }
             modify {
                 table 2
             }
             source {
                 address 192.168.1.0/24
             }
         }
     }
 }
FireWallの設定ができましたのでstatic routeの設定に追加します。
こんな感じになります。
 protocols {
     static {
         interface-route 0.0.0.0/0 {
             next-hop-interface pppoe0 {
                 distance 200
             }
             next-hop-interface v6tun0 {
             }
         }
         table 1 {
             interface-route 0.0.0.0/0 {
                 next-hop-interface pppoe0 {
                 }
             }
         }
         table 2 {
             interface-route 0.0.0.0/0 {
                 next-hop-interface v6tun0 {
                 }
             }
         }
     }
 }
あとは、natでmasqueradeを設定してもらえればと思います。
 service {
     :
     nat {
         rule 5010 {
             description "masquerade for PPPoE"
             outbound-interface pppoe0
             type masquerade
         }
     }
 }
私は、普段、GUIのConfig Treeで設定するか、直接、ルータにsshで入って、configureから設定する方が多いのですが、 最初にsetup wizardsでPPPoEの設定してから、そのあとに前回説明したDS-Liteの設定を追加した方が楽かなと思います。 また、今回の設定は、Edgerouter Lite-3でDS-Liteが大変参考になりました。感謝です。

次回は、今までに、説明しなかった部分を補足しながら、私が今回設定した全体の設定を記載しようと思います。

EdgeRouter XでDS-Lite+公開サーバ用PPPoE設定 その1

EdgeRouterXでDS-Liteと公開サーバ用にPPPoEを設定したいと思います。

1. ネットワーク概要

WAN側は、NTT光、光電話はなし。WAN側の接続(eth0)は、IPoE+DS-LiteとPPPoEで接続します。LAN側は、IPv6の設定はしないでIPv4のみとします。LAN1(eth1)に192.168.10.0/24を割り当て、こちらに公開用サーバを立てます。こちらは、PPPoE接続にします。LAN2(switch=eth2-eth4)側は、IPoE+DS-Liteで接続し、インターネットの高速化を狙います。
speedtestで測ると、PPPoEが100Mbps〜300Mbps前後ですが、IPoE+DS-Lite接続にすると400Mbps〜600Mbpsぐらいのようです。

2. IPoE+DS-Liteの設定

eth0でIPoE用のIPv6を設定します。しばらくすると、ルータにIPv6が設定されます。そのIPを元にDS-Lite用の設定をしていきます。 ipv6-tunnelで、encapsulationにipip6を設定し、local-ipにルータに割り当てられたipv6のアドレスを設定しremote-ipにtransixサービスのipを設定します。
設定は、こんな感じになります。
 interfaces {
     ethernet eth0 {
         description WAN(IPoE+DS-Lite)
         duplex auto
         firewall {
             in {
                 ipv6-name WANv6_IN
             }
             local {
                 ipv6-name WANv6_LOCAL
             }
         }
         ipv6 {
             address {
                 autoconf
             }
             disable-forwarding
             dup-addr-detect-transmits 1
         }
         speed auto
    }
    :
    ipv6-tunnel v6tun0 {
         description DSLite
         encapsulation ipip6
         firewall {
             in {
                 name DSLite_IN
             }
             local {
                 name DSLite_LOCAL
             }
         }
         local-ip 2409:xx:xx:xx:xx:xx:xx:xx <-自分の環境に合わせてください。
         multicast disable
         remote-ip 2404:8e00::feed:100 <-NTT東日本
         ttl 64
     }
 }
最後にstatic routeでv6tun0へ流し込みます。
 protocols {
     static {
         interface-route 0.0.0.0/0 {
             next-hop-interface v6tun0 {
             }
         }
     }
 }
次回は、PPPoEの設定とその振り分けについて記載しようと思います。

NuxtからGatsbyに変えてLighthouseで100点を目指す、ついでにPWA対応もしてみた。

Nuxt から Gatsby に変えて Lighthouse の点数が 92 点まで上がりました。今回はさらに 100 点を目指したいと思います。ついで PWA に対応したいと思います。 SEO対応のため、NuxtからGatsbyに変更、さらにLighthouseを...