basforge

Search titles, text and the “If it doesn’t work” cases.

    RU
    OverviewHomelabMikroTik

    RouterOS 7: how the MikroTik router system works

    RouterOS is a Linux-based system, the same for every MikroTik device. Its config is a menu tree that commands change. /export prints all of it as one text: that’s both a backup and a way to see what changed. Updates come through the stable and long-term channels, optional features install as packages, and since RouterOS 7.17 the dangerous ones sit behind device-mode: they turn on only with a press of a button on the router itself.

    What’s inside

    RouterOS 7 runs on a Linux kernel, but Linux isn’t visible from outside: there’s no bash, the system files are closed, and everything goes through RouterOS’s own commands. The system is the main routeros package plus extras:

    Package What it adds
    wifi-qcom the Wi-Fi 6+ driver for Qualcomm chips: hAP ax², ax³, cAP ax
    wifi-qcom-ac the new driver for Wi-Fi 5 on ARM: hAP ac², ac³, cAP ac
    wireless the old driver, for Wi-Fi 4 and Wi-Fi 5 on MIPS
    container running Docker images
    iot Bluetooth, LoRa, MQTT
    user-manager its own RADIUS server
    rose-storage disks, RAID, SMB and NFS shares

    What’s installed now: /system package print. Since 7.18 an extra package installs from the menu: System, Packages, Check For Updates, Enable on the package you want, then Apply Changes — the router downloads it and reboots. Without internet on the router, put the package in Files and reboot: the package version must match RouterOS, and the architecture must match the router (/system resource print, the architecture-name line).

    Update channels

    /system package update print
    #          channel: stable
    #  installed-version: 7.24.5
    #     latest-version: 7.24.5
    #             status: System is already up to date
    Channel What’s in it Version as of 2026-10-19
    stable new features and fixes; a new minor version every 2–4 months 7.24.5 (October 1)
    long-term fixes only, within one branch; features don’t change 7.23.8 (October 9)
    testing betas and release candidates of the next version 7.25rc
    development developer builds —

    Branch 6 lives on for old devices: 6.49.23 came out on October 9, 2026, with the same security fixes.

    For a home router you’d rather not touch, use long-term: an update there only fixes things. On stable any minor version can change something: in 7.13 Wi-Fi moved to a new package, in 7.17 device-mode appeared. Switching channels is one command: /system package update set channel=long-term.

    An update goes in two steps, check-for-updates and install; the router downloads the packages and reboots. After that, update the RouterBOOT bootloader separately (RouterBOOT update).

    device-mode: dangerous features behind a button

    Since RouterOS 7.17 a router has a mode that turns off features useful to an attacker. The mode can’t be changed remotely: after the command you must press the reset button or power-cycle the router within 5 minutes. A stranger on the internet with the admin password can’t do that.

    Mode Default on What’s off
    home home routers scheduler, fetch, sniffer, bandwidth-test, SOCKS and proxy, hotspot, e-mail, RoMON, containers and a few more
    basic other devices bandwidth-test, containers, hotspot, proxy, SOCKS, traffic generator
    advanced CCR and RB1100 containers, traffic generator, partitions, installing any version

    The list follows the table on the Device-mode documentation page. Which mode a given model ships with: /system/device-mode/print1.

    /system/device-mode/print
    /system/device-mode/update container=yes
    # update: please activate by turning off power or pressing reset or mode button in 5m00s

    mode= in the command replaces the whole set: update mode=advanced resets features enabled one by one, so add the ones you need to the same command — update mode=advanced container=yes. You get three attempts; a power-cycle resets the counter.

    If at boot RouterOS finds traces of compromise in the config (foreign scripts, scheduler entries, users), it disables what looks suspicious and sets flagged=yes. Clearing the flag also takes the button, but first go through the config and change the passwords.

    License

    Routers have a built-in license whose level depends on the model: 4 on the hAP ax² and hEX, 5 on the RB5009 and L009, 6 on the hAP ax³ and CCR. The levels differ in limits a home never meets — the number of hotspot users, for example.

    CHR is separate: RouterOS as a virtual machine for Proxmox, VMware, VirtualBox or the cloud. Without a license it runs indefinitely but at 1 Mbit/s per interface — enough for experiments and learning. The paid p1, p10 and unlimited levels lift the cap to 1 Gbit/s, 10 Gbit/s and no limit; the trial lasts 60 days.

    How to connect

    Tool How What to keep in mind
    Winbox 4 an app for Windows, macOS, Linux; port 8291 also connects by MAC address, with no IP — that’s how a router with broken addresses gets rescued
    WebFig the browser, http://192.168.88.1 the same menu as Winbox; Quick Set lives here too
    SSH ssh [email protected] key login via /user ssh-keys import (SSH keys)
    REST API https://192.168.88.1/rest/…, the www-ssl service JSON over HTTP: for your own scripts and monitoring
    the MikroTik app iOS and Android Quick Set and the main settings from a phone

    All tools change the same thing: an edit in Winbox shows up right away on the command line and in /export.

    The command line

    The RouterOS menu is a tree: /ip firewall filter holds firewall rules, /interface bridge port bridge ports. Inside any branch the same commands work: print, add, set, remove, enable, disable, export.

    /ip address print
    # Columns: ADDRESS, NETWORK, INTERFACE
    # #   ADDRESS            NETWORK       INTERFACE
    # 0   192.168.88.1/24    192.168.88.0  bridge
    
    /ip dhcp-server lease print where status=bound
    /interface print where running
    /ip firewall filter set [find comment="defconf: drop invalid"] log=yes
    • Tab completes commands and parameters, a double Tab lists options, ? gives help in place.
    • where filters output, and [find …] selects entries for set and remove by condition rather than number: the numbers in print change after every add.
    • /export prints only what differs from the defaults; /export verbose prints everything, /export show-sensitive includes passwords (MikroTik config backup).
    • Ctrl+X is Safe Mode (Safe Mode).

    Scripts and scheduling

    RouterOS has its own scripting language: :local, :if, :foreach, :delay. An example: check for an update once a day and log it if one is out. The script installs nothing itself: an unattended update with a reboot at 4 a.m. risks leaving you without a network until evening.

    /system script add name=check-update policy=read,write,test source={
      /system package update check-for-updates once
      :delay 10s
      :if ([/system package update get status] = "New version is available") do={
        :log warning ("RouterOS: new version " . [/system package update get latest-version])
      }
    }
    /system scheduler add name=check-update interval=1d start-time=09:00:00 \
        on-event=check-update policy=read,write,test

    Keep scripts, names and comments in plain ASCII: RouterOS’s UTF-8 support is incomplete, and non-ASCII characters turn into garbage in the log and terminal, and into codes like \D0\B2 in /export.

    Per the device-mode table, the scheduler is off in home mode — such a script won’t run on a schedule there; you need basic or advanced. Notifications to Telegram or e-mail go through /tool fetch and /tool e-mail, which are also off in home.

    Containers

    On ARM, ARM64 and x86 routers RouterOS runs Docker images. At home that’s how people put AdGuard Home or Pi-hole right on the router. What you need:

    • the container package and container=yes in device-mode — with a button press;
    • room for images: the hAP’s own 128 MB isn’t enough, you need a USB stick or SSD; the RB5009 has 1 GB built in;
    • an image for the router’s architecture: arm64 for the hAP ax and RB5009, arm (v7) for 32-bit models;
    • memory: 1 GB for everything on the hAP ax³ and RB5009, 512 MB on the hEX.
    /interface veth add name=veth-adguard address=172.17.0.2/24 gateway=172.17.0.1
    /interface bridge add name=containers
    /ip address add address=172.17.0.1/24 interface=containers
    /interface bridge port add bridge=containers interface=veth-adguard
    /container config set registry-url=https://registry-1.docker.io tmpdir=usb1/tmp
    /container add remote-image=adguard/adguardhome:latest interface=veth-adguard \
        root-dir=usb1/adguard logging=yes
    /container start [find]

    The container gets its own address, 172.17.0.2, in a separate bridge. It reaches the internet through the default masquerade, and home computers get 172.17.0.2 as DNS from DHCP2.

    If it doesn’t work

    /container add answers not allowed by device-mode

    Cause
    Since RouterOS 7.17 containers are off in every device-mode until enabled separately.
    Fix
    /system/device-mode/update container=yes and, within 5 minutes, a short press of reset or a power cycle. The router reboots with the feature on.

    Put the container package in Files, rebooted — no package

    Cause
    The extra package’s version doesn’t match RouterOS, or the architecture is wrong: the hAP ax needs arm64, the hEX refresh arm.
    Fix
    /system resource print shows version and architecture-name; download the Extra packages archive for exactly that version and architecture.

    A command from an article fails: bad command name wireless or expected end of command

    Cause
    The article is about RouterOS 6. In 7, Wi-Fi moved to /interface wifi and routing was rewritten entirely: /routing filter became /routing filter rule, OSPF and BGP have different commands.
    Fix
    Search help.mikrotik.com — its documentation covers version 7. If an article has no date, look at the commands: /interface wireless and /ip route rule give away version 6.

    A scheduled script doesn’t run, and the log is silent

    Cause
    In the home device-mode, scheduler and fetch are off, along with container, sniffer, bandwidth-test and a dozen more features. Or the script lacks permissions: the scheduler’s policy is missing read, write, test.
    Fix
    /system/device-mode/print shows the mode and what’s off. Permissions: /system scheduler set check-update policy=read,write,test.

    Winbox doesn’t see the router in the Neighbors tab

    Cause
    Neighbors are found by MNDP, which works only within one segment and, in the default config, only on interfaces in the LAN list.
    Fix
    Connect by address, 192.168.88.1. If that doesn’t show it either, connect by MAC from the same network: Winbox over MAC bypasses IP.

    Not verified yet

    1. which device-mode a hAP ax² ships with and what from the list is in fact off ↑
    2. the usb1/ paths and the adguard/adguardhome image on a hAP ax³ with a USB stick ↑