小米路由器青春版R1CL刷入OpenWrt

您所在的位置:网站首页 刷openwrt有些什么功能 小米路由器青春版R1CL刷入OpenWrt

小米路由器青春版R1CL刷入OpenWrt

2023-08-20 03:38| 来源: 网络整理| 查看: 265

1. 复位机器

小米路由器青春版 ,采用 Micro USB 接口,重置键位于路由器背部,镂空小孔阵列的右上角(有 Reset 文字提示) ,操作按键需要使用取卡针或类似物体长按。

2. 连接路由器

路由器连接电源

方法一:使用网线将路由器 LAN口 与电脑连接方法二:连接路由器 Wi-Fi (一般以XIAOMI_开头) 打开浏览器,输入 192.168.31.1 进入路由器管理界面(如果遇到推广页面,跳过选项在右下角,为一段不太清晰文字) 登录成功后地址栏URL会变为:http://192.168.31.1/cgi-bin/luci/;stok=###/web/home#router

进入页面后,对路由进行设置(如登录密码等),完成后保存退出。

3. 开启ssh连接 3.1 下载并安装固件miwifi_r1cl_all_59371_2.1.26.bin

固件等级低于2.1的可以忽略此步骤,由于新版本的固件,阻止开启ssh,故需要降级. openwrt官网又下载链接:Official Developer ROM

3.2 启用路由器telnet登录

将之前地址栏URL中的 /web/home#router 替换为 /api/xqsystem/set_name_password?oldPwd=当前路由器的管理密码&newPwd=新的路由器管理密码 如果网页返回 {“code”:0} ,则说明修改成功。

将之前地址栏URL中的 /web/home#router 替换为/api/xqnetwork/set_wifi_ap?ssid=xiaomi&encryption=NONE&enctype=NONE&channel=1%3B%2Fusr%2Fsbin%2Ftelnetd 如果网页返回 {“msg”:“未能连接到指定WiFi(Probe timeout)”,“code”:1616},则说明修改成功。

3.3 启用路由器SSH登录

使用MobaXterm,打开telnel连接,配置以下参数。 主机名称:192.168.31.1;用户名输入root,密码为刚修改后的新密码: 在这里插入图片描述

sed -i ":x;N;s/if \[.*\; then\n.*return 0\n.*fi/#tb/;b x" /etc/init.d/dropbear /etc/init.d/dropbear start nvram set ssh_en=1; nvram commit 4. 备份固件分区

使用MobaXterm,打开SSH连接。 主机名称:192.168.31.1;用户名输入root,密码为刚修改后的新密码: 在这里插入图片描述

cd /tmp mkdir rom dd if=/dev/mtd0 of=/tmp/rom/ALL.bin dd if=/dev/mtd1 of=/tmp/rom/Bootloader.bin dd if=/dev/mtd2 of=/tmp/rom/Config.bin dd if=/dev/mtd3 of=/tmp/rom/Factory.bin dd if=/dev/mtd4 of=/tmp/rom/OS1.bin dd if=/dev/mtd5 of=/tmp/rom/rootfs.bin dd if=/dev/mtd6 of=/tmp/rom/OS2.bin dd if=/dev/mtd7 of=/tmp/rom/overlay.bin dd if=/dev/mtd8 of=/tmp/rom/crash.bin dd if=/dev/mtd9 of=/tmp/rom/reserved.bin dd if=/dev/mtd10 of=/tmp/rom/Bdata.bin 5. 刷入OpenWrt固件

下载官方编译好得固件:https://downloads.openwrt.org/snapshots/trunk/ramips/mt7628/openwrt-ramips-mt7628-miwifi-nano-squashfs-sysupgrade.bin

通过SSH将固件放置路由器,然后输入命令:mtd -r write /tmp/openwrt-ramips-mt7628-miwifi-nano-squashfs-sysupgrade.bin firmware

待固件刷新并重启后,SSH重新登录路由。 此时主机名称:192.168.1.1;用户名输入root,密码为刚修改后的新密码: 在这里插入图片描述 成功登录后如界面: 在这里插入图片描述

6. 安装工具软件 1. 安装luci

由于默认不带luci,所以需要重新下载,输入以下命令:

opkg update opkg install luci /etc/init.d/uhttpd enable /etc/init.d/uhttpd start

在电脑端的浏览器中输入“192.168.1.1”,可访问路由器就表示Luci安装成功. 在这里插入图片描述

2. 安装iperf3

输入命令:opkg install iperf3 创建自启脚本:

#!/bin/sh /etc/rc.common START=99 #这里是启动优先级 STOP=15 #这里是停止优先级 start(){ iperf3 -s & } stop(){ killall iperf3 } restart(){ killall iperf3 iperf3 -s & } enable(){ iperf3 -s & } disable(){ killall iperf3 }

使能脚本自启:

touch /etc/init.d/myshell chmod 777 /etc/init.d/myshell ln -s /etc/init.d/myshell /etc/rc.d/S99myshell /etc/rc.d/myshell enable

这样路由每次启动都会启动iperf server.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3