RADIUSdesk

This is an old revision of the document!


Flash OpenWRT onto Mikrotik RB750Gr3

Introduction

  • Mikrotik is a very popular supplier of networking equipment.
  • They have their own operating system called RouterOS which most probably is Linux based.
  • RouterOS however is licensed and includes different levels of licensing for different functionalities.
  • To unlock a needed feature not included with the current license then requires you to upgrade which obviously involves cost.
  • However, the hardware itself is good and durable and it is easy to source all over the world.
  • Some of their models are also able to run OpenWRT as an alternative to RouterOS.
  • OpenWRT is OpenSource and there is no paid for licensing involved on OpenWRT.
  • This page will just cover the flash from RouterOS to OpenWRT.
  • We will cover the configuration of the device once OpenWRT is running on it on a separate page.

You will need

  • Linux based machine to communicate with the Mikrotik and supply the OpenWRT firmware over the network.
  • Mikrotik RB750Gr3 reset to factory defaults
  • 1xCat5 LAN cable.

Flash Process

  • The flash process is fairly simple and straight forward and involves three steps
    1. Export the RouterOS License Key.
    2. Load a RAM based version of OpenWRT.
    3. Flash the permanent (Flash) version of OpenWRT using the RAM based version.

Export the RouterOS License Key

  • It is recommended that you export the RouterOS license key in the event of returning to the original RouterOS, you might need to use it again to activate the RouterOS.
  • RouterOS can be accesses various ways which include
    • Web based UI called Webfig (default http://192.168.88.1) on the LAN side of the board
    • Using the WinBox application.
  • Unfortunately the Webfig interface does not support the export of the license key. (Only upgrade)
  • We have to use WinBox for that.

Running WinBox on Ubuntu 20.04

  • WinBox is a windows based program but since its a simple program its just as easy to run it on Ubuntu using Wine.
  • We assume you have a standard install of Ubuntu 20.04 (with some GUI)
  • Install Wine
sudo apt-get install wine
#cd to where the winbox64.exe program is
wine winbox64.exe
  • Configure the LAN port of your Ubuntu machine to have an IP Address on the 192.168.88 subnet.
#Here our LAN interface is enp8s0 
#Use ip a to discover what it is caleld on your machine
sudo ip addr add 192.168.88.10/24 dev enp8s0
  • Use the LAN cable to connect to any of the LAN ports on the Mikrotik (2-5) to your Ubuntu machine.
  • Go to the Neighbors tab and see if the device is listed.
  • Click on the listed device and click Connect to enter into its configuration.
  • Select SystemLicense
  • Click on Export Key to export it.
  • Store it on a safe place

Now that we have the license key taken care of we can go to the next step which is to load the RAM based OpenWRT onto the device

Load a RAM based version of OpenWRT

  • In order for us to get the RAM based version of OpenWRT onto the Mikrotik two things are involved.
    1. There has to be a BOOTP environment set up to serve the RAM based image
    2. The Mikrotik has to be set in such a mode as to use the BOOTP environment to fetch the RAM based image using BOOTP
  • On Ubuntu it is very simple and we just create a small shell script to take care of it
loader.sh
#!/bin/bash
USER=system
IFNAME=enp8s0
/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-19.07.6-ramips-mt7621-mikrotik_rb750gr3-initramfs-kernel.bin \
--log-dhcp \
--enable-tftp \
--tftp-root=$(pwd)
  • As you can see we will serve the openwrt-19.07.6-ramips-mt7621-mikrotik_rb750gr3-initramfs-kernel.bin image to the Mikrotik.
  • Download this image (This was the latest 19.07 based image at the time of this writing)
  • Make sure it is located in the same directory as the loader.sh script.
  • Do the following to start up the BOOTP service

<code bash>

</code<