Skip to content

Instantly share code, notes, and snippets.

@willwhui
Created December 22, 2017 15:49
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save willwhui/983ec159d0a44fc2beaa0c667e33f038 to your computer and use it in GitHub Desktop.
Save willwhui/983ec159d0a44fc2beaa0c667e33f038 to your computer and use it in GitHub Desktop.
小米路由器R1D刷机
@willwhui
Copy link
Author

刷开发版

下载开发版bin文件之后,可以直接从路由器web页面的一个入口通过上传文件的方式刷机:
常用设置 - 系统状态 - 手动升级

@willwhui
Copy link
Author

willwhui commented Dec 22, 2017

刷SSH

按照 http://miwifi.com/miwifi_open.html 这个页面的“开启SSH工具”中所指示的步骤:

1 请将下载的工具包bin文件复制到U盘(FAT/FAT32格式)的根目录下,保证文件名为miwifi_ssh.bin;
2 断开小米路由器的电源,将U盘插入USB接口;
3 按住reset按钮之后重新接入电源,指示灯变为黄色闪烁状态即可松开reset键;
4 等待3-5秒后安装完成之后,小米路由器会自动重启,之后您就可以尽情折腾啦 :)

做完之后貌似没有搞定?
变成了红灯状态,不知道是不是我操作失误。
反正后来刷成开发版又搞一次,却又变成了稳定版。。。
最后根据这篇文章,在刷机u盘根目录放了一个重复的miwifi_ssh.bin文件,并改名为ssh_rom.bin,再继续试一次。
就好了。

另外,上面的步骤可以省略为:

1 请将下载的工具包bin文件复制到U盘(FAT/FAT32格式)的根目录下,保证文件名为miwifi_ssh.bin;
2 将U盘插入USB接口;
3 按住reset按钮,指示灯变为黄色闪烁状态即可松开reset键;
4 等待3-5秒后安装完成之后,小米路由器会自动重启,之后您就可以尽情折腾啦 :)

@willwhui
Copy link
Author

willwhui commented Dec 28, 2017

两个子网互通

http://vod.sjtu.edu.cn/help/Article_Print.asp?ArticleID=1095

  • 小米路由器
    • 自身ip:192.168.31.225
    • 网段网关:192.168.28.1
    • 配置:目的ip=192.168.10.0,掩码:255.255.255.0,下一跳:路由器Y自身ip
  • Openwrt路由器
    • 自身ip:192.168.31.231
    • 网段网关:192.168.10.1
    • 配置:目的ip=192.168.20.0,掩码:255.255.224.0,下一跳:路由器X自身ip

在小米路由器设置允许访问Openwrt路由器

查看当前路由表:

root@XiaoQiang:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.31.0    *               255.255.255.0   U     0      0        0 eth0.2
169.254.29.0    *               255.255.255.0   U     0      0        0 wl1.3
192.168.28.0    *               255.255.255.0   U     0      0        0 br-lan
default         192.168.31.1    0.0.0.0         UG    0      0        0 eth0.2
default         192.168.31.1    0.0.0.0         UG    50     0        0 eth0.2

添加静态路由规则,并查看新的路由表:

root@XiaoQiang:~# route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.31.231
root@XiaoQiang:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     192.168.31.231  255.255.255.0   UG    0      0        0 eth0.2
192.168.31.0    *               255.255.255.0   U     0      0        0 eth0.2
169.254.29.0    *               255.255.255.0   U     0      0        0 wl1.3
192.168.28.0    *               255.255.255.0   U     0      0        0 br-lan
default         192.168.31.1    0.0.0.0         UG    0      0        0 eth0.2
default         192.168.31.1    0.0.0.0         UG    50     0        0 eth0.2

可见添加成功,自动绑定在eth0.2接口上

按照这里的提示http://www.miui.com/forum.php?mod=redirect&goto=findpost&ptid=2122469&pid=163834045
可以将静态路由设为开机自动配置

vi /etc/config/network

在文件末尾追加:

config route                 
        option interface 'eth0.2'
        option target '192.168.1.0'
        option netmask '255.255.255.0'
        option gateway '192.168.31.231'

在Openwrt路由器设置允许访问小米路由器

因为可以在luci界面进行设置,就直接设置了。
注意interface要选择Openwrt当初设置成为中继路由时创建的那个接口(wlanxxx)

然而按照上述方法设置好之后,都只能ping通gateway本身

无法ping通子网内的设备。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment