Skip to content

openwrt固件升级

  1. 下载最新的固件,选择generic-ext4-combined-efi.img.gz
  2. 在openwrt主界面的系统备份与更新,先点击生成备份,备份一下数据
  3. 点击刷新固件,把第一步下载的固件上传
  4. 更新完成之后,回到这一步,点击上传备份,把之前的配置恢复

中文恢复

  1. 选择系统软件包更新列表
  2. 如果报错wgetFailed to send request: Operation not permitted,可能的问题是OpenClash 配置保留了,但程序没有恢复安装 导致的 DNS 故障。
  3. 搜索zh-cn,安装luci-i18n-base-zh-cn
  4. 然后点击系统,修改语言

解决 DNS 故障问题

  1. 删除 OpenClash DNS 转发

    sh
    uci del_list dhcp.@dnsmasq[0].server='127.0.0.1#7874'
    uci commit dhcp
    service dnsmasq restart
  2. 恢复默认 DNS

    sh
    uci set dhcp.@dnsmasq[0].noresolv='0'
    uci commit dhcp
    service dnsmasq restart
  3. 测试 nslookup downloads.openwrt.orgapk update

判断过程

步骤命令判断什么
ping 1.1.1.1网络是否正常
nslookup downloads.openwrt.org是否 DNS 故障
nslookup downloads.openwrt.org 1.1.1.1本机 DNS 还是公网 DNS 问题
cat /etc/resolv.conf系统当前使用哪个 DNS
ps | grep dnsmasqdnsmasq 是否启动
logread | grep dnsmasq上游 DNS 是谁(最重要
netstat -lnup | grep :53dnsmasq 是否监听 53
grep -R "7874" /etc /var/etc是否有 OpenClash 遗留配置
uci show dhcp是否启用了 noresolvserver 等特殊配置

扩展分区大小

文档文档2

sh
# Install packages
apk update
apk add parted losetup resize2fs blkid
 
# Download expand-root.sh
wget -U "" -O expand-root.sh "https://openwrt.org/_export/code/docs/guide-user/advanced/expand_root?codeblock=0"
chmod +x expand-root.sh
 
# Source the script (creates /etc/uci-defaults/70-rootpt-resize and /etc/uci-defaults/80-rootfs-resize, and adds them to /etc/sysupgrade.conf so they will be re-run after a sysupgrade)
. ./expand-root.sh
 
# Resize root partition and filesystem (will resize partiton, reboot resize filesystem, and reboot again)
sh /etc/uci-defaults/70-rootpt-resize

OpenClash安装

  1. openclash下载,下载apk,如luci-app-openclash-0.47.133.apk
  2. 软件包中点击上传软件包,安装如果报错ERROR: /tmp/upload.apk: UNTRUSTED signature
  3. 手动在命令行执行,apk add --allow-untrusted /tmp/upload.apk
  4. 重启之后等待一会应该就会出现openclash菜单了

启动命令

sh
/etc/init.d/openclash start
/etc/init.d/openclash enable
/etc/init.d/openclash restart
/etc/init.d/openclash status

如果无法启动,软件包更新luci-compat, luci, luci-app-openclash/etc/init.d/uhttpd restart