Skip to content

Instantly share code, notes, and snippets.

@jwillikers
Last active March 3, 2020 00:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jwillikers/f90dabe6f2793c29daa4a341f7293099 to your computer and use it in GitHub Desktop.
Save jwillikers/f90dabe6f2793c29daa4a341f7293099 to your computer and use it in GitHub Desktop.
Installing OpenWRT on Mikrotik RB750r2 (hEX lite) from Ubuntu 19.10

Installing OpenWRT on Mikrotik RB750r2 (hEX lite)

OpenWrt is an open-source router firmware solution based off of the Linux kernel. There are many reasons to use OpenWrt. I finally replaced the default RouterOS installation on my MikroTik RB750r2 (hEX lite) router with OpenWrt. Unfortunately, this took longer than it should have because of the difficulty I had finding the right install locations on the OpenWrt website. The website is a bit cluttered with odds and ends of installation instructions throughout. This article documents all of the necessary steps to install OpenWrt 19.07.1 on a MikroTik RB750r2 router from a laptop running Xubuntu 19.10.

Instructions

The installation instructions are largely based on the OpenWrt instructions provided here.

Prepare

  1. Download the OpenWrt Firmware

    First, download the OpenWrt firmware for the RB750r2. Go to the OpenWrt downloads page. Click on the latest release, 19.07.1 at this time. The RB750r2 uses the ar71xx firmware, so click that link. Then, select mikrotik. From this page, download the vmlinux-initramfs-lzma.elf and the rb-nor-flash-16M-squashfs-sysupgrade.bin. The RouterBoard will boot this .elf file from the network and the sysupgrade .bin file will be flashed, i.e. installed, on to the RouterBoard.

    Download with curl
    curl https://downloads.openwrt.org/releases/19.07.1/targets/ar71xx/mikrotik/openwrt-19.07.1-ar71xx-mikrotik-vmlinux-initramfs-lzma.elf
    curl https://downloads.openwrt.org/releases/19.07.1/targets/ar71xx/mikrotik/openwrt-19.07.1-ar71xx-mikrotik-rb-nor-flash-16M-squashfs-sysupgrade.bin
    🔥
    It is important to verify the integrity of the downloaded files before proceeding. OpenWrt documents this here.
    Verify the Checksum
    cat 9af1a143c64db0bbd901b1a8a513c56daf3f2b0aaf408e8b12017c93dbb9cb8a > openwrt-19.07.1-ar71xx-mikrotik-rb-nor-flash-16M-squashfs-sysupgrade.bin.SHA256 # (1)
    sha256sum -c openwrt-19.07.1-ar71xx-mikrotik-vmlinux-initramfs-lzma.elf.SHA256 openwrt-19.07.1-ar71xx-mikrotik-vmlinux-initramfs-lzma.elf # (2)
    
    cat 112aeb3fafb4d791c41f5347b08f88282d0f052a2ac7a9f3b665e5c532b87d13 > openwrt-19.07.1-ar71xx-mikrotik-rb-nor-flash-16M-squashfs-sysupgrade.bin.SHA256
    sha256sum -c openwrt-19.07.1-ar71xx-mikrotik-rb-nor-flash-16M-squashfs-sysupgrade.bin.SHA256 openwrt-19.07.1-ar71xx-mikrotik-rb-nor-flash-16M-squashfs-sysupgrade.bin
    1. Place the SHA256 checksum corresponding to the downloaded file from the webpage in a file.

    2. Check that the SHA256 checksum of the downloaded file matches the SHA256 checksum from the website.

  2. Setup the NetBoot Directory

ln -s openwrt-19.07.1-ar71xx-mikrotik-vmlinux-initramfs-lzma.elf openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf # (1)
mkdir -p ~/mikrotik/trunk/bin/ar71xx/
cp openwrt-ar71xx-mikrotik-vmlinux-initramfs-lzma.elf ~/mikrotik/trunk/bin/ar71xx/ # (2)
  1. Symlink the versioned initramfs file to a non-versioned form so that you don’t have to worry about the specific version anymore.

  2. Place the initframfs file in a dedicated boot directory.

NetBoot

I found the easiest one-off solution for booting off the network to be dnsmasq on Ubuntu 19.10. The dnsmasq-base package was already installed on my system, making the dnsmasq command available with no extra setup required.

  1. Run NetBoot

ifconfig eth0 192.168.1.10 up # (1)
sudo dnsmasq -i eth0 --dhcp-range=192.168.1.100,192.168.1.200 \
--dhcp-boot=openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf \
--enable-tftp --tftp-root=~/mikrotik/trunk/bin/ar71xx/ -d -u $USER -p0 -K --log-dhcp --bootp-dynamic
  1. Set the static IP address for your ethernet interface to 192.168.1.10.

  2. Start the DHCP boot server.

💡
Finding Your Ethernet Interface

In the commands above, eth0 represents the name of the ethernet interface connecting your computer to the RouterBoard. To find the name of your ethernet interface, use the ip command.

ip link show # (1)
  1. List network interfaces.

Ethernet interfaces should start with the letter e. My ethernet interface is actually enp5s0, so I replace eth0 with enp5s0.

  1. NetBoot the RouterBoard

  2. Configure RouterOS to boot from ethernet. Using your favorite web browser, log in to the RouterOS web console of your router, likely at address 192.168.88.1. Under the Settings

  3. Plug

Flash

  1. Flash OpenWrt Access the LuCI web interface to OpenWrt through 192.168.1.1. The username is "root" and the password should be left blank. Click login.

Flash Firmware Menu Item
Flash Operations Page

Configure

  1. Setup SSH

  2. Setup PPPoE WAN

Update

  1. Update Packages

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