Step by step installation on a Mikrotik hap ac


  • OpenWRT Installation on the MikroTik Router 962UiGS-5HacT2HnT (hAP ac)

The router is delivered from the factory with the IP 192.168.88.1.
No password is set. The login is done with the user "admin".

The supported OpenWRT-Version for this router is currently the 19.07.10.
(was fixed, 22.03.3 now)

Overview of the installation steps:

  1. Save the license key of RouterOS and the original firmware.
  2. Downgrade to RouterOS v6 if you previously upgraded to v7.
    The bootloader from RouterOS v7 is not compatible with OpenWrt.
  3. Boot router via network boot BOOTP/TFTP for testing. OpenWrt isn't
    installed now, it's working from a RAM image.
  4. If all right, write OpenWrt into flash of the router, then reboot.
  5. Tuning OpenWrt.

Installation steps:

  1. Download the following files

openwrt-19.07.10-ar71xx-mikrotik-rb-nor-flash-16M-ac-initramfs-kernel.bin
openwrt-19.07.10-ar71xx-mikrotik-rb-nor-flash-16M-ac-squashfs-sysupgrade.bin

Later: The initramfs image is loaded into the RAM by the router via Ethernet.
The router restarts from the RAM. After that you can flash the sysupgrade
image.

  1. Preparation of your Manjaro-Linux-PC

  • Update the system: "pamac update -a"
  • Install the packages dnsmasq" and tftp-hpa: "pamac install dnsmasq tftp-hpa"
  • Disconnect your Linux computer from all networks.
  • Disable the firewall.
  • Deactivate apparmor:
    sudo systemctl stop apparmor.service
    sudo aa-teardown
  • Copy the downloaded files in the directory "$HOME/mikrotik".
  • Set the PC ethernet interface to the IP 192.168.88.10.
  1. Preparation of the router

The running RouterOS is used to enable the TFTP netboot.

Connect a PC to a LAN port (port 2…). Log into the web interface of RouterOS and
set router to boot from ethernet once with DHCP:

  • System β†’ Routerboard β†’ Settings β†’ Boot device: Try ethernet once then NAND
  • System β†’ Routerboard β†’ Settings β†’ Boot protocol: BOOTP
  • System β†’ Routerboard β†’ Settings β†’ Force Backup Booter: Checked
  • Press Apply and OK
  • System β†’ Shutdown
  • Switch off the router.
  • Connect the network cabel to the router port 1.
  1. Netboot of OpenWrt Uses BOOTP/TFTP

  • Connect the ethernet cable of your PC with a ethernet switch.
  • Connect the ethernet cable of your router with the same ethernet switch.
  • Create the following script into the directory "$HOME/miktrotik".
  • Open a terminal and start the script: sudo loader.sh

--- begin of the script loader.sh ----------------------
#!/bin/bash

FILENAME=openwrt-19.07.10-ar71xx-mikrotik-rb-nor-flash-16M-ac-initramfs-kernel.bin

/usr/sbin/dnsmasq
--no-daemon
--listen-address 192.168.88.10
--bind-interfaces
-p0
--dhcp-authoritative
--dhcp-range=192.168.88.100,192.168.88.200
--bootp-dynamic
--dhcp-boot=$FILENAME
--log-dhcp
--enable-tftp
--tftp-root=$(pwd)
--- end ----------------------------------------------------

4.1 Check the tftp server

  • Open a seconde terminal
  • Execute the command: "tftp 192.168.88.10"
  • You should get the tftp prompt.
  • Execute the command: "get 19.07.10-ar71xx-mikrotik-rb-nor-flash-16M-ac-initramfs-kernel.bin"
  • In the other terminal you should see a message that the file has been sent.
  • Press the keys "q" and return. tftp client is closed.
  • Close this terminal.

4.2 Netboot of the router

  • Switch on the router.

The router will get an IP from our DHCP Server. After that the tftp server send the initramfs file wit ha beep.
With the initramfs image in the ram the router will restart.

  • After the message "dnsmasq-dhcp: 751641945 sent size: 7 option: 12 hostname OpenWrt"
    stops the script loader.sh.
  • Connect the ethernet cable of the router with port 2...
  • Disconnect your PC from ethernet.
  • Set the IPv4-Setting to the methode: Automatically (DHCP)
  • Connect your PC to the ethernet.
  • Open an internet browser and call the IP 192.168.1.1.
  • You should get an OpenWRT login.
  • Login with the username "root" without a password.

4.3 Flash OpenWRT

  • Go to Systemβ†’Backup/Flash Firmware.
  • Click on 'Choose File' under 'Flash new firmware image'. Select the sysupgrade .bin file you previously
    downloaded for your RouterBoard
  • Click on 'Flash image'. This will flash the sysupgrade .bin file into your RouterBoard and reboot it.

Congratulations: you have now successfully flashed OpenWrt into your RouterBoard!

4 Likes