LoginSignup
1
1

OpenWrt 21.02.7 WTR-M2133HP (PR) Windowsから導入

Last updated at Posted at 2023-05-25

:warning:Japanese notation

はじめに

初心者対応構成

  • スクリプトでの自動設定
  • UCIとLuCi及びWinSCPにて比較しながら作業がおススメ

PowerShellSSHアクセス

ssh root@192.168.1.1
ssh root@192.168.1.1のショートカット作成(デスクトップ)
powershell
$DESKTOP = ([Environment]::GetFolderPath("Desktop") + "\192.168.1.1.lnk")
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$DESKTOP")
$Shortcut.TargetPath = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
$Shortcut.Arguments = '-windowstyle hidden -ExecutionPolicy RemoteSigned "Start-Process ssh root@192.168.1.1"'
$Shortcut.IconLocation = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe,0"
$Shortcut.WorkingDirectory = "."
$Shortcut.Save()

  • 強制的に貼り付け
  • yes

SSHログイン出来ない場合:exclamation:

known_hostsクリア

  • C:\Users\yourusername\.ssh\known_hosts ※Windows隠しファイル
powershell
Clear-Content .ssh\known_hosts -Force


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-M2133'HS'未対応
  • ファームウェア対応:安定バージョン 21.02.7
    ※22.03 以降ではQCA9984ドライバーを読み込まない
  • dawn-wolfssをインストールする場合、WPA3からWPA2に要ダウングレード

ファームウェアについて

デバイスについて

WTR-M2133HPラインナップ

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線を外す)

1. Set up a TFTP server (IP address: 192.168.11.10)

powershell: 192.168.11.10
C:\openwrt\ip\192-168-11-10.ps1

powershell
& "C:\openwrt\Serva\Serva64.exe"

Servaが起動

  • I'm a "Community" userを選択
    • 7 Secs待つ
      • 許可

※IPアドレス拾わない場合、ストックファームウェアのデバイスを起動し安定させてから、Servaを起動させる

2. Rename "initramfs-fit-uImage.itb" to "WTR-M2133HP-initramfs.uImage" and put it into the TFTP server directory.

3. Connect the TFTP server and WTR-M2133HP.

  • デバイス(WTR-M2133HP)とTFTPサーバー(Windows)が自動接続

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をクリック

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 root@192.168.1.1

yes

※SSHログイン出来ない場合、以下を削除(隠しファイル)

C:\Users\yourusername\.ssh\known_hosts

powershell
Clear-Content .ssh\known_hosts -Force


6. Transfer "squashfs-nand-factory.ubi" to the router.

SSH
sysupgrade /tmp/openwrt-21.02.7-ipq40xx-generic-buffalo_wtr-m2133hp-squashfs-nand-factory.ubi

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

Perform reboot.

SSH
reboot

絶対に電源は抜かない事

完了

  • LEDが消灯し、ルーターが再起動
  • LEDは以下に動作
    1.全点灯
    2.全消灯
    3.中央青点滅
    4.中央白点灯OK

OpenWrt化完了

デバイスをインターネット回線に物理的接続(ONU・HGWからLAN線に繋ぐ)

クライアントPCをDHCPにする

警告 > 強制的に貼り付け

powershell: DHCP
C:\openwrt\ip\dhcp.ps1
Set-ExecutionPolicy Restricted

新規設定用 オールインワンスクリプト 初心者対応

デバイス更新

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

1. Execute the following command.

・fw_setenv bootcmd bootbf

SSH
fw_setenv bootcmd bootbf
reboot

絶対に電源は抜かない事

2. Reboot and wait several minutes.

再起動後、数分待つ

あとがき

OpenWrt化、四つ目

性能良いし、以外と省エネなんじゃないかな

  • 4CPU、トライバンド、メモリ512MB、AC160Mhz、USB3.0
  • フリマ等での調達費用も格安
  • 純正ファーム復旧はコマンド1つ

バンドステアリングしたいけど、わざわざWPA2にしたくないなあ

中身が見たい、分解したくなってきた今日この頃・・・

参考資料(感謝:relaxed:

ハードウェア表:ファームウェアのダウンロード

Memo/OpenWrt/Buffalo_WSR-2533DHP

1
1
4

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