Lab 01-07 · Reinstall RouterOS with Netinstall¶
MTCNA
Module 1 · Introduction. Official course slides 66–67 and 86–89 (reset button, reset configuration, Netinstall) and the Netinstall LAB (slide 92, optional).
Real hardware only
This lab is done in class, on your hAP (hAP ax²; an hAP ac² works the same way with arm packages). It cannot run in the virtual lab: Netinstall talks to the router's boot loader over a cable, and a virtual CHR has none. There is no topology.clab.yml or check.sh: initial/r1.rsc is what you run on the router before, and final/r1.rsc is the configure script you give to Netinstall.
When a PC's operating system is so broken that it will not even start, you do not repair it: you boot from a USB stick and reinstall. The disk is formatted, a clean system goes on, and you copy your files back from your backup.
A router has no USB stick to boot from, but it can boot from the network. Your laptop plays the USB stick, and the tool that does it is Netinstall. It is the last resort when nothing else works: forgotten password with no backup, failed upgrade, a router that only blinks.
What you will learn
- When to use Netinstall instead of a configuration reset
- What Netinstall erases and what it keeps
- Put a RouterBOARD in Netinstall mode with the reset button
- Reinstall RouterOS from Linux with netinstall-cli (or from Windows with Netinstall)
- Restore your configuration from a backup afterwards
Reset button, reset configuration, or Netinstall?¶
| Problem | Tool | What is lost |
|---|---|---|
| Configuration is a mess, RouterOS works | System → Reset Configuration (lab 01-06) | configuration |
| Locked out, cannot log in | reset button: hold it while powering on until the LED starts blinking (~5 s) | configuration |
| RouterOS does not start, is corrupted, or you must remove a branding package | Netinstall | configuration and files: the storage is formatted |
The reset button of a RouterBOARD does more the longer you hold it while the router boots (course slide 66):
flowchart LR
A["Hold reset<br>while powering on"] --> B["~5 s · LED <b>blinks</b><br>release: reset configuration"]
B --> C["~10 s · LED <b>solid</b><br>release: CAP mode"]
C --> D["~15 s · LED <b>off</b><br>release: look for a<br><b>Netinstall</b> server"]
Backup RouterBOOT
If you hold the button before applying power, the router also loads the backup RouterBOOT (lab 01-03). To do the actions above with the normal RouterBOOT, press the button right after applying power.
How Netinstall works¶
Netinstall is a MikroTik program (Windows, and netinstall-cli for Linux) that installs RouterOS on a router booted from the network. It formats the router's storage and writes the packages you give it.
flowchart LR
L["<b>Laptop</b><br>netinstall-cli<br>192.168.88.2/24<br>routeros + wifi-qcom .npk"] -- "Ethernet cable<br>to <b>ether1</b>" --- R["<b>hAP</b><br>in Netinstall mode<br>(boots from the network,<br>gets 192.168.88.3)"]
- The router, in Netinstall mode, asks the network "who can give me a system?" (a BOOTP request).
- Netinstall answers, gives it a temporary address (the client IP, here
192.168.88.3) and a tiny boot program. - The router formats its storage and receives the
.npkpackages. - It reboots into a clean RouterOS.
What survives: the license key and RouterBOOT settings. What is lost: configuration and all files (your backups on the router too!). If you give neither -r nor -e, netinstall-cli downloads the old configuration database and puts it back after the install (files are still lost); in this lab we start clean on purpose.
Important rules (slide 88 and the MikroTik manual):
- The cable goes to ether1 (on some models, a port labelled BOOT; on a few models, such as the RB1100 series, the last port). The hAP ax² uses ether1.
- The laptop needs a fixed IP address on its wired interface, and only one active network interface.
- The packages must match the router's architecture (
arm64for the hAP ax²) and the system package goes first.
The scenario¶
| Device | Role | Address |
|---|---|---|
| your hAP ax² | the router to reinstall | gets 192.168.88.3 during the install, 192.168.88.1 after (from the configure script) |
| your laptop (Ubuntu) | runs netinstall-cli, keeps your backup |
wired interface 192.168.88.2/24, WiFi off |
Start the lab¶
Download the lab files and unzip them: 01-07-netinstall.zip. Open a terminal inside the 01-07-netinstall folder.
Prepare before touching the router:
- Download from mikrotik.com/download, all for the same version and ARM64:
- Netinstall (CLI Linux) (
netinstall-<version>.tar.gz) - the main package
routeros-7.23.8-arm64.npk - the extra packages archive, to take
wifi-qcom-7.23.8-arm64.npkfrom it
- Netinstall (CLI Linux) (
-
Unpack netinstall-cli:
Step 1 · Save what you want to keep¶
Why: Netinstall formats the router. Anything only on the router is gone.
On the working hAP, run the commands of initial/r1.rsc (WinBox: Files → Backup, then New Terminal for the export):
Copy both files to the laptop (WinBox Files, drag and drop to your desktop). Also note the version and architecture (System → Resources).
Check yourself
Why is it pointless to leave the backup only on the router before a Netinstall?
Done when: both files are on your laptop.
Step 2 · Prepare the laptop's network¶
Why: the router in Netinstall mode cannot get its address from a DHCP server; Netinstall gives it one, and needs a fixed address itself.
Turn WiFi off. Find your wired interface name and give it a fixed address (Ubuntu):
ip link # e.g. enp3s0 or enx1234567ee890
sudo ip addr add 192.168.88.2/24 dev enp3s0
sudo ip link set enp3s0 up
Plug the cable from the laptop into the hAP's ether1.
On Windows the equivalent is: static IP 192.168.88.2/24 on the Ethernet adapter, run Netinstall as administrator, allow it in the firewall, and in Net booting set the client IP 192.168.88.3.
Done when: ip addr show enp3s0 shows 192.168.88.2/24.
Step 3 · Start netinstall-cli¶
Why: Netinstall must be waiting before the router asks.
sudo ./netinstall-cli -r -s r1.rsc -a 192.168.88.3 \
routeros-7.23.8-arm64.npk wifi-qcom-7.23.8-arm64.npk
(copy final/r1.rsc next to netinstall-cli as r1.rsc first). What each part means:
| Option | Meaning |
|---|---|
-r |
reinstall and apply the default configuration script (-e would leave an empty configuration instead) |
-s r1.rsc |
replace that default configuration script with your own configure script: it runs on the first boot |
-a 192.168.88.3 |
the temporary IP address given to the router (must be free and in the laptop's subnet) |
-b |
(not used here) also remove a branding package (lab 01-04) |
*.npk |
the packages to install: system package first |
Expected: netinstall-cli starts and waits for a device to appear (leave the window open).
Check yourself
What would happen if you gave it routeros-7.23.8-arm.npk for your hAP ax²?
Done when: netinstall-cli is waiting.
Step 4 · Boot the router in Netinstall mode¶
- Unplug the hAP's power.
- Press and hold the reset button, plug the power back in while holding it.
- Keep holding: the LED blinks (~5 s), goes solid (~10 s), then turns off (~15 s). Release it.
- Watch the laptop: netinstall-cli shows the router's MAC address, the formatting, the packages being sent, and finally that the router is rebooting.
Alternative without the button, from a working RouterOS: /system routerboard settings set boot-device=try-ethernet-once-then-nand, then reboot (it applies to the next boot only).
Done when: netinstall-cli reports the installation finished.
Step 5 · Restore your configuration¶
Why: the course LAB ends by restoring the backup you saved in step 1.
- Move the laptop's address to the LAN: remove the cable from ether1, plug it into ether2, and use DHCP or
192.168.88.2/24. The configure script gave the router192.168.88.1on its LAN bridge and the admin passwordLab-Pass-13. - Log in (WinBox or
ssh admin@192.168.88.1). The prompt shows13_JohnDoe: your configure script ran. -
Upload
before-netinstall.backup(WinBox Files, drag and drop) and restore it: Files → Restore, or -
After the reboot, check that your configuration from the previous labs is back (identity, users, Internet access).
Check yourself
Netinstall kept the RouterOS license. Why is that important for a CHR (virtual) router? (Think of slide 97.)
Done when: the router is back to how it was before step 1.
If something goes wrong¶
| Symptom | Likely cause | Fix |
|---|---|---|
| netinstall-cli never sees the router | cable not in ether1, button released too early or too late, laptop WiFi on | check the cable, repeat step 4, turn WiFi off |
Permission denied / cannot bind |
netinstall-cli not run as root | sudo ./netinstall-cli ... |
| Install fails on package check | wrong architecture or mixed versions | arm64 packages, all of the same version, system package first |
| Router not reachable afterwards | you used -e (empty config: no IP) |
reach it with MAC WinBox (lab 01-01), or reinstall with -r -s r1.rsc |
| Windows Netinstall does nothing | firewall blocking it, or more than one active interface | allow Netinstall on Public networks, disable other adapters |
| Backup restore refuses the file | wrong password, or a backup from another model | use your own router's backup and password |
Key takeaways¶
- Netinstall reinstalls RouterOS over Ethernet: the last resort when RouterOS itself is broken.
- It formats the router: configuration and files are lost; the license and RouterBOOT settings survive. Save and copy your backup first.
- The router boots from the network when you hold the reset button at power-on until the LED goes off (~15 s); the cable goes to ether1 (or the BOOT port).
- The laptop needs a fixed IP, a single active interface, and packages for the right architecture, system package first.
- netinstall-cli options:
-eempty config,-rdefault config,-syour own configure script,-bremove branding,-athe router's temporary IP.
Quick check¶
1. When do you need Netinstall instead of a configuration reset?
- When RouterOS itself is corrupted or will not start
- When you only want to change the router's identity
- When you forgot to save an export
- When the router needs a new IP address
A reset clears the configuration of a working RouterOS. Netinstall reinstalls RouterOS itself, for routers that do not boot properly, or to remove a branding package.
2. What does Netinstall erase on the router?
- The configuration and all the files
- Only the configuration, keeping the files
- Only the files, keeping the configuration
- The license key and RouterBOOT settings
Netinstall formats the storage: configuration and files (including backups stored on the router) are lost. The license and RouterBOOT settings survive.
3. How long do you hold the reset button at power-on to make an hAP look for a Netinstall server?
- Until the LED turns off, about 15 seconds
- Until the LED starts blinking, about 5 seconds
- Until the LED stays solid, about 10 seconds
- One quick press, less than a second
About 5 s (blinking) resets the configuration, 10 s (solid) enables CAP mode, and about 15 s (LED off) makes the router look for Netinstall.
4. Which port of an hAP ax² must the Netinstall cable go to?
- ether1
- ether5
- Any LAN port of the bridge
- The USB port
Netinstall works from the first port (ether1) or a port labelled BOOT. Only a few models (such as the RB1100 series) use the last port.
5. What does the -s option of netinstall-cli do?
- It installs your own configure script instead of the default configuration
- It skips the check of the router's storage size
- It selects the router by its serial number
- It saves a backup before formatting the router
-s file.rsc installs a configure script that replaces the default configuration script and runs on the first boot. (-f skips the storage check; -e and -r choose an empty or default configuration.)
6. A classmate's Netinstall never sees the router. Which two causes are likely?
- The laptop's WiFi is still on, so it has more than one active interface
- The cable is plugged into a LAN port instead of ether1
- The packages are for the right architecture and version
- The laptop has a fixed IP address on its wired interface
Netinstall needs one active interface with a fixed IP, and the cable in ether1. Correct packages and a fixed IP are requirements, not causes of failure.
With Netinstall you can bring back any MikroTik router, no matter how broken. That closes Module 1: next, Module 2 and the world of DHCP, ARP and bridging.