小米旗下的红米AX6是一款性价比很高的无线WiFi6路由器,它拥有3000M无线速率,高通6核处理器,红米AX6无论是官方固件作为 AP Mesh Wi-Fi 的信号还是刷 openwrt 处理「网络数据」都是性价比非常非常高的选择,这方面性能上其实完全不输软路由。

如果你的系统没有 nano 你可以使用 vi 或 vim
vim /usr/lib/lua/luci/controller/admin/xqsystem.lua
文件内容填写下面的保存即可。
module("luci.controller.admin.xqsystem", package.seeall)
function index()
local page = node("api")
page.target = firstchild()
page.title = ("")
page.order = 100
page.index = true
page = node("api","xqsystem")
page.target = firstchild()
page.title = ("")
page.order = 100
page.index = true
entry({"api", "xqsystem", "token"}, call("getToken"), (""), 103, 0x08)
end
local LuciHttp = require("luci.http")
function getToken()
local result = {}
result["code"] = 0
result["token"] = "; nvram set ssh_en=1; nvram commit; echo -e 'adminnadmin' | passwd root; sed -i 's/channel=.*/channel="debug"/g' /etc/init.d/dropbear; /etc/init.d/dropbear start;"
LuciHttp.write_json(result)
end
输入完成后你可以 cat /usr/lib/lua/luci/controller/admin/xqsystem.lua 检查一下。

/api/misystem/extendwifi_connect?ssid={SSID}&password={Wi-Fi密码}
替换为上面的值 - {SSID} 替换为 openwrt 路由器的 Wi-Fi 名
- {Wi-Fi密码} 替换为 openwrt 路由器的 Wi-Fi 密码
<> 和 {} 均需要替换
我的替换后如下(我的 Wi-Fi 没有密码,你的如果有密码填上密码即可)
http://192.168.31.1/cgi-bin/luci/;stok=b3ee3b3d1baa28c0b208a46a47c84a03/api/misystem/extendwifi_connect?ssid=OPENWRT_DEE_5G&password=
将替换好的值复制到浏览器请求,如果显示 code 0 则成功。

/api/xqsystem/oneclick_get_remote_token?username=xxx&password=xxx&nonce=xxx
将替换好的值复制到浏览器请求,如果显示 code 0 则成功。

浏览器请求该地址下载备份
http://192.168.31.1/backup/log/mtd9
第五步:刷入 openwrt 固件下载固件备用链接: https://pan.baidu.com/s/1OobJYj7kIdxXAXn4vC9g7w
提取码: kpna
ssh 连接 红米 ax 设置envssh 连接上后复制下面执行
nvram set flag_last_success=0 nvram set flag_boot_rootfs=0 nvram set flag_boot_success=1 nvram set flag_try_sys1_failed=0 nvram set flag_try_sys2_failed=0 nvram set boot_wait=on nvram set uart_en=1 nvram set telnet_en=1 nvram set ssh_en=1 nvram commitscp 固件 qsdk 固件并刷入
scp 下载好的 xiaomimtd12.bin 到 红米 AX6 的 /tmp 下面
scp xiaomimtd12.bin [email protected]:/tmp
并在红米 AX6 上执行
mtd write /tmp/xiaomimtd12.bin rootfs
断电重启红米 AX6,此时红米 AX 6 的后台地址已经变为 192.168.1.1
重新分区scp 下载好的 a6minbib.bin 到 红米 AX6 的 /tmp 下面
scp a6minbib.bin [email protected]:/tmp
并在 红米AX6 上执行
. /lib/upgrade/platform.sh switch_layout boot; do_flash_failsafe_partition a6minbib "0:MIBIB"
拔电源重启路由器
openwrt刷入到rootfs_1分区scp 下载好的 openwrt-ipq807x-generic-xiaomi_ax6-squashfs-nand-factory.bin 到 红米 AX6 的 /tmp
scp openwrt-ipq807x-generic-xiaomi_ax6-squashfs-nand-factory.bin [email protected]:/tmp
在红米 AX6 上执行刷入
ubiformat /dev/mtd13 -y -f /tmp/openwrt-ipq807x-generic-xiaomi_ax6-squashfs-nand-factory.bin fw_setenv flag_last_success 1 fw_setenv flag_boot_rootfs 1
红米 AX6 执行命令重启
reboot
重启后完成,系统应该已经是 openwrt 系统了。
one more thing 安装 Clash该固件并不会自带 clash ,或别的代理软件,需要手动安装。
wget https://github.com/vernesong/OpenClash/releases/download/v0.40.7-beta/luci-app-openclash_0.40.7-beta_all.ipk opkg install luci-app-openclash_0.40.7-beta_all.ipk
因为 libcap 安装比较麻烦,所以上面 openclash 安装的是去年10月初的版本。
如果你想安装最新的可以修改
vim /etc/opkg.conf 将 /etc/opkg.conf 的内容修改为以下内容
dest root / dest ram /tmp lists_dir ext /var/opkg-lists option overlay_root /overlay #option check_signature arch all 100 arch aarch64_cortex-a53_neon-vfpv4 200 arch aarch64_cortex-a53 300
vim /etc/opkg/distfeeds.conf 将 /etc/opkg/distfeeds.conf 的内容修改为以下内容
src/gz openwrt_19.07_base https://mirrors.cloud.tencent.com/lede/releases/19.07-SNAPSHOT/packages/aarch64_cortex-a53/base/ src/gz openwrt_19.07_freifunk https://mirrors.cloud.tencent.com/lede/releases/19.07-SNAPSHOT/packages/aarch64_cortex-a53/freifunk/ src/gz openwrt_19.07_luci https://mirrors.cloud.tencent.com/lede/releases/19.07-SNAPSHOT/packages/aarch64_cortex-a53/luci/ src/gz openwrt_19.07_packages https://mirrors.cloud.tencent.com/lede/releases/19.07-SNAPSHOT/packages/aarch64_cortex-a53/packages/ src/gz openwrt_19.07_routing https://mirrors.cloud.tencent.com/lede/releases/19.07-SNAPSHOT/packages/aarch64_cortex-a53/routing/ src/gz openwrt_19.07_telephony https://mirrors.cloud.tencent.com/lede/releases/19.07-SNAPSHOT/packages/aarch64_cortex-a53/telephony/


