找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 7099|回复: 16

[红米ax6000] 红米AX6000刷机折腾记录

[复制链接]
本帖最后由 sandylaw 于 2023-11-24 11:22 编辑


Redmi AX6000 Openwrt
准备工作
  • 红米AX6000,自带固件1.0.67,无需降级,也可以开启ssh。
  • Mac/Linux/windows(windows开启本机的telnet功能:控制面板——卸载程序——启用或关闭Windows功能——勾选telnet功能——确定)

小米路由官方修复工具
小米路由官方修复工具MIWIFIRepairTool.x86.zip
红米AX6000 RB06官方固件
网线接路由器和电脑,路由器断电,电脑退出杀毒软件,还有Windows的自带Windows Defender防火墙杀毒,关闭电脑防火墙,解压并打开小米路由修复工具,选择官方的rb06固件,网卡选择当前连接路由器的网卡,点下一步,工具会自动配置网卡IP为192.168.31.100/24,配置好后会显示刷机步骤,然后按住路由器RESET插电开机,大概12秒后等到黄灯闪烁后可以松开RESET,等待小米路由修复工具连接路由器开始上传固件,上传完后会刷机,刷机成功后蓝灯闪烁。等待10秒后重新断电插电即可恢复到官方系统。点击退出小米路由修复工具,网卡会自动恢复自动获取的配置。

踩坑1: 杀毒关了,防火墙没关,上传固件的界面不会弹出来,我也不知道怎么回事,没有任何提示,防火墙关掉后才会弹出传输固件的弹窗。

踩坑2:小米路由出厂固件开机,设置上网方式,我选择了wifi中继模式,结果后面的开启ssh的命令就是不生效,恢复到了dhcp或者拨号模式后,ip是192.168.31.1才可以。

获取token
登陆小米路由器admin,浏览器地址栏stok=后面部分就是token, 这个token是每次登录都会变化,后面都会用到这个token。如果重新登录后,都要重新复制这个token.
开启开发者模式
更改路由器的crash分区,使其进入到开发者模式
将下面的URL里面的stok=token的token替换成上面获取路由器的token值,然后复制到到浏览器并且按enter打开
  1. http://192.168.31.1/cgi-bin/luci/;stok=token/api/misystem/set_sys_time?timezone=%20%27%20%3B%20zz%3D%24%28dd%20if%3D%2Fdev%2Fzero%20bs%3D1%20count%3D2%202%3E%2Fdev%2Fnull%29%20%3B%20printf%20%27%A5%5A%25c%25c%27%20%24zz%20%24zz%20%7C%20mtd%20write%20-%20crash%20%3B%20
复制代码

浏览器返回{“code”:0},表示成功。
通过浏览器重启路由器
在浏览器地址栏输入下面的url, 和上面的做法一样,将stok=token的token替换成上面获取路由器的token值
  1. http://192.168.31.1/cgi-bin/luci/;stok=token/api/misystem/set_sys_time?timezone=%20%27%20%3b%20reboot%20%3b%20
复制代码

设置Bdata参数
设置参数telnet_en、 ssh_en、uart_en
重启后,要重新获取token, 然后在浏览器地址栏输入下面的url, 将stok=token的token替换成上面获取路由器的token值
  1. http://192.168.31.1/cgi-bin/luci/;stok=token/api/misystem/set_sys_time?timezone=%20%27%20%3B%20bdata%20set%20telnet_en%3D1%20%3B%20bdata%20set%20ssh_en%3D1%20%3B%20bdata%20set%20uart_en%3D1%20%3B%20bdata%20commit%20%3B%20
复制代码

重启路由器
在浏览器地址栏输入下面的url, 和上面的做法一样,将stok=token的token替换成上面获取路由器的token值
  1. http://192.168.31.1/cgi-bin/luci/;stok=token/api/misystem/set_sys_time?timezone=%20%27%20%3b%20reboot%20%3b%20
复制代码

通过telnet开启ssh
在终端输入telnet 192.168.31.1, 可以看到Are you ok的界面,就证明telnet成功了。
telnet连接上,输入指令开启ssh并修改密码为admin:
  1. bdata set boot_wait=on
  2. bdata commit
  3. nvram set ssh_en=1
  4. nvram set telnet_en=1
  5. nvram set uart_en=1
  6. nvram set boot_wait=on
  7. nvram commit
  8. sed -i 's/channel=.*/channel="debug"/g' /etc/init.d/dropbear
  9. /etc/init.d/dropbear restart
  10. echo -e 'admin\nadmin' | passwd root
复制代码

永久开启ssh
开启新窗口,使用ssh登录路由器,输入指令开启ssh并修改密码为admin:
ssh root@192.168.31.1
不过ssh登录的时候如果报下面的错误no matching host key type found. Their offer: ssh-rsa, 是因为OpenSSH 7.0以后的版本不再支持ssh-rsa (RSA)算法, 解决方法是手动加上
  1. # vi ~/.ssh/config
  2. Host redmi
  3.   HostName 192.168.31.1
  4.   User root
  5.   Port 22
  6.   HostKeyAlgorithms +ssh-rsa
  7.   PubkeyAcceptedKeyTypes +ssh-rsa
复制代码

或者
  1. #  ssh -oHostKeyAlgorithms=+ssh-rsa  <a href="mailto:root@192.168.31.1">root@192.168.31.1</a>
复制代码

从telnet开启的ssh,路由器重启会失效,添加一个开启自动运行的脚本,来实现自动开启ssh。如果恢复出厂设置或重新刷机后需要重新添加.
  1. mkdir /data/auto_ssh && cd /data/auto_ssh
  2. touch auto_ssh.sh
  3. chmod +x auto_ssh.sh
复制代码

创建auto_ssh.sh文件,使用vi输入下面的内容并保存
  1. <blockquote>#!/bin/sh
复制代码

将auto_ssh写入固化
  1. uci set firewall.auto_ssh=include
  2. uci set firewall.auto_ssh.type='script'
  3. uci set firewall.auto_ssh.path='/data/auto_ssh/auto_ssh.sh'
  4. uci set firewall.auto_ssh.enabled='1'
  5. uci commit firewall
复制代码

关闭开发者模式
ssh连接上路由器后,输入指令关闭开发者模式
  1. mtd erase crash
  2. reboot
复制代码

修复时区异常
如果路由器时区异常,ssh连接中路由器后, 输入指令修复时区异常
  1. uci set system.@system[0].timezone='CST-8'
  2. uci set system.@system[0].webtimezone='CST-8'
  3. uci set system.@system[0].timezoneindex='2.84'
  4. uci commit
复制代码

刷hanwckf大佬的不死uboot
hanwckf大佬uboot地址:https://github.com/hanwckf/bl-mt798x/releases下载后解压出来mt7986_redmi_ax6000-fip-fixed-parts-multi-layout.bin就是红米AX6000的uboot20230902大佬更新了最新红米AX6000支持多分区的uboot,具体使用可以看大佬博客https://cmi.hanwckf.top/p/mt798x-uboot-usage/
  • 不论你现在在什么三方系统下,请先用救砖工具回官方系统后,进telnet解锁ssh
  • 进入ssh界面运行命令cat /proc/mtd

查看FIP在哪个分区,有的非官方固件在分区4,官方固件在分区5;一定要看好自己的
  • 替换不死文件前,先备份官方引导 fip分区,并自行导出。
    1. dd if=/dev/mtd5 of=/tmp/FIP.bin
    复制代码

  • 将不死uboot传输到路由/tmp目录
  • ssh界面运行命令刷入不死uboot:
    1. mtd write /tmp/xxuboot.bin /dev/mtd5
    复制代码

  • 写入不死完SSH无提示报错;等个5秒直接拔电;电脑以太网卡ipv4地址固定为192.168.31.X(X为2-254任意数字)


  • 断电状态下;先顶住reset孔后插电,观察以太网卡,大约15秒即可松手,目前第一版不死BOOT无LED灯提示


  • 非IE浏览器外的任意高内核版本浏览器,输入192.168.31.1;即可进入uboot的webui界面


刷不死uboot后不支持小米官方救砖工具,需要刷回原厂FIP分区后,才能用小米救砖工具刷回官方固件。
【110MB大分区uboot版本固件】目前237大佬和**hanwckf大佬的闭源OP支持uboot(ubi分区110MB)大分区,OpenWrt官方X-Wrt源码则已经更新了ubootmod(ubi分区122.5MB),为了避免混乱他们舍弃了uboot(ubi分区110MB)的支持,Lean开源源码目前还支持110MB大分区固件,大家也可以尝试。强烈推荐237大佬的闭源OP,uboot大分区和官方分区的固件都有:**https://www.right.com.cn/forum/thread-8261104-1-1.html

固件: https://www.right.com.cn/forum/thread-6352752-1-1.html  刷机后,open克拉什  正在收集数据…,不稳定。
固件:https://www.right.com.cn/forum/thread-8288981-1-1.html  刷机后,open克拉什 无法更新配置。
固件:https://www.right.com.cn/forum/thread-8285429-1-1.html 插件太多,open克拉什  正在收集数据…,不稳定。
固件:https://www.right.com.cn/forum/thread-8261104-1-1.html 较稳定,服务只有OP,有Turbo ACC网络加速。

从hanwckf大佬的不死uboot刷回官方
原理参考红米AX6刷回官方固件,就是把uboot还原回原厂uboot(因为没有刷分区表文件,所以没有刷回原厂分区表操作),再用官方修复工具恢复官方固件。目前只知道237大佬和hanwckf大佬的闭源OP是已解锁FIP的,可以直接刷uboot,如果当前固件不能刷FIP分区,请先刷回闭源OP,再刷回原厂uboot。建议使用自己机子的FIP备份,其他的我没试过。将自己的原厂FIP备份文件,如mtd5_FIP.bin,上传到tmp文件夹下,然后解锁FIP分区的固件下输入命令刷入:
  1. md5sum /tmp/mtd5_FIP.bin
  2. mtd write /tmp/mtd5_FIP.bin FIP
  3. mtd verify /tmp/mtd5_FIP.bin FIP
复制代码

注意:写入FIP分区时不能断电、重启,不然就直接变砖,只能上编程器了。这里和刷不死uboot一样,使用md5sum检查上传到tmp文件夹的原厂uboot文件的md5值和你保存的是否一样,无误后用mtd write将原厂uboot文件写入FIP分区,再用mtd verify对比检查原厂uboot文件是否已写入FIP分区。注意mtd命令最后的FIP是大写。
对比检查最后输出“Success"说明刷入已成功,可以断电路由器,然后打开小米路由官方修复工具进行修复了。

常用软件配置open克拉什
  • 手动安装

https://github.com/zerolabnet/open克拉什
这个版本 没有 kmod-inet-diag 依赖,适用于使用存储库 kmod-inet-diag 中没有的版本的用户。
    1. opkg update
    2. opkg install dnsmasq-full --download-only && opkg remove dnsmasq && opkg install dnsmasq-full --cache . && rm *.ipk
    3. opkg install wget-ssl coreutils-nohup bash iptables curl ca-certificates ipset ip-full iptables-mod-tproxy iptables-mod-extra libcap libcap-bin ruby ruby-yaml kmod-tun unzip luci-compat
    4. cd /tmp
    5. wget <a href="https://github.com/zerolabnet/open克拉什/releases/download/v0.45.121-beta/luci-app-open克拉什_0.45.121-beta_all.ipk" target="_blank">https://github.com/zerolabnet/op ... 45.121-beta_all.ipk</a>
    6. opkg install luci-app-open克拉什_0.45.121-beta_all.ipk
    7. reboot
    复制代码

    下载mesh内核

解压后的文件较大,使用upx压缩。
upx可以有效地对可执行文件进行压缩,并且压缩后的文件可以直接由系统执行,支持多系统和平台。 使用 UPX 来压缩可执行文件是一种减少发布包大小的有效方式。
  1. upx [options] yourfile
复制代码

复制
upx 对文件的默认操作即为压缩,使用上述命令会使用默认参数压缩并替换文件 yourfile。 upx 支持如下可选参数:
  • -1[23456789]:不同的压缩级别,数值越高压缩率越高,但耗时更长。对于小于 512 KiB 的文件默认使用 -8  ,其他的默认为  -7        。

  • --best:最高压缩级别
  • --brute:尝试使用各种压缩方式来获取最高压缩比
  • --ultra-brute:尝试使用更多的参数来获取更高的压缩比
  • -o [file]:将压缩文件保存为 [file]

将压缩后的clash_meta传输到/etc/open克拉什/core/clash_meta

配置open克拉什,订阅一个,并启动。
Adguard home
  • 手动安装 Adguard home

  1. opkg install luci-app-adguardhome_1.8-11_all.ipk
  2. reboot
复制代码

  • Adguard广告规则

  1. filters:
  2.   - enabled: true
  3.     url: <a href="https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txt" target="_blank">https://adguardteam.github.io/Ho ... assets/filter_1.txt</a>
  4.     name: AdGuard DNS filter
  5.     id: 1
  6.   - enabled: false
  7.     url: <a href="https://adguardteam.github.io/HostlistsRegistry/assets/filter_2.txt" target="_blank">https://adguardteam.github.io/Ho ... assets/filter_2.txt</a>
  8.     name: AdAway Default Blocklist
  9.     id: 2
  10.   - enabled: true
  11.     url: <a href="https://ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/EasyList.txt" target="_blank">https://ghproxy.com/https://raw. ... /rules/EasyList.txt</a>
  12.     name: EasyList
  13.     id: 1700569140
  14.   - enabled: true
  15.     url: <a href="https://ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/EasyList_China.txt" target="_blank">https://ghproxy.com/https://raw. ... /EasyList_China.txt</a>
  16.     name: EasyList China
  17.     id: 1700569141
  18.   - enabled: true
  19.     url: <a href="https://ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/EasyPrivacy.txt" target="_blank">https://ghproxy.com/https://raw. ... les/EasyPrivacy.txt</a>
  20.     name: EasyPrivacy
  21.     id: 1700569142
  22.   - enabled: true
  23.     url: [url]https://ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/CJX's_Annoyance_List.txt[/url]
  24.     name: CJX's Annoyance List
  25.     id: 1700569144
  26.   - enabled: true
  27.     url: <a href="https://ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/SmartTV_Blocklist.txt" target="_blank">https://ghproxy.com/https://raw. ... artTV_Blocklist.txt</a>
  28.     name: SmartTV Blocklist
  29.     id: 1700569145
  30.   - enabled: true
  31.     url: <a href="https://ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/1Hosts_" target="_blank">https://ghproxy.com/https://raw. ... /main/rules/1Hosts_</a>(Lite).txt
  32.     name: 1Hosts (Lite)
  33.     id: 1700569146
复制代码

AdguardHome + open克拉什 配合使用
整体思路:客户端-->dnsmasq-->AdguardHome-->open克拉什-->互联网

  • 首先订阅一个服务并启用op,使之能够访问网络
  • AdguardHome更新核心,不选择重定向,启用。
  • 打开Adg网页管理页面,如果出现无法登录的情况,可能是使用了快速配置,这个时候去ssh删除配置文件/etc/AdGuardHome.yaml,并重启adg服务:

    1. chmod 755 /etc/init.d/AdGuardHome
    2. service AdGuardHome restart
    复制代码
  • 访问路由器ip:3000/install.html进行向导安装配置,举例设定:网页端口3000,dns端口5353。

  • OP设置:

    • 禁用 本地DNS劫持
    • 自定义上游DNS服务器 启用
    • Fallback-Filter 启用
    • dns服务器默认的即可

  • Adg设置:

    • 重定向:作为的dnsmasq的上游
    • 网页管理界面,DNS设置-->上游dns服务器改成OP的地址:127.0.0.1:7874
    • 网页管理界面,过滤器,黑名单参考,可以直接在Adg的配置里改:

    1. filters:
    2.   - enabled: true
    3.     url: <a href="https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txt" target="_blank">https://adguardteam.github.io/Ho ... assets/filter_1.txt</a>
    4.     name: AdGuard DNS filter
    5.     id: 1
    6.   - enabled: false
    7.     url: <a href="https://adguardteam.github.io/HostlistsRegistry/assets/filter_2.txt" target="_blank">https://adguardteam.github.io/Ho ... assets/filter_2.txt</a>
    8.     name: AdAway Default Blocklist
    9.     id: 2
    10.   - enabled: true
    11.     url: <a href="https://ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/EasyList.txt" target="_blank">https://ghproxy.com/https://raw. ... /rules/EasyList.txt</a>
    12.     name: EasyList
    13.     id: 1700569140
    14.   - enabled: true
    15.     url: <a href="https://ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/EasyList_China.txt" target="_blank">https://ghproxy.com/https://raw. ... /EasyList_China.txt</a>
    16.     name: EasyList China
    17.     id: 1700569141
    18.   - enabled: true
    19.     url: <a href="https://ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/EasyPrivacy.txt" target="_blank">https://ghproxy.com/https://raw. ... les/EasyPrivacy.txt</a>
    20.     name: EasyPrivacy
    21.     id: 1700569142
    22.   - enabled: true
    23.     url: [url]https://ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/CJX's_Annoyance_List.txt[/url]
    24.     name: CJX's Annoyance List
    25.     id: 1700569144
    26.   - enabled: true
    27.     url: <a href="https://ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/SmartTV_Blocklist.txt" target="_blank">https://ghproxy.com/https://raw. ... artTV_Blocklist.txt</a>
    28.     name: SmartTV Blocklist
    29.     id: 1700569145
    30.   - enabled: true
    31.     url: <a href="https://ghproxy.com/https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/1Hosts_" target="_blank">https://ghproxy.com/https://raw. ... /main/rules/1Hosts_</a>(Lite).txt
    32.     name: 1Hosts (Lite)
    33.     id: 1700569146
    复制代码



  • 确认网络设置:
  • DHCP/DNS-->
    DNS 转发-->odg的dns端口,例如:127.0.0.1#5353






我的恩山、我的无线 The best wifi forum is right here.
正准备刷,进来学习一下,

点评

不会了,我可以代刷,并提供AX6000固件定制。哈哈  详情 回复 发表于 2023-11-22 10:11
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

厉害了啊 ,真全面!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

来自手机 | 显示全部楼层
本帖最后由 iamyangyi 于 2023-11-22 10:11 编辑

鼓励。。。感谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

来自手机 | 显示全部楼层
悔恨 发表于 2023-11-22 10:03
正准备刷,进来学习一下,

不会了,我可以代刷,并提供AX6000固件定制。哈哈
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

原版用着不错,以后需要了再折腾,收藏先
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

已经刷入了uboot,备份过原来系统的mtd5_FIP.bin,可以把这个mtd5_FIP.bin的文件上传到现在路由器已经刷过的系统里面,然后用官方工具恢复不

点评

理论上可以;我没有实际再恢复原厂固件。  详情 回复 发表于 2023-12-1 16:26
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

牛逼啊 大佬
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
xingshiduirenxi 发表于 2023-11-24 16:13
已经刷入了uboot,备份过原来系统的mtd5_FIP.bin,可以把这个mtd5_FIP.bin的文件上传到现在路由器已经刷过 ...

理论上可以;我没有实际再恢复原厂固件。

点评

已验证,确实可以  详情 回复 发表于 2023-12-1 22:36
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

sandylaw 发表于 2023-12-1 16:26
理论上可以;我没有实际再恢复原厂固件。

已验证,确实可以
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

如果出厂固件开启ssh,设置wifi中继模式,能开启ssh的命令,恢复出厂设置不失效,堪称完美
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

大佬,Adguard home这么安装呀?

点评

安装luci-app-adguardhome,然后再设置界面更新核心就可以  详情 回复 发表于 2024-1-14 11:44
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

skycn77 发表于 2024-1-2 15:00
大佬,Adguard home这么安装呀?

安装luci-app-adguardhome,然后再设置界面更新核心就可以
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

来自手机 | 显示全部楼层
机器到手,正好试下刷机
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

谢谢楼主分享。。。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-29 05:06

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表