$npx -y skills add tikoci/routeros-skills --skill routeros-fundamentalsRouterOS v7 domain knowledge for AI agents. Use when: working with MikroTik RouterOS, writing RouterOS CLI/script commands, calling RouterOS REST API, debugging why a Linux command fails on RouterOS, or when the user mentions MikroTik, RouterOS, CHR, or /ip /system /interface pat
| 1 | # RouterOS Fundamentals |
| 2 | |
| 3 | ## RouterOS Is NOT GNU/Linux |
| 4 | |
| 5 | RouterOS runs a Linux kernel (5.6.3) but **everything above the kernel is MikroTik's proprietary `nova` system**. This is the single most important fact for agents to internalize. |
| 6 | |
| 7 | **What does NOT exist on RouterOS:** |
| 8 | |
| 9 | - No `/bin`, `/usr`, `/etc`, `/var` — no FHS layout |
| 10 | - No bash, sh, ash, zsh — no Unix shell at all |
| 11 | - No coreutils (`ls`, `cat`, `grep`, `ps`, `mount`, `ip`, `iptables`, etc.) |
| 12 | - No glibc, musl, busybox |
| 13 | - No apt, pkg, opkg — no package manager (packages are `.npk` files installed via upload + reboot) |
| 14 | - No `systemctl`, `service`, init system |
| 15 | - No `/proc` or `/sys` accessible from userland |
| 16 | - No `docker`, `podman` — RouterOS has its own `/container` subsystem (7.x+) |
| 17 | |
| 18 | **What DOES exist:** |
| 19 | |
| 20 | - RouterOS CLI — its own language, not shell. Accessed via SSH, serial, WinBox, or WebFig |
| 21 | - REST API at `/rest/` (HTTP, port 80 by default) — the primary programmatic interface |
| 22 | - RouterOS scripting language (`.rsc` files) — its own syntax, not bash. See the `routeros-scripting` skill and [Scripting reference](./references/scripting.md) |
| 23 | - WebFig (web UI) on port 80 |
| 24 | - WinBox protocol on port 8291 |
| 25 | |
| 26 | **Common agent mistakes to avoid:** |
| 27 | |
| 28 | - Do NOT try `ssh admin@host 'ls /'` — it opens RouterOS CLI, not a shell |
| 29 | - Do NOT suggest `mount`, `fdisk`, `mkfs` — use `/disk` commands instead |
| 30 | - Do NOT look for config files at `/etc/` — configuration is in the RouterOS database |
| 31 | - Do NOT assume `ping` works the same — it's `/tool/ping` or `/ping` in CLI |
| 32 | - Do NOT suggest installing packages via `apt` or `opkg` — upload `.npk` via SCP then `/system/package/apply-changes` (7.18+) or `/system/reboot` (<7.18) |
| 33 | - See [Extra packages reference](./references/extra-packages.md) for the full package list and installation pattern |
| 34 | |
| 35 | ## RouterOS CLI Syntax |
| 36 | |
| 37 | RouterOS CLI uses path-based navigation, not Unix command pipelines: |
| 38 | |
| 39 | ```routeros |
| 40 | # Navigation |
| 41 | /ip/address/print |
| 42 | /interface/print |
| 43 | /system/resource/print |
| 44 | |
| 45 | # Adding entries |
| 46 | /ip/address/add address=192.168.1.1/24 interface=ether1 |
| 47 | |
| 48 | # Modifying (by internal ID or find expression) |
| 49 | /ip/address/set [find interface=ether1] address=10.0.0.1/24 |
| 50 | |
| 51 | # Removing |
| 52 | /ip/address/remove [find address="192.168.1.1/24"] |
| 53 | |
| 54 | # Running a command |
| 55 | /system/reboot |
| 56 | /tool/fetch url="http://example.com/file.npk" dst-path="/" |
| 57 | ``` |
| 58 | |
| 59 | **Key syntax differences from shell:** |
| 60 | |
| 61 | - `=` assigns properties (no spaces around it) |
| 62 | - `[find ...]` is the query expression (like WHERE) |
| 63 | - Interactive `print` row numbers are not script-safe object IDs; use `[find ...]` or `*HEX` internal IDs |
| 64 | - Strings use `""` (double quotes only) |
| 65 | - Comments use `#` |
| 66 | - Variables: `:local myVar "value"` and `$myVar` |
| 67 | - No pipes, no redirection, no subshell |
| 68 | |
| 69 | ## REST API |
| 70 | |
| 71 | RouterOS REST API at `http://HOST:PORT/rest/`. HTTP verbs map non-standardly: |
| 72 | |
| 73 | | HTTP | RouterOS Action | CLI Equiv | |
| 74 | |---|---|---| |
| 75 | | `GET` | print (list/read) | `/path/print` | |
| 76 | | `PUT` | **add (create)** | `/path/add` | |
| 77 | | `PATCH` | set (update) | `/path/set` | |
| 78 | | `DELETE` | remove | `/path/remove` | |
| 79 | | `POST` | command (execute) | `/path/command` | |
| 80 | |
| 81 | **Key gotchas:** |
| 82 | |
| 83 | - `PUT` creates (NOT updates) — opposite of many REST APIs |
| 84 | - Empty password auth: `admin:` (colon required, nothing after) |
| 85 | - WebFig root (`GET /`) returns HTTP 200 without auth — use as health check |
| 86 | - REST API (`/rest/`) requires auth (HTTP 401 without it) |
| 87 | - `.id` field is `*HEX` format (e.g., `*1`, `*A`) |
| 88 | |
| 89 | See [REST API reference](./references/rest-api-patterns.md) for full patterns, error handling, filtering, POST commands, and `/console/inspect`. |
| 90 | |
| 91 | ## Version Scheme |
| 92 | |
| 93 | Format: `MAJOR.MINOR[.PATCH][betaN|rcN]` — e.g., `7.22`, `7.22.1`, `7.23beta2`, `7.22rc1` |
| 94 | |
| 95 | **Channels:** `stable` / `long-term` / `testing` / `development` |
| 96 | |
| 97 | Version endpoint (plain text): `https://upgrade.mikrotik.com/routeros/NEWESTa7.<channel>` |
| 98 | |
| 99 | For version parsing, comparison, download URLs, and package naming: see [Version parsing reference](./references/version-parsing.md). |
| 100 | |
| 101 | ## Architecture Names |
| 102 | |
| 103 | MikroTik uses these architecture identifiers (not standard Linux arch names): |
| 104 | |
| 105 | | MikroTik name | CPU | Common hardware | |
| 106 | |---|---|---| |
| 107 | | `x86` | x86_64 | CHR, x86-based RouterBOARDs | |
| 108 | | `arm64` | aarch64 | Modern ARM boards (RB5009, Chateau) | |
| 109 | | `arm` | ARMv7 | Older ARM boards | |
| 110 | | `mipsbe` | MIPS big-endian | Legacy RouterBOARDs | |
| 111 | | `mmips` | MIPS multi-core | hAP ac, RB4011 | |
| 112 | | `smips` | MIPS single-core | hAP lite, mAP | |
| 113 | | `ppc` | PowerPC | CCR1xxx series | |
| 114 | | `tile` | Tilera | CCR (older models) | |
| 115 | |
| 116 | CHR (Cloud Hosted Router) is available only for `x86` and `arm64`. |
| 117 | |
| 118 | ## Default Credentials |