—小米路由器3Pro刷OpenWrt-R21.md流程–

1.小米官方ssh工具包下载

2.Openwrt固件下载地址

3.开始准备刷入环境

4.登录管理修改配置

5.关于连接报错

 

1.小米官方ssh工具包下载

登录小米账号,绑定路由器 https://d.miwifi.com/rom/ssh

[工具包使用方法]

小米路由器需升级到开发版0.5.28及以上,小米路由器mini需升级到开发版0.3.84及以上,小米路由器3即将支持。注意:稳定版不支持。

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

2.Openwrt固件下载地址

 #https://github.com/yeliulee/openwrt-ramips-mt7621-xiaomi_mir3p
 
 #mv openwrt-ramips-mt7621-xiaomi_mir3p firmware.bin //重命名固件
 
 #scp firmware.bin [email protected]:/tmp //把固件传入tmp
 
 
 #ssh [email protected] //登入路由器ssh
 [email protected]'s password: 

BusyBox v1.19.4 (2017-08-25 14:54:27 CST) built-in shell (ash) Enter ‘help’ for a list of built-in commands.


    Welcome to XiaoQiang!

$$$$$$\ $$$$$$$\ $$$$$$$$\ $$\ $$\ $$$$$$\ $$\ $$\ $$ $$\ $$ $$\ $$ _| $$ | $$ | $$ $$\ $$ | $$ | $$ / $$ |$$ | $$ |$$ | $$ | $$ | $$ / $$ |$$ |$$ / $$$$$$$$ |$$$$$$$ |$$$$$\ $$ | $$ | $$ | $$ |$$$$$ / $$ $$ |$$ $$< $$ | $$ | $$ | $$ | $$ |$$ $$< $$ | $$ |$$ | $$ |$$ | $$ | $$ | $$ | $$ |$$ |$$\ $$ | $$ |$$ | $$ |$$$$$$$$\ $$$$$$$$$ | $$$$$$ |$$ | $$\ _| _|_| _|___| ___/ ____/ _| __|

[email protected]:~# cd /tmp/ 查看传入成功的文件 firmware.bin [email protected]:/tmp# ls 4701.bootcheck.log luci-indexcache security.db DataBase luci-modulecache spool TZ luci-nonce startscene_crontab.lua.PID arrays luci-sessions stat_points_privacy.log cache messages stat_points_rom.log daemon mi_ip_conflict_pid state datalist mihttpd sysapihttpd dhcp.leases mnt sysapihttpdconf diag_net_spd mt76xx.sh.log sysinfo etc network.env syslog-ng.ctl etm.log nginx_check.log syslog-ng.pid firmware.bin ntp.status taskmonitor fstab oui thunder hosts rc.done uci2dat_mt7615e2.log http_info rc.timing uci2dat_mt7615e5.log lock resolv.conf uploadfiles locks resolv.conf.auto web_config_list log rr web_filter_list logexec run wifi_analysis.log

3.开始准备刷入环境

 [email protected]:/tmp# nvram set flag_try_sys1_failed=1 //执行1
 [email protected]:/tmp# nvram set flag_try_sys2_failed=0 //执行2
 [email protected]:/tmp# nvram set flag_boot_success=0     //执行3
 [email protected]:/tmp# nvram commit   //执行4
 [email protected]:/tmp# dd if=firmware.bin bs=1M count=4 | mtd write - kernel1 //执行5
 Unlocking kernel1 ...
 
 Writing from <stdin> to kernel1 ... [e]4+0 records in
 4+0 records out
 4194304 bytes (4.0MB) copie[w]1.633416 seconds, 2.4MB/s
     
 [email protected]:/tmp# mtd erase rootfs0 //执行6
 Unlocking rootfs0 ...
 Erasing rootfs0 ...
 [email protected]:/tmp# mtd erase rootfs1 //执行7
 Unlocking rootfs1 ...
 Erasing rootfs1 ...
 [email protected]:/tmp# mtd erase overlay //执行8
 Unlocking overlay ...
 Erasing overlay ...
 [email protected]:/tmp# dd if=firmware.bin bs=1M skip=4 | mtd write - rootfs0 //执行9
 Unlocking rootfs0 ...
 
 Writing from <stdin> to rootfs0 ... [w]
 [e]22+1 records in
 22+1 records out
 [w]23724032 bytes (22.6MB) copied, 9.091053 seconds, 2.5MB/s
     
 [email protected]:/tmp# 
 [email protected]:/tmp#rebbot //最后重启系统

4.登录管理修改配置

找到一个wifi名字为:OpenWrt的 无线网络连接后进去管理地址: http://192.168.1.1/cgi-bin/luci/ root password

连接后正常是不会有网络的,这因为默认和光猫的管理地址冲突. 进去接口修改

接口 – LAN 随机将 192.168.1.1 修改成 192.168.X.1 不同网段即可!

5.关于连接报错:

报错: [Unable to negotiate with xx.xx.xx.xx port xx: no matching key exchange method found.Their offer: diffie-hellman-group1-sha1.] 原因:在Mac本地修改配置,因为目前很多不支持sha1协议

#sudo vim /etc/ssh/ssh_config

去掉MACs hmac-md5,hmac-sha1,[email protected]前的”#”

在末尾加

HostkeyAlgorithms ssh-dss,ssh-rsa

KexAlgorithms +diffie-hellman-group1-sha1

重新连接ssh即可 !

发表评论

后才能评论