openwrt固件升级
- 下载最新的固件,选择generic-ext4-combined-efi.img.gz
- 在openwrt主界面的系统,备份与更新,先点击生成备份,备份一下数据
- 点击刷新固件,把第一步下载的固件上传
- 更新完成之后,回到这一步,点击上传备份,把之前的配置恢复
中文恢复
- 选择系统,软件包,更新列表
- 如果报错wgetFailed to send request: Operation not permitted,可能的问题是OpenClash 配置保留了,但程序没有恢复安装 导致的 DNS 故障。
- 搜索zh-cn,安装luci-i18n-base-zh-cn
- 然后点击系统,修改语言
解决 DNS 故障问题
删除 OpenClash DNS 转发
shuci del_list dhcp.@dnsmasq[0].server='127.0.0.1#7874' uci commit dhcp service dnsmasq restart恢复默认 DNS
shuci set dhcp.@dnsmasq[0].noresolv='0' uci commit dhcp service dnsmasq restart测试
nslookup downloads.openwrt.org,apk 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 dnsmasq | dnsmasq 是否启动 |
| ⑥ | logread | grep dnsmasq | 上游 DNS 是谁(最重要) |
| ⑦ | netstat -lnup | grep :53 | dnsmasq 是否监听 53 |
| ⑧ | grep -R "7874" /etc /var/etc | 是否有 OpenClash 遗留配置 |
| ⑨ | uci show dhcp | 是否启用了 noresolv、server 等特殊配置 |
扩展分区大小
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-resizeOpenClash安装
- openclash下载,下载apk,如luci-app-openclash-0.47.133.apk
- 在软件包中点击上传软件包,安装如果报错ERROR: /tmp/upload.apk: UNTRUSTED signature
- 手动在命令行执行,
apk add --allow-untrusted /tmp/upload.apk - 重启之后等待一会应该就会出现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