はじめに
初心者対応構成
- Windowsからの導入手順
- スクリプトでの自動設定
-
UCI (ttyd)、Webコンソール (LuCi)、ファイラー (SFTP)にて比較作業がおススメ
デバイスアクセス
PowerShellの開始
- キー入力:
Win+x>a>はい
UCI(SSH)アクセス
powershell:初期設定用
ssh -o StrictHostKeyChecking=no root@192.168.1.1
- root@192.168.1.1's password:
初期値:パスワード無し
OpenSSHのインストールが無い場合
- 機能の確認
※Windows 10 Fall Creators Update(1709)以降標準搭載
powershell
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
- 機能のインストール
powershell
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
ファームウェアについて
デバイスについて
WTR-M2133HPラインナップ
-
WTR-M2133HP
-
WTR-M2133HP-PR
- ハードウェア仕様
ARMv7 Cortex-A7 (Quad-Core)- CPU : 717 MHz x4
- RAM : 512 MB
- Flash Memory: 128 MB # 1Gb SLC
- WiFi : 5 (ac) 160 MHz # WPA3(OpenWrt)
- Ethernet : 1 Gbps x4
- USB : USB 3.0 x1
- Power : DC 12 V / 2 A
- Qualcomm IPQ4019
- Qualcomm QCA9984
- Macronix MX30LF1G18AC
OpenWrt化手順:Flash instruction
事前準備
- スクリプト: buffalo
- ディレクトリ:
C:\openwrt
警告 > 強制的に貼り付け
powershell
Set-ExecutionPolicy Unrestricted
Set-ExecutionPolicy Unrestricted
New-Item C:\openwrt -ItemType Directory -Force
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/site-u2023/buffalo/main/wtr-m2133hp.ps1" -OutFile "C:\openwrt\wtr-m2133hp.ps1"
C:\openwrt\wtr-m2133hp.ps1
デバイスをインターネット回線から物理的切断(ONU・HGWからLAN線を外す)
4. Hold down the AOSS button, then power on the router.
- AOSSボタンを押しながら電源に接続
- そのまま10秒ほど押し続けてから離す
- 以下2行のログを確認しServaを閉じる
[**/** **:**:**.***] TFTP Inf: Read file <WTR-M2133HP-initramfs.uImage>. Mode octet[**/** **:**:**.***] TFTP Inf: <WTR-M2133HP-initramfs.uImage>: sent blks=5701 blkSz=1468, Total 8368804 bytes in 4s, err recovery=0
- ルーターが自動で再起動
※うまくいかない場合、以下からServaを起動させ再度実行
powershell
& "C:\openwrt\Serva\Serva64.exe"
-
I am"Community" userを選択 -
左上アイコンをダブルクリック -
TFTPタブを選択- Service Up/Down
-
TFTP Serverにチェック
-
- THTP Server IP address
-
192.168.11.10になっている事を確認
-
- THTP Server root directory
-
Browseをクリック
C:\openwrt\buffalo\WXR-5950AX12-initramfs.uImageを指定-
Selectをクリック
-
-
-
OKをクリック
- Service Up/Down
5. After booting OpenWrt initramfs image, connect to the router by SSH.
powershell: 192.168.1.2
C:\openwrt\ip\192-168-1-2.ps1
powershell
scp -r C:\openwrt\buffalo\openwrt-21.02.7-ipq40xx-generic-buffalo_wtr-m2133hp-squashfs-nand-factory.ubi root@192.168.1.1:/tmp/openwrt-21.02.7-ipq40xx-generic-buffalo_wtr-m2133hp-squashfs-nand-factory.ub
powershell
ssh -o StrictHostKeyChecking=no root@192.168.1.1
7. Execute the following commands.
example
ubidetach -p /dev/mtd15
ubiformat /dev/mtd15 -f /tmp/openwrt-21.02.7-ipq40xx-generic-buffalo_wtr-m2133hp-squashfs-nand-factory.ubi
fw_setenv bootcmd bootipq
SSH
ubidetach -p /dev/mtd15
ubiformat /dev/mtd15 -f /tmp/openwrt-21.02.7-ipq40xx-generic-buffalo_wtr-m2133hp-squashfs-nand-factory.ubi
fw_setenv bootcmd bootipq
絶対に電源は抜かない事
デバイスをインターネット回線に物理的接続(ONU・HGWからLAN線に繋ぐ)
フラッシュ&インストールシステム
ランディングページ
キッティングツール
デバイス用のOpenWrtカスタムファームウェアをダウンロード
サンプル
#!/bin/sh
cat > "/tmp/openwrt-network-auto-config.sh" << 'SCRIPT_END'
#!/bin/sh
set -eu
API_RESPONSE="$(wget -qO- https://auto-config.site-u.workers.dev/)"
echo "NOTICE=$(echo "$API_RESPONSE" | jsonfilter -e '@.notice')"
echo "IPV4=$(echo "$API_RESPONSE" | jsonfilter -e '@.ipv4')"
echo "IPV6=$(echo "$API_RESPONSE" | jsonfilter -e '@.ipv6')"
echo "COUNTRY=$(echo "$API_RESPONSE" | jsonfilter -e '@.country')"
echo "TIMEZONE=$(echo "$API_RESPONSE" | jsonfilter -e '@.timezone')"
echo "ZONENAME=$(echo "$API_RESPONSE" | jsonfilter -e '@.zonename')"
echo "ISP=$(echo "$API_RESPONSE" | jsonfilter -e '@.isp')"
echo "AS=$(echo "$API_RESPONSE" | jsonfilter -e '@.as')"
echo "REGION_NAME=$(echo "$API_RESPONSE" | jsonfilter -e '@.regionName')"
echo "REGION_CODE=$(echo "$API_RESPONSE" | jsonfilter -e '@.region')"
echo "AFTR_TYPE=$(echo "$API_RESPONSE" | jsonfilter -e '@.aftr.aftrType')"
echo "AFTR_JURISDICTION=$(echo "$API_RESPONSE" | jsonfilter -e '@.aftr.jurisdiction')"
echo "AFTR_IPV6=$(echo "$API_RESPONSE" | jsonfilter -e '@.aftr.aftrIpv6Address')"
echo "MAPE_BR_IPV6=$(echo "$API_RESPONSE" | jsonfilter -e '@.mape.brIpv6Address')"
echo "MAPE_EA_BITS=$(echo "$API_RESPONSE" | jsonfilter -e '@.mape.eaBitLength')"
echo "MAPE_IPV4_PREFIX=$(echo "$API_RESPONSE" | jsonfilter -e '@.mape.ipv4Prefix')"
echo "MAPE_IPV4_PLEN=$(echo "$API_RESPONSE" | jsonfilter -e '@.mape.ipv4PrefixLength')"
echo "MAPE_IPV6_PREFIX=$(echo "$API_RESPONSE" | jsonfilter -e '@.mape.ipv6Prefix')"
echo "MAPE_IPV6_PLEN=$(echo "$API_RESPONSE" | jsonfilter -e '@.mape.ipv6PrefixLength')"
echo "MAPE_PSID_OFFSET=$(echo "$API_RESPONSE" | jsonfilter -e '@.mape.psIdOffset')"
echo "MAPE_PSIDLEN=$(echo "$API_RESPONSE" | jsonfilter -e '@.mape.psidlen')"
SCRIPT_END
sh "/tmp/openwrt-network-auto-config.sh"
コンソールツール
デバイス更新
22.03 以降ではQCA9984ドライバーを読み込まない
SSH
wget /tmp/openwrt-23.05.2-ipq40xx-generic-buffalo_wtr-m2133hp-squashfs-sysupgrade.bin
sysupgrade -v /tmp/openwrt-23.05.2-ipq40xx-generic-buffalo_wtr-m2133hp-squashfs-sysupgrade.bin
Attended Sysupgrade
opkg update
luci-app-attendedsysupgrade
opkg install auc
純正ファームウェアリカバリ:Recover to stock firmware
絶対に電源は抜かない事
あとがき
OpenWrt化、四つ目
性能良いし、以外と省エネなんじゃないかな
- 4CPU、トライバンド、メモリ512MB、AC160Mhz、USB3.0
- フリマ等での調達費用も格安
- 純正ファーム復旧はコマンド1つ
バンドステアリングしたいけど、わざわざWPA2にしたくないなあ
中身が見たい、分解したくなってきた今日この頃・・・




