LoginSignup
0
0

OpenWrt パッケージインストール

Last updated at Posted at 2023-08-29

:warning:Japanese notation

こちらに統合しました

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


インストール

インストールは目的で取捨選択

アップデート

  • 最初必須
    アップデート情報は再起動でリセット
opkg update
UPDATE="1"

非推奨
opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade

デバイス再起動

  • 必要に応じて
reboot

終了

  • TeraTerm終了
exit

LuCi(Web管理画面)

リリースビルド(RC含む)は不要

#! /bin/sh
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
opkg install luci

LuCi日本語化

#! /bin/sh
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
opkg install luci-i18n-base-ja 
opkg install luci-i18n-opkg-ja
opkg install luci-i18n-firewall-ja

  • ブラウザ:
    192.168.1.1

    • ユーザー名:root
    • パスワード:設定したパスワード
  • QRコード:
    192.168.1.1
    QR192.168.1.1.png

Dashboard

#! /bin/sh
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
opkg install luci-mod-dashboard
opkg install luci-i18n-dashboard-ja

TTYD

WEBからSSHが使える
かなり便利

#! /bin/sh
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
opkg install luci-app-ttyd
opkg install luci-i18n-ttyd-ja
uci set ttyd.@ttyd[0]=ttyd
uci set ttyd.@ttyd[0].interface='@lan'
# uci set ttyd.@ttyd[0].command='/bin/login -f root ' # 自動ログイン
uci set ttyd.@ttyd[0].ipv6='1'
uci set ttyd.@ttyd[0].debug='7'
uci set ttyd.@ttyd[0].url_arg='1'
uci commit ttyd
service ttyd restart
/etc/init.d/rpcd restart

TTYDログイン

  • ブラウザ:
    192.168.1.1:7681

    • ユーザー名:root
    • パスワード:設定したパスワード
  • QRコード:
    192.168.1.1:7681
    QR_062248.png

SFTP server

ファイラー(WinSCPでエクスプローラー風に利用)
※要WinSCPインストール

#! /bin/sh
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
opkg install openssh-sftp-server

  • ダウンロード:WinSCP

  • WinSCPを起動

    • セッション
      • ホスト名:192.168.1.1
      • ユーザー名:root
      • パスワード:設定したパスワード
      • ログインをクリック

BusyBoxフルバージョン

参考

if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
opkg install coreutils

CPU負荷分散

4コアシステム以上でより有効
※全体的なパフォーマンスが向上し、さらには消費電力が削減される可能性があります
※2core ターゲットでは、ベンチマークのみを除くと、パフォーマンスが低下する可能性があります

#! /bin/sh
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
opkg install irqbalance
uci set irqbalance.irqbalance=irqbalance
uci set irqbalance.irqbalance.enabled='1'
uci commit irqbalance
/etc/init.d/irqbalance start

SQM(Smart Queue Management)

WAN側帯域コントローラー
★スナップショット必須
※リリースビルドも効果大
※要チューニング

#! /bin/sh
DOWNLOAD='0' #初期値
UPLOAD='0' #初期値
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
opkg install luci-app-sqm
opkg install luci-i18n-sqm-ja
. /lib/functions/network.sh
network_flush_cache
network_find_wan6 NET_IF6
network_get_physdev NET_L2D6 "${NET_IF6}"
uci set sqm.@queue[0].enabled='1'
uci set sqm.@queue[0].interface=${NET_L2D6}
uci set sqm.@queue[0].download=${DOWNLOAD}
uci set sqm.@queue[0].upload=${UPLOAD}
uci commit sqm
/etc/init.d/sqm start
/etc/init.d/sqm enable
# reboot

QoS(Network Traffic Control)

LAN側帯域コントローラー

#! /bin/sh
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
opkg install tc-mod-iptables
opkg install luci-app-qos
opkg install luci-i18n-qos-ja
# reboot

ネットワーク統計インターフェイス

#! /bin/sh
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
opkg install luci-i18n-statistics-ja
/etc/init.d/collectd enable
/etc/init.d/rpcd restart

帯域幅モニター

#! /bin/sh
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
opkg install luci-i18n-nlbwmon-ja
# reboot

WiFiスケジュール

WiFi制御

#! /bin/sh
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
opkg install wifischedule
opkg install luci-app-wifischedule
opkg install luci-i18n-wifischedule-ja

追加テーマ

#! /bin/sh
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
# OpnWrt
opkg install luci-theme-openwrt
# マテリアル
opkg install luci-theme-material
# モダン
opkg install luci-theme-openwrt-2020

LOLCAT

虹色で綺麗(なだけ)

#! /bin/sh
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
opkg install lolcat

サンプル

lolcat /etc/config/network

Attended Sysupgrade

自動アップグレード

アップグレード.png

#! /bin/sh
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
opkg install attendedsysupgrade-common
opkg install luci-app-attendedsysupgrade
opkg install luci-i18n-attendedsysupgrade-ja
opkg install auc

カスタム フィード gSpotx2f

現在のバージョン

  • ログ情報
  • CPUステータス
  • CPUパフォーマンス
  • 温度センサー
  • インターネット可用性確認
    • モデム再起動モジュール
    • 電子メール通知モジュール
{
# custom feed (log viewer, cpu status, cpu perf, temp status, Internet detector, disk info)
mkdir -p /tmp/config-software
wget --no-check-certificate -O /tmp/config-software/pacage_list https://github.com/gSpotx2f/packages-openwrt/raw/master/current/
PACAGE_LIST=`cat  /tmp/config-software/pacage_list |sed -ne '/ <script type/,/<\/script>/p' |sed -e 's/<[^>]*>//g'`
LOG_VIEWER=`echo ${PACAGE_LIST} | awk '{print substr($0,index($0,"current/luci-app-log-viewer") ,41)}'`
CPU_STATUS=`echo ${PACAGE_LIST} | awk '{print substr($0,index($0,"current/luci-app-cpu-status_0") ,41)}'`
CPU_PERF=`echo ${PACAGE_LIST} | awk '{print substr($0,index($0,"current/luci-app-cpu-perf") ,39)}'`
TEMP_STATUS=`echo ${PACAGE_LIST} | awk '{print substr($0,index($0,"current/luci-app-temp-status") ,42)}'`
INTERNET_DETECTOR=`echo ${PACAGE_LIST} | awk '{print substr($0,index($0,"current/internet-detector_1") ,39)}'`
INTERNET_DETECTER_A=`echo ${PACAGE_LIST} | awk '{print substr($0,index($0,"current/luci-app-internet-detector") ,48)}'`
INTERNET_DETECTOR_MODEM=`echo ${PACAGE_LIST} | awk '{print substr($0,index($0,"current/internet-detector") ,49)}'`
INTERNET_DETECTOR_EMAIL=`echo ${PACAGE_LIST} | awk '{print substr($0,index($0,"current/internet-detector-mod-email") ,49)}'`
DISKA_INFO=`echo ${PACAGE_LIST} | awk '{print substr($0,index($0,"current/luci-app-disks-info") ,41)}'`
rm -rf /tmp/config-software
echo Current Version -------------------------
echo ${LOG_VIEWER} | cut -d'/' -f2
echo ${CPU_STATUS} | cut -d'/' -f2
echo ${CPU_PERF} | cut -d'/' -f2
echo ${TEMP_STATUS} | cut -d'/' -f2
echo ${INTERNET_DETECTOR} | cut -d'/' -f2
echo ${INTERNET_DETECTER_A} | cut -d'/' -f2
echo ${INTERNET_DETECTOR_MODEM} | cut -d'/' -f2
echo ${INTERNET_DETECTOR_EMAIL} | cut -d'/' -f2
echo ${DISKA_INFO} | cut -d'/' -f2
echo -----------------------------------------
}

ログ情報

#! /bin/sh
# custom feed (log viewer, cpu status, cpu perf, temp status, Internet detector, disk info)
mkdir -p /tmp/config-software
wget --no-check-certificate -O /tmp/config-software/pacage_list https://github.com/gSpotx2f/packages-openwrt/raw/master/current/
PACAGE_LIST=`cat  /tmp/config-software/pacage_list |sed -ne '/ <script type/,/<\/script>/p' |sed -e 's/<[^>]*>//g'`
LOG_VIEWER=`echo ${PACAGE_LIST} | awk '{print substr($0,index($0,"current/luci-app-log-viewer") ,41)}'`
wget --no-check-certificate -O /tmp/luci-app-log-viewer_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/${LOG_VIEWER}
opkg install /tmp/luci-app-log-viewer_all.ipk
rm /tmp/luci-app-log-viewer_all.ipk

CPUステータス

CPUの使用率等リアルタイム表示

#! /bin/sh
# custom feed (log viewer, cpu status, cpu perf, temp status, Internet detector, disk info)
mkdir -p /tmp/config-software
wget --no-check-certificate -O /tmp/config-software/pacage_list https://github.com/gSpotx2f/packages-openwrt/raw/master/current/
PACAGE_LIST=`cat  /tmp/config-software/pacage_list |sed -ne '/ <script type/,/<\/script>/p' |sed -e 's/<[^>]*>//g'`
CPU_STATUS=`echo ${PACAGE_LIST} | awk '{print substr($0,index($0,"current/luci-app-cpu-status_0") ,41)}'`
wget --no-check-certificate -O /tmp/luci-app-cpu-status_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/${CPU_STATUS}
opkg install /tmp/luci-app-cpu-status_all.ipk
rm /tmp/luci-app-cpu-status_all.ipk

CPUパフォーマンス

CPUのパフォーマンスコントローラー

#! /bin/sh
# custom feed (log viewer, cpu status, cpu perf, temp status, Internet detector, disk info)
mkdir -p /tmp/config-software
wget --no-check-certificate -O /tmp/config-software/pacage_list https://github.com/gSpotx2f/packages-openwrt/raw/master/current/
PACAGE_LIST=`cat  /tmp/config-software/pacage_list |sed -ne '/ <script type/,/<\/script>/p' |sed -e 's/<[^>]*>//g'`
CPU_PERF=`echo ${PACAGE_LIST} | awk '{print substr($0,index($0,"current/luci-app-cpu-perf") ,39)}'`
wget --no-check-certificate -O /tmp/luci-app-cpu-perf_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/${CPU_PERF}
opkg install /tmp/luci-app-cpu-perf_all.ipk
rm /tmp/luci-app-cpu-perf_all.ipk

温度センサー

デバイス各センサーのリアルタイム表示

#! /bin/sh
# custom feed (log viewer, cpu status, cpu perf, temp status, Internet detector, disk info)
mkdir -p /tmp/config-software
wget --no-check-certificate -O /tmp/config-software/pacage_list https://github.com/gSpotx2f/packages-openwrt/raw/master/current/
PACAGE_LIST=`cat  /tmp/config-software/pacage_list |sed -ne '/ <script type/,/<\/script>/p' |sed -e 's/<[^>]*>//g'`
TEMP_STATUS=`echo ${PACAGE_LIST} | awk '{print substr($0,index($0,"current/luci-app-temp-status") ,42)}'`
wget --no-check-certificate -O /tmp/luci-app-temp-status_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/${TEMP_STATUS}
opkg install /tmp/luci-app-temp-status_all.ipk
rm /tmp/luci-app-temp-status_all.ipk

インターネット可用性確認

#! /bin/sh
# custom feed (log viewer, cpu status, cpu perf, temp status, Internet detector, disk info)
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
mkdir -p /tmp/config-software
wget --no-check-certificate -O /tmp/config-software/pacage_list https://github.com/gSpotx2f/packages-openwrt/raw/master/current/
PACAGE_LIST=`cat  /tmp/config-software/pacage_list |sed -ne '/ <script type/,/<\/script>/p' |sed -e 's/<[^>]*>//g'`
INTERNET_DETECTOR=`echo ${PACAGE_LIST} | awk '{print substr($0,index($0,"current/internet-detector_1") ,39)}'`
wget --no-check-certificate -O /tmp/internet-detector_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/${INTERNET_DETECTOR}
opkg install /tmp/internet-detector_all.ipk
rm /tmp/internet-detector_all.ipk
/tmp/init.d/internet-detector enable
INTERNET_DETECTER_A=`echo ${PACAGE_LIST} | awk '{print substr($0,index($0,"current/luci-app-internet-detector") ,48)}'`
wget --no-check-certificate -O /tmp/luci-app-internet-detector_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/${INTERNET_DETECTER_A}
opkg install /tmp/luci-app-internet-detector_all.ipk
rm /tmp/luci-app-internet-detector_all.ipk

#! /bin/sh
# custom feed (log viewer, cpu status, cpu perf, temp status, Internet detector, disk info)
mkdir -p /tmp/config-software
wget --no-check-certificate -O /tmp/config-software/pacage_list https://github.com/gSpotx2f/packages-openwrt/raw/master/current/
PACAGE_LIST=`cat  /tmp/config-software/pacage_list |sed -ne '/ <script type/,/<\/script>/p' |sed -e 's/<[^>]*>//g'`
INTERNET_DETECTOR_MODEM=`echo ${PACAGE_LIST} | awk '{print substr($0,index($0,"current/internet-detector") ,49)}'`
wget --no-check-certificate -O /tmp/internet-detector-mod-modem-restart_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/${INTERNET_DETECTOR_MODEM}
opkg install /tmp/internet-detector-mod-modem-restart_all.ipk
rm /tmp/internet-detector-mod-modem-restart_all.ipk
/etc/init.d/internet-detector restart

#! /bin/sh
# custom feed (log viewer, cpu status, cpu perf, temp status, Internet detector, disk info)
mkdir -p /tmp/config-software
wget --no-check-certificate -O /tmp/config-software/pacage_list https://github.com/gSpotx2f/packages-openwrt/raw/master/current/
PACAGE_LIST=`cat  /tmp/config-software/pacage_list |sed -ne '/ <script type/,/<\/script>/p' |sed -e 's/<[^>]*>//g'`
INTERNET_DETECTOR_EMAIL=`echo ${PACAGE_LIST} | awk '{print substr($0,index($0,"current/internet-detector-mod-email") ,49)}'`
wget --no-check-certificate -O /tmp/internet-detector-mod-email_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/${INTERNET_DETECTOR_EMAIL}
opkg install /tmp/internet-detector-mod-email_all.ipk
rm /tmp/internet-detector-mod-email_all.ipk
/etc/init.d/internet-detector restart

カスタムフィード ARGON

テーマ ARGON (テンプレート)

※Chrome ブラウザを強くお勧めします。このテーマではいくつかの新しい css3 機能が使用されていますが、現時点で最も互換性が高いのは Chrome のみです。

#! /bin/sh
ARGON_VERSION='2.3.1'
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
opkg install luci-compat
opkg install luci-lib-ipkg
wget --no-check-certificate -O /tmp/luci-theme-argon.ipk https://github.com/jerrykuku/luci-theme-argon/releases/download/v${ARGON_VERSION}/luci-theme-argon_${ARGON_VERSION}_all.ipk
opkg install /tmp/luci-theme-argon.ipk
rm /tmp/luci-theme-argon.ipk
/etc/init.d/rpcd restart

テーマ EDGE

#! /bin/sh
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
wget --no-check-certificate -O /tmp/luci-theme-edge.ipk https://github.com/noct99/blog.vpngame.com/raw/main/luci-theme-edge.ipk
opkg install /tmp/luci-theme-edge.ipk
rm /tmp/luci-theme-edge.ipk
/etc/init.d/rpcd restart

テーマ OPENTOMATO

#! /bin/sh
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
wget --no-check-certificate -O /tmp/luci-theme-opentomato.ipk https://github.com/noct99/blog.vpngame.com/raw/main/luci-theme-opentomato.ipk
opkg install /tmp/luci-theme-opentomato.ipk
rm /tmp/luci-theme-opentomato.ipk
/etc/init.d/rpcd restart

テーマ TANO

#! /bin/sh
if [ -e ${UPDATE} ]; then
opkg update
UPDATE="1"
fi
wget --no-check-certificate -O /tmp/luci-theme-tano.ipk https://github.com/noct99/blog.vpngame.com/raw/main/luci-theme-tano.ipk
opkg install /tmp/luci-theme-tano.ipk
rm /tmp/luci-theme-tano.ipk
/etc/init.d/rpcd restart

他デバイス設定

USB

WAN

選択型インターネット接続自動設定

階層
※それぞれの階層に設定とその復元がある
※一度設定すると、そのバックアップを取るので、復元が出来る仕様

  • OCNバーチャルコネクト
    • ニチバン対策のみ
  • V6プラス・IPv6オプション
    • ニチバン対策のみ
  • トランジックス
  • クロスパス
  • v6 コネクト
  • ひかりone系・他PPPoE
  • アクセスポイント
  • 終了

初期化

ファクトリーリセット(初期化)

# 要注意
firstboot && reboot now

This will erase all settings and remove any installed packages. Are you sure? [N/y]

初期化:入力モード
y

デバイスリセットボタン

デバイスのリセットボタンを5秒押し続ける

あとがき

参考資料(感謝:relaxed:

https://github.com/gSpotx2f

新しいOpenWrt LuCIテーマ

0
0
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
0
0