备份license key
原系统的license key最好备份下,以备还原官方系统。
电脑连接路由器LAN口,用Winbox登录路由器,在system下找到license管理,将license export即可备份。
下载openwrt镜像
一共需要两个文件
Firmware OpenWrt Install
- openwrt-23.05.3-ramips-mt7621-mikrotik_routerboard-750gr3-initramfs-kernel.bin
- openwrt-21.02.3-ramips-mt7621-mikrotik_routerboard-750gr3-initramfs-kernel.bin
Firmware OpenWrt Upgrade
- openwrt-23.05.3-ramips-mt7621-mikrotik_routerboard-750gr3-squashfs-sysupgrade.bin
- openwrt-21.02.3-ramips-mt7621-mikrotik_routerboard-750gr3-squashfs-sysupgrade.bin
第一个是网络引导安装镜像,第二个是升级包,上面链接失效的话可以去官方下载页找找。
网络引导写入initramfs kernel
这里使用的工具是Tiny PXE,下载pxesrv_Tiny_PXE_Server_1.0.0.23.zip
下载后,编辑config.ini文件,在[dhcp]部分下添加rfc951=1参数
右键管理员打开pxesrv.exe
- 最上面默认为HTTPd
- Option 54(DHCP Server)处,勾选当前固网IP(192.168.1.10)
- 在Boot File中Filename后,选择openwrt-ramips-mt7621-mikrotik_rb750gr3-initramfs-kernel.bin文件
- 将Boot File中Filename if use-class=gPXE or iPXE去掉勾选
- 其余默认即可,点击右上角三个按钮中间的Online
将网线连接到路由器WAN口,断电,用卡针按住RES按钮,上电后观察USR灯,连闪三下后,再闪一下后熄灭马上放开RES按钮,此时路由器进入netboot模式
看到Tiny pxe窗口出现DoReadFile:openwrt-ramips-mt7621-mikrotik_rb750gr3-initramfs-kernel.bin即可,如下log:
14:10:50 ROOT=D:\\rb750\\
14:10:50 DHCPd 192.168.1.10:67 started...
14:10:50 TFPTd 192.168.1.10:69 started...
14:10:51 HTTPd:80 started...
14:11:27 DHCPd:DISCOVER received, MAC:64-D1-54-9F-79-0F, XID:9D74838A
14:11:28 DHCPd:OFFER sent, IP:192.168.1.11, XID:9D74838A
14:11:28 DHCPd:REQUEST received, MAC:64-D1-54-9F-79-0F, XID:9D74838A
14:11:28 DHCPd:ACK sent, IP:192.168.1.11, XID:9D74838A
14:12:01 DHCPd:REQUEST received, MAC:64-D1-54-9F-79-0F, XID:ECAC163F
14:12:01 DHCPd:BOOTP REQUEST
14:12:01 TFTPd:DoReadFile:openwrt-ramips-mt7621-mikrotik_rb750gr3-initramfs-kernel.bin B:1452 T:0
14:12:01 DHCPd:ACK sent, IP:192.168.1.21, XID:ECAC163F
14:12:19 DHCPd:DISCOVER received, MAC:64-D1-54-9F-79-11, XID:F919527A
14:12:19 DHCPd:OFFER sent, IP:192.168.1.12, XID:F919527A
14:12:19 DHCPd:REQUEST received, MAC:64-D1-54-9F-79-11, XID:F919527A
14:12:19 DHCPd:ACK sent, IP:192.168.1.12, XID:F919527A
此时initramfs kernel已经以RAM方式运行在路由器中,可以关闭Tiny PXE了
安装OpenWRT
将电脑通过网线连接路由器LAN口,ping一下192.168.1.1即可表示是否可以访问路由器,此时路由器还没有LUCI界面,无法使用web进行管理,我们需要通过SSH来刷入upgrade包。
下来通过scp将upgrade包发给路由器
$ scp openwrt-ramips-mt7621-mikrotik_rb750gr3-squashfs-sysupgrade.bin [email protected]:/root
openwrt-ramips-mt7621-mikrotik_rb750gr3-squas 100% 3457KB 3.9MB/s 00:00
然后SSH登录路由器,通过sysupgrade命令更新upgrade包
$ ssh [email protected]
BusyBox v1.30.0 () built-in shell (ash)
-----------------------------------------------------
OpenWrt SNAPSHOT, r9028-75fdf3b
-----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the \"passwd\" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:~# ls
luci_0.11.1-1_ar71xx.ipk
luci_git-19.011.54896-1f423b1-1_all.ipk
openwrt-ramips-mt7621-mikrotik_rb750gr3-squashfs-sysupgrade.bin
root
root@OpenWrt:~# sysupgrade -v openwrt-ramips-mt7621-mikrotik_rb750gr3-squashfs-s
ysupgrade.bin
Image not in /tmp, copying...
Cannot save config while running from ramdisk.
Commencing upgrade. Closing all shell sessions.
Connection to 192.168.1.1 closed by remote host.
Connection to 192.168.1.1 closed.
路由器更新完成后会重启,等重启完成后再次登录192.168.1.1试试,已经完成OpenWRT刷入。
下来就是在SSH下安装luci了,推荐参OpenWRT通过SSH 安装LUCI