Timetombs

泛义的工具是文明的基础,而确指的工具却是愚人的器物

66h / 117a
,更新于 2024-03-10T17:38:47Z+08:00 by   63c7f91

[工具] openwrt

版权声明 - CC BY-NC-SA 4.0

1 flush

1.1 breed

breed1是一个bootloader,类似与电脑中的BIOS以及安卓手机中的recovery,用来刷机用的。

# 登陆到路由器
ssh root@10.1.199.1

# 复制breed.bin到路由器
scp breed.bin ssh root@10.1.199.1:/root/

# 刷入breed
mtd -r write breed.bin u-boot

成功刷入后路由器会自动重启,启动后长按重置键3~6秒松开即可进入breed模式。breed的默认ip为192.168.1.1,故而需要网线连接路由器的LAN口到电脑网口,电脑设置IP如下:

ip      192.168.1.2
netmask 255.255.255.0
dns     192.168.1.1

然后访问http://192.168.1.1即可。

1.2 openwrt

openwrt2直接用mtd刷入也可以。

# 刷路由器固件
mtd -r write openwrt.bin firmware

aliyun-mirror:https://mirrors.aliyun.com/openwrt/releases/22.03.2/targets/x86/64/

# mirror
sed -i 's_downloads.openwrt.org_mirrors.aliyun.com/openwrt_' /etc/opkg/distfeeds.conf

# 安装ca-certificates
opkg update
opkg install ca-certificates

2 software

2.1 openwrt-v2ray

openwrt-v2ray3安装步骤

  1. ca-certificates:在线安装即可。
  2. v2ray-core-mini_4.37.3-1_mipsel_24kc.ipk:下载ipk文件,上传安装。

默认的安装目录/usr/bin/v2ray

# 复制相关的配置文件
scp config.json geoip.dat geosite.dat root@10.1.199.1:/usr/bin/

2.2 USB

opkg update

opkg install kmod-usb-core
opkg install kmod-scsi-core
opkg install kmod-scsi-generic
opkg install kmod-usb-uhci
opkg install kmod-usb-ohci
opkg install kmod-usb2
opkg install kmod-usb3
opkg install kmod-usb-storage
opkg install kmod-usb-storage-extras
opkg install kmod-fs-exfat
opkg install block-mount
opkg install usbutils

lsusb

2.3 Samba

opkg update
opkg install luci-app-samba4

2.4 Stats

opkg update

opkg install luci-app-statistics

# 查询支持的监控模块
# opkg list | grep collectd-mod | sort

opkg install collectd-mod-cpu
opkg install collectd-mod-df
opkg install collectd-mod-disk
opkg install collectd-mod-load
opkg install collectd-mod-ipstatistics
#opkg install collectd-mod-iptables
opkg install collectd-mod-memory
opkg install collectd-mod-network
opkg install collectd-mod-ping
#opkg install collectd-mod-protocols
/etc/init.d/collectd enable

3 x86

x86:https://downloads.openwrt.org/releases/22.03.2/targets/x86/64/
download:https://downloads.openwrt.org/releases/22.03.5/targets/x86/64/openwrt-22.03.5-x86-64-generic-ext4-combined.img.gz

各版本区别

  1. squashfs : 只读文件系统,支持重置,不支持扩容。
  2. ext4 : 可读写,不支持重置,支持扩容。
vim /etc/config/network
# add wan
# 替换镜像
sed -i 's_downloads.openwrt.org_mirrors.aliyun.com/openwrt_' /etc/opkg/distfeeds.conf

opkg install fdisk
fdisk -l
# F查看剩余空间 n创建新分区
fdisk /dev/sda
fdisk -l
# 为新创建的分区格式化文件系统为ext4
mkfs.ext4 /dev/sda3

opkg install block-mount

4 reference

  1. local_token: http://hiwifi.com/local-ssh
  2. uuid: http://hiwifi.com/cgi-bin/turbo/proxy/router_info
  3. ssh: http://www.hiwifi.wtf
  4. aliyun-mirrors :https://mirrors.aliyun.com/openwrt/releases/22.03.2/targets/ramips/mt7621
下一篇 : [工具] traefik