Install OpenWrt on a Microtik RouterBoard

Published: 05.02.2024 | 438 Words | 3 minutes
Instructions how to install OpenWrt on a Microtik Routerboard hEX RB75Gr3.
Notice:

If your RouterBoard has an OS version 7.x you will need to downgrade it to a 6.x version. I recomend you downgrade to the factory version of your RouterBoard.

Export your RouterOS licence key

You need to login to your RouterBoard to get console Access:

Then run:

/file print 1
/system license output 2
/file print 3
1 Display all files that are currently on the RouterBoard file system
2 This will export your LicenceKey to the filesystem
3 Display all files again, there should now be one more file that at step <1>

Download the key file from your RouterBoard, either via the WebFig or with ssh:

scp admin@<routerBoard-IP>:/<file-name> .

Download OpenWrt

Download the Factory image from the "OpenWrt website" or a copy form here.

Put it in a Folder called tftp. _ You can name the folder any name you want but I named it tftp _

Also create a script containig the following content:

#!/bin/bash
USER=user 1
IFNAME=enp2s0 2
/sbin/ip addr replace 192.168.1.10/24 dev $IFNAME
/sbin/ip link set dev $IFNAME up
/usr/sbin/dnsmasq --user=$USER \
--no-daemon \
--listen-address 192.168.1.10 \
--bind-interfaces \
-p0 \
--dhcp-authoritative \
--dhcp-range=192.168.1.100,192.168.1.200 \
--bootp-dynamic \
--dhcp-boot=openwrt-23.05.0-rc3-ramips-mt7621-mikrotik_routerboard-750gr3-initramfs-kernel.bin \ 3
--log-dhcp \
--enable-tftp \
--tftp-root=$(pwd)
1 Change this to your username
2 Change this to the network interface you will connect the RouterBoard with your computer. It must be an ethernet connection.
3 Change this to the filename of the downloaded Factory image.

Prepare RouterBoard for network boot

Run the following commands on the RouterBoard terminal:

/system routerboard settings set force-backup-booter=yes 1
/system routerboard settings set boot-device=try-ethernet-once-then-nand 2
/system shutdown 3
1 We do want to use the fallback bootloader.
2 Try to boot via the ethernet connection.
3 Turn the RouterBoard off

Connect to computer

Connect your computer via an ethernet cable to the RouterBoard port labeld Internet. You must use the same interface on your computer you set in the script at IFNAME

Boot OpenWrt

Start the script on your computer as root user and after that turn on the RouterBoard.

Wait until you see the lines:

dnsmasq-tftp: sent /home/marvin/project/opnwrt-to-routerboard/tftp/openwrt-23.05.0-rc3-ramips-mt7621-mikrotik_routerboard-750gr3-initramfs-kernel.bin to 192.168.1.178

dnsmasq-tftp: sent /home/marvin/project/opnwrt-to-routerboard/tftp/openwrt-23.05.0-rc3-ramips-mt7621-mikrotik_routerboard-750gr3-initramfs-kernel.bin to 192.168.1.178

After that you can connect to the OpenWrt webinterface at: http://192.168.1.1 .

Write OpenWrt into flash of the router.

If you decide you want to run your RouterBoard permanently with OpenWrt you can write it to the internal flash.

Go to: http://192.168.1.1/cgi-bin/luci/admin/system/flash and upload a matching Sysupgrade image. You can find a copy here: sysupgrade.bin

In the webinterface click on Flash image and upload the file.

Then you need to wait a few minutes (mine took 3 minutes). The RouterBoard will reboot when its done with the flashing.

That's all ;)
Back to the top